From a644b75e508e26a0ea360ec9aad11b19a2384d0a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 23:55:22 +0000 Subject: [PATCH 1/2] chore(deps): bump @anthropic-ai/sdk from 0.125.0 to 0.135.0 Bumps [@anthropic-ai/sdk](https://github.com/anthropics/anthropic-sdk-typescript) from 0.125.0 to 0.135.0. - [Release notes](https://github.com/anthropics/anthropic-sdk-typescript/releases) - [Changelog](https://github.com/anthropics/anthropic-sdk-typescript/blob/main/CHANGELOG.md) - [Commits](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.125.0...sdk-v0.135.0) --- updated-dependencies: - dependency-name: "@anthropic-ai/sdk" dependency-version: 0.135.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 21 ++++++++++++++++----- package.json | 2 +- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2da8dc34..7ca159d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.14", "license": "MIT", "dependencies": { - "@anthropic-ai/sdk": "0.125.0", + "@anthropic-ai/sdk": "0.135.0", "@graphql-inspector/core": "^8.0.0", "@modelcontextprotocol/sdk": "^1.30.0", "@octokit/rest": "^22.0.1", @@ -33,16 +33,17 @@ "node": ">=22.6.0" }, "optionalDependencies": { - "@anthropic-ai/sdk": "^0.125.0" + "@anthropic-ai/sdk": "^0.135.0" } }, "node_modules/@anthropic-ai/sdk": { - "version": "0.125.0", - "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.125.0.tgz", - "integrity": "sha512-Hq5wYlXupzJ9M1Fzqjqa3hObcuigEXVZJqSYDgeZGM3wF4qrNERM5Z1OOAeoT9rlod8awJ3uYyJjbQXp1ckIGg==", + "version": "0.135.0", + "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.135.0.tgz", + "integrity": "sha512-WWrdL57JhU5KoynpTjt9GXK6k7ud9nPw2uw/Trn+oBXh6s0KpjhAccWZm2Qxw08ARYG1UDQj5iC+JO42j1rt/g==", "license": "MIT", "optional": true, "dependencies": { + "@opentelemetry/api": "^1.4.1", "json-schema-to-ts": "^3.1.1", "standardwebhooks": "^1.0.0" }, @@ -802,6 +803,16 @@ "node": ">= 20" } }, + "node_modules/@opentelemetry/api": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.1.tgz", + "integrity": "sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/@stablelib/base64": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/base64/-/base64-1.0.1.tgz", diff --git a/package.json b/package.json index 3d5ff3a2..56c660b9 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,6 @@ "developer-tools" ], "optionalDependencies": { - "@anthropic-ai/sdk": "^0.125.0" + "@anthropic-ai/sdk": "^0.135.0" } } From a08764640378389151e076c38cd4381e81857044 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 23:55:36 +0000 Subject: [PATCH 2/2] chore(action): update bundled action --- action/index.cjs | 968 +++++++++++++++++++++++------------------------ 1 file changed, 473 insertions(+), 495 deletions(-) diff --git a/action/index.cjs b/action/index.cjs index 5f6dbf9a..22f774de 100644 --- a/action/index.cjs +++ b/action/index.cjs @@ -1,247 +1,225 @@ -"use strict";var Mie=Object.create;var aE=Object.defineProperty;var Lie=Object.getOwnPropertyDescriptor;var Fie=Object.getOwnPropertyNames;var Uie=Object.getPrototypeOf,jie=Object.prototype.hasOwnProperty;var j=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var q=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},_r=(e,t)=>{for(var n in t)aE(e,n,{get:t[n],enumerable:!0})},zie=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Fie(t))!jie.call(e,r)&&r!==n&&aE(e,r,{get:()=>t[r],enumerable:!(i=Lie(t,r))||i.enumerable});return e};var gt=(e,t,n)=>(n=e!=null?Mie(Uie(e)):{},zie(t||!e||!e.__esModule?aE(n,"default",{value:e,enumerable:!0}):n,e));var Ze=q(Pn=>{"use strict";var cE=Symbol.for("yaml.alias"),zU=Symbol.for("yaml.document"),ib=Symbol.for("yaml.map"),GU=Symbol.for("yaml.pair"),lE=Symbol.for("yaml.scalar"),ob=Symbol.for("yaml.seq"),Bo=Symbol.for("yaml.node.type"),Gie=e=>!!e&&typeof e=="object"&&e[Bo]===cE,Vie=e=>!!e&&typeof e=="object"&&e[Bo]===zU,Bie=e=>!!e&&typeof e=="object"&&e[Bo]===ib,qie=e=>!!e&&typeof e=="object"&&e[Bo]===GU,VU=e=>!!e&&typeof e=="object"&&e[Bo]===lE,Wie=e=>!!e&&typeof e=="object"&&e[Bo]===ob;function BU(e){if(e&&typeof e=="object")switch(e[Bo]){case ib:case ob:return!0}return!1}function Hie(e){if(e&&typeof e=="object")switch(e[Bo]){case cE:case ib:case lE:case ob:return!0}return!1}var Kie=e=>(VU(e)||BU(e))&&!!e.anchor;Pn.ALIAS=cE;Pn.DOC=zU;Pn.MAP=ib;Pn.NODE_TYPE=Bo;Pn.PAIR=GU;Pn.SCALAR=lE;Pn.SEQ=ob;Pn.hasAnchor=Kie;Pn.isAlias=Gie;Pn.isCollection=BU;Pn.isDocument=Vie;Pn.isMap=Bie;Pn.isNode=Hie;Pn.isPair=qie;Pn.isScalar=VU;Pn.isSeq=Wie});var Kf=q(uE=>{"use strict";var gn=Ze(),Sr=Symbol("break visit"),qU=Symbol("skip children"),lo=Symbol("remove node");function sb(e,t){let n=WU(t);gn.isDocument(e)?gu(null,e.contents,n,Object.freeze([e]))===lo&&(e.contents=null):gu(null,e,n,Object.freeze([]))}sb.BREAK=Sr;sb.SKIP=qU;sb.REMOVE=lo;function gu(e,t,n,i){let r=HU(e,t,n,i);if(gn.isNode(r)||gn.isPair(r))return KU(e,i,r),gu(e,r,n,i);if(typeof r!="symbol"){if(gn.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o{"use strict";var JU=Ze(),Jie=Kf(),Zie={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Yie=e=>e.replace(/[!,[\]{}]/g,t=>Zie[t]),Jf=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,s]=i;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(s){return n(String(s)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+Yie(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(t&&i.length>0&&JU.isNode(t.contents)){let o={};Jie.visit(t.contents,(s,a)=>{JU.isNode(a)&&a.tag&&(o[a.tag]=!0)}),r=Object.keys(o)}else r=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!t||r.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(` -`)}};Jf.defaultYaml={explicit:!1,version:"1.2"};Jf.defaultTags={"!!":"tag:yaml.org,2002:"};ZU.Directives=Jf});var cb=q(Zf=>{"use strict";var YU=Ze(),Qie=Kf();function Xie(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function QU(e){let t=new Set;return Qie.visit(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function XU(e,t){for(let n=1;;++n){let i=`${e}${n}`;if(!t.has(i))return i}}function eoe(e,t){let n=[],i=new Map,r=null;return{onAnchor:o=>{n.push(o),r??(r=QU(e));let s=XU(t,r);return r.add(s),s},setAnchors:()=>{for(let o of n){let s=i.get(o);if(typeof s=="object"&&s.anchor&&(YU.isScalar(s.node)||YU.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:i}}Zf.anchorIsValid=Xie;Zf.anchorNames=QU;Zf.createNodeAnchors=eoe;Zf.findNewAnchor=XU});var pE=q(ej=>{"use strict";function Yf(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,o=i.length;r{"use strict";var toe=Ze();function tj(e,t,n){if(Array.isArray(e))return e.map((i,r)=>tj(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!toe.hasAnchor(e))return e.toJSON(t,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=o=>{i.res=o,delete n.onCreate};let r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!n?.keep?Number(e):e}nj.toJS=tj});var lb=q(ij=>{"use strict";var noe=pE(),rj=Ze(),roe=Is(),fE=class{constructor(t){Object.defineProperty(this,rj.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){if(!rj.isDocument(t))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=roe.toJS(this,"",s);if(typeof r=="function")for(let{count:c,res:l}of s.anchors.values())r(l,c);return typeof o=="function"?noe.applyReviver(o,{"":a},"",a):a}};ij.NodeBase=fE});var Qf=q(oj=>{"use strict";var ioe=cb(),ooe=Kf(),yu=Ze(),soe=lb(),aoe=Is(),mE=class extends soe.NodeBase{constructor(t){super(yu.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],ooe.visit(t,{Node:(o,s)=>{(yu.isAlias(s)||yu.hasAnchor(s))&&i.push(s)}}),n&&(n.aliasResolveCache=i));let r;for(let o of i){if(o===this)break;o.anchor===this.source&&(r=o)}if(r&&n){let{anchors:o,doc:s,maxAliasCount:a}=n,c=o.get(r);if(c||(aoe.toJS(r,null,n),c=o.get(r)),c?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=ub(s,r,o)),c.count*c.aliasCount>a)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}}return r}toJSON(t,n){if(!n)return{source:this.source};let i=this.resolve(n.doc,n);if(!i){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(r)}return n.anchors.get(i).res}toString(t,n,i){let r=`*${this.source}`;if(t){if(ioe.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${r} `}return r}};function ub(e,t,n){if(yu.isAlias(t)){let i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(yu.isCollection(t)){let i=0;for(let r of t.items){let o=ub(e,r,n);o>i&&(i=o)}return i}else if(yu.isPair(t)){let i=ub(e,t.key,n),r=ub(e,t.value,n);return Math.max(i,r)}return 1}oj.Alias=mE});var an=q(gE=>{"use strict";var coe=Ze(),loe=lb(),uoe=Is(),doe=e=>!e||typeof e!="function"&&typeof e!="object",As=class extends loe.NodeBase{constructor(t){super(coe.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:uoe.toJS(this.value,t,n)}toString(){return String(this.value)}};As.BLOCK_FOLDED="BLOCK_FOLDED";As.BLOCK_LITERAL="BLOCK_LITERAL";As.PLAIN="PLAIN";As.QUOTE_DOUBLE="QUOTE_DOUBLE";As.QUOTE_SINGLE="QUOTE_SINGLE";gE.Scalar=As;gE.isScalarValue=doe});var Xf=q(aj=>{"use strict";var poe=Qf(),lc=Ze(),sj=an(),foe="tag:yaml.org,2002:";function moe(e,t,n){if(t){let i=n.filter(o=>o.tag===t),r=i.find(o=>!o.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>i.identify?.(e)&&!i.format)}function goe(e,t,n){if(lc.isDocument(e)&&(e=e.contents),lc.isNode(e))return e;if(lc.isPair(e)){let d=n.schema[lc.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:o,schema:s,sourceObjects:a}=n,c;if(i&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=r(e)),new poe.Alias(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=foe+t.slice(2));let l=moe(e,t,s.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new sj.Scalar(e);return c&&(c.node=d),d}l=e instanceof Map?s[lc.MAP]:Symbol.iterator in Object(e)?s[lc.SEQ]:s[lc.MAP]}o&&(o(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new sj.Scalar(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}aj.createNode=goe});var pb=q(db=>{"use strict";var hoe=Xf(),uo=Ze(),yoe=lb();function hE(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){let o=t[r];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=i,i=s}else i=new Map([[o,i]])}return hoe.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var cj=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,yE=class extends yoe.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>uo.isNode(i)||uo.isPair(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(cj(t))this.add(n);else{let[i,...r]=t,o=this.get(i,!0);if(uo.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,hE(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){let[n,...i]=t;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(uo.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){let[i,...r]=t,o=this.get(i,!0);return r.length===0?!n&&uo.isScalar(o)?o.value:o:uo.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!uo.isPair(n))return!1;let i=n.value;return i==null||t&&uo.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){let[n,...i]=t;if(i.length===0)return this.has(n);let r=this.get(n,!0);return uo.isCollection(r)?r.hasIn(i):!1}setIn(t,n){let[i,...r]=t;if(r.length===0)this.set(i,n);else{let o=this.get(i,!0);if(uo.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,hE(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};db.Collection=yE;db.collectionFromPath=hE;db.isEmptyPath=cj});var em=q(fb=>{"use strict";var boe=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function bE(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var voe=(e,t,n)=>e.endsWith(` -`)?bE(n,t):n.includes(` +"use strict";var dde=Object.create;var QA=Object.defineProperty;var pde=Object.getOwnPropertyDescriptor;var fde=Object.getOwnPropertyNames;var mde=Object.getPrototypeOf,gde=Object.prototype.hasOwnProperty;var P=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var K=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Cr=(e,t)=>{for(var n in t)QA(e,n,{get:t[n],enumerable:!0})},hde=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fde(t))!gde.call(e,i)&&i!==n&&QA(e,i,{get:()=>t[i],enumerable:!(r=pde(t,i))||r.enumerable});return e};var $t=(e,t,n)=>(n=e!=null?dde(mde(e)):{},hde(t||!e||!e.__esModule?QA(n,"default",{value:e,enumerable:!0}):n,e));var Ye=K(Fn=>{"use strict";var XA=Symbol.for("yaml.alias"),lV=Symbol.for("yaml.document"),Fv=Symbol.for("yaml.map"),uV=Symbol.for("yaml.pair"),eI=Symbol.for("yaml.scalar"),Uv=Symbol.for("yaml.seq"),ps=Symbol.for("yaml.node.type"),yde=e=>!!e&&typeof e=="object"&&e[ps]===XA,bde=e=>!!e&&typeof e=="object"&&e[ps]===lV,vde=e=>!!e&&typeof e=="object"&&e[ps]===Fv,_de=e=>!!e&&typeof e=="object"&&e[ps]===uV,dV=e=>!!e&&typeof e=="object"&&e[ps]===eI,wde=e=>!!e&&typeof e=="object"&&e[ps]===Uv;function pV(e){if(e&&typeof e=="object")switch(e[ps]){case Fv:case Uv:return!0}return!1}function kde(e){if(e&&typeof e=="object")switch(e[ps]){case XA:case Fv:case eI:case Uv:return!0}return!1}var $de=e=>(dV(e)||pV(e))&&!!e.anchor;Fn.ALIAS=XA;Fn.DOC=lV;Fn.MAP=Fv;Fn.NODE_TYPE=ps;Fn.PAIR=uV;Fn.SCALAR=eI;Fn.SEQ=Uv;Fn.hasAnchor=$de;Fn.isAlias=yde;Fn.isCollection=pV;Fn.isDocument=bde;Fn.isMap=vde;Fn.isNode=kde;Fn.isPair=_de;Fn.isScalar=dV;Fn.isSeq=wde});var ng=K(tI=>{"use strict";var vn=Ye(),Nr=Symbol("break visit"),fV=Symbol("skip children"),So=Symbol("remove node");function jv(e,t){let n=mV(t);vn.isDocument(e)?Uu(null,e.contents,n,Object.freeze([e]))===So&&(e.contents=null):Uu(null,e,n,Object.freeze([]))}jv.BREAK=Nr;jv.SKIP=fV;jv.REMOVE=So;function Uu(e,t,n,r){let i=gV(e,t,n,r);if(vn.isNode(i)||vn.isPair(i))return hV(e,r,i),Uu(e,i,n,r);if(typeof i!="symbol"){if(vn.isCollection(t)){r=Object.freeze(r.concat(t));for(let o=0;o{"use strict";var yV=Ye(),Sde=ng(),xde={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ede=e=>e.replace(/[!,[\]{}]/g,t=>xde[t]),rg=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[o,s]=r;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);let o=this.tags[r];if(o)try{return o+decodeURIComponent(i)}catch(s){return n(String(s)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+Ede(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(t&&r.length>0&&yV.isNode(t.contents)){let o={};Sde.visit(t.contents,(s,a)=>{yV.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of r)o==="!!"&&s==="tag:yaml.org,2002:"||(!t||i.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(` +`)}};rg.defaultYaml={explicit:!1,version:"1.2"};rg.defaultTags={"!!":"tag:yaml.org,2002:"};bV.Directives=rg});var Gv=K(ig=>{"use strict";var vV=Ye(),Tde=ng();function Ade(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function _V(e){let t=new Set;return Tde.visit(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function wV(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Ide(e,t){let n=[],r=new Map,i=null;return{onAnchor:o=>{n.push(o),i??(i=_V(e));let s=wV(t,i);return i.add(s),s},setAnchors:()=>{for(let o of n){let s=r.get(o);if(typeof s=="object"&&s.anchor&&(vV.isScalar(s.node)||vV.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:r}}ig.anchorIsValid=Ade;ig.anchorNames=_V;ig.createNodeAnchors=Ide;ig.findNewAnchor=wV});var rI=K(kV=>{"use strict";function og(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,o=r.length;i{"use strict";var Rde=Ye();function $V(e,t,n){if(Array.isArray(e))return e.map((r,i)=>$V(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!Rde.hasAnchor(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=o=>{r.res=o,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}SV.toJS=$V});var Bv=K(EV=>{"use strict";var Pde=rI(),xV=Ye(),Cde=ta(),iI=class{constructor(t){Object.defineProperty(this,xV.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){if(!xV.isDocument(t))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=Cde.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?Pde.applyReviver(o,{"":a},"",a):a}};EV.NodeBase=iI});var sg=K(TV=>{"use strict";var Nde=Gv(),Ode=ng(),zu=Ye(),Dde=Bv(),Mde=ta(),oI=class extends Dde.NodeBase{constructor(t){super(zu.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],Ode.visit(t,{Node:(o,s)=>{(zu.isAlias(s)||zu.hasAnchor(s))&&r.push(s)}}),n&&(n.aliasResolveCache=r));let i;for(let o of r){if(o===this)break;o.anchor===this.source&&(i=o)}if(i&&n){let{anchors:o,doc:s,maxAliasCount:a}=n,c=o.get(i);if(c||(Mde.toJS(i,null,n),c=o.get(i)),c?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Vv(s,i,o)),c.count*c.aliasCount>a)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}}return i}toJSON(t,n){if(!n)return{source:this.source};let r=this.resolve(n.doc,n);if(!r){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return n.anchors.get(r).res}toString(t,n,r){let i=`*${this.source}`;if(t){if(Nde.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${i} `}return i}};function Vv(e,t,n){if(zu.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(zu.isCollection(t)){let r=0;for(let i of t.items){let o=Vv(e,i,n);o>r&&(r=o)}return r}else if(zu.isPair(t)){let r=Vv(e,t.key,n),i=Vv(e,t.value,n);return Math.max(r,i)}return 1}TV.Alias=oI});var pn=K(sI=>{"use strict";var Lde=Ye(),Fde=Bv(),Ude=ta(),jde=e=>!e||typeof e!="function"&&typeof e!="object",na=class extends Fde.NodeBase{constructor(t){super(Lde.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:Ude.toJS(this.value,t,n)}toString(){return String(this.value)}};na.BLOCK_FOLDED="BLOCK_FOLDED";na.BLOCK_LITERAL="BLOCK_LITERAL";na.PLAIN="PLAIN";na.QUOTE_DOUBLE="QUOTE_DOUBLE";na.QUOTE_SINGLE="QUOTE_SINGLE";sI.Scalar=na;sI.isScalarValue=jde});var ag=K(IV=>{"use strict";var zde=sg(),Pc=Ye(),AV=pn(),Gde="tag:yaml.org,2002:";function Bde(e,t,n){if(t){let r=n.filter(o=>o.tag===t),i=r.find(o=>!o.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function Vde(e,t,n){if(Pc.isDocument(e)&&(e=e.contents),Pc.isNode(e))return e;if(Pc.isPair(e)){let d=n.schema[Pc.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=n,c;if(r&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=i(e)),new zde.Alias(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=Gde+t.slice(2));let l=Bde(e,t,s.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new AV.Scalar(e);return c&&(c.node=d),d}l=e instanceof Map?s[Pc.MAP]:Symbol.iterator in Object(e)?s[Pc.SEQ]:s[Pc.MAP]}o&&(o(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new AV.Scalar(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}IV.createNode=Vde});var Wv=K(qv=>{"use strict";var qde=ag(),xo=Ye(),Wde=Bv();function aI(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){let o=t[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=r,r=s}else r=new Map([[o,r]])}return qde.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var RV=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,cI=class extends Wde.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>xo.isNode(r)||xo.isPair(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(RV(t))this.add(n);else{let[r,...i]=t,o=this.get(r,!0);if(xo.isCollection(o))o.addIn(i,n);else if(o===void 0&&this.schema)this.set(r,aI(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){let[n,...r]=t;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(xo.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){let[r,...i]=t,o=this.get(r,!0);return i.length===0?!n&&xo.isScalar(o)?o.value:o:xo.isCollection(o)?o.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!xo.isPair(n))return!1;let r=n.value;return r==null||t&&xo.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){let[n,...r]=t;if(r.length===0)return this.has(n);let i=this.get(n,!0);return xo.isCollection(i)?i.hasIn(r):!1}setIn(t,n){let[r,...i]=t;if(i.length===0)this.set(r,n);else{let o=this.get(r,!0);if(xo.isCollection(o))o.setIn(i,n);else if(o===void 0&&this.schema)this.set(r,aI(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};qv.Collection=cI;qv.collectionFromPath=aI;qv.isEmptyPath=RV});var cg=K(Hv=>{"use strict";var Hde=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function lI(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Kde=(e,t,n)=>e.endsWith(` +`)?lI(n,t):n.includes(` `)?` -`+bE(n,t):(e.endsWith(" ")?"":" ")+n;fb.indentComment=bE;fb.lineComment=voe;fb.stringifyComment=boe});var uj=q(tm=>{"use strict";var woe="flow",vE="block",mb="quoted";function koe(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!r||r<0)return e;rr-Math.max(2,o)?l.push(0):d=r-i);let p,f,m=!1,g=-1,h=-1,b=-1;n===vE&&(g=lj(e,g,t.length),g!==-1&&(d=g+c));for(let w;w=e[g+=1];){if(n===mb&&w==="\\"){switch(h=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}b=g}if(w===` -`)n===vE&&(g=lj(e,g,t.length)),d=g+t.length+c,p=void 0;else{if(w===" "&&f&&f!==" "&&f!==` -`&&f!==" "){let k=e[g+1];k&&k!==" "&&k!==` -`&&k!==" "&&(p=g)}if(g>=d)if(p)l.push(p),d=p+c,p=void 0;else if(n===mb){for(;f===" "||f===" ";)f=w,w=e[g+=1],m=!0;let k=g>b+1?g-2:h-1;if(u[k])return e;l.push(k),u[k]=!0,d=k+c,p=void 0}else m=!0}f=w}if(m&&a&&a(),l.length===0)return e;s&&s();let y=e.slice(0,l[0]);for(let w=0;w{"use strict";var Mi=an(),Rs=uj(),hb=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),yb=e=>/^(%|---|\.\.\.)/m.test(e);function $oe(e,t,n){if(!t||t<0)return!1;let i=t-n,r=e.length;if(r<=i)return!1;for(let o=0,s=0;oi)return!0;if(s=o+1,r-s<=i)return!1}return!0}function nm(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(yb(e)?" ":""),s="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(s+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{s+=n.slice(a,c);let u=n.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(i||n[c+2]==='"'||n.length{"use strict";var Jde="flow",uI="block",Kv="quoted";function Zde(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return e;ii-Math.max(2,o)?l.push(0):d=i-r);let p,f,m=!1,g=-1,h=-1,v=-1;n===uI&&(g=PV(e,g,t.length),g!==-1&&(d=g+c));for(let _;_=e[g+=1];){if(n===Kv&&_==="\\"){switch(h=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}v=g}if(_===` +`)n===uI&&(g=PV(e,g,t.length)),d=g+t.length+c,p=void 0;else{if(_===" "&&f&&f!==" "&&f!==` +`&&f!==" "){let w=e[g+1];w&&w!==" "&&w!==` +`&&w!==" "&&(p=g)}if(g>=d)if(p)l.push(p),d=p+c,p=void 0;else if(n===Kv){for(;f===" "||f===" ";)f=_,_=e[g+=1],m=!0;let w=g>v+1?g-2:h-1;if(u[w])return e;l.push(w),u[w]=!0,d=w+c,p=void 0}else m=!0}f=_}if(m&&a&&a(),l.length===0)return e;s&&s();let b=e.slice(0,l[0]);for(let _=0;_{"use strict";var Qi=pn(),ra=CV(),Zv=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Yv=e=>/^(%|---|\.\.\.)/m.test(e);function Yde(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let o=0,s=0;or)return!0;if(s=o+1,i-s<=r)return!1}return!0}function ug(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Yv(e)?" ":""),s="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(s+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{s+=n.slice(a,c);let u=n.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length -`;let d,p;for(p=n.length;p>0;--p){let _=n[p-1];if(_!==` -`&&_!==" "&&_!==" ")break}let f=n.substring(p),m=f.indexOf(` +`;let d,p;for(p=n.length;p>0;--p){let k=n[p-1];if(k!==` +`&&k!==" "&&k!==" ")break}let f=n.substring(p),m=f.indexOf(` `);m===-1?d="-":n===f||m!==f.length-1?(d="+",o&&o()):d="",f&&(n=n.slice(0,-f.length),f[f.length-1]===` -`&&(f=f.slice(0,-1)),f=f.replace(kE,`$&${l}`));let g=!1,h,b=-1;for(h=0;h{S=!0});let E=Rs.foldFlowLines(`${y}${_}${f}`,l,Rs.FOLD_BLOCK,x);if(!S)return`>${k} -${l}${E}`}return n=n.replace(/\n+/g,`$&${l}`),`|${k} -${l}${y}${n}${f}`}function _oe(e,t,n,i){let{type:r,value:o}=e,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=t;if(a&&o.includes(` -`)||u&&/[[\]{},]/.test(o))return bu(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` -`)?bu(o,t):gb(e,t,n,i);if(!a&&!u&&r!==Mi.Scalar.PLAIN&&o.includes(` -`))return gb(e,t,n,i);if(yb(o)){if(c==="")return t.forceBlockIndent=!0,gb(e,t,n,i);if(a&&c===l)return bu(o,t)}let d=o.replace(/\n+/g,`$& -${c}`);if(s){let p=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:f,tags:m}=t.doc.schema;if(m.some(p)||f?.some(p))return bu(o,t)}return a?d:Rs.foldFlowLines(d,c,Rs.FOLD_FLOW,hb(t,!1))}function Soe(e,t,n,i){let{implicitKey:r,inFlow:o}=t,s=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;a!==Mi.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Mi.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Mi.Scalar.BLOCK_FOLDED:case Mi.Scalar.BLOCK_LITERAL:return r||o?bu(s.value,t):gb(s,t,n,i);case Mi.Scalar.QUOTE_DOUBLE:return nm(s.value,t);case Mi.Scalar.QUOTE_SINGLE:return wE(s.value,t);case Mi.Scalar.PLAIN:return _oe(s,t,n,i);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=t.options,p=r&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}dj.stringifyString=Soe});var im=q($E=>{"use strict";var xoe=cb(),Ns=Ze(),Eoe=em(),Toe=rm();function Ioe(e,t){let n=Object.assign({blockQuote:!0,commentString:Eoe.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Aoe(e,t){if(t.tag){let r=e.filter(o=>o.tag===t.tag);if(r.length>0)return r.find(o=>o.format===t.format)??r[0]}let n,i;if(Ns.isScalar(t)){i=t.value;let r=e.filter(o=>o.identify?.(i));if(r.length>1){let o=r.filter(s=>s.test);o.length>0&&(r=o)}n=r.find(o=>o.format===t.format)??r.find(o=>!o.format)}else i=t,n=e.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function Roe(e,t,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],o=(Ns.isScalar(e)||Ns.isCollection(e))&&e.anchor;o&&xoe.anchorIsValid(o)&&(n.add(o),r.push(`&${o}`));let s=e.tag??(t.default?null:t.tag);return s&&r.push(i.directives.tagString(s)),r.join(" ")}function Noe(e,t,n,i){if(Ns.isPair(e))return e.toString(t,n,i);if(Ns.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r,o=Ns.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>r=c});r??(r=Aoe(t.doc.schema.tags,o));let s=Roe(o,r,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);let a=typeof r.stringify=="function"?r.stringify(o,t,n,i):Ns.isScalar(o)?Toe.stringifyString(o,t,n,i):o.toString(t,n,i);return s?Ns.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} -${t.indent}${a}`:a}$E.createStringifyContext=Ioe;$E.stringify=Noe});var gj=q(mj=>{"use strict";var qo=Ze(),pj=an(),fj=im(),om=em();function Coe({key:e,value:t},n,i,r){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,p=qo.isNode(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(qo.isCollection(e)||!qo.isNode(e)&&typeof e=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let f=!d&&(!e||p&&t==null&&!n.inFlow||qo.isCollection(e)||(qo.isScalar(e)?e.type===pj.Scalar.BLOCK_FOLDED||e.type===pj.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(d||!o),indent:a+c});let m=!1,g=!1,h=fj.stringify(e,n,()=>m=!0,()=>g=!0);if(!f&&!n.inFlow&&h.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(n.inFlow){if(o||t==null)return m&&i&&i(),h===""?"?":f?`? ${h}`:h}else if(o&&!d||t==null&&f)return h=`? ${h}`,p&&!m?h+=om.lineComment(h,n.indent,l(p)):g&&r&&r(),h;m&&(p=null),f?(p&&(h+=om.lineComment(h,n.indent,l(p))),h=`? ${h} -${a}:`):(h=`${h}:`,p&&(h+=om.lineComment(h,n.indent,l(p))));let b,y,w;qo.isNode(t)?(b=!!t.spaceBefore,y=t.commentBefore,w=t.comment):(b=!1,y=null,w=null,t&&typeof t=="object"&&(t=s.createNode(t))),n.implicitKey=!1,!f&&!p&&qo.isScalar(t)&&(n.indentAtStart=h.length+1),g=!1,!u&&c.length>=2&&!n.inFlow&&!f&&qo.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let k=!1,_=fj.stringify(t,n,()=>k=!0,()=>g=!0),S=" ";if(p||b||y){if(S=b?` -`:"",y){let x=l(y);S+=` -${om.indentComment(x,n.indent)}`}_===""&&!n.inFlow?S===` -`&&w&&(S=` - -`):S+=` -${n.indent}`}else if(!f&&qo.isCollection(t)){let x=_[0],E=_.indexOf(` -`),T=E!==-1,A=n.inFlow??t.flow??t.items.length===0;if(T||!A){let L=!1;if(T&&(x==="&"||x==="!")){let F=_.indexOf(" ");x==="&"&&F!==-1&&F{"use strict";var hj=require("process");function Poe(e,...t){e==="debug"&&console.log(...t)}function Doe(e,t){(e==="debug"||e==="warn")&&(typeof hj.emitWarning=="function"?hj.emitWarning(t):console.warn(t))}_E.debug=Poe;_E.warn=Doe});var $b=q(kb=>{"use strict";var wb=Ze(),yj=an(),bb="<<",vb={identify:e=>e===bb||typeof e=="symbol"&&e.description===bb,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new yj.Scalar(Symbol(bb)),{addToJSMap:bj}),stringify:()=>bb},Ooe=(e,t)=>(vb.identify(t)||wb.isScalar(t)&&(!t.type||t.type===yj.Scalar.PLAIN)&&vb.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===vb.tag&&n.default);function bj(e,t,n){let i=vj(e,n);if(wb.isSeq(i))for(let r of i.items)xE(e,t,r);else if(Array.isArray(i))for(let r of i)xE(e,t,r);else xE(e,t,i)}function xE(e,t,n){let i=vj(e,n);if(!wb.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,e,Map);for(let[o,s]of r)t instanceof Map?t.has(o)||t.set(o,s):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function vj(e,t){return e&&wb.isAlias(t)?t.resolve(e.doc,e):t}kb.addMergeToJSMap=bj;kb.isMergeKey=Ooe;kb.merge=vb});var TE=q($j=>{"use strict";var Moe=SE(),wj=$b(),Loe=im(),kj=Ze(),EE=Is();function Foe(e,t,{key:n,value:i}){if(kj.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(wj.isMergeKey(e,n))wj.addMergeToJSMap(e,t,i);else{let r=EE.toJS(n,"",e);if(t instanceof Map)t.set(r,EE.toJS(i,r,e));else if(t instanceof Set)t.add(r);else{let o=Uoe(n,r,e),s=EE.toJS(i,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}}return t}function Uoe(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(kj.isNode(e)&&n?.doc){let i=Loe.createStringifyContext(n.doc,{});i.anchors=new Set;for(let o of n.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=e.toString(i);if(!n.mapKeyWarned){let o=JSON.stringify(r);o.length>40&&(o=o.substring(0,36)+'..."'),Moe.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}$j.addPairToJSMap=Foe});var Cs=q(IE=>{"use strict";var _j=Xf(),joe=gj(),zoe=TE(),_b=Ze();function Goe(e,t,n){let i=_j.createNode(e,void 0,n),r=_j.createNode(t,void 0,n);return new Sb(i,r)}var Sb=class e{constructor(t,n=null){Object.defineProperty(this,_b.NODE_TYPE,{value:_b.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return _b.isNode(n)&&(n=n.clone(t)),_b.isNode(i)&&(i=i.clone(t)),new e(n,i)}toJSON(t,n){let i=n?.mapAsMap?new Map:{};return zoe.addPairToJSMap(n,i,this)}toString(t,n,i){return t?.doc?joe.stringifyPair(this,t,n,i):JSON.stringify(this)}};IE.Pair=Sb;IE.createPair=Goe});var AE=q(xj=>{"use strict";var uc=Ze(),Sj=im(),xb=em();function Voe(e,t,n){return(t.inFlow??e.flow?qoe:Boe)(e,t,n)}function Boe({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:o,type:null}),d=!1,p=[];for(let m=0;mh=null,()=>d=!0);h&&(b+=xb.lineComment(b,o,l(h))),d&&h&&(d=!1),p.push(i+b)}let f;if(p.length===0)f=r.start+r.end;else{f=p[0];for(let m=1;m{x=!0});let I=ra.foldFlowLines(`${b}${k}${f}`,l,ra.FOLD_BLOCK,A);if(!x)return`>${w} +${l}${I}`}return n=n.replace(/\n+/g,`$&${l}`),`|${w} +${l}${b}${n}${f}`}function Qde(e,t,n,r){let{type:i,value:o}=e,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=t;if(a&&o.includes(` +`)||u&&/[[\]{},]/.test(o))return Gu(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` +`)?Gu(o,t):Jv(e,t,n,r);if(!a&&!u&&i!==Qi.Scalar.PLAIN&&o.includes(` +`))return Jv(e,t,n,r);if(Yv(o)){if(c==="")return t.forceBlockIndent=!0,Jv(e,t,n,r);if(a&&c===l)return Gu(o,t)}let d=o.replace(/\n+/g,`$& +${c}`);if(s){let p=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:f,tags:m}=t.doc.schema;if(m.some(p)||f?.some(p))return Gu(o,t)}return a?d:ra.foldFlowLines(d,c,ra.FOLD_FLOW,Zv(t,!1))}function Xde(e,t,n,r){let{implicitKey:i,inFlow:o}=t,s=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;a!==Qi.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Qi.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Qi.Scalar.BLOCK_FOLDED:case Qi.Scalar.BLOCK_LITERAL:return i||o?Gu(s.value,t):Jv(s,t,n,r);case Qi.Scalar.QUOTE_DOUBLE:return ug(s.value,t);case Qi.Scalar.QUOTE_SINGLE:return dI(s.value,t);case Qi.Scalar.PLAIN:return Qde(s,t,n,r);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=t.options,p=i&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}NV.stringifyString=Xde});var pg=K(fI=>{"use strict";var epe=Gv(),ia=Ye(),tpe=cg(),npe=dg();function rpe(e,t){let n=Object.assign({blockQuote:!0,commentString:tpe.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function ipe(e,t){if(t.tag){let i=e.filter(o=>o.tag===t.tag);if(i.length>0)return i.find(o=>o.format===t.format)??i[0]}let n,r;if(ia.isScalar(t)){r=t.value;let i=e.filter(o=>o.identify?.(r));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}n=i.find(o=>o.format===t.format)??i.find(o=>!o.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function ope(e,t,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],o=(ia.isScalar(e)||ia.isCollection(e))&&e.anchor;o&&epe.anchorIsValid(o)&&(n.add(o),i.push(`&${o}`));let s=e.tag??(t.default?null:t.tag);return s&&i.push(r.directives.tagString(s)),i.join(" ")}function spe(e,t,n,r){if(ia.isPair(e))return e.toString(t,n,r);if(ia.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,o=ia.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i??(i=ipe(t.doc.schema.tags,o));let s=ope(o,i,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,t,n,r):ia.isScalar(o)?npe.stringifyString(o,t,n,r):o.toString(t,n,r);return s?ia.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} +${t.indent}${a}`:a}fI.createStringifyContext=rpe;fI.stringify=spe});var LV=K(MV=>{"use strict";var fs=Ye(),OV=pn(),DV=pg(),fg=cg();function ape({key:e,value:t},n,r,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,p=fs.isNode(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(fs.isCollection(e)||!fs.isNode(e)&&typeof e=="object"){let A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let f=!d&&(!e||p&&t==null&&!n.inFlow||fs.isCollection(e)||(fs.isScalar(e)?e.type===OV.Scalar.BLOCK_FOLDED||e.type===OV.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(d||!o),indent:a+c});let m=!1,g=!1,h=DV.stringify(e,n,()=>m=!0,()=>g=!0);if(!f&&!n.inFlow&&h.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(n.inFlow){if(o||t==null)return m&&r&&r(),h===""?"?":f?`? ${h}`:h}else if(o&&!d||t==null&&f)return h=`? ${h}`,p&&!m?h+=fg.lineComment(h,n.indent,l(p)):g&&i&&i(),h;m&&(p=null),f?(p&&(h+=fg.lineComment(h,n.indent,l(p))),h=`? ${h} +${a}:`):(h=`${h}:`,p&&(h+=fg.lineComment(h,n.indent,l(p))));let v,b,_;fs.isNode(t)?(v=!!t.spaceBefore,b=t.commentBefore,_=t.comment):(v=!1,b=null,_=null,t&&typeof t=="object"&&(t=s.createNode(t))),n.implicitKey=!1,!f&&!p&&fs.isScalar(t)&&(n.indentAtStart=h.length+1),g=!1,!u&&c.length>=2&&!n.inFlow&&!f&&fs.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let w=!1,k=DV.stringify(t,n,()=>w=!0,()=>g=!0),x=" ";if(p||v||b){if(x=v?` +`:"",b){let A=l(b);x+=` +${fg.indentComment(A,n.indent)}`}k===""&&!n.inFlow?x===` +`&&_&&(x=` + +`):x+=` +${n.indent}`}else if(!f&&fs.isCollection(t)){let A=k[0],I=k.indexOf(` +`),R=I!==-1,C=n.inFlow??t.flow??t.items.length===0;if(R||!C){let j=!1;if(R&&(A==="&"||A==="!")){let z=k.indexOf(" ");A==="&"&&z!==-1&&z{"use strict";var FV=require("process");function cpe(e,...t){e==="debug"&&console.log(...t)}function lpe(e,t){(e==="debug"||e==="warn")&&(typeof FV.emitWarning=="function"?FV.emitWarning(t):console.warn(t))}mI.debug=cpe;mI.warn=lpe});var n_=K(t_=>{"use strict";var e_=Ye(),UV=pn(),Qv="<<",Xv={identify:e=>e===Qv||typeof e=="symbol"&&e.description===Qv,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new UV.Scalar(Symbol(Qv)),{addToJSMap:jV}),stringify:()=>Qv},upe=(e,t)=>(Xv.identify(t)||e_.isScalar(t)&&(!t.type||t.type===UV.Scalar.PLAIN)&&Xv.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Xv.tag&&n.default);function jV(e,t,n){let r=zV(e,n);if(e_.isSeq(r))for(let i of r.items)hI(e,t,i);else if(Array.isArray(r))for(let i of r)hI(e,t,i);else hI(e,t,r)}function hI(e,t,n){let r=zV(e,n);if(!e_.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,e,Map);for(let[o,s]of i)t instanceof Map?t.has(o)||t.set(o,s):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function zV(e,t){return e&&e_.isAlias(t)?t.resolve(e.doc,e):t}t_.addMergeToJSMap=jV;t_.isMergeKey=upe;t_.merge=Xv});var bI=K(VV=>{"use strict";var dpe=gI(),GV=n_(),ppe=pg(),BV=Ye(),yI=ta();function fpe(e,t,{key:n,value:r}){if(BV.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(GV.isMergeKey(e,n))GV.addMergeToJSMap(e,t,r);else{let i=yI.toJS(n,"",e);if(t instanceof Map)t.set(i,yI.toJS(r,i,e));else if(t instanceof Set)t.add(i);else{let o=mpe(n,i,e),s=yI.toJS(r,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}}return t}function mpe(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(BV.isNode(e)&&n?.doc){let r=ppe.createStringifyContext(n.doc,{});r.anchors=new Set;for(let o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=e.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),dpe.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}VV.addPairToJSMap=fpe});var oa=K(vI=>{"use strict";var qV=ag(),gpe=LV(),hpe=bI(),r_=Ye();function ype(e,t,n){let r=qV.createNode(e,void 0,n),i=qV.createNode(t,void 0,n);return new i_(r,i)}var i_=class e{constructor(t,n=null){Object.defineProperty(this,r_.NODE_TYPE,{value:r_.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return r_.isNode(n)&&(n=n.clone(t)),r_.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(t,n){let r=n?.mapAsMap?new Map:{};return hpe.addPairToJSMap(n,r,this)}toString(t,n,r){return t?.doc?gpe.stringifyPair(this,t,n,r):JSON.stringify(this)}};vI.Pair=i_;vI.createPair=ype});var _I=K(HV=>{"use strict";var Cc=Ye(),WV=pg(),o_=cg();function bpe(e,t,n){return(t.inFlow??e.flow?_pe:vpe)(e,t,n)}function vpe({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:o,type:null}),d=!1,p=[];for(let m=0;mh=null,()=>d=!0);h&&(v+=o_.lineComment(v,o,l(h))),d&&h&&(d=!1),p.push(r+v)}let f;if(p.length===0)f=i.start+i.end;else{f=p[0];for(let m=1;mh=null);l||(l=d.length>u||b.includes(` -`)),m0&&(l||(l=d.reduce((y,w)=>y+w.length+2,2)+(b.length+2)>t.options.lineWidth)),l&&(b+=",")),h&&(b+=xb.lineComment(b,i,a(h))),d.push(b),u=d.length}let{start:p,end:f}=n;if(d.length===0)return p+f;if(!l){let m=d.reduce((g,h)=>g+h.length+2,2);l=t.options.lineWidth>0&&m>t.options.lineWidth}if(l){let m=p;for(let g of d)m+=g?` -${o}${r}${g}`:` +`+o_.indentComment(l(e),c),a&&a()):d&&s&&s(),f}function _pe({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=t;r+=o;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let m=0;mh=null);l||(l=d.length>u||v.includes(` +`)),m0&&(l||(l=d.reduce((b,_)=>b+_.length+2,2)+(v.length+2)>t.options.lineWidth)),l&&(v+=",")),h&&(v+=o_.lineComment(v,r,a(h))),d.push(v),u=d.length}let{start:p,end:f}=n;if(d.length===0)return p+f;if(!l){let m=d.reduce((g,h)=>g+h.length+2,2);l=t.options.lineWidth>0&&m>t.options.lineWidth}if(l){let m=p;for(let g of d)m+=g?` +${o}${i}${g}`:` `;return`${m} -${r}${f}`}else return`${p}${s}${d.join(" ")}${s}${f}`}function Eb({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let o=xb.indentComment(t(i),e);n.push(o.trimStart())}}xj.stringifyCollection=Voe});var Ds=q(NE=>{"use strict";var Woe=AE(),Hoe=TE(),Koe=pb(),Ps=Ze(),Tb=Cs(),Joe=an();function sm(e,t){let n=Ps.isScalar(t)?t.value:t;for(let i of e)if(Ps.isPair(i)&&(i.key===t||i.key===n||Ps.isScalar(i.key)&&i.key.value===n))return i}var RE=class extends Koe.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ps.MAP,t),this.items=[]}static from(t,n,i){let{keepUndefined:r,replacer:o}=i,s=new this(t),a=(c,l)=>{if(typeof o=="function")l=o.call(n,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||r)&&s.items.push(Tb.createPair(c,l,i))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&s.items.sort(t.sortMapEntries),s}add(t,n){let i;Ps.isPair(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Tb.Pair(t,t?.value):i=new Tb.Pair(t.key,t.value);let r=sm(this.items,i.key),o=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Ps.isScalar(r.value)&&Joe.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(o){let s=this.items.findIndex(a=>o(i,a)<0);s===-1?this.items.push(i):this.items.splice(s,0,i)}else this.items.push(i)}delete(t){let n=sm(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let r=sm(this.items,t)?.value;return(!n&&Ps.isScalar(r)?r.value:r)??void 0}has(t){return!!sm(this.items,t)}set(t,n){this.add(new Tb.Pair(t,n),!0)}toJSON(t,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let o of this.items)Hoe.addPairToJSMap(n,r,o);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(let r of this.items)if(!Ps.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Woe.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}};NE.YAMLMap=RE;NE.findPair=sm});var vu=q(Tj=>{"use strict";var Zoe=Ze(),Ej=Ds(),Yoe={collection:"map",default:!0,nodeClass:Ej.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return Zoe.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ej.YAMLMap.from(e,t,n)};Tj.map=Yoe});var Os=q(Ij=>{"use strict";var Qoe=Xf(),Xoe=AE(),ese=pb(),Ab=Ze(),tse=an(),nse=Is(),CE=class extends ese.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ab.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Ib(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let i=Ib(t);if(typeof i!="number")return;let r=this.items[i];return!n&&Ab.isScalar(r)?r.value:r}has(t){let n=Ib(t);return typeof n=="number"&&n=0?t:null}Ij.YAMLSeq=CE});var wu=q(Rj=>{"use strict";var rse=Ze(),Aj=Os(),ise={collection:"seq",default:!0,nodeClass:Aj.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return rse.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Aj.YAMLSeq.from(e,t,n)};Rj.seq=ise});var am=q(Nj=>{"use strict";var ose=rm(),sse={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),ose.stringifyString(e,t,n,i)}};Nj.string=sse});var Rb=q(Dj=>{"use strict";var Cj=an(),Pj={identify:e=>e==null,createNode:()=>new Cj.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Cj.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&Pj.test.test(e)?e:t.options.nullStr};Dj.nullTag=Pj});var PE=q(Mj=>{"use strict";var ase=an(),Oj={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ase.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Oj.test.test(e)){let i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};Mj.boolTag=Oj});var ku=q(Lj=>{"use strict";function cse({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=t-(o.length-s-1);for(;a-- >0;)o+="0"}return o}Lj.stringifyNumber=cse});var OE=q(Nb=>{"use strict";var lse=an(),DE=ku(),use={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:DE.stringifyNumber},dse={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():DE.stringifyNumber(e)}},pse={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new lse.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:DE.stringifyNumber};Nb.float=pse;Nb.floatExp=dse;Nb.floatNaN=use});var LE=q(Pb=>{"use strict";var Fj=ku(),Cb=e=>typeof e=="bigint"||Number.isInteger(e),ME=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function Uj(e,t,n){let{value:i}=e;return Cb(i)&&i>=0?n+i.toString(t):Fj.stringifyNumber(e)}var fse={identify:e=>Cb(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>ME(e,2,8,n),stringify:e=>Uj(e,8,"0o")},mse={identify:Cb,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ME(e,0,10,n),stringify:Fj.stringifyNumber},gse={identify:e=>Cb(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ME(e,2,16,n),stringify:e=>Uj(e,16,"0x")};Pb.int=mse;Pb.intHex=gse;Pb.intOct=fse});var zj=q(jj=>{"use strict";var hse=vu(),yse=Rb(),bse=wu(),vse=am(),wse=PE(),FE=OE(),UE=LE(),kse=[hse.map,bse.seq,vse.string,yse.nullTag,wse.boolTag,UE.intOct,UE.int,UE.intHex,FE.floatNaN,FE.floatExp,FE.float];jj.schema=kse});var Bj=q(Vj=>{"use strict";var $se=an(),_se=vu(),Sse=wu();function Gj(e){return typeof e=="bigint"||Number.isInteger(e)}var Db=({value:e})=>JSON.stringify(e),xse=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Db},{identify:e=>e==null,createNode:()=>new $se.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Db},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Db},{identify:Gj,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Gj(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Db}],Ese={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Tse=[_se.map,Sse.seq].concat(xse,Ese);Vj.schema=Tse});var zE=q(qj=>{"use strict";var cm=require("buffer"),jE=an(),Ise=rm(),Ase={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof cm.Buffer=="function")return cm.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r{"use strict";var Ob=Ze(),GE=Cs(),Rse=an(),Nse=Os();function Wj(e,t){if(Ob.isSeq(e))for(let n=0;n1&&t("Each pair must have its own sequence indicator");let r=i.items[0]||new GE.Pair(new Rse.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} -${r.key.commentBefore}`:i.commentBefore),i.comment){let o=r.value??r.key;o.comment=o.comment?`${i.comment} -${o.comment}`:i.comment}i=r}e.items[n]=Ob.isPair(i)?i:new GE.Pair(i)}}else t("Expected a sequence for this tag");return e}function Hj(e,t,n){let{replacer:i}=n,r=new Nse.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){typeof i=="function"&&(s=i.call(t,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;r.items.push(GE.createPair(a,c,n))}return r}var Cse={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Wj,createNode:Hj};Mb.createPairs=Hj;Mb.pairs=Cse;Mb.resolvePairs=Wj});var qE=q(BE=>{"use strict";var Kj=Ze(),VE=Is(),lm=Ds(),Pse=Os(),Jj=Lb(),dc=class e extends Pse.YAMLSeq{constructor(){super(),this.add=lm.YAMLMap.prototype.add.bind(this),this.delete=lm.YAMLMap.prototype.delete.bind(this),this.get=lm.YAMLMap.prototype.get.bind(this),this.has=lm.YAMLMap.prototype.has.bind(this),this.set=lm.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let o,s;if(Kj.isPair(r)?(o=VE.toJS(r.key,"",n),s=VE.toJS(r.value,o,n)):o=VE.toJS(r,"",n),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,s)}return i}static from(t,n,i){let r=Jj.createPairs(t,n,i),o=new this;return o.items=r.items,o}};dc.tag="tag:yaml.org,2002:omap";var Dse={collection:"seq",identify:e=>e instanceof Map,nodeClass:dc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=Jj.resolvePairs(e,t),i=[];for(let{key:r}of n.items)Kj.isScalar(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new dc,n)},createNode:(e,t,n)=>dc.from(e,t,n)};BE.YAMLOMap=dc;BE.omap=Dse});var ez=q(WE=>{"use strict";var Zj=an();function Yj({value:e,source:t},n){return t&&(e?Qj:Xj).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Qj={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Zj.Scalar(!0),stringify:Yj},Xj={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Zj.Scalar(!1),stringify:Yj};WE.falseTag=Xj;WE.trueTag=Qj});var tz=q(Fb=>{"use strict";var Ose=an(),HE=ku(),Mse={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:HE.stringifyNumber},Lse={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():HE.stringifyNumber(e)}},Fse={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new Ose.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:HE.stringifyNumber};Fb.float=Fse;Fb.floatExp=Lse;Fb.floatNaN=Mse});var rz=q(dm=>{"use strict";var nz=ku(),um=e=>typeof e=="bigint"||Number.isInteger(e);function Ub(e,t,n,{intAsBigInt:i}){let r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return r==="-"?BigInt(-1)*s:s}let o=parseInt(e,n);return r==="-"?-1*o:o}function KE(e,t,n){let{value:i}=e;if(um(i)){let r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return nz.stringifyNumber(e)}var Use={identify:um,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Ub(e,2,2,n),stringify:e=>KE(e,2,"0b")},jse={identify:um,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Ub(e,1,8,n),stringify:e=>KE(e,8,"0")},zse={identify:um,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Ub(e,0,10,n),stringify:nz.stringifyNumber},Gse={identify:um,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Ub(e,2,16,n),stringify:e=>KE(e,16,"0x")};dm.int=zse;dm.intBin=Use;dm.intHex=Gse;dm.intOct=jse});var ZE=q(JE=>{"use strict";var Gb=Ze(),jb=Cs(),zb=Ds(),pc=class e extends zb.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;Gb.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new jb.Pair(t.key,null):n=new jb.Pair(t,null),zb.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let i=zb.findPair(this.items,t);return!n&&Gb.isPair(i)?Gb.isScalar(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=zb.findPair(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new jb.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){let{replacer:r}=i,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof r=="function"&&(s=r.call(n,s,s)),o.items.push(jb.createPair(s,null,i));return o}};pc.tag="tag:yaml.org,2002:set";var Vse={collection:"map",identify:e=>e instanceof Set,nodeClass:pc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>pc.from(e,t,n),resolve(e,t){if(Gb.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new pc,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};JE.YAMLSet=pc;JE.set=Vse});var QE=q(Vb=>{"use strict";var Bse=ku();function YE(e,t){let n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=s=>t?BigInt(s):Number(s),o=i.replace(/_/g,"").split(":").reduce((s,a)=>s*r(60)+r(a),r(0));return n==="-"?r(-1)*o:o}function iz(e){let{value:t}=e,n=s=>s;if(typeof t=="bigint")n=s=>BigInt(s);else if(isNaN(t)||!isFinite(t))return Bse.stringifyNumber(e);let i="";t<0&&(i="-",t*=n(-1));let r=n(60),o=[t%r];return t<60?o.unshift(0):(t=(t-o[0])/r,o.unshift(t%r),t>=60&&(t=(t-o[0])/r,o.unshift(t))),i+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var qse={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>YE(e,n),stringify:iz},Wse={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>YE(e,!1),stringify:iz},oz={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(oz.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(n,i-1,r,o||0,s||0,a||0,c),u=t[8];if(u&&u!=="Z"){let d=YE(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Vb.floatTime=Wse;Vb.intTime=qse;Vb.timestamp=oz});var cz=q(az=>{"use strict";var Hse=vu(),Kse=Rb(),Jse=wu(),Zse=am(),Yse=zE(),sz=ez(),XE=tz(),Bb=rz(),Qse=$b(),Xse=qE(),eae=Lb(),tae=ZE(),eT=QE(),nae=[Hse.map,Jse.seq,Zse.string,Kse.nullTag,sz.trueTag,sz.falseTag,Bb.intBin,Bb.intOct,Bb.int,Bb.intHex,XE.floatNaN,XE.floatExp,XE.float,Yse.binary,Qse.merge,Xse.omap,eae.pairs,tae.set,eT.intTime,eT.floatTime,eT.timestamp];az.schema=nae});var bz=q(rT=>{"use strict";var pz=vu(),rae=Rb(),fz=wu(),iae=am(),oae=PE(),tT=OE(),nT=LE(),sae=zj(),aae=Bj(),mz=zE(),pm=$b(),gz=qE(),hz=Lb(),lz=cz(),yz=ZE(),qb=QE(),uz=new Map([["core",sae.schema],["failsafe",[pz.map,fz.seq,iae.string]],["json",aae.schema],["yaml11",lz.schema],["yaml-1.1",lz.schema]]),dz={binary:mz.binary,bool:oae.boolTag,float:tT.float,floatExp:tT.floatExp,floatNaN:tT.floatNaN,floatTime:qb.floatTime,int:nT.int,intHex:nT.intHex,intOct:nT.intOct,intTime:qb.intTime,map:pz.map,merge:pm.merge,null:rae.nullTag,omap:gz.omap,pairs:hz.pairs,seq:fz.seq,set:yz.set,timestamp:qb.timestamp},cae={"tag:yaml.org,2002:binary":mz.binary,"tag:yaml.org,2002:merge":pm.merge,"tag:yaml.org,2002:omap":gz.omap,"tag:yaml.org,2002:pairs":hz.pairs,"tag:yaml.org,2002:set":yz.set,"tag:yaml.org,2002:timestamp":qb.timestamp};function lae(e,t,n){let i=uz.get(t);if(i&&!e)return n&&!i.includes(pm.merge)?i.concat(pm.merge):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{let o=Array.from(uz.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)r=r.concat(o);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(pm.merge)),r.reduce((o,s)=>{let a=typeof s=="string"?dz[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(dz).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}rT.coreKnownTags=cae;rT.getTags=lae});var sT=q(vz=>{"use strict";var iT=Ze(),uae=vu(),dae=wu(),pae=am(),Wb=bz(),fae=(e,t)=>e.keyt.key?1:0,oT=class e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(t)?Wb.getTags(t,"compat"):t?Wb.getTags(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=r?Wb.coreKnownTags:{},this.tags=Wb.getTags(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,iT.MAP,{value:uae.map}),Object.defineProperty(this,iT.SCALAR,{value:pae.string}),Object.defineProperty(this,iT.SEQ,{value:dae.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?fae:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};vz.Schema=oT});var kz=q(wz=>{"use strict";var mae=Ze(),aT=im(),fm=em();function gae(e,t){let n=[],i=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");let r=aT.createStringifyContext(e,t),{commentString:o}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=o(e.commentBefore);n.unshift(fm.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(mae.isNode(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){let u=o(e.contents.commentBefore);n.push(fm.indentComment(u,""))}r.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,l=aT.stringify(e.contents,r,()=>a=null,c);a&&(l+=fm.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(aT.stringify(e.contents,r));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);c.includes(` -`)?(n.push("..."),n.push(fm.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push(fm.indentComment(o(c),"")))}return n.join(` +${i}${f}`}else return`${p}${s}${d.join(" ")}${s}${f}`}function s_({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let o=o_.indentComment(t(r),e);n.push(o.trimStart())}}HV.stringifyCollection=bpe});var aa=K(kI=>{"use strict";var wpe=_I(),kpe=bI(),$pe=Wv(),sa=Ye(),a_=oa(),Spe=pn();function mg(e,t){let n=sa.isScalar(t)?t.value:t;for(let r of e)if(sa.isPair(r)&&(r.key===t||r.key===n||sa.isScalar(r.key)&&r.key.value===n))return r}var wI=class extends $pe.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(sa.MAP,t),this.items=[]}static from(t,n,r){let{keepUndefined:i,replacer:o}=r,s=new this(t),a=(c,l)=>{if(typeof o=="function")l=o.call(n,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(a_.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&s.items.sort(t.sortMapEntries),s}add(t,n){let r;sa.isPair(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new a_.Pair(t,t?.value):r=new a_.Pair(t.key,t.value);let i=mg(this.items,r.key),o=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);sa.isScalar(i.value)&&Spe.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(o){let s=this.items.findIndex(a=>o(r,a)<0);s===-1?this.items.push(r):this.items.splice(s,0,r)}else this.items.push(r)}delete(t){let n=mg(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let i=mg(this.items,t)?.value;return(!n&&sa.isScalar(i)?i.value:i)??void 0}has(t){return!!mg(this.items,t)}set(t,n){this.add(new a_.Pair(t,n),!0)}toJSON(t,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let o of this.items)kpe.addPairToJSMap(n,i,o);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(let i of this.items)if(!sa.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),wpe.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}};kI.YAMLMap=wI;kI.findPair=mg});var Bu=K(JV=>{"use strict";var xpe=Ye(),KV=aa(),Epe={collection:"map",default:!0,nodeClass:KV.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return xpe.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>KV.YAMLMap.from(e,t,n)};JV.map=Epe});var ca=K(ZV=>{"use strict";var Tpe=ag(),Ape=_I(),Ipe=Wv(),l_=Ye(),Rpe=pn(),Ppe=ta(),$I=class extends Ipe.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(l_.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=c_(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let r=c_(t);if(typeof r!="number")return;let i=this.items[r];return!n&&l_.isScalar(i)?i.value:i}has(t){let n=c_(t);return typeof n=="number"&&n=0?t:null}ZV.YAMLSeq=$I});var Vu=K(QV=>{"use strict";var Cpe=Ye(),YV=ca(),Npe={collection:"seq",default:!0,nodeClass:YV.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Cpe.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>YV.YAMLSeq.from(e,t,n)};QV.seq=Npe});var gg=K(XV=>{"use strict";var Ope=dg(),Dpe={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Ope.stringifyString(e,t,n,r)}};XV.string=Dpe});var u_=K(nq=>{"use strict";var eq=pn(),tq={identify:e=>e==null,createNode:()=>new eq.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new eq.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&tq.test.test(e)?e:t.options.nullStr};nq.nullTag=tq});var SI=K(iq=>{"use strict";var Mpe=pn(),rq={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Mpe.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&rq.test.test(e)){let r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};iq.boolTag=rq});var qu=K(oq=>{"use strict";function Lpe({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=t-(o.length-s-1);for(;a-- >0;)o+="0"}return o}oq.stringifyNumber=Lpe});var EI=K(d_=>{"use strict";var Fpe=pn(),xI=qu(),Upe={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:xI.stringifyNumber},jpe={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():xI.stringifyNumber(e)}},zpe={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new Fpe.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:xI.stringifyNumber};d_.float=zpe;d_.floatExp=jpe;d_.floatNaN=Upe});var AI=K(f_=>{"use strict";var sq=qu(),p_=e=>typeof e=="bigint"||Number.isInteger(e),TI=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function aq(e,t,n){let{value:r}=e;return p_(r)&&r>=0?n+r.toString(t):sq.stringifyNumber(e)}var Gpe={identify:e=>p_(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>TI(e,2,8,n),stringify:e=>aq(e,8,"0o")},Bpe={identify:p_,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>TI(e,0,10,n),stringify:sq.stringifyNumber},Vpe={identify:e=>p_(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>TI(e,2,16,n),stringify:e=>aq(e,16,"0x")};f_.int=Bpe;f_.intHex=Vpe;f_.intOct=Gpe});var lq=K(cq=>{"use strict";var qpe=Bu(),Wpe=u_(),Hpe=Vu(),Kpe=gg(),Jpe=SI(),II=EI(),RI=AI(),Zpe=[qpe.map,Hpe.seq,Kpe.string,Wpe.nullTag,Jpe.boolTag,RI.intOct,RI.int,RI.intHex,II.floatNaN,II.floatExp,II.float];cq.schema=Zpe});var pq=K(dq=>{"use strict";var Ype=pn(),Qpe=Bu(),Xpe=Vu();function uq(e){return typeof e=="bigint"||Number.isInteger(e)}var m_=({value:e})=>JSON.stringify(e),efe=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:m_},{identify:e=>e==null,createNode:()=>new Ype.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:m_},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:m_},{identify:uq,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>uq(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:m_}],tfe={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},nfe=[Qpe.map,Xpe.seq].concat(efe,tfe);dq.schema=nfe});var CI=K(fq=>{"use strict";var hg=require("buffer"),PI=pn(),rfe=dg(),ife={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof hg.Buffer=="function")return hg.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i{"use strict";var g_=Ye(),NI=oa(),ofe=pn(),sfe=ca();function mq(e,t){if(g_.isSeq(e))for(let n=0;n1&&t("Each pair must have its own sequence indicator");let i=r.items[0]||new NI.Pair(new ofe.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore} +${i.key.commentBefore}`:r.commentBefore),r.comment){let o=i.value??i.key;o.comment=o.comment?`${r.comment} +${o.comment}`:r.comment}r=i}e.items[n]=g_.isPair(r)?r:new NI.Pair(r)}}else t("Expected a sequence for this tag");return e}function gq(e,t,n){let{replacer:r}=n,i=new sfe.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){typeof r=="function"&&(s=r.call(t,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(NI.createPair(a,c,n))}return i}var afe={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:mq,createNode:gq};h_.createPairs=gq;h_.pairs=afe;h_.resolvePairs=mq});var MI=K(DI=>{"use strict";var hq=Ye(),OI=ta(),yg=aa(),cfe=ca(),yq=y_(),Nc=class e extends cfe.YAMLSeq{constructor(){super(),this.add=yg.YAMLMap.prototype.add.bind(this),this.delete=yg.YAMLMap.prototype.delete.bind(this),this.get=yg.YAMLMap.prototype.get.bind(this),this.has=yg.YAMLMap.prototype.has.bind(this),this.set=yg.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let o,s;if(hq.isPair(i)?(o=OI.toJS(i.key,"",n),s=OI.toJS(i.value,o,n)):o=OI.toJS(i,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,s)}return r}static from(t,n,r){let i=yq.createPairs(t,n,r),o=new this;return o.items=i.items,o}};Nc.tag="tag:yaml.org,2002:omap";var lfe={collection:"seq",identify:e=>e instanceof Map,nodeClass:Nc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=yq.resolvePairs(e,t),r=[];for(let{key:i}of n.items)hq.isScalar(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Nc,n)},createNode:(e,t,n)=>Nc.from(e,t,n)};DI.YAMLOMap=Nc;DI.omap=lfe});var kq=K(LI=>{"use strict";var bq=pn();function vq({value:e,source:t},n){return t&&(e?_q:wq).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var _q={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new bq.Scalar(!0),stringify:vq},wq={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new bq.Scalar(!1),stringify:vq};LI.falseTag=wq;LI.trueTag=_q});var $q=K(b_=>{"use strict";var ufe=pn(),FI=qu(),dfe={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:FI.stringifyNumber},pfe={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():FI.stringifyNumber(e)}},ffe={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new ufe.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:FI.stringifyNumber};b_.float=ffe;b_.floatExp=pfe;b_.floatNaN=dfe});var xq=K(vg=>{"use strict";var Sq=qu(),bg=e=>typeof e=="bigint"||Number.isInteger(e);function v_(e,t,n,{intAsBigInt:r}){let i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return i==="-"?BigInt(-1)*s:s}let o=parseInt(e,n);return i==="-"?-1*o:o}function UI(e,t,n){let{value:r}=e;if(bg(r)){let i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Sq.stringifyNumber(e)}var mfe={identify:bg,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>v_(e,2,2,n),stringify:e=>UI(e,2,"0b")},gfe={identify:bg,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>v_(e,1,8,n),stringify:e=>UI(e,8,"0")},hfe={identify:bg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>v_(e,0,10,n),stringify:Sq.stringifyNumber},yfe={identify:bg,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>v_(e,2,16,n),stringify:e=>UI(e,16,"0x")};vg.int=hfe;vg.intBin=mfe;vg.intHex=yfe;vg.intOct=gfe});var zI=K(jI=>{"use strict";var k_=Ye(),__=oa(),w_=aa(),Oc=class e extends w_.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;k_.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new __.Pair(t.key,null):n=new __.Pair(t,null),w_.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let r=w_.findPair(this.items,t);return!n&&k_.isPair(r)?k_.isScalar(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=w_.findPair(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new __.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){let{replacer:i}=r,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof i=="function"&&(s=i.call(n,s,s)),o.items.push(__.createPair(s,null,r));return o}};Oc.tag="tag:yaml.org,2002:set";var bfe={collection:"map",identify:e=>e instanceof Set,nodeClass:Oc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Oc.from(e,t,n),resolve(e,t){if(k_.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new Oc,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};jI.YAMLSet=Oc;jI.set=bfe});var BI=K($_=>{"use strict";var vfe=qu();function GI(e,t){let n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=s=>t?BigInt(s):Number(s),o=r.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return n==="-"?i(-1)*o:o}function Eq(e){let{value:t}=e,n=s=>s;if(typeof t=="bigint")n=s=>BigInt(s);else if(isNaN(t)||!isFinite(t))return vfe.stringifyNumber(e);let r="";t<0&&(r="-",t*=n(-1));let i=n(60),o=[t%i];return t<60?o.unshift(0):(t=(t-o[0])/i,o.unshift(t%i),t>=60&&(t=(t-o[0])/i,o.unshift(t))),r+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var _fe={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>GI(e,n),stringify:Eq},wfe={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>GI(e,!1),stringify:Eq},Tq={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(Tq.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,o||0,s||0,a||0,c),u=t[8];if(u&&u!=="Z"){let d=GI(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};$_.floatTime=wfe;$_.intTime=_fe;$_.timestamp=Tq});var Rq=K(Iq=>{"use strict";var kfe=Bu(),$fe=u_(),Sfe=Vu(),xfe=gg(),Efe=CI(),Aq=kq(),VI=$q(),S_=xq(),Tfe=n_(),Afe=MI(),Ife=y_(),Rfe=zI(),qI=BI(),Pfe=[kfe.map,Sfe.seq,xfe.string,$fe.nullTag,Aq.trueTag,Aq.falseTag,S_.intBin,S_.intOct,S_.int,S_.intHex,VI.floatNaN,VI.floatExp,VI.float,Efe.binary,Tfe.merge,Afe.omap,Ife.pairs,Rfe.set,qI.intTime,qI.floatTime,qI.timestamp];Iq.schema=Pfe});var jq=K(KI=>{"use strict";var Oq=Bu(),Cfe=u_(),Dq=Vu(),Nfe=gg(),Ofe=SI(),WI=EI(),HI=AI(),Dfe=lq(),Mfe=pq(),Mq=CI(),_g=n_(),Lq=MI(),Fq=y_(),Pq=Rq(),Uq=zI(),x_=BI(),Cq=new Map([["core",Dfe.schema],["failsafe",[Oq.map,Dq.seq,Nfe.string]],["json",Mfe.schema],["yaml11",Pq.schema],["yaml-1.1",Pq.schema]]),Nq={binary:Mq.binary,bool:Ofe.boolTag,float:WI.float,floatExp:WI.floatExp,floatNaN:WI.floatNaN,floatTime:x_.floatTime,int:HI.int,intHex:HI.intHex,intOct:HI.intOct,intTime:x_.intTime,map:Oq.map,merge:_g.merge,null:Cfe.nullTag,omap:Lq.omap,pairs:Fq.pairs,seq:Dq.seq,set:Uq.set,timestamp:x_.timestamp},Lfe={"tag:yaml.org,2002:binary":Mq.binary,"tag:yaml.org,2002:merge":_g.merge,"tag:yaml.org,2002:omap":Lq.omap,"tag:yaml.org,2002:pairs":Fq.pairs,"tag:yaml.org,2002:set":Uq.set,"tag:yaml.org,2002:timestamp":x_.timestamp};function Ffe(e,t,n){let r=Cq.get(t);if(r&&!e)return n&&!r.includes(_g.merge)?r.concat(_g.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let o=Array.from(Cq.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)i=i.concat(o);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(_g.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?Nq[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(Nq).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}KI.coreKnownTags=Lfe;KI.getTags=Ffe});var YI=K(zq=>{"use strict";var JI=Ye(),Ufe=Bu(),jfe=Vu(),zfe=gg(),E_=jq(),Gfe=(e,t)=>e.keyt.key?1:0,ZI=class e{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(t)?E_.getTags(t,"compat"):t?E_.getTags(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?E_.coreKnownTags:{},this.tags=E_.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,JI.MAP,{value:Ufe.map}),Object.defineProperty(this,JI.SCALAR,{value:zfe.string}),Object.defineProperty(this,JI.SEQ,{value:jfe.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Gfe:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};zq.Schema=ZI});var Bq=K(Gq=>{"use strict";var Bfe=Ye(),QI=pg(),wg=cg();function Vfe(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");let i=QI.createStringifyContext(e,t),{commentString:o}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=o(e.commentBefore);n.unshift(wg.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(Bfe.isNode(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){let u=o(e.contents.commentBefore);n.push(wg.indentComment(u,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,l=QI.stringify(e.contents,i,()=>a=null,c);a&&(l+=wg.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(QI.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);c.includes(` +`)?(n.push("..."),n.push(wg.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push(wg.indentComment(o(c),"")))}return n.join(` `)+` -`}wz.stringifyDocument=gae});var mm=q($z=>{"use strict";var hae=Qf(),$u=pb(),ai=Ze(),yae=Cs(),bae=Is(),vae=sT(),wae=kz(),cT=cb(),kae=pE(),$ae=Xf(),lT=dE(),uT=class e{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ai.NODE_TYPE,{value:ai.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:s}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new lT.Directives({version:s}),this.setSchema(s,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){let t=Object.create(e.prototype,{[ai.NODE_TYPE]:{value:ai.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ai.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){_u(this.contents)&&this.contents.add(t)}addIn(t,n){_u(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let i=cT.anchorNames(this);t.anchor=!n||i.has(n)?cT.findNewAnchor(n||"a",i):n}return new hae.Alias(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){let h=y=>typeof y=="number"||y instanceof String||y instanceof Number,b=n.filter(h).map(String);b.length>0&&(n=n.concat(b)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=i??{},{onAnchor:d,setAnchors:p,sourceObjects:f}=cT.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:f},g=$ae.createNode(t,u,m);return a&&ai.isCollection(g)&&(g.flow=!0),p(),g}createPair(t,n,i={}){let r=this.createNode(t,null,i),o=this.createNode(n,null,i);return new yae.Pair(r,o)}delete(t){return _u(this.contents)?this.contents.delete(t):!1}deleteIn(t){return $u.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):_u(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return ai.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return $u.isEmptyPath(t)?!n&&ai.isScalar(this.contents)?this.contents.value:this.contents:ai.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return ai.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return $u.isEmptyPath(t)?this.contents!==void 0:ai.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=$u.collectionFromPath(this.schema,[t],n):_u(this.contents)&&this.contents.set(t,n)}setIn(t,n){$u.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=$u.collectionFromPath(this.schema,Array.from(t),n):_u(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new lT.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new lT.Directives({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new vae.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=bae.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?kae.applyReviver(s,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return wae.stringifyDocument(this,t)}};function _u(e){if(ai.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}$z.Document=uT});var ym=q(hm=>{"use strict";var gm=class extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}},dT=class extends gm{constructor(t,n,i){super("YAMLParseError",t,n,i)}},pT=class extends gm{constructor(t,n,i){super("YAMLWarning",t,n,i)}},_ae=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let o=r-1,s=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 -`),s=a+s}if(/[^ ]/.test(s)){let a=1,c=n.linePos[1];c?.line===i&&c.col>r&&(a=Math.max(1,Math.min(c.col-r,80-o)));let l=" ".repeat(o)+"^".repeat(a);n.message+=`: +`}Gq.stringifyDocument=Vfe});var kg=K(Vq=>{"use strict";var qfe=sg(),Wu=Wv(),xi=Ye(),Wfe=oa(),Hfe=ta(),Kfe=YI(),Jfe=Bq(),XI=Gv(),Zfe=rI(),Yfe=ag(),eR=nI(),tR=class e{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,xi.NODE_TYPE,{value:xi.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:s}=o;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new eR.Directives({version:s}),this.setSchema(s,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){let t=Object.create(e.prototype,{[xi.NODE_TYPE]:{value:xi.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=xi.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Hu(this.contents)&&this.contents.add(t)}addIn(t,n){Hu(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let r=XI.anchorNames(this);t.anchor=!n||r.has(n)?XI.findNewAnchor(n||"a",r):n}return new qfe.Alias(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){let h=b=>typeof b=="number"||b instanceof String||b instanceof Number,v=n.filter(h).map(String);v.length>0&&(n=n.concat(v)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:p,sourceObjects:f}=XI.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:f},g=Yfe.createNode(t,u,m);return a&&xi.isCollection(g)&&(g.flow=!0),p(),g}createPair(t,n,r={}){let i=this.createNode(t,null,r),o=this.createNode(n,null,r);return new Wfe.Pair(i,o)}delete(t){return Hu(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Wu.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):Hu(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return xi.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Wu.isEmptyPath(t)?!n&&xi.isScalar(this.contents)?this.contents.value:this.contents:xi.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return xi.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Wu.isEmptyPath(t)?this.contents!==void 0:xi.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Wu.collectionFromPath(this.schema,[t],n):Hu(this.contents)&&this.contents.set(t,n)}setIn(t,n){Wu.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=Wu.collectionFromPath(this.schema,Array.from(t),n):Hu(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new eR.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new eR.Directives({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Kfe.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Hfe.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Zfe.applyReviver(s,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Jfe.stringifyDocument(this,t)}};function Hu(e){if(xi.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}Vq.Document=tR});var xg=K(Sg=>{"use strict";var $g=class extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}},nR=class extends $g{constructor(t,n,r){super("YAMLParseError",t,n,r)}},rR=class extends $g{constructor(t,n,r){super("YAMLWarning",t,n,r)}},Qfe=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,s=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 +`),s=a+s}if(/[^ ]/.test(s)){let a=1,c=n.linePos[1];c?.line===r&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-o)));let l=" ".repeat(o)+"^".repeat(a);n.message+=`: ${s} ${l} -`}};hm.YAMLError=gm;hm.YAMLParseError=dT;hm.YAMLWarning=pT;hm.prettifyError=_ae});var bm=q(_z=>{"use strict";function Sae(e,{flow:t,indicator:n,next:i,offset:r,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",p="",f=!1,m=!1,g=null,h=null,b=null,y=null,w=null,k=null,_=null;for(let E of e)switch(m&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&o(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),g&&(l&&E.type!=="comment"&&E.type!=="newline"&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),E.type){case"space":!t&&(n!=="doc-start"||i?.type!=="flow-collection")&&E.source.includes(" ")&&(g=E),u=!0;break;case"comment":{u||o(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let T=E.source.substring(1)||" ";d?d+=p+T:d=T,p="",l=!1;break}case"newline":l?d?d+=E.source:(!k||n!=="seq-item-ind")&&(c=!0):p+=E.source,l=!0,f=!0,(h||b)&&(y=E),u=!0;break;case"anchor":h&&o(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&o(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=E,_??(_=E.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(E,"MULTIPLE_TAGS","A node can have at most one tag"),b=E,_??(_=E.offset),l=!1,u=!1,m=!0;break}case n:(h||b)&&o(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),k&&o(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),k=E,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){w&&o(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),w=E,l=!1,u=!1;break}default:o(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),l=!1,u=!1}let S=e[e.length-1],x=S?S.offset+S.source.length:r;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=s||i?.type==="block-map"||i?.type==="block-seq")&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:k,spaceBefore:c,comment:d,hasNewline:f,anchor:h,tag:b,newlineAfterProp:y,end:x,start:_??x}}_z.resolveProps=Sae});var Hb=q(Sz=>{"use strict";function fT(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` -`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(fT(t.key)||fT(t.value))return!0}return!1;default:return!0}}Sz.containsNewline=fT});var mT=q(xz=>{"use strict";var xae=Hb();function Eae(e,t,n){if(t?.type==="flow-collection"){let i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&xae.containsNewline(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}xz.flowIndentCheck=Eae});var gT=q(Tz=>{"use strict";var Ez=Ze();function Tae(e,t,n){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let r=typeof i=="function"?i:(o,s)=>o===s||Ez.isScalar(o)&&Ez.isScalar(s)&&o.value===s.value;return t.some(o=>r(o.key,n))}Tz.mapIncludes=Tae});var Pz=q(Cz=>{"use strict";var Iz=Cs(),Iae=Ds(),Az=bm(),Aae=Hb(),Rz=mT(),Rae=gT(),Nz="All mapping items must start at the same column";function Nae({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??Iae.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,l=null;for(let u of i.items){let{start:d,key:p,sep:f,value:m}=u,g=Az.resolveProps(d,{indicator:"explicit-key-ind",next:p??f?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),h=!g.found;if(h){if(p&&(p.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==i.indent&&r(c,"BAD_INDENT",Nz)),!g.anchor&&!g.tag&&!f){l=g.end,g.comment&&(a.comment?a.comment+=` -`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||Aae.containsNewline(p))&&r(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==i.indent&&r(c,"BAD_INDENT",Nz);n.atKey=!0;let b=g.end,y=p?e(n,p,g,r):t(n,b,d,null,g,r);n.schema.compat&&Rz.flowIndentCheck(i.indent,p,r),n.atKey=!1,Rae.mapIncludes(n,a.items,y)&&r(b,"DUPLICATE_KEY","Map keys must be unique");let w=Az.resolveProps(f??[],{indicator:"map-value-ind",next:m,offset:y.range[2],onError:r,parentIndent:i.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=w.end,w.found){h&&(m?.type==="block-map"&&!w.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start{"use strict";var Cae=Os(),Pae=bm(),Dae=mT();function Oae({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??Cae.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=i.offset,l=null;for(let{start:u,value:d}of i.items){let p=Pae.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(a.comment=p.comment);continue}let f=d?e(n,d,p,r):t(n,p.end,u,null,p,r);n.schema.compat&&Dae.flowIndentCheck(i.indent,d,r),c=f.range[2],a.items.push(f)}return a.range=[i.offset,c,l??c],a}Dz.resolveBlockSeq=Oae});var Su=q(Mz=>{"use strict";function Mae(e,t,n,i){let r="";if(e){let o=!1,s="";for(let a of e){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{n&&!o&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";r?r+=s+u:r=u,s="";break}case"newline":r&&(s+=c),o=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:r,offset:t}}Mz.resolveEnd=Mae});var jz=q(Uz=>{"use strict";var Lae=Ze(),Fae=Cs(),Lz=Ds(),Uae=Os(),jae=Su(),Fz=bm(),zae=Hb(),Gae=gT(),hT="Block collections are not allowed within flow collections",yT=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Vae({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=i.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?Lz.YAMLMap:Uae.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=i.offset+i.start.source.length;for(let h=0;h0){let h=jae.resolveEnd(m,g,n.options.strict,r);h.comment&&(l.comment?l.comment+=` -`+h.comment:l.comment=h.comment),l.range=[i.offset,g,h.offset]}else l.range=[i.offset,g,g];return l}Uz.resolveFlowCollection=Vae});var Gz=q(zz=>{"use strict";var Bae=Ze(),qae=an(),Wae=Ds(),Hae=Os(),Kae=Pz(),Jae=Oz(),Zae=jz();function bT(e,t,n,i,r,o){let s=n.type==="block-map"?Kae.resolveBlockMap(e,t,n,i,o):n.type==="block-seq"?Jae.resolveBlockSeq(e,t,n,i,o):Zae.resolveFlowCollection(e,t,n,i,o),a=s.constructor;return r==="!"||r===a.tagName?(s.tag=a.tagName,s):(r&&(s.tag=r),s)}function Yae(e,t,n,i,r){let o=i.tag,s=o?t.directives.tagName(o.source,p=>r(o,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){let{anchor:p,newlineAfterProp:f}=i,m=p&&o?p.offset>o.offset?p:o:p??o;m&&(!f||f.offsetp.tag===s&&p.collection===a);if(!c){let p=t.schema.knownTags[s];if(p?.collection===a)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?r(o,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0):r(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),bT(e,t,n,r,s)}let l=bT(e,t,n,r,s,c),u=c.resolve?.(l,p=>r(o,"TAG_RESOLVE_FAILED",p),t.options)??l,d=Bae.isNode(u)?u:new qae.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}zz.composeCollection=Yae});var wT=q(Vz=>{"use strict";var vT=an();function Qae(e,t,n){let i=t.offset,r=Xae(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let o=r.mode===">"?vT.Scalar.BLOCK_FOLDED:vT.Scalar.BLOCK_LITERAL,s=t.source?ece(t.source):[],a=s.length;for(let g=s.length-1;g>=0;--g){let h=s[g][1];if(h===""||h==="\r")a=g;else break}if(a===0){let g=r.chomp==="+"&&s.length>0?` -`.repeat(Math.max(1,s.length-1)):"",h=i+r.length;return t.source&&(h+=t.source.length),{value:g,type:o,comment:r.comment,range:[i,h,h]}}let c=t.indent+r.indent,l=t.offset+r.length,u=0;for(let g=0;gc&&(c=h.length);else{h.length=a;--g)s[g][0].length>c&&(a=g+1);let d="",p="",f=!1;for(let g=0;gc||b[0]===" "?(p===" "?p=` +`}};Sg.YAMLError=$g;Sg.YAMLParseError=nR;Sg.YAMLWarning=rR;Sg.prettifyError=Qfe});var Eg=K(qq=>{"use strict";function Xfe(e,{flow:t,indicator:n,next:r,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",p="",f=!1,m=!1,g=null,h=null,v=null,b=null,_=null,w=null,k=null;for(let I of e)switch(m&&(I.type!=="space"&&I.type!=="newline"&&I.type!=="comma"&&o(I.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),g&&(l&&I.type!=="comment"&&I.type!=="newline"&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),I.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&I.source.includes(" ")&&(g=I),u=!0;break;case"comment":{u||o(I,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let R=I.source.substring(1)||" ";d?d+=p+R:d=R,p="",l=!1;break}case"newline":l?d?d+=I.source:(!w||n!=="seq-item-ind")&&(c=!0):p+=I.source,l=!0,f=!0,(h||v)&&(b=I),u=!0;break;case"anchor":h&&o(I,"MULTIPLE_ANCHORS","A node can have at most one anchor"),I.source.endsWith(":")&&o(I.offset+I.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=I,k??(k=I.offset),l=!1,u=!1,m=!0;break;case"tag":{v&&o(I,"MULTIPLE_TAGS","A node can have at most one tag"),v=I,k??(k=I.offset),l=!1,u=!1,m=!0;break}case n:(h||v)&&o(I,"BAD_PROP_ORDER",`Anchors and tags must be after the ${I.source} indicator`),w&&o(I,"UNEXPECTED_TOKEN",`Unexpected ${I.source} in ${t??"collection"}`),w=I,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){_&&o(I,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=I,l=!1,u=!1;break}default:o(I,"UNEXPECTED_TOKEN",`Unexpected ${I.type} token`),l=!1,u=!1}let x=e[e.length-1],A=x?x.offset+x.source.length:i;return m&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=s||r?.type==="block-map"||r?.type==="block-seq")&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:w,spaceBefore:c,comment:d,hasNewline:f,anchor:h,tag:v,newlineAfterProp:b,end:A,start:k??A}}qq.resolveProps=Xfe});var T_=K(Wq=>{"use strict";function iR(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` +`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(iR(t.key)||iR(t.value))return!0}return!1;default:return!0}}Wq.containsNewline=iR});var oR=K(Hq=>{"use strict";var eme=T_();function tme(e,t,n){if(t?.type==="flow-collection"){let r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&eme.containsNewline(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Hq.flowIndentCheck=tme});var sR=K(Jq=>{"use strict";var Kq=Ye();function nme(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r=="function"?r:(o,s)=>o===s||Kq.isScalar(o)&&Kq.isScalar(s)&&o.value===s.value;return t.some(o=>i(o.key,n))}Jq.mapIncludes=nme});var t2=K(e2=>{"use strict";var Zq=oa(),rme=aa(),Yq=Eg(),ime=T_(),Qq=oR(),ome=sR(),Xq="All mapping items must start at the same column";function sme({composeNode:e,composeEmptyNode:t},n,r,i,o){let s=o?.nodeClass??rme.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:p,sep:f,value:m}=u,g=Yq.resolveProps(d,{indicator:"explicit-key-ind",next:p??f?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),h=!g.found;if(h){if(p&&(p.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&i(c,"BAD_INDENT",Xq)),!g.anchor&&!g.tag&&!f){l=g.end,g.comment&&(a.comment?a.comment+=` +`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||ime.containsNewline(p))&&i(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==r.indent&&i(c,"BAD_INDENT",Xq);n.atKey=!0;let v=g.end,b=p?e(n,p,g,i):t(n,v,d,null,g,i);n.schema.compat&&Qq.flowIndentCheck(r.indent,p,i),n.atKey=!1,ome.mapIncludes(n,a.items,b)&&i(v,"DUPLICATE_KEY","Map keys must be unique");let _=Yq.resolveProps(f??[],{indicator:"map-value-ind",next:m,offset:b.range[2],onError:i,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=_.end,_.found){h&&(m?.type==="block-map"&&!_.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start<_.found.offset-1024&&i(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let w=m?e(n,m,_,i):t(n,c,f,null,_,i);n.schema.compat&&Qq.flowIndentCheck(r.indent,m,i),c=w.range[2];let k=new Zq.Pair(b,w);n.options.keepSourceTokens&&(k.srcToken=u),a.items.push(k)}else{h&&i(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(b.comment?b.comment+=` +`+_.comment:b.comment=_.comment);let w=new Zq.Pair(b);n.options.keepSourceTokens&&(w.srcToken=u),a.items.push(w)}}return l&&l{"use strict";var ame=ca(),cme=Eg(),lme=oR();function ume({composeNode:e,composeEmptyNode:t},n,r,i,o){let s=o?.nodeClass??ame.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let p=cme.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?i(p.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(a.comment=p.comment);continue}let f=d?e(n,d,p,i):t(n,p.end,u,null,p,i);n.schema.compat&&lme.flowIndentCheck(r.indent,d,i),c=f.range[2],a.items.push(f)}return a.range=[r.offset,c,l??c],a}n2.resolveBlockSeq=ume});var Ku=K(i2=>{"use strict";function dme(e,t,n,r){let i="";if(e){let o=!1,s="";for(let a of e){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{n&&!o&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:i,offset:t}}i2.resolveEnd=dme});var c2=K(a2=>{"use strict";var pme=Ye(),fme=oa(),o2=aa(),mme=ca(),gme=Ku(),s2=Eg(),hme=T_(),yme=sR(),aR="Block collections are not allowed within flow collections",cR=e=>e&&(e.type==="block-map"||e.type==="block-seq");function bme({composeNode:e,composeEmptyNode:t},n,r,i,o){let s=r.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?o2.YAMLMap:mme.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset+r.start.source.length;for(let h=0;h0){let h=gme.resolveEnd(m,g,n.options.strict,i);h.comment&&(l.comment?l.comment+=` +`+h.comment:l.comment=h.comment),l.range=[r.offset,g,h.offset]}else l.range=[r.offset,g,g];return l}a2.resolveFlowCollection=bme});var u2=K(l2=>{"use strict";var vme=Ye(),_me=pn(),wme=aa(),kme=ca(),$me=t2(),Sme=r2(),xme=c2();function lR(e,t,n,r,i,o){let s=n.type==="block-map"?$me.resolveBlockMap(e,t,n,r,o):n.type==="block-seq"?Sme.resolveBlockSeq(e,t,n,r,o):xme.resolveFlowCollection(e,t,n,r,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function Eme(e,t,n,r,i){let o=r.tag,s=o?t.directives.tagName(o.source,p=>i(o,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){let{anchor:p,newlineAfterProp:f}=r,m=p&&o?p.offset>o.offset?p:o:p??o;m&&(!f||f.offsetp.tag===s&&p.collection===a);if(!c){let p=t.schema.knownTags[s];if(p?.collection===a)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?i(o,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),lR(e,t,n,i,s)}let l=lR(e,t,n,i,s,c),u=c.resolve?.(l,p=>i(o,"TAG_RESOLVE_FAILED",p),t.options)??l,d=vme.isNode(u)?u:new _me.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}l2.composeCollection=Eme});var dR=K(d2=>{"use strict";var uR=pn();function Tme(e,t,n){let r=t.offset,i=Ame(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let o=i.mode===">"?uR.Scalar.BLOCK_FOLDED:uR.Scalar.BLOCK_LITERAL,s=t.source?Ime(t.source):[],a=s.length;for(let g=s.length-1;g>=0;--g){let h=s[g][1];if(h===""||h==="\r")a=g;else break}if(a===0){let g=i.chomp==="+"&&s.length>0?` +`.repeat(Math.max(1,s.length-1)):"",h=r+i.length;return t.source&&(h+=t.source.length),{value:g,type:o,comment:i.comment,range:[r,h,h]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let g=0;gc&&(c=h.length);else{h.length=a;--g)s[g][0].length>c&&(a=g+1);let d="",p="",f=!1;for(let g=0;gc||v[0]===" "?(p===" "?p=` `:!f&&p===` `&&(p=` -`),d+=p+h.slice(c)+b,p=` -`,f=!0):b===""?p===` +`),d+=p+h.slice(c)+v,p=` +`,f=!0):v===""?p===` `?d+=` `:p=` -`:(d+=p+b,p=" ",f=!1)}switch(r.chomp){case"-":break;case"+":for(let g=a;g{"use strict";var kT=an(),tce=Su();function nce(e,t,n){let{offset:i,type:r,source:o,end:s}=e,a,c,l=(p,f,m)=>n(i+p,f,m);switch(r){case"scalar":a=kT.Scalar.PLAIN,c=rce(o,l);break;case"single-quoted-scalar":a=kT.Scalar.QUOTE_SINGLE,c=ice(o,l);break;case"double-quoted-scalar":a=kT.Scalar.QUOTE_DOUBLE,c=oce(o,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let u=i+o.length,d=tce.resolveEnd(s,u,t,n);return{value:c,type:a,comment:d.comment,range:[i,u,d.offset]}}function rce(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Bz(e)}function ice(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Bz(e.slice(1,-1)).replace(/''/g,"'")}function Bz(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let i,r;try{i=new RegExp("(?{"use strict";var pR=pn(),Rme=Ku();function Pme(e,t,n){let{offset:r,type:i,source:o,end:s}=e,a,c,l=(p,f,m)=>n(r+p,f,m);switch(i){case"scalar":a=pR.Scalar.PLAIN,c=Cme(o,l);break;case"single-quoted-scalar":a=pR.Scalar.QUOTE_SINGLE,c=Nme(o,l);break;case"double-quoted-scalar":a=pR.Scalar.QUOTE_DOUBLE,c=Ome(o,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}let u=r+o.length,d=Rme.resolveEnd(s,u,t,n);return{value:c,type:a,comment:d.comment,range:[r,u,d.offset]}}function Cme(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),p2(e)}function Nme(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),p2(e.slice(1,-1)).replace(/''/g,"'")}function p2(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=new RegExp("(?o?e.slice(o,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function sce(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===` -`||i==="\r")&&!(i==="\r"&&e[t+2]!==` -`);)i===` +`:(o+=s+l,s=" "),a=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=a,n=c.exec(e),o+s+(n?.[1]??"")}function Ome(e,t){let n="";for(let r=1;ro?e.slice(o,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function Dme(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===` +`||r==="\r")&&!(r==="\r"&&e[t+2]!==` +`);)r===` `&&(n+=` -`),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}var ace={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function cce(e,t,n,i){let r=e.substr(t,n),s=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(s)}catch{let a=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}qz.resolveFlowScalar=nce});var Kz=q(Hz=>{"use strict";var fc=Ze(),Wz=an(),lce=wT(),uce=$T();function dce(e,t,n,i){let{value:r,type:o,comment:s,range:a}=t.type==="block-scalar"?lce.resolveBlockScalar(e,t,i):uce.resolveFlowScalar(t,e.options.strict,i),c=n?e.directives.tagName(n.source,d=>i(n,"TAG_RESOLVE_FAILED",d)):null,l;e.options.stringKeys&&e.atKey?l=e.schema[fc.SCALAR]:c?l=pce(e.schema,r,c,n,i):t.type==="scalar"?l=fce(e,r,t,i):l=e.schema[fc.SCALAR];let u;try{let d=l.resolve(r,p=>i(n??t,"TAG_RESOLVE_FAILED",p),e.options);u=fc.isScalar(d)?d:new Wz.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);i(n??t,"TAG_RESOLVE_FAILED",p),u=new Wz.Scalar(r)}return u.range=a,u.source=r,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function pce(e,t,n,i,r){if(n==="!")return e[fc.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(t))return a;let s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[fc.SCALAR])}function fce({atKey:e,directives:t,schema:n},i,r,o){let s=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(i))||n[fc.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(i))??n[fc.SCALAR];if(s.tag!==a.tag){let c=t.tagString(s.tag),l=t.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(r,"TAG_RESOLVE_FAILED",u,!0)}}return s}Hz.composeScalar=dce});var Zz=q(Jz=>{"use strict";function mce(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];r?.type==="space";)e+=r.source.length,r=t[++i];break}}return e}Jz.emptyScalarPosition=mce});var Xz=q(ST=>{"use strict";var gce=Qf(),hce=Ze(),yce=Gz(),Yz=Kz(),bce=Su(),vce=Zz(),wce={composeNode:Qz,composeEmptyNode:_T};function Qz(e,t,n,i){let r=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=n,l,u=!0;switch(t.type){case"alias":l=kce(e,t,i),(a||c)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Yz.composeScalar(e,t,c,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=yce.composeCollection(wce,e,t,n,i),a&&(l.anchor=a.source.substring(1))}catch(d){let p=d instanceof Error?d.message:String(d);i(t,"RESOURCE_EXHAUSTION",p)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=_T(e,t.offset,void 0,null,n,i)),a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!hce.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(t.type==="scalar"&&t.source===""?l.comment=s:l.commentBefore=s),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function _T(e,t,n,i,{spaceBefore:r,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:vce.emptyScalarPosition(t,n,i),indent:-1,source:""},d=Yz.composeScalar(e,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function kce({options:e},{offset:t,source:n,end:i},r){let o=new gce.Alias(n.substring(1));o.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+n.length,a=bce.resolveEnd(i,s,e.strict,r);return o.range=[t,s,a.offset],a.comment&&(o.comment=a.comment),o}ST.composeEmptyNode=_T;ST.composeNode=Qz});var nG=q(tG=>{"use strict";var $ce=mm(),eG=Xz(),_ce=Su(),Sce=bm();function xce(e,t,{offset:n,start:i,value:r,end:o},s){let a=Object.assign({_directives:t},e),c=new $ce.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Sce.resolveProps(i,{indicator:"doc-start",next:r??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?eG.composeNode(l,r,u,s):eG.composeEmptyNode(l,u.end,i,null,u,s);let d=c.contents.range[2],p=_ce.resolveEnd(o,d,!1,s);return p.comment&&(c.comment=p.comment),c.range=[n,d,p.offset],c}tG.composeDoc=xce});var ET=q(oG=>{"use strict";var Ece=require("process"),Tce=dE(),Ice=mm(),vm=ym(),rG=Ze(),Ace=nG(),Rce=Su();function wm(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function iG(e){let t="",n=!1,i=!1;for(let r=0;r{"use strict";var Dc=Ye(),m2=pn(),Fme=dR(),Ume=fR();function jme(e,t,n,r){let{value:i,type:o,comment:s,range:a}=t.type==="block-scalar"?Fme.resolveBlockScalar(e,t,r):Ume.resolveFlowScalar(t,e.options.strict,r),c=n?e.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null,l;e.options.stringKeys&&e.atKey?l=e.schema[Dc.SCALAR]:c?l=zme(e.schema,i,c,n,r):t.type==="scalar"?l=Gme(e,i,t,r):l=e.schema[Dc.SCALAR];let u;try{let d=l.resolve(i,p=>r(n??t,"TAG_RESOLVE_FAILED",p),e.options);u=Dc.isScalar(d)?d:new m2.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);r(n??t,"TAG_RESOLVE_FAILED",p),u=new m2.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function zme(e,t,n,r,i){if(n==="!")return e[Dc.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(t))return a;let s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Dc.SCALAR])}function Gme({atKey:e,directives:t,schema:n},r,i,o){let s=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(r))||n[Dc.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(r))??n[Dc.SCALAR];if(s.tag!==a.tag){let c=t.tagString(s.tag),l=t.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}g2.composeScalar=jme});var b2=K(y2=>{"use strict";function Bme(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];i?.type==="space";)e+=i.source.length,i=t[++r];break}}return e}y2.emptyScalarPosition=Bme});var w2=K(gR=>{"use strict";var Vme=sg(),qme=Ye(),Wme=u2(),v2=h2(),Hme=Ku(),Kme=b2(),Jme={composeNode:_2,composeEmptyNode:mR};function _2(e,t,n,r){let i=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=n,l,u=!0;switch(t.type){case"alias":l=Zme(e,t,r),(a||c)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=v2.composeScalar(e,t,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Wme.composeCollection(Jme,e,t,n,r),a&&(l.anchor=a.source.substring(1))}catch(d){let p=d instanceof Error?d.message:String(d);r(t,"RESOURCE_EXHAUSTION",p)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=mR(e,t.offset,void 0,null,n,r)),a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!qme.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(t.type==="scalar"&&t.source===""?l.comment=s:l.commentBefore=s),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function mR(e,t,n,r,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:Kme.emptyScalarPosition(t,n,r),indent:-1,source:""},d=v2.composeScalar(e,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function Zme({options:e},{offset:t,source:n,end:r},i){let o=new Vme.Alias(n.substring(1));o.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+n.length,a=Hme.resolveEnd(r,s,e.strict,i);return o.range=[t,s,a.offset],a.comment&&(o.comment=a.comment),o}gR.composeEmptyNode=mR;gR.composeNode=_2});var S2=K($2=>{"use strict";var Yme=kg(),k2=w2(),Qme=Ku(),Xme=Eg();function ege(e,t,{offset:n,start:r,value:i,end:o},s){let a=Object.assign({_directives:t},e),c=new Yme.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Xme.resolveProps(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?k2.composeNode(l,i,u,s):k2.composeEmptyNode(l,u.end,r,null,u,s);let d=c.contents.range[2],p=Qme.resolveEnd(o,d,!1,s);return p.comment&&(c.comment=p.comment),c.range=[n,d,p.offset],c}$2.composeDoc=ege});var yR=K(T2=>{"use strict";var tge=require("process"),nge=nI(),rge=kg(),Tg=xg(),x2=Ye(),ige=S2(),oge=Ku();function Ag(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function E2(e){let t="",n=!1,r=!1;for(let i=0;i{let s=wm(n);o?this.warnings.push(new vm.YAMLWarning(s,i,r)):this.errors.push(new vm.YAMLParseError(s,i,r))},this.directives=new Tce.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:i,afterEmptyLine:r}=iG(this.prelude);if(i){let o=t.contents;if(n)t.comment=t.comment?`${t.comment} -${i}`:i;else if(r||t.directives.docStart||!o)t.commentBefore=i;else if(rG.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];rG.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${i} -${a}`:i}else{let s=o.commentBefore;o.commentBefore=s?`${i} -${s}`:i}}if(n){for(let o=0;o{let o=wm(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=Ace.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new vm.YAMLParseError(wm(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new vm.YAMLParseError(wm(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=Rce.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new vm.YAMLParseError(wm(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let i=Object.assign({_directives:this.directives},this.options),r=new Ice.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};oG.Composer=xT});var cG=q(Kb=>{"use strict";var Nce=wT(),Cce=$T(),Pce=ym(),sG=rm();function Dce(e,t=!0,n){if(e){let i=(r,o,s)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,o,s);else throw new Pce.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Cce.resolveFlowScalar(e,t,i);case"block-scalar":return Nce.resolveBlockScalar({options:{strict:t}},e,i)}}return null}function Oce(e,t){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:o=-1,type:s="PLAIN"}=t,a=sG.stringifyString({type:s,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:i,source:` +`)+(o.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var hR=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,o)=>{let s=Ag(n);o?this.warnings.push(new Tg.YAMLWarning(s,r,i)):this.errors.push(new Tg.YAMLParseError(s,r,i))},this.directives=new nge.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:r,afterEmptyLine:i}=E2(this.prelude);if(r){let o=t.contents;if(n)t.comment=t.comment?`${t.comment} +${r}`:r;else if(i||t.directives.docStart||!o)t.commentBefore=r;else if(x2.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];x2.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${r} +${a}`:r}else{let s=o.commentBefore;o.commentBefore=s?`${r} +${s}`:r}}if(n){for(let o=0;o{let o=Ag(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=ige.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new Tg.YAMLParseError(Ag(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new Tg.YAMLParseError(Ag(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=oge.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Tg.YAMLParseError(Ag(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let r=Object.assign({_directives:this.directives},this.options),i=new rge.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};T2.Composer=hR});var R2=K(A_=>{"use strict";var sge=dR(),age=fR(),cge=xg(),A2=dg();function lge(e,t=!0,n){if(e){let r=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,o,s);else throw new cge.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return age.resolveFlowScalar(e,t,r);case"block-scalar":return sge.resolveBlockScalar({options:{strict:t}},e,r)}}return null}function uge(e,t){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=t,a=A2.stringifyString({type:s,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:r,source:` `}];switch(a[0]){case"|":case">":{let l=a.indexOf(` `),u=a.substring(0,l),d=a.substring(l+1)+` -`,p=[{type:"block-scalar-header",offset:o,indent:i,source:u}];return aG(p,c)||p.push({type:"newline",offset:-1,indent:i,source:` -`}),{type:"block-scalar",offset:o,indent:i,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:a,end:c};default:return{type:"scalar",offset:o,indent:i,source:a,end:c}}}function Mce(e,t,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:o=!1,type:s}=n,a="indent"in e?e.indent:null;if(i&&typeof a=="number"&&(a+=2),!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=sG.stringifyString({type:s,value:t},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Lce(e,c);break;case'"':TT(e,c,"double-quoted-scalar");break;case"'":TT(e,c,"single-quoted-scalar");break;default:TT(e,c,"scalar")}}function Lce(e,t){let n=t.indexOf(` -`),i=t.substring(0,n),r=t.substring(n+1)+` -`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=i,e.source=r}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:i}];aG(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` -`});for(let c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:r})}}function aG(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function TT(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let i=e.props.slice(1),r=t.length;e.props[0].type==="block-scalar-header"&&(r-=e.props[0].source.length);for(let o of i)o.offset+=r;delete e.props,Object.assign(e,{type:n,source:t,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:` -`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let i="indent"in e?e.indent:-1,r="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))o!=="type"&&o!=="offset"&&delete e[o];Object.assign(e,{type:n,indent:i,source:t,end:r})}}}Kb.createScalarToken=Oce;Kb.resolveAsScalar=Dce;Kb.setScalarValue=Mce});var uG=q(lG=>{"use strict";var Fce=e=>"type"in e?Zb(e):Jb(e);function Zb(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=Zb(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=Jb(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=Jb(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=Jb(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function Jb({start:e,key:t,sep:n,value:i}){let r="";for(let o of e)r+=o.source;if(t&&(r+=Zb(t)),n)for(let o of n)r+=o.source;return i&&(r+=Zb(i)),r}lG.stringify=Fce});var mG=q(fG=>{"use strict";var IT=Symbol("break visit"),Uce=Symbol("skip children"),dG=Symbol("remove item");function mc(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),pG(Object.freeze([]),e,t)}mc.BREAK=IT;mc.SKIP=Uce;mc.REMOVE=dG;mc.itemAtPath=(e,t)=>{let n=e;for(let[i,r]of t){let o=n?.[i];if(o&&"items"in o)n=o.items[r];else return}return n};mc.parentCollection=(e,t)=>{let n=mc.itemAtPath(e,t.slice(0,-1)),i=t[t.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function pG(e,t,n){let i=n(t,e);if(typeof i=="symbol")return i;for(let r of["key","value"]){let o=t[r];if(o&&"items"in o){for(let s=0;s{"use strict";var AT=cG(),jce=uG(),zce=mG(),RT="\uFEFF",NT="",CT="",PT="",Gce=e=>!!e&&"items"in e,Vce=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Bce(e){switch(e){case RT:return"";case NT:return"";case CT:return"";case PT:return"";default:return JSON.stringify(e)}}function qce(e){switch(e){case RT:return"byte-order-mark";case NT:return"doc-mode";case CT:return"flow-error-end";case PT:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`,p=[{type:"block-scalar-header",offset:o,indent:r,source:u}];return I2(p,c)||p.push({type:"newline",offset:-1,indent:r,source:` +`}),{type:"block-scalar",offset:o,indent:r,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:r,source:a,end:c};default:return{type:"scalar",offset:o,indent:r,source:a,end:c}}}function dge(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=n,a="indent"in e?e.indent:null;if(r&&typeof a=="number"&&(a+=2),!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=A2.stringifyString({type:s,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":pge(e,c);break;case'"':bR(e,c,"double-quoted-scalar");break;case"'":bR(e,c,"single-quoted-scalar");break;default:bR(e,c,"scalar")}}function pge(e,t){let n=t.indexOf(` +`),r=t.substring(0,n),i=t.substring(n+1)+` +`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=r,e.source=i}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:r}];I2(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` +`});for(let c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:i})}}function I2(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function bR(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let r=e.props.slice(1),i=t.length;e.props[0].type==="block-scalar-header"&&(i-=e.props[0].source.length);for(let o of r)o.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:` +`};delete e.items,Object.assign(e,{type:n,source:t,end:[i]});break}default:{let r="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))o!=="type"&&o!=="offset"&&delete e[o];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}A_.createScalarToken=uge;A_.resolveAsScalar=lge;A_.setScalarValue=dge});var C2=K(P2=>{"use strict";var fge=e=>"type"in e?R_(e):I_(e);function R_(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=R_(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=I_(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=I_(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=I_(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function I_({start:e,key:t,sep:n,value:r}){let i="";for(let o of e)i+=o.source;if(t&&(i+=R_(t)),n)for(let o of n)i+=o.source;return r&&(i+=R_(r)),i}P2.stringify=fge});var M2=K(D2=>{"use strict";var vR=Symbol("break visit"),mge=Symbol("skip children"),N2=Symbol("remove item");function Mc(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),O2(Object.freeze([]),e,t)}Mc.BREAK=vR;Mc.SKIP=mge;Mc.REMOVE=N2;Mc.itemAtPath=(e,t)=>{let n=e;for(let[r,i]of t){let o=n?.[r];if(o&&"items"in o)n=o.items[i];else return}return n};Mc.parentCollection=(e,t)=>{let n=Mc.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function O2(e,t,n){let r=n(t,e);if(typeof r=="symbol")return r;for(let i of["key","value"]){let o=t[i];if(o&&"items"in o){for(let s=0;s{"use strict";var _R=R2(),gge=C2(),hge=M2(),wR="\uFEFF",kR="",$R="",SR="",yge=e=>!!e&&"items"in e,bge=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function vge(e){switch(e){case wR:return"";case kR:return"";case $R:return"";case SR:return"";default:return JSON.stringify(e)}}function _ge(e){switch(e){case wR:return"byte-order-mark";case kR:return"doc-mode";case $R:return"flow-error-end";case SR:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}xr.createScalarToken=AT.createScalarToken;xr.resolveAsScalar=AT.resolveAsScalar;xr.setScalarValue=AT.setScalarValue;xr.stringify=jce.stringify;xr.visit=zce.visit;xr.BOM=RT;xr.DOCUMENT=NT;xr.FLOW_END=CT;xr.SCALAR=PT;xr.isCollection=Gce;xr.isScalar=Vce;xr.prettyToken=Bce;xr.tokenType=qce});var MT=q(hG=>{"use strict";var km=Yb();function Li(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}var gG=new Set("0123456789ABCDEFabcdef"),Wce=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Qb=new Set(",[]{}"),Hce=new Set(` ,[]{} -\r `),DT=e=>!e||Hce.has(e),OT=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Or.createScalarToken=_R.createScalarToken;Or.resolveAsScalar=_R.resolveAsScalar;Or.setScalarValue=_R.setScalarValue;Or.stringify=gge.stringify;Or.visit=hge.visit;Or.BOM=wR;Or.DOCUMENT=kR;Or.FLOW_END=$R;Or.SCALAR=SR;Or.isCollection=yge;Or.isScalar=bge;Or.prettyToken=vge;Or.tokenType=_ge});var TR=K(F2=>{"use strict";var Ig=P_();function Xi(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}var L2=new Set("0123456789ABCDEFabcdef"),wge=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),C_=new Set(",[]{}"),kge=new Set(` ,[]{} +\r `),xR=e=>!e||kge.has(e),ER=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` `?!0:n==="\r"?this.buffer[t+1]===` -`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){let r=this.buffer[i+t+1];if(r===` -`||!r&&!this.atEnd)return t+i+1}return n===` -`||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&Li(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!Li(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Li(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(DT),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Li(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let o=this.pos;i=this.buffer[o];++o)switch(i){case" ":n+=1;break;case` +`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){let i=this.buffer[r+t+1];if(i===` +`||!i&&!this.atEnd)return t+r+1}return n===` +`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Xi(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!Xi(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Xi(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(xR),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Xi(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let o=this.pos;r=this.buffer[o];++o)switch(r){case" ":n+=1;break;case` `:t=o,n=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===` -`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(` -`,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===` -`;)i=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let o=t-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===` -`&&o>=this.pos&&o+1+n>a)t=o;else break}while(!0);return yield km.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let o=this.buffer[i+1];if(Li(o)||t&&Qb.has(o))break;n=i}else if(Li(r)){let o=this.buffer[i+1];if(r==="\r"&&(o===` -`?(i+=1,r=` -`,o=this.buffer[i+1]):n=i),o==="#"||t&&Qb.has(o))break;if(r===` -`){let s=this.continueScalar(i+1);if(s===-1)break;i=Math.max(i,s-2)}}else{if(t&&Qb.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield km.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(DT),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(Li(i)||n&&Qb.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Li(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(Wce.has(n))n=this.buffer[++t];else if(n==="%"&&gG.has(this.buffer[t+1])&&gG.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===` +`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(` +`,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===` +`;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let o=t-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===` +`&&o>=this.pos&&o+1+n>a)t=o;else break}while(!0);return yield Ig.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let o=this.buffer[r+1];if(Xi(o)||t&&C_.has(o))break;n=r}else if(Xi(i)){let o=this.buffer[r+1];if(i==="\r"&&(o===` +`?(r+=1,i=` +`,o=this.buffer[r+1]):n=r),o==="#"||t&&C_.has(o))break;if(i===` +`){let s=this.continueScalar(r+1);if(s===-1)break;r=Math.max(r,s-2)}}else{if(t&&C_.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ig.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(xR),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(Xi(r)||n&&C_.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Xi(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(wge.has(n))n=this.buffer[++t];else if(n==="%"&&L2.has(this.buffer[t+1])&&L2.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===` `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};hG.Lexer=OT});var FT=q(yG=>{"use strict";var LT=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n>1;this.lineStarts[o]{"use strict";var Kce=require("process"),bG=Yb(),Jce=MT();function Ms(e,t){for(let n=0;n=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function ev(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&wG(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&vG(r.start)===-1&&(n.indent===0||r.start.every(o=>o.type!=="comment"||o.indent0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};F2.Lexer=ER});var IR=K(U2=>{"use strict";var AR=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[o]{"use strict";var $ge=require("process"),j2=P_(),Sge=TR();function la(e,t){for(let n=0;n=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function O_(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&G2(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&z2(i.start)===-1&&(n.indent===0||i.start.every(o=>o.type!=="comment"||o.indent=t.indent){let i=!this.onKeyLine&&this.indent===t.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(r&&n.sep&&!n.value){let s=[];for(let a=0;at.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ms(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(kG(n.key)&&!Ms(n.sep,"newline")){let s=xu(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ms(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=xu(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Ms(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);r||n.value?(t.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(t);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ms(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&t.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){ev(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ms(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=Xb(i),o=xu(r);wG(t);let s=t.end.splice(1,t.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` +`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){O_(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&n.sep&&!n.value){let s=[];for(let a=0;at.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(la(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(B2(n.key)&&!la(n.sep,"newline")){let s=Ju(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(la(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=Ju(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:o,key:null,sep:[this.sourceToken]}):la(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||n.value?(t.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(t);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!la(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){O_(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||la(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=N_(r),o=Ju(i);G2(t);let s=t.end.splice(1,t.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` -`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=Xb(t),i=xu(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Xb(t),i=xu(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};$G.Parser=UT});var TG=q(_m=>{"use strict";var _G=ET(),Zce=mm(),$m=ym(),Yce=SE(),Qce=Ze(),Xce=FT(),SG=jT();function xG(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Xce.LineCounter||null,prettyErrors:t}}function ele(e,t={}){let{lineCounter:n,prettyErrors:i}=xG(t),r=new SG.Parser(n?.addNewLine),o=new _G.Composer(t),s=Array.from(o.compose(r.parse(e)));if(i&&n)for(let a of s)a.errors.forEach($m.prettifyError(e,n)),a.warnings.forEach($m.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function EG(e,t={}){let{lineCounter:n,prettyErrors:i}=xG(t),r=new SG.Parser(n?.addNewLine),o=new _G.Composer(t),s=null;for(let a of o.compose(r.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new $m.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(s.errors.forEach($m.prettifyError(e,n)),s.warnings.forEach($m.prettifyError(e,n))),s}function tle(e,t,n){let i;typeof t=="function"?i=t:n===void 0&&t&&typeof t=="object"&&(n=t);let r=EG(e,n);if(!r)return null;if(r.warnings.forEach(o=>Yce.warn(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function nle(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){let{keepUndefined:r}=n??t??{};if(!r)return}return Qce.isDocument(e)&&!i?e.toString(n):new Zce.Document(e,i,n).toString(n)}_m.parse=tle;_m.parseAllDocuments=ele;_m.parseDocument=EG;_m.stringify=nle});var gc=q(lt=>{"use strict";var rle=ET(),ile=mm(),ole=sT(),zT=ym(),sle=Qf(),Ls=Ze(),ale=Cs(),cle=an(),lle=Ds(),ule=Os(),dle=Yb(),ple=MT(),fle=FT(),mle=jT(),tv=TG(),IG=Kf();lt.Composer=rle.Composer;lt.Document=ile.Document;lt.Schema=ole.Schema;lt.YAMLError=zT.YAMLError;lt.YAMLParseError=zT.YAMLParseError;lt.YAMLWarning=zT.YAMLWarning;lt.Alias=sle.Alias;lt.isAlias=Ls.isAlias;lt.isCollection=Ls.isCollection;lt.isDocument=Ls.isDocument;lt.isMap=Ls.isMap;lt.isNode=Ls.isNode;lt.isPair=Ls.isPair;lt.isScalar=Ls.isScalar;lt.isSeq=Ls.isSeq;lt.Pair=ale.Pair;lt.Scalar=cle.Scalar;lt.YAMLMap=lle.YAMLMap;lt.YAMLSeq=ule.YAMLSeq;lt.CST=dle;lt.Lexer=ple.Lexer;lt.LineCounter=fle.LineCounter;lt.Parser=mle.Parser;lt.parse=tv.parse;lt.parseAllDocuments=tv.parseAllDocuments;lt.parseDocument=tv.parseDocument;lt.stringify=tv.stringify;lt.visit=IG.visit;lt.visitAsync=IG.visitAsync});var hd=q((kKe,S4)=>{"use strict";var dge="2.0.0",pge=Number.MAX_SAFE_INTEGER||9007199254740991,fge=16,mge=250,gge=["major","premajor","minor","preminor","patch","prepatch","prerelease"];S4.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:fge,MAX_SAFE_BUILD_LENGTH:mge,MAX_SAFE_INTEGER:pge,RELEASE_TYPES:gge,SEMVER_SPEC_VERSION:dge,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var vg=q(($Ke,x4)=>{"use strict";var hge=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};x4.exports=hge});var yd=q((ho,E4)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:OC,MAX_SAFE_BUILD_LENGTH:yge,MAX_LENGTH:bge}=hd(),vge=vg();ho=E4.exports={};var wge=ho.re=[],kge=ho.safeRe=[],ue=ho.src=[],$ge=ho.safeSrc=[],de=ho.t={},_ge=0,MC="[a-zA-Z0-9-]",Sge=[["\\s",1],["\\d",bge],[MC,yge]],xge=e=>{for(let[t,n]of Sge)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},Fe=(e,t,n)=>{let i=xge(t),r=_ge++;vge(e,r,t),de[e]=r,ue[r]=t,$ge[r]=i,wge[r]=new RegExp(t,n?"g":void 0),kge[r]=new RegExp(i,n?"g":void 0)};Fe("NUMERICIDENTIFIER","0|[1-9]\\d*");Fe("NUMERICIDENTIFIERLOOSE","\\d+");Fe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${MC}*`);Fe("MAINVERSION",`(${ue[de.NUMERICIDENTIFIER]})\\.(${ue[de.NUMERICIDENTIFIER]})\\.(${ue[de.NUMERICIDENTIFIER]})`);Fe("MAINVERSIONLOOSE",`(${ue[de.NUMERICIDENTIFIERLOOSE]})\\.(${ue[de.NUMERICIDENTIFIERLOOSE]})\\.(${ue[de.NUMERICIDENTIFIERLOOSE]})`);Fe("PRERELEASEIDENTIFIER",`(?:${ue[de.NONNUMERICIDENTIFIER]}|${ue[de.NUMERICIDENTIFIER]})`);Fe("PRERELEASEIDENTIFIERLOOSE",`(?:${ue[de.NONNUMERICIDENTIFIER]}|${ue[de.NUMERICIDENTIFIERLOOSE]})`);Fe("PRERELEASE",`(?:-(${ue[de.PRERELEASEIDENTIFIER]}(?:\\.${ue[de.PRERELEASEIDENTIFIER]})*))`);Fe("PRERELEASELOOSE",`(?:-?(${ue[de.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ue[de.PRERELEASEIDENTIFIERLOOSE]})*))`);Fe("BUILDIDENTIFIER",`${MC}+`);Fe("BUILD",`(?:\\+(${ue[de.BUILDIDENTIFIER]}(?:\\.${ue[de.BUILDIDENTIFIER]})*))`);Fe("FULLPLAIN",`v?${ue[de.MAINVERSION]}${ue[de.PRERELEASE]}?${ue[de.BUILD]}?`);Fe("FULL",`^${ue[de.FULLPLAIN]}$`);Fe("LOOSEPLAIN",`[v=\\s]*${ue[de.MAINVERSIONLOOSE]}${ue[de.PRERELEASELOOSE]}?${ue[de.BUILD]}?`);Fe("LOOSE",`^${ue[de.LOOSEPLAIN]}$`);Fe("GTLT","((?:<|>)?=?)");Fe("XRANGEIDENTIFIERLOOSE",`${ue[de.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Fe("XRANGEIDENTIFIER",`${ue[de.NUMERICIDENTIFIER]}|x|X|\\*`);Fe("XRANGEPLAIN",`[v=\\s]*(${ue[de.XRANGEIDENTIFIER]})(?:\\.(${ue[de.XRANGEIDENTIFIER]})(?:\\.(${ue[de.XRANGEIDENTIFIER]})(?:${ue[de.PRERELEASE]})?${ue[de.BUILD]}?)?)?`);Fe("XRANGEPLAINLOOSE",`[v=\\s]*(${ue[de.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ue[de.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ue[de.XRANGEIDENTIFIERLOOSE]})(?:${ue[de.PRERELEASELOOSE]})?${ue[de.BUILD]}?)?)?`);Fe("XRANGE",`^${ue[de.GTLT]}\\s*${ue[de.XRANGEPLAIN]}$`);Fe("XRANGELOOSE",`^${ue[de.GTLT]}\\s*${ue[de.XRANGEPLAINLOOSE]}$`);Fe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${OC}})(?:\\.(\\d{1,${OC}}))?(?:\\.(\\d{1,${OC}}))?`);Fe("COERCE",`${ue[de.COERCEPLAIN]}(?:$|[^\\d])`);Fe("COERCEFULL",ue[de.COERCEPLAIN]+`(?:${ue[de.PRERELEASE]})?(?:${ue[de.BUILD]})?(?:$|[^\\d])`);Fe("COERCERTL",ue[de.COERCE],!0);Fe("COERCERTLFULL",ue[de.COERCEFULL],!0);Fe("LONETILDE","(?:~>?)");Fe("TILDETRIM",`(\\s*)${ue[de.LONETILDE]}\\s+`,!0);ho.tildeTrimReplace="$1~";Fe("TILDE",`^${ue[de.LONETILDE]}${ue[de.XRANGEPLAIN]}$`);Fe("TILDELOOSE",`^${ue[de.LONETILDE]}${ue[de.XRANGEPLAINLOOSE]}$`);Fe("LONECARET","(?:\\^)");Fe("CARETTRIM",`(\\s*)${ue[de.LONECARET]}\\s+`,!0);ho.caretTrimReplace="$1^";Fe("CARET",`^${ue[de.LONECARET]}${ue[de.XRANGEPLAIN]}$`);Fe("CARETLOOSE",`^${ue[de.LONECARET]}${ue[de.XRANGEPLAINLOOSE]}$`);Fe("COMPARATORLOOSE",`^${ue[de.GTLT]}\\s*(${ue[de.LOOSEPLAIN]})$|^$`);Fe("COMPARATOR",`^${ue[de.GTLT]}\\s*(${ue[de.FULLPLAIN]})$|^$`);Fe("COMPARATORTRIM",`(\\s*)${ue[de.GTLT]}\\s*(${ue[de.LOOSEPLAIN]}|${ue[de.XRANGEPLAIN]})`,!0);ho.comparatorTrimReplace="$1$2$3";Fe("HYPHENRANGE",`^\\s*(${ue[de.XRANGEPLAIN]})\\s+-\\s+(${ue[de.XRANGEPLAIN]})\\s*$`);Fe("HYPHENRANGELOOSE",`^\\s*(${ue[de.XRANGEPLAINLOOSE]})\\s+-\\s+(${ue[de.XRANGEPLAINLOOSE]})\\s*$`);Fe("STAR","(<|>)?=?\\s*\\*");Fe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Fe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var gk=q((_Ke,T4)=>{"use strict";var Ege=Object.freeze({loose:!0}),Tge=Object.freeze({}),Ige=e=>e?typeof e!="object"?Ege:e:Tge;T4.exports=Ige});var LC=q((SKe,R4)=>{"use strict";var I4=/^[0-9]+$/,A4=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:eA4(t,e);R4.exports={compareIdentifiers:A4,rcompareIdentifiers:Age}});var On=q((xKe,C4)=>{"use strict";var hk=vg(),{MAX_LENGTH:N4,MAX_SAFE_INTEGER:yk}=hd(),{safeRe:bk,t:vk}=yd(),Rge=gk(),{compareIdentifiers:FC}=LC(),Nge=(e,t)=>{let n=t.split(".");if(n.length>e.length)return!1;for(let i=0;iN4)throw new TypeError(`version is longer than ${N4} characters`);hk("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let i=t.trim().match(n.loose?bk[vk.LOOSE]:bk[vk.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>yk||this.major<0)throw new TypeError("Invalid major version");if(this.minor>yk||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>yk||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){let o=+r;if(o>=0&&ot.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let i=this.prerelease[n],r=t.prerelease[n];if(hk("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return FC(i,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let i=this.build[n],r=t.build[n];if(hk("build compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return FC(i,r)}while(++n)}inc(t,n,i){if(t.startsWith("pre")){if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let r=`-${n}`.match(this.options.loose?bk[vk.PRERELEASELOOSE]:bk[vk.PRERELEASE]);if(!r||r[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let r=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[r];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let o=[n,r];if(i===!1&&(o=[n]),Nge(this.prerelease,n)){let s=this.prerelease[n.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};C4.exports=UC});var Xs=q((EKe,D4)=>{"use strict";var P4=On(),Cge=(e,t,n=!1)=>{if(e instanceof P4)return e;try{return new P4(e,t)}catch(i){if(!n)return null;throw i}};D4.exports=Cge});var M4=q((TKe,O4)=>{"use strict";var Pge=Xs(),Dge=(e,t)=>{let n=Pge(e,t);return n?n.version:null};O4.exports=Dge});var F4=q((IKe,L4)=>{"use strict";var Oge=Xs(),Mge=(e,t)=>{let n=Oge(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};L4.exports=Mge});var z4=q((AKe,j4)=>{"use strict";var U4=On(),Lge=(e,t,n,i,r)=>{typeof n=="string"&&(r=i,i=n,n=void 0);try{return new U4(e instanceof U4?e.version:e,n).inc(t,i,r).version}catch{return null}};j4.exports=Lge});var B4=q((RKe,V4)=>{"use strict";var G4=Xs(),Fge=(e,t)=>{let n=G4(e,null,!0),i=G4(t,null,!0),r=n.compare(i);if(r===0)return null;let o=r>0,s=o?n:i,a=o?i:n,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return n.major!==i.major?u+"major":n.minor!==i.minor?u+"minor":n.patch!==i.patch?u+"patch":"prerelease"};V4.exports=Fge});var W4=q((NKe,q4)=>{"use strict";var Uge=On(),jge=(e,t)=>new Uge(e,t).major;q4.exports=jge});var K4=q((CKe,H4)=>{"use strict";var zge=On(),Gge=(e,t)=>new zge(e,t).minor;H4.exports=Gge});var Z4=q((PKe,J4)=>{"use strict";var Vge=On(),Bge=(e,t)=>new Vge(e,t).patch;J4.exports=Bge});var Q4=q((DKe,Y4)=>{"use strict";var qge=Xs(),Wge=(e,t)=>{let n=qge(e,t);return n&&n.prerelease.length?n.prerelease:null};Y4.exports=Wge});var ui=q((OKe,e6)=>{"use strict";var X4=On(),Hge=(e,t,n)=>new X4(e,n).compare(new X4(t,n));e6.exports=Hge});var n6=q((MKe,t6)=>{"use strict";var Kge=ui(),Jge=(e,t,n)=>Kge(t,e,n);t6.exports=Jge});var i6=q((LKe,r6)=>{"use strict";var Zge=ui(),Yge=(e,t)=>Zge(e,t,!0);r6.exports=Yge});var wk=q((FKe,s6)=>{"use strict";var o6=On(),Qge=(e,t,n)=>{let i=new o6(e,n),r=new o6(t,n);return i.compare(r)||i.compareBuild(r)};s6.exports=Qge});var c6=q((UKe,a6)=>{"use strict";var Xge=wk(),ehe=(e,t)=>e.sort((n,i)=>Xge(n,i,t));a6.exports=ehe});var u6=q((jKe,l6)=>{"use strict";var the=wk(),nhe=(e,t)=>e.sort((n,i)=>the(i,n,t));l6.exports=nhe});var wg=q((zKe,d6)=>{"use strict";var rhe=ui(),ihe=(e,t,n)=>rhe(e,t,n)>0;d6.exports=ihe});var kk=q((GKe,p6)=>{"use strict";var ohe=ui(),she=(e,t,n)=>ohe(e,t,n)<0;p6.exports=she});var jC=q((VKe,f6)=>{"use strict";var ahe=ui(),che=(e,t,n)=>ahe(e,t,n)===0;f6.exports=che});var zC=q((BKe,m6)=>{"use strict";var lhe=ui(),uhe=(e,t,n)=>lhe(e,t,n)!==0;m6.exports=uhe});var $k=q((qKe,g6)=>{"use strict";var dhe=ui(),phe=(e,t,n)=>dhe(e,t,n)>=0;g6.exports=phe});var _k=q((WKe,h6)=>{"use strict";var fhe=ui(),mhe=(e,t,n)=>fhe(e,t,n)<=0;h6.exports=mhe});var GC=q((HKe,y6)=>{"use strict";var ghe=jC(),hhe=zC(),yhe=wg(),bhe=$k(),vhe=kk(),whe=_k(),khe=(e,t,n,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return ghe(e,n,i);case"!=":return hhe(e,n,i);case">":return yhe(e,n,i);case">=":return bhe(e,n,i);case"<":return vhe(e,n,i);case"<=":return whe(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}};y6.exports=khe});var v6=q((KKe,b6)=>{"use strict";var $he=On(),_he=Xs(),{safeRe:Sk,t:xk}=yd(),She=(e,t)=>{if(e instanceof $he)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?Sk[xk.COERCEFULL]:Sk[xk.COERCE]);else{let c=t.includePrerelease?Sk[xk.COERCERTLFULL]:Sk[xk.COERCERTL],l;for(;(l=c.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||l.index+l[0].length!==n.index+n[0].length)&&(n=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(n===null)return null;let i=n[2],r=n[3]||"0",o=n[4]||"0",s=t.includePrerelease&&n[5]?`-${n[5]}`:"",a=t.includePrerelease&&n[6]?`+${n[6]}`:"";return _he(`${i}.${r}.${o}${s}${a}`,t)};b6.exports=She});var k6=q((JKe,w6)=>{"use strict";var xhe=Xs(),Ehe=hd(),The=On(),Ihe=(e,t,n)=>{if(!Ehe.RELEASE_TYPES.includes(t))return null;let i=Ahe(e,n);return i&&Rhe(i,t)},Ahe=(e,t)=>{let n=e instanceof The?e.version:e;return xhe(n,t)},Rhe=(e,t)=>{if(Nhe(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Nhe=e=>e.startsWith("pre");w6.exports=Ihe});var _6=q((ZKe,$6)=>{"use strict";var VC=class{constructor(){this.max=1e3,this.map=new Map}get(t){let n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){let r=this.map.keys().next().value;this.delete(r)}this.map.set(t,n)}return this}};$6.exports=VC});var di=q((YKe,T6)=>{"use strict";var Che=/\s+/g,BC=class e{constructor(t,n){if(n=Dhe(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof qC)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(Che," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(r=>!x6(r[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let r of this.set)if(r.length===1&&Vhe(r[0])){this.set=[r];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let n=this.set[t];for(let i=0;i0&&(this.formatted+=" "),this.formatted+=n[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(Ghe,"");let i=((this.options.includePrerelease&&jhe)|(this.options.loose&&zhe))+":"+t,r=S6.get(i);if(r)return r;let o=this.options.loose,s=o?cr[Mn.HYPHENRANGELOOSE]:cr[Mn.HYPHENRANGE];t=t.replace(s,eye(this.options.includePrerelease)),Tt("hyphen replace",t),t=t.replace(cr[Mn.COMPARATORTRIM],Lhe),Tt("comparator trim",t),t=t.replace(cr[Mn.TILDETRIM],Fhe),Tt("tilde trim",t),t=t.replace(cr[Mn.CARETTRIM],Uhe),Tt("caret trim",t);let a=t.split(" ").map(d=>Bhe(d,this.options)).join(" ").split(/\s+/).map(d=>Xhe(d,this.options));o&&(a=a.filter(d=>(Tt("loose invalid filter",d,this.options),!!d.match(cr[Mn.COMPARATORLOOSE])))),Tt("range list",a);let c=new Map,l=a.map(d=>new qC(d,this.options));for(let d of l){if(x6(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return S6.set(i,u),u}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(i=>E6(i,n)&&t.set.some(r=>E6(r,n)&&i.every(o=>r.every(s=>o.intersects(s,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new Ohe(t,this.options)}catch{return!1}for(let n=0;ne.value==="<0.0.0-0",Vhe=e=>e.value==="",E6=(e,t)=>{let n=!0,i=e.slice(),r=i.pop();for(;n&&i.length;)n=i.every(o=>r.intersects(o,t)),r=i.pop();return n},Bhe=(e,t)=>(e=e.replace(cr[Mn.BUILD],""),Tt("comp",e,t),e=Khe(e,t),Tt("caret",e),e=Whe(e,t),Tt("tildes",e),e=Zhe(e,t),Tt("xrange",e),e=Qhe(e,t),Tt("stars",e),e),bn=e=>!e||e.toLowerCase()==="x"||e==="*",qhe=(e,t,n)=>bn(e)&&!bn(t)||bn(t)&&n&&!bn(n),Whe=(e,t)=>e.trim().split(/\s+/).map(n=>Hhe(n,t)).join(" "),Hhe=(e,t)=>{let n=t.loose?cr[Mn.TILDELOOSE]:cr[Mn.TILDE],i=t.includePrerelease?"-0":"";return e.replace(n,(r,o,s,a,c)=>{Tt("tilde",e,r,o,s,a,c);let l;return bn(o)?l="":bn(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:bn(a)?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:c?(Tt("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,Tt("tilde return",l),l})},Khe=(e,t)=>e.trim().split(/\s+/).map(n=>Jhe(n,t)).join(" "),Jhe=(e,t)=>{Tt("caret",e,t);let n=t.loose?cr[Mn.CARETLOOSE]:cr[Mn.CARET],i=t.includePrerelease?"-0":"";return e.replace(n,(r,o,s,a,c)=>{Tt("caret",e,r,o,s,a,c);let l;return bn(o)?l="":bn(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:bn(a)?o==="0"?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:c?(Tt("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(Tt("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Tt("caret return",l),l})},Zhe=(e,t)=>(Tt("replaceXRanges",e,t),e.split(/\s+/).map(n=>Yhe(n,t)).join(" ")),Yhe=(e,t)=>{e=e.trim();let n=t.loose?cr[Mn.XRANGELOOSE]:cr[Mn.XRANGE];return e.replace(n,(i,r,o,s,a,c)=>{if(Tt("xRange",e,i,r,o,s,a,c),qhe(o,s,a))return e;let l=bn(o),u=l||bn(s),d=u||bn(a),p=d;return r==="="&&p&&(r=""),c=t.includePrerelease?"-0":"",l?r===">"||r==="<"?i="<0.0.0-0":i="*":r&&p?(u&&(s=0),a=0,r===">"?(r=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):r==="<="&&(r="<",u?o=+o+1:s=+s+1),r==="<"&&(c="-0"),i=`${r+o}.${s}.${a}${c}`):u?i=`>=${o}.0.0${c} <${+o+1}.0.0-0`:d&&(i=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),Tt("xRange return",i),i})},Qhe=(e,t)=>(Tt("replaceStars",e,t),e.trim().replace(cr[Mn.STAR],"")),Xhe=(e,t)=>(Tt("replaceGTE0",e,t),e.trim().replace(cr[t.includePrerelease?Mn.GTE0PRE:Mn.GTE0],"")),eye=e=>(t,n,i,r,o,s,a,c,l,u,d,p)=>(bn(i)?n="":bn(r)?n=`>=${i}.0.0${e?"-0":""}`:bn(o)?n=`>=${i}.${r}.0${e?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${e?"-0":""}`,bn(l)?c="":bn(u)?c=`<${+l+1}.0.0-0`:bn(d)?c=`<${l}.${+u+1}.0-0`:p?c=`<=${l}.${u}.${d}-${p}`:e?c=`<${l}.${u}.${+d+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),tye=(e,t,n)=>{for(let i=0;i0){let r=e[i].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}});var kg=q((QKe,P6)=>{"use strict";var $g=Symbol("SemVer ANY"),KC=class e{static get ANY(){return $g}constructor(t,n){if(n=I6(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),HC("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===$g?this.value="":this.value=this.operator+this.semver.version,HC("comp",this)}parse(t){let n=this.options.loose?A6[R6.COMPARATORLOOSE]:A6[R6.COMPARATOR],i=t.match(n);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new N6(i[2],this.options.loose):this.semver=$g}toString(){return this.value}test(t){if(HC("Comparator.test",t,this.options.loose),this.semver===$g||t===$g)return!0;if(typeof t=="string")try{t=new N6(t,this.options)}catch{return!1}return WC(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new C6(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new C6(this.value,n).test(t.semver):(n=I6(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||WC(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||WC(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};P6.exports=KC;var I6=gk(),{safeRe:A6,t:R6}=yd(),WC=GC(),HC=vg(),N6=On(),C6=di()});var _g=q((XKe,D6)=>{"use strict";var nye=di(),rye=(e,t,n)=>{try{t=new nye(t,n)}catch{return!1}return t.test(e)};D6.exports=rye});var M6=q((eJe,O6)=>{"use strict";var iye=di(),oye=(e,t)=>new iye(e,t).set.map(n=>n.map(i=>i.value).join(" ").trim().split(" "));O6.exports=oye});var F6=q((tJe,L6)=>{"use strict";var sye=On(),aye=di(),cye=(e,t,n)=>{let i=null,r=null,o=null;try{o=new aye(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||r.compare(s)===-1)&&(i=s,r=new sye(i,n))}),i};L6.exports=cye});var j6=q((nJe,U6)=>{"use strict";var lye=On(),uye=di(),dye=(e,t,n)=>{let i=null,r=null,o=null;try{o=new uye(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||r.compare(s)===1)&&(i=s,r=new lye(i,n))}),i};U6.exports=dye});var V6=q((rJe,G6)=>{"use strict";var JC=On(),pye=di(),z6=wg(),fye=(e,t)=>{e=new pye(e,t);let n=new JC("0.0.0");if(e.test(n)||(n=new JC("0.0.0-0"),e.test(n)))return n;n=null;for(let i=0;i{let a=new JC(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||z6(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||z6(n,o))&&(n=o)}return n&&e.test(n)?n:null};G6.exports=fye});var q6=q((iJe,B6)=>{"use strict";var mye=di(),gye=(e,t)=>{try{return new mye(e,t).range||"*"}catch{return null}};B6.exports=gye});var Ek=q((oJe,J6)=>{"use strict";var hye=On(),K6=kg(),{ANY:yye}=K6,bye=di(),vye=_g(),W6=wg(),H6=kk(),wye=_k(),kye=$k(),$ye=(e,t,n,i)=>{e=new hye(e,i),t=new bye(t,i);let r,o,s,a,c;switch(n){case">":r=W6,o=wye,s=H6,a=">",c=">=";break;case"<":r=H6,o=kye,s=W6,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(vye(e,t,i))return!1;for(let l=0;l{f.semver===yye&&(f=new K6(">=0.0.0")),d=d||f,p=p||f,r(f.semver,d.semver,i)?d=f:s(f.semver,p.semver,i)&&(p=f)}),d.operator===a||d.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0};J6.exports=$ye});var Y6=q((sJe,Z6)=>{"use strict";var _ye=Ek(),Sye=(e,t,n)=>_ye(e,t,">",n);Z6.exports=Sye});var X6=q((aJe,Q6)=>{"use strict";var xye=Ek(),Eye=(e,t,n)=>xye(e,t,"<",n);Q6.exports=Eye});var nW=q((cJe,tW)=>{"use strict";var eW=di(),Tye=(e,t,n)=>(e=new eW(e,n),t=new eW(t,n),e.intersects(t,n));tW.exports=Tye});var iW=q((lJe,rW)=>{"use strict";var Iye=_g(),Aye=ui();rW.exports=(e,t,n)=>{let i=[],r=null,o=null,s=e.sort((u,d)=>Aye(u,d,n));for(let u of s)Iye(u,t,n)?(o=u,r||(r=u)):(o&&i.push([r,o]),o=null,r=null);r&&i.push([r,null]);let a=[];for(let[u,d]of i)u===d?a.push(u):!d&&u===s[0]?a.push("*"):d?u===s[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length{"use strict";var oW=di(),QC=kg(),{ANY:ZC}=QC,YC=_g(),XC=ui(),Rye=(e,t,n={})=>{if(e===t)return!0;e=new oW(e,n),t=new oW(t,n);let i=!1;e:for(let r of e.set){for(let o of t.set){let s=Cye(r,o,n);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},Nye=[new QC(">=0.0.0-0")],sW=[new QC(">=0.0.0")],Cye=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===ZC){if(t.length===1&&t[0].semver===ZC)return!0;n.includePrerelease?e=Nye:e=sW}if(t.length===1&&t[0].semver===ZC){if(n.includePrerelease)return!0;t=sW}let i=new Set,r,o;for(let f of e)f.operator===">"||f.operator===">="?r=aW(r,f,n):f.operator==="<"||f.operator==="<="?o=cW(o,f,n):i.add(f.semver);if(i.size>1)return null;let s;if(r&&o){if(s=XC(r.semver,o.semver,n),s>0)return null;if(s===0&&(r.operator!==">="||o.operator!=="<="))return null}for(let f of i){if(r&&!YC(f,String(r),n)||o&&!YC(f,String(o),n))return null;for(let m of t)if(!YC(f,String(m),n))return!1;return!0}let a,c,l,u,d=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=r&&!n.includePrerelease&&r.semver.prerelease.length?r.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let f of t){if(u=u||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",r){if(p&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch&&(p=!1),f.operator===">"||f.operator===">="){if(a=aW(r,f,n),a===f&&a!==r)return!1}else if(r.operator===">="&&!f.test(r.semver))return!1}if(o){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(c=cW(o,f,n),c===f&&c!==o)return!1}else if(o.operator==="<="&&!f.test(o.semver))return!1}if(!f.operator&&(o||r)&&s!==0)return!1}return!(r&&l&&!o&&s!==0||o&&u&&!r&&s!==0||p||d)},aW=(e,t,n)=>{if(!e)return t;let i=XC(e.semver,t.semver,n);return i>0?e:i<0||t.operator===">"&&e.operator===">="?t:e},cW=(e,t,n)=>{if(!e)return t;let i=XC(e.semver,t.semver,n);return i<0?e:i>0||t.operator==="<"&&e.operator==="<="?t:e};lW.exports=Rye});var Dc=q((dJe,fW)=>{"use strict";var eP=yd(),dW=hd(),Pye=On(),pW=LC(),Dye=Xs(),Oye=M4(),Mye=F4(),Lye=z4(),Fye=B4(),Uye=W4(),jye=K4(),zye=Z4(),Gye=Q4(),Vye=ui(),Bye=n6(),qye=i6(),Wye=wk(),Hye=c6(),Kye=u6(),Jye=wg(),Zye=kk(),Yye=jC(),Qye=zC(),Xye=$k(),ebe=_k(),tbe=GC(),nbe=v6(),rbe=k6(),ibe=kg(),obe=di(),sbe=_g(),abe=M6(),cbe=F6(),lbe=j6(),ube=V6(),dbe=q6(),pbe=Ek(),fbe=Y6(),mbe=X6(),gbe=nW(),hbe=iW(),ybe=uW();fW.exports={parse:Dye,valid:Oye,clean:Mye,inc:Lye,diff:Fye,major:Uye,minor:jye,patch:zye,prerelease:Gye,compare:Vye,rcompare:Bye,compareLoose:qye,compareBuild:Wye,sort:Hye,rsort:Kye,gt:Jye,lt:Zye,eq:Yye,neq:Qye,gte:Xye,lte:ebe,cmp:tbe,coerce:nbe,truncate:rbe,Comparator:ibe,Range:obe,satisfies:sbe,toComparators:abe,maxSatisfying:cbe,minSatisfying:lbe,minVersion:ube,validRange:dbe,outside:pbe,gtr:fbe,ltr:mbe,intersects:gbe,simplifyRange:hbe,subset:ybe,SemVer:Pye,re:eP.re,src:eP.src,tokens:eP.t,SEMVER_SPEC_VERSION:dW.SEMVER_SPEC_VERSION,RELEASE_TYPES:dW.RELEASE_TYPES,compareIdentifiers:pW.compareIdentifiers,rcompareIdentifiers:pW.rcompareIdentifiers}});var AZ=q((qtt,IZ)=>{IZ.exports=require("util").inspect});var JZ=q((Wtt,KZ)=>{var KD=typeof Map=="function"&&Map.prototype,UD=Object.getOwnPropertyDescriptor&&KD?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,D$=KD&&UD&&typeof UD.get=="function"?UD.get:null,RZ=KD&&Map.prototype.forEach,JD=typeof Set=="function"&&Set.prototype,jD=Object.getOwnPropertyDescriptor&&JD?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,O$=JD&&jD&&typeof jD.get=="function"?jD.get:null,NZ=JD&&Set.prototype.forEach,fEe=typeof WeakMap=="function"&&WeakMap.prototype,dh=fEe?WeakMap.prototype.has:null,mEe=typeof WeakSet=="function"&&WeakSet.prototype,ph=mEe?WeakSet.prototype.has:null,gEe=typeof WeakRef=="function"&&WeakRef.prototype,CZ=gEe?WeakRef.prototype.deref:null,hEe=Boolean.prototype.valueOf,yEe=Object.prototype.toString,bEe=Function.prototype.toString,vEe=String.prototype.match,ZD=String.prototype.slice,Ia=String.prototype.replace,wEe=String.prototype.toUpperCase,PZ=String.prototype.toLowerCase,GZ=RegExp.prototype.test,DZ=Array.prototype.concat,xo=Array.prototype.join,kEe=Array.prototype.slice,OZ=Math.floor,VD=typeof BigInt=="function"?BigInt.prototype.valueOf:null,zD=Object.getOwnPropertySymbols,BD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Qn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Wd||!0)?Symbol.toStringTag:null,VZ=Object.prototype.propertyIsEnumerable,MZ=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function LZ(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||GZ.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var i=e<0?-OZ(-e):OZ(e);if(i!==e){var r=String(i),o=ZD.call(t,r.length+1);return Ia.call(r,n,"$&_")+"."+Ia.call(Ia.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ia.call(t,n,"$&_")}var qD=AZ(),FZ=qD.custom,UZ=qZ(FZ)?FZ:null;KZ.exports=function e(t,n,i,r){var o=n||{};if(Ta(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ta(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Ta(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ta(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ta(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return HZ(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?LZ(t,c):c}if(typeof t=="bigint"){var l=String(t)+"n";return a?LZ(t,l):l}var u=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=u&&u>0&&typeof t=="object")return WD(t)?"[Array]":"[Object]";var d=UEe(o,i);if(typeof r>"u")r=[];else if(WZ(r,t)>=0)return"[Circular]";function p(K,te,D){if(te&&(r=kEe.call(r),r.push(te)),D){var X={depth:o.depth};return Ta(o,"quoteStyle")&&(X.quoteStyle=o.quoteStyle),e(K,X,i+1,r)}return e(K,o,i+1,r)}if(typeof t=="function"&&!jZ(t)){var f=REe(t),m=P$(t,p);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(m.length>0?" { "+xo.call(m,", ")+" }":"")}if(qZ(t)){var g=Wd?Ia.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):BD.call(t);return typeof t=="object"&&!Wd?uh(g):g}if(MEe(t)){for(var h="<"+PZ.call(String(t.nodeName)),b=t.attributes||[],y=0;y",h}if(WD(t)){if(t.length===0)return"[]";var w=P$(t,p);return d&&!FEe(w)?"["+HD(w,d)+"]":"[ "+xo.call(w,", ")+" ]"}if(SEe(t)){var k=P$(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!VZ.call(t,"cause")?"{ ["+String(t)+"] "+xo.call(DZ.call("[cause]: "+p(t.cause),k),", ")+" }":k.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+xo.call(k,", ")+" }"}if(typeof t=="object"&&s){if(UZ&&typeof t[UZ]=="function"&&qD)return qD(t,{depth:u-i});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(NEe(t)){var _=[];return RZ&&RZ.call(t,function(K,te){_.push(p(te,t,!0)+" => "+p(K,t))}),zZ("Map",D$.call(t),_,d)}if(DEe(t)){var S=[];return NZ&&NZ.call(t,function(K){S.push(p(K,t))}),zZ("Set",O$.call(t),S,d)}if(CEe(t))return GD("WeakMap");if(OEe(t))return GD("WeakSet");if(PEe(t))return GD("WeakRef");if(EEe(t))return uh(p(Number(t)));if(IEe(t))return uh(p(VD.call(t)));if(TEe(t))return uh(hEe.call(t));if(xEe(t))return uh(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!_Ee(t)&&!jZ(t)){var x=P$(t,p),E=MZ?MZ(t)===Object.prototype:t instanceof Object||t.constructor===Object,T=t instanceof Object?"":"null prototype",A=!E&&Qn&&Object(t)===t&&Qn in t?ZD.call(Aa(t),8,-1):T?"Object":"",L=E||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",F=L+(A||T?"["+xo.call(DZ.call([],A||[],T||[]),": ")+"] ":"");return x.length===0?F+"{}":d?F+"{"+HD(x,d)+"}":F+"{ "+xo.call(x,", ")+" }"}return String(t)};function BZ(e,t,n){var i=(n.quoteStyle||t)==="double"?'"':"'";return i+e+i}function $Ee(e){return Ia.call(String(e),/"/g,""")}function WD(e){return Aa(e)==="[object Array]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function _Ee(e){return Aa(e)==="[object Date]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function jZ(e){return Aa(e)==="[object RegExp]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function SEe(e){return Aa(e)==="[object Error]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function xEe(e){return Aa(e)==="[object String]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function EEe(e){return Aa(e)==="[object Number]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function TEe(e){return Aa(e)==="[object Boolean]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function qZ(e){if(Wd)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!BD)return!1;try{return BD.call(e),!0}catch{}return!1}function IEe(e){if(!e||typeof e!="object"||!VD)return!1;try{return VD.call(e),!0}catch{}return!1}var AEe=Object.prototype.hasOwnProperty||function(e){return e in this};function Ta(e,t){return AEe.call(e,t)}function Aa(e){return yEe.call(e)}function REe(e){if(e.name)return e.name;var t=vEe.call(bEe.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function WZ(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,i="... "+n+" more character"+(n>1?"s":"");return HZ(ZD.call(e,0,t.maxStringLength),t)+i}var r=Ia.call(Ia.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,LEe);return BZ(r,"single",t)}function LEe(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+wEe.call(t.toString(16))}function uh(e){return"Object("+e+")"}function GD(e){return e+" { ? }"}function zZ(e,t,n,i){var r=i?HD(n,i):xo.call(n,", ");return e+" ("+t+") {"+r+"}"}function FEe(e){for(var t=0;t=0)return!1;return!0}function UEe(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=xo.call(Array(e.indent+1)," ");else return null;return{base:n,prev:xo.call(Array(t+1),n)}}function HD(e,t){if(e.length===0)return"";var n=` -`+t.prev+t.base;return n+xo.call(e,","+n)+` -`+t.prev}function P$(e,t){var n=WD(e),i=[];if(n){i.length=e.length;for(var r=0;ree,decodeFieldSignature:()=>k9,decodeMethodSignature:()=>w9,readAssembly:()=>s_});function sNe(e){if(e.length<64||e.readUInt16LE(0)!==23117)return null;let t=e.readUInt32LE(60);if(t+24>e.length||e.readUInt32LE(t)!==17744)return null;let n=e.readUInt16LE(t+6),i=e.readUInt16LE(t+20),r=t+24;if(i===0)return null;let o=e.readUInt16LE(r),s=r+(o===523?112:96),a=[],c=r+i;for(let f=0;fe.length)break;a.push({virtualSize:e.readUInt32LE(m+8),virtualAddress:e.readUInt32LE(m+12),rawAddress:e.readUInt32LE(m+20)})}let l=e.readUInt32LE(s+112);if(l===0)return null;let u=g9(l,a);if(u===null||u+16>e.length)return null;let d=e.readUInt32LE(u+8),p=g9(d,a);return p===null?null:{offset:p,sections:a}}function g9(e,t){for(let n of t)if(e>=n.virtualAddress&&ee.length||e.readUInt32LE(t)!==1112167234)return null;let n=e.readUInt32LE(t+12),i=t+16+n+2,r=e.readUInt16LE(i);i+=2;let o=new Map;for(let c=0;c"||h.startsWith("<"))continue;let b=$Ne(i,r,l,f),y=v9(i,m[3]),w=[],k=[];for(let _ of y9(m[4],f,r,4,o.length)){let S=o[_];if(!h9(S[0]))continue;let x=i.string(S[1]);x.startsWith("<")||(w.push(x),k.push(`${x}: ${k9(i,i.blob(S[2]))}`))}for(let _ of y9(m[5],f,r,5,s.length)){let S=s[_];if(!h9(S[2]))continue;let x=i.string(S[3]);x.startsWith("<")||/^(get_|set_|add_|remove_)/.test(x)||(w.push(x),k.push(`${x}${w9(i,i.blob(S[4]))}`))}for(let _ of u.get(f+1)??[]){let S=i.string(a[_][1]);S.startsWith("<")||(w.push(S),k.push(`${S} { get; set; }`))}for(let _ of d.get(f+1)??[]){let S=i.string(c[_][1]);S.startsWith("<")||(w.push(S),k.push(`event ${S}`))}p.push({fullName:b,kind:kNe(g,y),members:[...new Set(w)],signatures:[...new Set(k)]})}return p}function kNe(e,t){return e&gNe?"interface":t==="System.Enum"?"enum":t==="System.ValueType"?"struct":t==="System.MulticastDelegate"||t==="System.Delegate"?"delegate":"class"}function $Ne(e,t,n,i){let r=[],o=i;for(let s=0;s<16;s++){let a=t[o];if(!a)break;r.unshift(e.string(a[1]));let c=n.get(o+1);if(c===void 0){let l=e.string(a[2]);return l?`${l}.${r.join("+")}`:r.join("+")}o=c-1}return r.join("+")}function v9(e,t){let n=t&3,i=t>>2;if(i===0)return null;if(n===0){let r=e.table(ee.TypeDef)[i-1];if(!r)return null;let o=e.string(r[2]),s=e.string(r[1]);return o?`${o}.${s}`:s}if(n===1){let r=e.table(ee.TypeRef)[i-1];if(!r)return null;let o=e.string(r[2]),s=e.string(r[1]);return o?`${o}.${s}`:s}return null}function y9(e,t,n,i,r){let o=n[t+1]?.[i]??r+1,s=[];for(let a=e;a`}let o=No(t,n);n+=o.width;let s=Ji(e,t,n);n=s.offset;let a=[];for(let c=0;c=t.length);c++){let l=Ji(e,t,n);n=l.offset,a.push(l.text)}return`${r}(${a.join(", ")}): ${s.text}`}function k9(e,t){return t.length<2?"?":Ji(e,t,1).text}function Ji(e,t,n){let i=n,r=t[i++];if(r===void 0)return{text:"?",offset:i};let o=_Ne[r];if(o)return{text:o,offset:i};switch(r){case 15:{let s=Ji(e,t,i);return{text:`${s.text}*`,offset:s.offset}}case 16:{let s=Ji(e,t,i);return{text:`ref ${s.text}`,offset:s.offset}}case 29:{let s=Ji(e,t,i);return{text:`${s.text}[]`,offset:s.offset}}case 69:{let s=Ji(e,t,i);return{text:s.text,offset:s.offset}}case 17:case 18:{let s=No(t,i);return i+=s.width,{text:v9(e,s.value)??"object",offset:i}}case 19:case 30:{let s=No(t,i);return i+=s.width,{text:`${r===19?"T":"M"}${s.value}`,offset:i}}case 21:{let s=Ji(e,t,i);i=s.offset;let a=No(t,i);i+=a.width;let c=[];for(let l=0;l`,offset:i}}case 20:{let s=Ji(e,t,i);i=s.offset;let a=No(t,i);i+=a.width;for(let c of["sizes","lowBounds"]){let l=No(t,i);i+=l.width;for(let u=0;u{"use strict";Ut={type:"u16"},Ct={type:"u32"},Ht={type:"string"},DO={type:"guid"},mr={type:"blob"},Pt=e=>({type:"rid",table:e}),wn=e=>({type:"coded",family:e}),ee={Module:0,TypeRef:1,TypeDef:2,Field:4,MethodDef:6,Param:8,InterfaceImpl:9,MemberRef:10,Constant:11,CustomAttribute:12,FieldMarshal:13,DeclSecurity:14,ClassLayout:15,FieldLayout:16,StandAloneSig:17,EventMap:18,Event:20,PropertyMap:21,Property:23,MethodSemantics:24,MethodImpl:25,ModuleRef:26,TypeSpec:27,ImplMap:28,FieldRVA:29,Assembly:32,AssemblyRef:35,File:38,ExportedType:39,ManifestResource:40,NestedClass:41,GenericParam:42,MethodSpec:43,GenericParamConstraint:44},cNe={TypeDefOrRef:[ee.TypeDef,ee.TypeRef,ee.TypeSpec],HasConstant:[ee.Field,ee.Param,ee.Property],HasCustomAttribute:[ee.MethodDef,ee.Field,ee.TypeRef,ee.TypeDef,ee.Param,ee.InterfaceImpl,ee.MemberRef,ee.Module,ee.DeclSecurity,ee.Property,ee.Event,ee.StandAloneSig,ee.ModuleRef,ee.TypeSpec,ee.Assembly,ee.AssemblyRef,ee.File,ee.ExportedType,ee.ManifestResource,ee.GenericParam,ee.GenericParamConstraint,ee.MethodSpec],HasFieldMarshal:[ee.Field,ee.Param],HasDeclSecurity:[ee.TypeDef,ee.MethodDef,ee.Assembly],MemberRefParent:[ee.TypeDef,ee.TypeRef,ee.ModuleRef,ee.MethodDef,ee.TypeSpec],HasSemantics:[ee.Event,ee.Property],MethodDefOrRef:[ee.MethodDef,ee.MemberRef],MemberForwarded:[ee.Field,ee.MethodDef],Implementation:[ee.File,ee.AssemblyRef,ee.ExportedType],CustomAttributeType:[null,null,ee.MethodDef,ee.MemberRef,null],ResolutionScope:[ee.Module,ee.ModuleRef,ee.AssemblyRef,ee.TypeRef],TypeOrMethodDef:[ee.TypeDef,ee.MethodDef]},lNe={0:[Ut,Ht,DO,DO,DO],1:[wn("ResolutionScope"),Ht,Ht],2:[Ct,Ht,Ht,wn("TypeDefOrRef"),Pt(ee.Field),Pt(ee.MethodDef)],3:[Pt(ee.Field)],4:[Ut,Ht,mr],5:[Pt(ee.MethodDef)],6:[Ct,Ut,Ut,Ht,mr,Pt(ee.Param)],7:[Pt(ee.Param)],8:[Ut,Ut,Ht],9:[Pt(ee.TypeDef),wn("TypeDefOrRef")],10:[wn("MemberRefParent"),Ht,mr],11:[Ut,wn("HasConstant"),mr],12:[wn("HasCustomAttribute"),wn("CustomAttributeType"),mr],13:[wn("HasFieldMarshal"),mr],14:[Ut,wn("HasDeclSecurity"),mr],15:[Ut,Ct,Pt(ee.TypeDef)],16:[Ct,Pt(ee.Field)],17:[mr],18:[Pt(ee.TypeDef),Pt(ee.Event)],19:[Pt(ee.Event)],20:[Ut,Ht,wn("TypeDefOrRef")],21:[Pt(ee.TypeDef),Pt(ee.Property)],22:[Pt(ee.Property)],23:[Ut,Ht,mr],24:[Ut,Pt(ee.MethodDef),wn("HasSemantics")],25:[Pt(ee.TypeDef),wn("MethodDefOrRef"),wn("MethodDefOrRef")],26:[Ht],27:[mr],28:[Ut,wn("MemberForwarded"),Ht,Pt(ee.ModuleRef)],29:[Ct,Pt(ee.Field)],30:[Ct,Ct],31:[Ct],32:[Ct,Ut,Ut,Ut,Ut,Ct,mr,Ht,Ht],33:[Ct],34:[Ct,Ct,Ct],35:[Ut,Ut,Ut,Ut,Ct,mr,Ht,Ht,mr],36:[Ct,Pt(ee.AssemblyRef)],37:[Ct,Ct,Ct,Pt(ee.AssemblyRef)],38:[Ct,Ht,mr],39:[Ct,Ct,Ht,Ht,wn("Implementation")],40:[Ct,Ct,Ht,wn("Implementation")],41:[Pt(ee.TypeDef),Pt(ee.TypeDef)],42:[Ut,Ut,wn("TypeOrMethodDef"),Ht],43:[wn("MethodDefOrRef"),mr],44:[Pt(ee.GenericParam),wn("TypeDefOrRef")]},OO=class{constructor(t,n,i){this.strings=t;this.blobs=n;let r=i.readUInt8(6),o=i.readBigUInt64LE(8),s=new Map,a=24;for(let u=0;u<64;u++)o>>BigInt(u)&1n&&(s.set(u,i.readUInt32LE(a)),a+=4);let c={string:r&1?4:2,guid:r&2?4:2,blob:r&4?4:2},l=u=>{switch(u.type){case"u16":return 2;case"u32":return 4;case"string":return c.string;case"guid":return c.guid;case"blob":return c.blob;case"rid":return(s.get(u.table)??0)<65536?2:4;case"coded":{let d=cNe[u.family],p=Math.ceil(Math.log2(d.length));return Math.max(...d.map(m=>m===null?0:s.get(m)??0))<1<<16-p?2:4}}};for(let[u,d]of s){let p=lNe[u];if(!p)break;let f=p.map(l),m=f.reduce((h,b)=>h+b,0),g=[];for(let h=0;hi.length);h++){let b=[],y=a;for(let w of f)b.push(w===2?i.readUInt16LE(y):i.readUInt32LE(y)),y+=w;g.push(b),a+=m}this.rows.set(u,g)}}strings;blobs;rows=new Map;table(t){return this.rows.get(t)??[]}string(t){if(t>=this.strings.length)return"";let n=t;for(;n=this.blobs.length)return Buffer.alloc(0);let{value:n,width:i}=No(this.blobs,t);return this.blobs.subarray(t+i,t+i+n)}};uNe=7,dNe=1,pNe=2,fNe=4,mNe=7,gNe=32,hNe=7,yNe=4,bNe=6,vNe=5;_Ne={1:"void",2:"bool",3:"char",4:"sbyte",5:"byte",6:"short",7:"ushort",8:"int",9:"uint",10:"long",11:"ulong",12:"float",13:"double",14:"string",22:"TypedReference",24:"IntPtr",25:"UIntPtr",28:"object"}});function M(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n}function v(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}var gr=j(()=>{});function Yr(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}var pl,Da=j(()=>{pl=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{let t=Object.prototype.toString.call(e);if(t==="[object Error]"||t==="[object DOMException]"){let n=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(n.stack=e.stack),e.cause&&!n.cause&&(n.cause=e.cause),e.name&&(n.name=e.name),n}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)}});var J,Dt,In,Zi,fl,ap,ml,gl,hl,yl,bl,vl,wl,kl,kt=j(()=>{Da();J=class extends Error{},Dt=class e extends J{constructor(t,n,i,r,o){super(`${e.makeMessage(t,n,i)}`),this.status=t,this.headers=r,this.requestID=r?.get("request-id"),this.workspaceID=r?.get("anthropic-workspace-id"),this.error=n,this.type=o??null}static makeMessage(t,n,i){let r=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):i;return t&&r?`${t} ${r}`:t?`${t} status code (no body)`:r||"(no status code or body)"}static generate(t,n,i,r){if(!t||!r)return new Zi({message:i,cause:pl(n)});let o=n,s=o?.error?.type;return t===400?new ml(t,o,i,r,s):t===401?new gl(t,o,i,r,s):t===403?new hl(t,o,i,r,s):t===404?new yl(t,o,i,r,s):t===409?new bl(t,o,i,r,s):t===422?new vl(t,o,i,r,s):t===429?new wl(t,o,i,r,s):t>=500?new kl(t,o,i,r,s):new e(t,o,i,r,s)}},In=class extends Dt{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},Zi=class extends Dt{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}},fl=class extends Zi{constructor({message:t}={}){super({message:t??"Request timed out."})}},ap=class extends J{constructor(t,{cause:n}={}){super(t??"Retryable error."),n!==void 0&&(this.cause=n)}},ml=class extends Dt{},gl=class extends Dt{},hl=class extends Dt{},yl=class extends Dt{},bl=class extends Dt{},vl=class extends Dt{},wl=class extends Dt{},kl=class extends Dt{}});function Ih(e){return typeof e!="object"?{}:e??{}}function VO(e){if(!e)return!0;for(let t in e)return!1;return!0}function m5(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function BO(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}var hCe,f5,er,GO,d_,$l,hr=j(()=>{kt();hCe=/^[a-z][a-z0-9+.-]*:/i,f5=e=>hCe.test(e),er=e=>(er=Array.isArray,er(e)),GO=er;d_=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new J(`${e} must be an integer`);if(t<0)throw new J(`${e} must be a positive integer`);return t},$l=e=>{try{return JSON.parse(e)}catch{return}}});var Yi,cp=j(()=>{Yi=(e,t)=>new Promise(n=>{if(t?.aborted)return n();let i=()=>{clearTimeout(r),n()},r=setTimeout(()=>{t?.removeEventListener("abort",i),n()},e);t?.addEventListener("abort",i,{once:!0})})});var Si,Ah=j(()=>{Si="0.125.0"});function yCe(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function vCe(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:n}of e){let i=n.exec(navigator.userAgent);if(i){let r=i[1]||0,o=i[2]||0,s=i[3]||0;return{browser:t,version:`${r}.${o}.${s}`}}}return null}var b5,bCe,g5,h5,y5,Rh,p_=j(()=>{Ah();b5=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";bCe=()=>{let e=yCe();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":h5(Deno.build.os),"X-Stainless-Arch":g5(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process?.version??"unknown"};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":h5(globalThis.process.platform??"unknown"),"X-Stainless-Arch":g5(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=vCe();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};g5=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",h5=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown"),Rh=()=>y5??(y5=bCe())});function wCe(e,t){return()=>e.removeEventListener("abort",t)}function w5(e,t,n){f_.set(e,wCe(t,n))}function k5(e,t){f_.has(t)&&v5?.register(e,t,t)}function Co(e){let t=f_.get(e);t&&(f_.delete(e),v5?.unregister(e),t())}var f_,v5,m_=j(()=>{f_=new WeakMap,v5=typeof globalThis.FinalizationRegistry=="function"?new globalThis.FinalizationRegistry(e=>Co(e)):null});function $5(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function qO(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function g_(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return qO({start(){},async pull(n){let{done:i,value:r}=await t.next();i?n.close():n.enqueue(r)},async cancel(){await t.return?.()}})}function Nh(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let n=await t.read();return n?.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){let n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function _5(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var lp=j(()=>{});var Ch,S5,WO=j(()=>{Ch=class{},S5=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)})});var HO,KO,JO,x5,ZO=j(()=>{HO="RFC3986",KO=e=>String(e),JO={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:KO},x5="RFC1738"});function T5(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function QO(e,t){if(er(e)){let n=[];for(let i=0;i{ZO();hr();h_=(e,t)=>(h_=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),h_(e,t)),Po=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),YO=1024,E5=(e,t,n,i,r)=>{if(e.length===0)return e;let o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a=YO?o.slice(a,a+YO):o,l=[];for(let u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||r===x5&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=Po[d];continue}if(d<2048){l[l.length]=Po[192|d>>6]+Po[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=Po[224|d>>12]+Po[128|d>>6&63]+Po[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=Po[240|d>>18]+Po[128|d>>12&63]+Po[128|d>>6&63]+Po[128|d&63]}s+=l.join("")}return s}});function _Ce(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"}function C5(e,t,n,i,r,o,s,a,c,l,u,d,p,f,m,g,h,b){let y=e,w=b,k=0,_=!1;for(;(w=w.get(XO))!==void 0&&!_;){let A=w.get(e);if(k+=1,typeof A<"u"){if(A===k)throw new RangeError("Cyclic object value");_=!0}typeof w.get(XO)>"u"&&(k=0)}if(typeof l=="function"?y=l(t,y):y instanceof Date?y=p?.(y):n==="comma"&&er(y)&&(y=QO(y,function(A){return A instanceof Date?p?.(A):A})),y===null){if(o)return c&&!g?c(t,kn.encoder,h,"key",f):t;y=""}if(_Ce(y)||T5(y)){if(c){let A=g?t:c(t,kn.encoder,h,"key",f);return[m?.(A)+"="+m?.(c(y,kn.encoder,h,"value",f))]}return[m?.(t)+"="+m?.(String(y))]}let S=[];if(typeof y>"u")return S;let x;if(n==="comma"&&er(y))g&&c&&(y=QO(y,c)),x=[{value:y.length>0?y.join(",")||null:void 0}];else if(er(l))x=l;else{let A=Object.keys(y);x=u?A.sort(u):A}let E=a?String(t).replace(/\./g,"%2E"):String(t),T=i&&er(y)&&y.length===1?E+"[]":E;if(r&&er(y)&&y.length===0)return T+"[]";for(let A=0;A"u"?e.encodeDotInKeys?!0:kn.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:kn.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:kn.allowEmptyArrays,arrayFormat:o,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:kn.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?kn.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:kn.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:kn.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:kn.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:kn.encodeValuesOnly,filter:r,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:kn.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:kn.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:kn.strictNullHandling}}function P5(e,t={}){let n=e,i=SCe(t),r,o;typeof i.filter=="function"?(o=i.filter,n=o("",n)):er(i.filter)&&(o=i.filter,r=o);let s=[];if(typeof n!="object"||n===null)return"";let a=R5[i.arrayFormat],c=a==="comma"&&i.commaRoundTrip;r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);let l=new WeakMap;for(let p=0;p0?d+u:""}var R5,N5,A5,kn,XO,D5=j(()=>{I5();ZO();hr();R5={brackets(e){return String(e)+"[]"},comma:"comma",indices(e,t){return String(e)+"["+t+"]"},repeat(e){return String(e)}},N5=function(e,t){Array.prototype.push.apply(e,er(t)?t:[t])},kn={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:E5,encodeValuesOnly:!1,format:HO,formatter:KO,indices:!1,serializeDate(e){return(A5??(A5=Function.prototype.call.bind(Date.prototype.toISOString)))(e)},skipNulls:!1,strictNullHandling:!1};XO={}});function O5(e){return P5(e,{arrayFormat:"brackets"})}var eM=j(()=>{D5()});var Do={};_r(Do,{child_process:()=>tM,crypto:()=>Oa,fs:()=>fs,os:()=>ECe,path:()=>xe,stream:()=>y_,util:()=>nM});var tM,Oa,fs,ECe,xe,y_,nM,Mr=j(()=>{tM=gt(require("node:child_process"),1),Oa=gt(require("node:crypto"),1),fs=gt(require("node:fs"),1),ECe=gt(require("node:os"),1),xe=gt(require("node:path"),1),y_=gt(require("node:stream"),1),nM=gt(require("node:util"),1)});function v_(e){if(!e)return;let t;try{t=new URL(e)}catch(i){throw new dt(`Invalid token endpoint base URL "${e}": ${i}`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(t.protocol==="http:"&&(n==="localhost"||n==="127.0.0.1"||n==="::1")))throw new dt(`Refusing to send credential over non-https token endpoint "${e}"`)}async function w_(e,t){let n=await ICe(e),i;try{i=JSON.parse(n)}catch{throw new dt(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,Lr(n),t)}if(!i.access_token)throw new dt(`Token endpoint response missing access_token: ${JSON.stringify(Lr(i))}`,e.status,Lr(i),t);if(i.token_type&&i.token_type.toLowerCase()!=="bearer")throw new dt(`Token endpoint response: unsupported token_type "${i.token_type}" (want Bearer)`,e.status,Lr(i),t);return i}function Lr(e){if(e==null)return e;if(typeof e=="string"){let t;try{t=JSON.parse(e)}catch{return e.length<=rM?e:e.slice(0,rM)+`... <${e.length-rM} more chars>`}return JSON.stringify(Lr(t))}if(typeof e=="object"&&!Array.isArray(e)){let t={};for(let[n,i]of Object.entries(e))TCe.has(n)&&(t[n]=i);return t}return null}async function k_(e,t=n=>console.warn(`anthropic-sdk: ${n}`)){if(typeof process>"u"||process.platform==="win32")return;let{fs:n}=await Promise.resolve().then(()=>(Mr(),Do)),i=e,r;try{i=await n.promises.realpath(e),r=await n.promises.stat(i)}catch{return}let o=r.mode&511;if(o&18)throw new dt(`Credentials file at ${i} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${i}\`.`);if(o&36)throw new dt(`Credentials file at ${i} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${i}\` before retrying.`);typeof process.getuid=="function"&&r.uid!==process.getuid()&&t(`credentials file at ${i} is owned by uid ${r.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function $_(e,t){let{fs:n,path:i}=await Promise.resolve().then(()=>(Mr(),Do)),r=i.dirname(e);await n.promises.mkdir(r,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await n.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(t,null,2)),await s.sync()}finally{await s.close()}await n.promises.rename(o,e)}catch(s){throw await n.promises.unlink(o).catch(()=>{}),s}try{let s=await n.promises.open(r,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function ICe(e){if(!e.body)return"";let t=e.body.getReader(),n=[],i=0;for(;;){let{done:o,value:s}=await t.read();if(o)break;if(i+s.length>M5){let a=M5-i;a>0&&n.push(s.subarray(0,a)),await t.cancel();break}n.push(s),i+=s.length}let r;if(n.length===1)r=n[0];else{r=new Uint8Array(n.reduce((s,a)=>s+a.length,0));let o=0;for(let s of n)r.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(r)}var L5,F5,b_,_l,U5,j5,up,z5,M5,rM,TCe,dt,dp=j(()=>{kt();L5="urn:ietf:params:oauth:grant-type:jwt-bearer",F5="refresh_token",b_="/v1/oauth/token",_l="oauth-2025-04-20",U5="oidc-federation-2026-04-01",j5=120,up=30,z5=5,M5=1<<20;rM=2e3,TCe=new Set(["error","error_description","error_uri"]);dt=class extends J{constructor(t,n=null,i=null,r=null){super(t),this.statusCode=n,this.body=i,this.requestId=r}}});function Qi(){return Math.floor(Date.now()/1e3)}var Ph=j(()=>{});var __,G5=j(()=>{dp();Ph();__=class{constructor(t,n){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=t,this.onAdvisoryRefreshError=n}async getToken(){let t=this.nextForce;this.nextForce=!1;let n=this.cached;if(t||n==null)return(await this.refresh(t)).token;if(n.expiresAt==null)return n.token;let i=n.expiresAt-Qi();return i>j5?n.token:i>up?(this.backgroundRefresh(),n.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(t=!1){return this.pendingRefresh&&!t?this.pendingRefresh:this.doRefresh(t)}backgroundRefresh(){this.pendingRefresh||Qi()-this.lastAdvisoryError{this.lastAdvisoryError=Qi(),this.onAdvisoryRefreshError?.(t)})}doRefresh(t=!1){return this.pendingRefresh=this.provider(t?{forceRefresh:!0}:void 0).then(n=>(this.cached=n,this.pendingRefresh=null,n),n=>{throw this.pendingRefresh=null,n}),this.pendingRefresh}}});var ze,pp=j(()=>{ze=e=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0}});function q5(e){let t=0;for(let r of e)t+=r.length;let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.length;return n}function Ma(e){let t;return(V5??(t=new globalThis.TextEncoder,V5=t.encode.bind(t)))(e)}function Sl(e){let t;return(B5??(t=new globalThis.TextDecoder,B5=t.decode.bind(t)))(e)}var V5,B5,xl=j(()=>{});var W5,iM=j(()=>{kt();xl();W5=e=>{if(typeof globalThis.Buffer<"u"){let t=globalThis.Buffer.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(typeof atob<"u"){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;ix_[n]?Dh:t[e].bind(t)}function sM(e,t){let n=H5.get(e);if(n&&n[0]===t)return n[1];let i={error:S_("error",e,t),warn:S_("warn",e,t),info:S_("info",e,t),debug:S_("debug",e,t)};return H5.set(e,[t,i]),i}function qe(e){let t=e.logger,n=e.logLevel??"off";return t?sM(t,n):ACe}function J5(){let e=ze("ANTHROPIC_LOG");return(!oM||e!==K5)&&(K5=e,oM=sM(console,E_(e,"process.env['ANTHROPIC_LOG']",sM(console,Oh))??Oh)),oM}var Oh,x_,E_,ACe,H5,K5,oM,Oo,Xi=j(()=>{hr();pp();Oh="warn",x_={off:0,error:200,warn:300,info:400,debug:500},E_=(e,t,n)=>{if(e){if(m5(x_,e))return e;n.warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(x_))}`)}};ACe={error:Dh,warn:Dh,info:Dh,debug:Dh},H5=new WeakMap;Oo=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="authorization"||t.toLowerCase()==="api-key"||t.toLowerCase()==="x-api-key"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e)});var T_,aM=j(()=>{T_=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return T_=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^n()&15>>+i/4).toString(16))}});var cM=j(()=>{hr();iM();pp();Xi();aM();cp();eM()});function Z5(e){if(!e)throw new Error("profile name is empty");if(e==="."||e==="..")throw new Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw new Error(`profile name "${e}" must not contain path separators`);if(!RCe.test(e))throw new Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var I_,RCe,Y5,Q5,lM,NCe,X5,uM=j(()=>{p_();cM();I_="1.0",RCe=/^[A-Za-z0-9_.-]+$/;Y5=async e=>{var t,n;let i=await lM();if(i===null)return null;let r=e??await X5();if(r===null)return null;Z5(r);let{fs:o,path:s}=await Promise.resolve().then(()=>(Mr(),Do)),a=s.join(i,"configs",`${r}.json`),c;try{c=await o.promises.readFile(a,"utf-8")}catch(d){if(d?.code!=="ENOENT")throw new Error(`failed to read config file ${a}: ${d}`);c=null}if(c===null){let d=ze("ANTHROPIC_ORGANIZATION_ID"),p=ze("ANTHROPIC_IDENTITY_TOKEN_FILE"),f=ze("ANTHROPIC_FEDERATION_RULE_ID");return f&&d?{fromFile:!1,config:{organization_id:d,workspace_id:ze("ANTHROPIC_WORKSPACE_ID"),base_url:ze("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:f,service_account_id:ze("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:p?{source:"file",path:p}:void 0,scope:ze("ANTHROPIC_SCOPE")}}}:null}let l;try{l=JSON.parse(c)}catch(d){throw new Error(`failed to parse config file ${a}: ${d}`)}if(!l.authentication)throw new Error(`config file ${a} is missing "authentication"`);let u=l.authentication.type;if(u!=="oidc_federation"&&u!=="user_oauth")throw new Error(`authentication.type "${u}" is not a known authentication type`);if(l.organization_id??(l.organization_id=ze("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=ze("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=ze("ANTHROPIC_BASE_URL")),(t=l.authentication).scope??(t.scope=ze("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let d=ze("ANTHROPIC_IDENTITY_TOKEN_FILE");d&&(l.authentication.identity_token={source:"file",path:d})}l.authentication.federation_rule_id||(l.authentication.federation_rule_id=ze("ANTHROPIC_FEDERATION_RULE_ID")??""),(n=l.authentication).service_account_id??(n.service_account_id=ze("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}},Q5=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let n=await lM();if(!n)return null;let i=t??await X5();if(!i)return null;Z5(i);let{path:r}=await Promise.resolve().then(()=>(Mr(),Do));return r.join(n,"credentials",`${i}.json`)},lM=async()=>{if(!NCe())return null;let{path:e}=await Promise.resolve().then(()=>(Mr(),Do)),t=ze("ANTHROPIC_CONFIG_DIR");if(t)return t;if(Rh()["X-Stainless-OS"]==="Windows"){let o=ze("APPDATA");if(o)return e.join(o,"Anthropic");let s=ze("USERPROFILE");return s?e.join(s,"AppData","Roaming","Anthropic"):null}let i=ze("XDG_CONFIG_HOME");if(i)return e.join(i,"anthropic");let r=ze("HOME");return r?e.join(r,".config","anthropic"):null},NCe=()=>{let e=Rh()["X-Stainless-Runtime"];return e==="node"||e==="deno"},X5=async()=>{let e=await lM();if(!e)return null;let t=ze("ANTHROPIC_PROFILE");if(t)return t;let{fs:n,path:i}=await Promise.resolve().then(()=>(Mr(),Do)),r=i.join(e,"active_config");try{return(await n.promises.readFile(r,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read ${r}: ${o}`);return"default"}}});function dM(e){if(!e)throw new J("Identity token file path is empty");return async()=>{let{fs:t}=await Promise.resolve().then(()=>(Mr(),Do)),n;try{n=await t.promises.readFile(e,"utf-8")}catch(r){throw new J(`Failed to read identity token file at ${e}: ${r}`)}let i=n.trim();if(!i)throw new J(`Identity token file at ${e} is empty`);return i}}function eQ(e){if(!e)throw new J("Identity token value is empty");return()=>e}var tQ=j(()=>{kt()});function nQ(e){return async()=>{v_(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16*1024)throw new dt(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let n={grant_type:L5,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};e.serviceAccountId&&(n.service_account_id=e.serviceAccountId),e.workspaceId&&(n.workspace_id=e.workspaceId);let i=`${e.baseURL}${b_}`,r;try{r=await e.fetch(i,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${_l},${U5}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Si} oidcFederationProvider`},body:JSON.stringify(n)})}catch(c){throw new dt(`Failed to reach token endpoint ${i}: ${c}`)}let o=r.headers.get("Request-Id");if(!r.ok){let c=await r.text().catch(()=>""),l=Lr(c),u="";throw r.status===401&&(u=` Ensure your federation rule matches your identity token. ${e.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new dt(`Token exchange failed with status ${r.status}${o?` (request-id ${o})`:""}: ${l}${u}`,r.status,l,o)}let s=await w_(r,o),a=Number(s.expires_in);if(!Number.isFinite(a))throw new dt(`Token endpoint response missing required fields: ${JSON.stringify(Lr(s))}`,r.status,Lr(s),o);return{token:s.access_token,expiresAt:Qi()+a}}}var rQ=j(()=>{dp();Ph();Ah()});function iQ(e){return async t=>{let{fs:n}=await Promise.resolve().then(()=>(Mr(),Do));await k_(e.credentialsPath,e.onSafetyWarning);let i;try{i=await n.promises.readFile(e.credentialsPath,"utf-8")}catch(h){throw new dt(`Credentials file not found at ${e.credentialsPath}: ${h}`)}let r;try{r=JSON.parse(i)}catch(h){throw new dt(`Credentials file at ${e.credentialsPath} is not valid JSON: ${h}`)}let o=r.access_token;if(!o)throw new dt(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let s=r.expires_at;if(!t?.forceRefresh&&(s==null||Qi()"");throw new dt(`User OAuth refresh failed (HTTP ${u.status}): ${Lr(h)}`,u.status,Lr(h),d)}let p=await w_(u,d),f=Number(p.expires_in);if(!Number.isFinite(f))throw new dt(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Lr(p))}`,u.status,Lr(p),d);let m=Qi()+f,g=p.refresh_token||a;return await $_(e.credentialsPath,{...r,version:I_,type:"oauth_token",access_token:p.access_token,expires_at:m,refresh_token:g}),{token:p.access_token,expiresAt:m}}}var oQ=j(()=>{uM();dp();Ph();Ah()});function pM(e,t){let n=e.authentication.credentials_path??null,i=(e.base_url||t.baseURL).replace(/\/+$/,""),r=CCe(e,n,i,t),o={};return e.workspace_id&&e.authentication.type==="user_oauth"&&(o["anthropic-workspace-id"]=e.workspace_id),{provider:r,extraHeaders:o,baseURL:e.base_url||void 0}}async function sQ(e,t){let n=await Y5(t);if(!n)return null;let{config:i,fromFile:r}=n,o=i.authentication.credentials_path||!r?i:{...i,authentication:{...i.authentication,credentials_path:await Q5(i,t)??void 0}};return pM(o,e)}function CCe(e,t,n,i){switch(e.authentication.type){case"oidc_federation":{let r=e.authentication,o=PCe(r);if(!o)throw new dt("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!r.federation_rule_id)throw new dt("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new dt("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let s=nQ({identityTokenProvider:o,federationRuleId:r.federation_rule_id,organizationId:e.organization_id,serviceAccountId:r.service_account_id,workspaceId:e.workspace_id,baseURL:n,fetch:i.fetch,userAgent:i.userAgent});return t?DCe(s,t,i.onCacheWriteError,i.onSafetyWarning):s}case"user_oauth":{if(!t)throw new dt("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return iQ({credentialsPath:t,clientId:e.authentication.client_id,baseURL:n,fetch:i.fetch,userAgent:i.userAgent,onSafetyWarning:i.onSafetyWarning})}default:{let r=e.authentication.type;throw new dt(`authentication.type "${r}" is not a known authentication type`)}}}function PCe(e){if(e.identity_token){let i=e.identity_token.source;if(i!=="file")throw new dt(`identity_token.source "${i}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new dt('identity_token.source "file" requires a non-empty path');return dM(e.identity_token.path)}let t=ze("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return dM(t);let n=ze("ANTHROPIC_IDENTITY_TOKEN");return n?eQ(n):null}function DCe(e,t,n,i){return async r=>{let{fs:o}=await Promise.resolve().then(()=>(Mr(),Do));await k_(t,i);let s;try{let c=await o.promises.readFile(t,"utf-8");s=JSON.parse(c);let l=s?.access_token;if(l&&!r?.forceRefresh){let u=s?.expires_at;if(u==null||Qi(){pp();uM();dp();Ph();tQ();rQ();oQ()});function OCe(e,t){for(let r=t??0;r{gr();xl();ms=class{constructor(){Qr.set(this,void 0),Xr.set(this,void 0),M(this,Qr,new Uint8Array,"f"),M(this,Xr,null,"f")}decode(t){if(t==null)return[];let n=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?Ma(t):t;M(this,Qr,q5([v(this,Qr,"f"),n]),"f");let i=[],r;for(;(r=OCe(v(this,Qr,"f"),v(this,Xr,"f")))!=null;){if(r.carriage&&v(this,Xr,"f")==null){M(this,Xr,r.index,"f");continue}if(v(this,Xr,"f")!=null&&(r.index!==v(this,Xr,"f")+1||r.carriage)){i.push(Sl(v(this,Qr,"f").subarray(0,v(this,Xr,"f")-1))),M(this,Qr,v(this,Qr,"f").subarray(v(this,Xr,"f")),"f"),M(this,Xr,null,"f");continue}let o=v(this,Xr,"f")!==null?r.preceding-1:r.preceding,s=Sl(v(this,Qr,"f").subarray(0,o));i.push(s),M(this,Qr,v(this,Qr,"f").subarray(r.index),"f"),M(this,Xr,null,"f")}return i}flush(){return v(this,Qr,"f").length?this.decode(` -`):[]}};Qr=new WeakMap,Xr=new WeakMap;ms.NEWLINE_CHARS=new Set([` -`,"\r"]);ms.NEWLINE_REGEXP=/\r\n|[\n\r]/g});async function*lQ(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new J("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new J("Attempted to iterate over a response with no body");let n=new mM,i=new ms,r=Nh(e.body);for await(let o of MCe(r))for(let s of i.decode(o)){let a=n.decode(s);a&&(yield a)}for(let o of i.flush()){let s=n.decode(o);s&&(yield s)}}async function*MCe(e){let t=new Uint8Array;for await(let n of e){if(n==null)continue;let i=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?Ma(n):n,r=new Uint8Array(t.length+i.length);r.set(t),r.set(i,t.length),t=r;let o;for(;(o=cQ(t))!==-1;)yield t.subarray(0,o),t=t.subarray(o)}t.length>0&&(yield t)}function LCe(e,t){let n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}var Mh,Fr,mM,Lh=j(()=>{gr();kt();lp();fM();lp();Da();hr();xl();Xi();kt();m_();Fr=class e{constructor(t,n,i){this.iterator=t,Mh.set(this,void 0),this.controller=n,M(this,Mh,i,"f")}static rawEvents(t,n=new AbortController){return lQ(t,n)}static fromSSEResponse(t,n,i){let r=!1,o=i?qe(i):console;async function*s(){if(r)throw new J("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(let c of lQ(t,n)){if(c.event==="completion")try{yield JSON.parse(c.data)}catch(l){throw o.error("Could not parse message into JSON:",c.data),o.error("From chunk:",c.raw),l}if(c.event==="message_start"||c.event==="message_delta"||c.event==="message_stop"||c.event==="content_block_start"||c.event==="content_block_delta"||c.event==="content_block_stop"||c.event==="message"||c.event==="user.message"||c.event==="user.interrupt"||c.event==="user.tool_confirmation"||c.event==="user.custom_tool_result"||c.event==="user.tool_result"||c.event==="agent.message"||c.event==="agent.thinking"||c.event==="agent.tool_use"||c.event==="agent.tool_result"||c.event==="agent.mcp_tool_use"||c.event==="agent.mcp_tool_result"||c.event==="agent.custom_tool_use"||c.event==="agent.thread_context_compacted"||c.event==="session.status_running"||c.event==="session.status_idle"||c.event==="session.status_rescheduled"||c.event==="session.status_terminated"||c.event==="session.error"||c.event==="session.deleted"||c.event==="session.updated"||c.event==="span.model_request_start"||c.event==="span.model_request_end"||c.event==="span.outcome_evaluation_start"||c.event==="span.outcome_evaluation_ongoing"||c.event==="span.outcome_evaluation_end"||c.event==="user.define_outcome"||c.event==="agent.thread_message_received"||c.event==="agent.thread_message_sent"||c.event==="agent.session_thread_message_received"||c.event==="agent.session_thread_message_sent"||c.event==="session.thread_created"||c.event==="session.thread_status_created"||c.event==="session.thread_status_running"||c.event==="session.thread_status_idle"||c.event==="session.thread_status_rescheduled"||c.event==="session.thread_status_terminated"||c.event==="event_start"||c.event==="event_delta"||c.event==="system.message")try{yield JSON.parse(c.data)}catch(l){throw o.error("Could not parse message into JSON:",c.data),o.error("From chunk:",c.raw),l}if(c.event!=="ping"&&c.event==="error"){let l=$l(c.data)??c.data,u=l?.error?.type;throw new Dt(void 0,l,void 0,t.headers,u)}}a=!0}catch(c){if(Yr(c))return;throw c}finally{a||n.abort(),Co(n)}}return new e(s,n,i)}static fromReadableStream(t,n,i){let r=!1;async function*o(){let a=new ms,c=Nh(t);for await(let l of c)for(let u of a.decode(l))yield u;for(let l of a.flush())yield l}async function*s(){if(r)throw new J("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(let c of o())a||c&&(yield JSON.parse(c));a=!0}catch(c){if(Yr(c))return;throw c}finally{a||n.abort(),Co(n)}}return new e(s,n,i)}[(Mh=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],n=[],i=this.iterator(),r=o=>({next:()=>{if(o.length===0){let s=i.next();t.push(s),n.push(s)}return o.shift()}});return[new e(()=>r(t),this.controller,v(this,Mh,"f")),new e(()=>r(n),this.controller,v(this,Mh,"f"))]}toReadableStream(){let t=this,n;return qO({async start(){n=t[Symbol.asyncIterator]()},async pull(i){try{let{value:r,done:o}=await n.next();if(o)return i.close();let s=Ma(JSON.stringify(r)+` -`);i.enqueue(s)}catch(r){i.error(r)}},async cancel(){await n.return?.()}})}};mM=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(t),t.startsWith(":"))return null;let[n,i,r]=LCe(t,":");return r.startsWith(" ")&&(r=r.substring(1)),n==="event"?this.event=r:n==="data"&&this.data.push(r),null}}});async function A_(e,t){let{response:n,requestLogID:i,retryOfRequestLogID:r,startTime:o}=t,s=await(async()=>{if(t.options.stream)return qe(e).debug("response",n.status,n.url,n.headers,n.body),Fr.fromSSEResponse(n,t.controller,e);if(n.status===204)return null;if(t.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let p=await n.json();return Fh(p,n)}return await n.text()})().finally(()=>{!t.options.stream&&!t.options.__binaryResponse&&Co(t.controller)});return qe(e).debug(`[${i}] response parsed`,Oo({retryOfRequestLogID:r,url:n.url,status:n.status,body:s,durationMs:Date.now()-o})),s}function Fh(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperties(e,{_request_id:{value:t.headers.get("request-id"),enumerable:!1},_workspace_id:{value:t.headers.get("anthropic-workspace-id"),enumerable:!1}})}var R_=j(()=>{Lh();Xi();m_()});function gM(e){return typeof e=="object"&&e!==null&&dQ.has(e)}function pQ(e){let t=new Set;for(;typeof e=="object"&&e!==null&&!t.has(e);){if(t.add(e),gM(e)||Yr(e)||e instanceof Zi||e instanceof ap)return!0;e=e.cause}return!1}function hM(e,t,n,i){return async(r,o={})=>{if(t.length===0)return e.call(void 0,r,o);let s=o.headers instanceof Headers?o.headers:new Headers(o.headers),a=await UCe(e,t,n,i)({...o,headers:s,url:typeof r=="string"?r:r instanceof URL?r.href:r.url});if(a.bodyUsed||a.body?.locked)throw new J("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return a}}function FCe(e,t){let n=new WeakMap;return{options:e,logger:t?qe(t):J5(),parse(i){if(e?.stream&&i.ok)return uQ(i,e,t);let r=n.get(i);return r||(r=uQ(i,e,t),n.set(i,r)),r}}}async function uQ(e,t,n){if(e.bodyUsed||e.body?.locked)throw new J("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(t?.stream&&e.ok)return Fr.fromSSEResponse(e.clone(),new AbortController,n);if(e.status===204)return null;if(t?.__binaryResponse)return e;let r=e.headers.get("content-type")?.split(";")[0]?.trim();return r?.includes("application/json")||r?.endsWith("+json")?e.headers.get("content-length")==="0"?void 0:Fh(await e.clone().json(),e):await e.clone().text()}function UCe(e,t,n,i){let r=async({url:s,...a})=>{try{return await e.call(void 0,s,a)}catch(c){let l=pl(c);throw dQ.add(l),l}},o=FCe(n,i);for(let s=t.length-1;s>=0;s--){let a=t[s],c=r;r=async l=>a(l,c,o)}return r}var dQ,fQ=j(()=>{Da();R_();Xi();kt();Lh();dQ=new WeakSet});var Uh,La,N_=j(()=>{gr();R_();La=class e extends Promise{constructor(t,n,i=A_){super(r=>{r(null)}),this.responsePromise=n,this.parseResponse=i,Uh.set(this,void 0),M(this,Uh,t,"f")}_thenUnwrap(t){return new e(v(this,Uh,"f"),this.responsePromise,async(n,i)=>Fh(t(await this.parseResponse(n,i),i),i.response))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){let[t,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:n,request_id:n.headers.get("request-id"),workspace_id:n.headers.get("anthropic-workspace-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(v(this,Uh,"f"),t))),this.parsedPromise}then(t,n){return this.parse().then(t,n)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}};Uh=new WeakMap});var C_,jh,fp,pn,le,P_,De=j(()=>{gr();kt();R_();N_();hr();jh=class{constructor(t,n,i,r){C_.set(this,void 0),M(this,C_,t,"f"),this.options=r,this.response=n,this.body=i}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let t=this.nextPageRequestOptions();if(!t)throw new J("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await v(this,C_,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(C_=new WeakMap,Symbol.asyncIterator)](){for await(let t of this.iterPages())for(let n of t.getPaginatedItems())yield n}},fp=class extends La{constructor(t,n,i){super(t,n,async(r,o)=>new i(r,o.response,await A_(r,o),o.options))}async*[Symbol.asyncIterator](){let t=await this;for await(let n of t)yield n}},pn=class extends jh{constructor(t,n,i,r){super(t,n,i,r),this.data=i.data||[],this.has_more=i.has_more||!1,this.first_id=i.first_id||null,this.last_id=i.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let n=this.first_id;return n?{...this.options,query:{...Ih(this.options.query),before_id:n}}:null}let t=this.last_id;return t?{...this.options,query:{...Ih(this.options.query),after_id:t}}:null}},le=class extends jh{constructor(t,n,i,r){super(t,n,i,r),this.data=i.data||[],this.next_page=i.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...Ih(this.options.query),page:t}}:null}},P_=class extends jh{constructor(t,n,i,r){super(t,n,i,r),this.data=i.data||[],this.next_page=i.next_page||null,this.prev_page=i.prev_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...Ih(this.options.query),page:t}}:null}}});function El(e,t,n){return bM(),new File(e,t??"unknown_file",n)}function zh(e,t){let n=typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"";return t?n.split(/[\\/]/).pop()||void 0:n}function zCe(e){let t=typeof e=="function"?e:e.fetch,n=mQ.get(t);if(n)return n;let i=(async()=>{try{let r="Response"in t?t.Response:(await t("data:,")).constructor,o=new FormData;return o.toString()!==await new r(o).text()}catch{return!0}})();return mQ.set(t,i),i}var bM,vM,xi,mQ,GCe,yM,gs=j(()=>{lp();bM=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};vM=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",xi=async(e,t,n=!0)=>({...e,body:await GCe(e.body,t,n)}),mQ=new WeakMap;GCe=async(e,t,n=!0)=>{if(!await zCe(t))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let i=new FormData;return await Promise.all(Object.entries(e||{}).map(([r,o])=>yM(i,r,o,n))),i},yM=async(e,t,n,i)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")e.append(t,String(n));else if(n instanceof Response){let r={},o=n.headers.get("Content-Type");o&&(r={type:o}),e.append(t,El([await n.blob()],zh(n,i),r))}else if(vM(n))e.append(t,El([await new Response(g_(n)).blob()],zh(n,i)));else if(n instanceof Blob)e.append(t,El([n],zh(n,i)||void 0,{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(r=>yM(e,t+"[]",r,i)));else{if(typeof n.then=="function")throw new TypeError(`Received a Promise for "${t}"; await it first, e.g. \`await toFile(...)\``);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n))throw new TypeError(`Received ${n.constructor.name} for "${t}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``);if(typeof n=="object")await Promise.all(Object.entries(n).map(([r,o])=>yM(e,`${t}[${r}]`,o,i)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}}});async function Gh(e,t,n){if(bM(),e=await e,t||(t=zh(e,!0)),VCe(e))return e instanceof File&&t==null&&n==null?e:El([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(BCe(e)){let r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),El(await wM(r),t,n)}let i=await wM(e);if(!n?.type){let r=i.find(o=>typeof o=="object"&&"type"in o&&o.type);typeof r=="string"&&(n={...n,type:r})}return El(i,t,n)}async function wM(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(gQ(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(vM(e))for await(let n of e)t.push(...await wM(n));else{let n=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${qCe(e)}`)}return t}function qCe(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}var gQ,VCe,BCe,hQ=j(()=>{gs();gs();gQ=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",VCe=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&gQ(e),BCe=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function"});var kM=j(()=>{hQ()});var yQ=j(()=>{});var Z,Se=j(()=>{Z=class{constructor(t){this._client=t}}});function*HCe(e){if(!e)return;if(bQ in e){let{values:i,nulls:r}=e;yield*i.entries();for(let o of r)yield[o,null];return}let t=!1,n;e instanceof Headers?n=e.entries():GO(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let i of n){let r=i[0];if(typeof r!="string")throw new TypeError("expected header name to be a string");let o=GO(i[1])?i[1]:[i[1]],s=!1;for(let a of o)a!==void 0&&(t&&!s&&(s=!0,yield[r,D_]),yield[r,a])}}var bQ,D_,KCe,$M,I,Ne=j(()=>{hr();bQ=Symbol.for("brand.privateNullableHeaders");D_=Symbol("clear"),KCe=new Set(["x-stainless-helper"]),$M=(e,t)=>{let n=e?e.split(",").map(i=>i.trim()).filter(Boolean):[];for(let i of t.split(",").map(r=>r.trim()))i&&!n.includes(i)&&n.push(i);return n.join(", ")},I=e=>{let t=new Headers,n=new Set;for(let i of e){let r=new Set;for(let[o,s]of HCe(i)){let a=o.toLowerCase();if(KCe.has(a)){if(s===D_)continue;s===null?(t.delete(o),n.add(a)):(t.set(o,$M(t.get(o),s)),n.delete(a));continue}(s===D_||!r.has(a))&&(t.delete(o),r.add(a),s===D_)||(s===null?(t.delete(o),n.add(a)):(t.append(o,s),n.delete(a)))}}return{[bQ]:!0,values:t,nulls:n}}});function wQ(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var vQ,JCe,N,Me=j(()=>{kt();vQ=Object.freeze(Object.create(null)),JCe=(e=wQ)=>function(n,...i){if(n.length===1)return n[0];let r=!1,o=[],s=n.reduce((u,d,p)=>{/[?#]/.test(d)&&(r=!0);let f=i[p],m=(r?encodeURIComponent:e)(""+f);return p!==i.length&&(f==null||typeof f=="object"&&f.toString===Object.getPrototypeOf(Object.getPrototypeOf(f.hasOwnProperty??vQ)??vQ)?.toString)&&(m=f+"",o.push({start:u.length+d.length,length:m.length,error:`Value of type ${Object.prototype.toString.call(f).slice(8,-1)} is not a valid path parameter`})),u+d+(p===i.length?"":m)},""),a=s.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,l;for(;(l=c.exec(a))!==null;)o.push({start:l.index,length:l[0].length,error:`Value "${l[0]}" can't be safely passed as a path parameter`});if(o.sort((u,d)=>u.start-d.start),o.length>0){let u=0,d=o.reduce((p,f)=>{let m=" ".repeat(f.start-u),g="^".repeat(f.length);return u=f.start+f.length,p+m+g},"");throw new J(`Path parameters result in path with invalid segments: +`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=N_(t),r=Ju(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=N_(t),r=Ju(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};V2.Parser=RR});var J2=K(Pg=>{"use strict";var q2=yR(),xge=kg(),Rg=xg(),Ege=gI(),Tge=Ye(),Age=IR(),W2=PR();function H2(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Age.LineCounter||null,prettyErrors:t}}function Ige(e,t={}){let{lineCounter:n,prettyErrors:r}=H2(t),i=new W2.Parser(n?.addNewLine),o=new q2.Composer(t),s=Array.from(o.compose(i.parse(e)));if(r&&n)for(let a of s)a.errors.forEach(Rg.prettifyError(e,n)),a.warnings.forEach(Rg.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function K2(e,t={}){let{lineCounter:n,prettyErrors:r}=H2(t),i=new W2.Parser(n?.addNewLine),o=new q2.Composer(t),s=null;for(let a of o.compose(i.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Rg.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(Rg.prettifyError(e,n)),s.warnings.forEach(Rg.prettifyError(e,n))),s}function Rge(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let i=K2(e,n);if(!i)return null;if(i.warnings.forEach(o=>Ege.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function Pge(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=n??t??{};if(!i)return}return Tge.isDocument(e)&&!r?e.toString(n):new xge.Document(e,r,n).toString(n)}Pg.parse=Rge;Pg.parseAllDocuments=Ige;Pg.parseDocument=K2;Pg.stringify=Pge});var Lc=K(pt=>{"use strict";var Cge=yR(),Nge=kg(),Oge=YI(),CR=xg(),Dge=sg(),ua=Ye(),Mge=oa(),Lge=pn(),Fge=aa(),Uge=ca(),jge=P_(),zge=TR(),Gge=IR(),Bge=PR(),D_=J2(),Z2=ng();pt.Composer=Cge.Composer;pt.Document=Nge.Document;pt.Schema=Oge.Schema;pt.YAMLError=CR.YAMLError;pt.YAMLParseError=CR.YAMLParseError;pt.YAMLWarning=CR.YAMLWarning;pt.Alias=Dge.Alias;pt.isAlias=ua.isAlias;pt.isCollection=ua.isCollection;pt.isDocument=ua.isDocument;pt.isMap=ua.isMap;pt.isNode=ua.isNode;pt.isPair=ua.isPair;pt.isScalar=ua.isScalar;pt.isSeq=ua.isSeq;pt.Pair=Mge.Pair;pt.Scalar=Lge.Scalar;pt.YAMLMap=Fge.YAMLMap;pt.YAMLSeq=Uge.YAMLSeq;pt.CST=jge;pt.Lexer=zge.Lexer;pt.LineCounter=Gge.LineCounter;pt.Parser=Bge.Parser;pt.parse=D_.parse;pt.parseAllDocuments=D_.parseAllDocuments;pt.parseDocument=D_.parseDocument;pt.stringify=D_.stringify;pt.visit=Z2.visit;pt.visitAsync=Z2.visitAsync});var jd=K((GQe,WK)=>{"use strict";var jwe="2.0.0",zwe=Number.MAX_SAFE_INTEGER||9007199254740991,Gwe=16,Bwe=250,Vwe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];WK.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Gwe,MAX_SAFE_BUILD_LENGTH:Bwe,MAX_SAFE_INTEGER:zwe,RELEASE_TYPES:Vwe,SEMVER_SPEC_VERSION:jwe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Th=K((BQe,HK)=>{"use strict";var qwe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};HK.exports=qwe});var zd=K((Ro,KK)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ED,MAX_SAFE_BUILD_LENGTH:Wwe,MAX_LENGTH:Hwe}=jd(),Kwe=Th();Ro=KK.exports={};var Jwe=Ro.re=[],Zwe=Ro.safeRe=[],ge=Ro.src=[],Ywe=Ro.safeSrc=[],he=Ro.t={},Qwe=0,TD="[a-zA-Z0-9-]",Xwe=[["\\s",1],["\\d",Hwe],[TD,Wwe]],eke=e=>{for(let[t,n]of Xwe)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},Ge=(e,t,n)=>{let r=eke(t),i=Qwe++;Kwe(e,i,t),he[e]=i,ge[i]=t,Ywe[i]=r,Jwe[i]=new RegExp(t,n?"g":void 0),Zwe[i]=new RegExp(r,n?"g":void 0)};Ge("NUMERICIDENTIFIER","0|[1-9]\\d*");Ge("NUMERICIDENTIFIERLOOSE","\\d+");Ge("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${TD}*`);Ge("MAINVERSION",`(${ge[he.NUMERICIDENTIFIER]})\\.(${ge[he.NUMERICIDENTIFIER]})\\.(${ge[he.NUMERICIDENTIFIER]})`);Ge("MAINVERSIONLOOSE",`(${ge[he.NUMERICIDENTIFIERLOOSE]})\\.(${ge[he.NUMERICIDENTIFIERLOOSE]})\\.(${ge[he.NUMERICIDENTIFIERLOOSE]})`);Ge("PRERELEASEIDENTIFIER",`(?:${ge[he.NONNUMERICIDENTIFIER]}|${ge[he.NUMERICIDENTIFIER]})`);Ge("PRERELEASEIDENTIFIERLOOSE",`(?:${ge[he.NONNUMERICIDENTIFIER]}|${ge[he.NUMERICIDENTIFIERLOOSE]})`);Ge("PRERELEASE",`(?:-(${ge[he.PRERELEASEIDENTIFIER]}(?:\\.${ge[he.PRERELEASEIDENTIFIER]})*))`);Ge("PRERELEASELOOSE",`(?:-?(${ge[he.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ge[he.PRERELEASEIDENTIFIERLOOSE]})*))`);Ge("BUILDIDENTIFIER",`${TD}+`);Ge("BUILD",`(?:\\+(${ge[he.BUILDIDENTIFIER]}(?:\\.${ge[he.BUILDIDENTIFIER]})*))`);Ge("FULLPLAIN",`v?${ge[he.MAINVERSION]}${ge[he.PRERELEASE]}?${ge[he.BUILD]}?`);Ge("FULL",`^${ge[he.FULLPLAIN]}$`);Ge("LOOSEPLAIN",`[v=\\s]*${ge[he.MAINVERSIONLOOSE]}${ge[he.PRERELEASELOOSE]}?${ge[he.BUILD]}?`);Ge("LOOSE",`^${ge[he.LOOSEPLAIN]}$`);Ge("GTLT","((?:<|>)?=?)");Ge("XRANGEIDENTIFIERLOOSE",`${ge[he.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Ge("XRANGEIDENTIFIER",`${ge[he.NUMERICIDENTIFIER]}|x|X|\\*`);Ge("XRANGEPLAIN",`[v=\\s]*(${ge[he.XRANGEIDENTIFIER]})(?:\\.(${ge[he.XRANGEIDENTIFIER]})(?:\\.(${ge[he.XRANGEIDENTIFIER]})(?:${ge[he.PRERELEASE]})?${ge[he.BUILD]}?)?)?`);Ge("XRANGEPLAINLOOSE",`[v=\\s]*(${ge[he.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ge[he.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ge[he.XRANGEIDENTIFIERLOOSE]})(?:${ge[he.PRERELEASELOOSE]})?${ge[he.BUILD]}?)?)?`);Ge("XRANGE",`^${ge[he.GTLT]}\\s*${ge[he.XRANGEPLAIN]}$`);Ge("XRANGELOOSE",`^${ge[he.GTLT]}\\s*${ge[he.XRANGEPLAINLOOSE]}$`);Ge("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ED}})(?:\\.(\\d{1,${ED}}))?(?:\\.(\\d{1,${ED}}))?`);Ge("COERCE",`${ge[he.COERCEPLAIN]}(?:$|[^\\d])`);Ge("COERCEFULL",ge[he.COERCEPLAIN]+`(?:${ge[he.PRERELEASE]})?(?:${ge[he.BUILD]})?(?:$|[^\\d])`);Ge("COERCERTL",ge[he.COERCE],!0);Ge("COERCERTLFULL",ge[he.COERCEFULL],!0);Ge("LONETILDE","(?:~>?)");Ge("TILDETRIM",`(\\s*)${ge[he.LONETILDE]}\\s+`,!0);Ro.tildeTrimReplace="$1~";Ge("TILDE",`^${ge[he.LONETILDE]}${ge[he.XRANGEPLAIN]}$`);Ge("TILDELOOSE",`^${ge[he.LONETILDE]}${ge[he.XRANGEPLAINLOOSE]}$`);Ge("LONECARET","(?:\\^)");Ge("CARETTRIM",`(\\s*)${ge[he.LONECARET]}\\s+`,!0);Ro.caretTrimReplace="$1^";Ge("CARET",`^${ge[he.LONECARET]}${ge[he.XRANGEPLAIN]}$`);Ge("CARETLOOSE",`^${ge[he.LONECARET]}${ge[he.XRANGEPLAINLOOSE]}$`);Ge("COMPARATORLOOSE",`^${ge[he.GTLT]}\\s*(${ge[he.LOOSEPLAIN]})$|^$`);Ge("COMPARATOR",`^${ge[he.GTLT]}\\s*(${ge[he.FULLPLAIN]})$|^$`);Ge("COMPARATORTRIM",`(\\s*)${ge[he.GTLT]}\\s*(${ge[he.LOOSEPLAIN]}|${ge[he.XRANGEPLAIN]})`,!0);Ro.comparatorTrimReplace="$1$2$3";Ge("HYPHENRANGE",`^\\s*(${ge[he.XRANGEPLAIN]})\\s+-\\s+(${ge[he.XRANGEPLAIN]})\\s*$`);Ge("HYPHENRANGELOOSE",`^\\s*(${ge[he.XRANGEPLAINLOOSE]})\\s+-\\s+(${ge[he.XRANGEPLAINLOOSE]})\\s*$`);Ge("STAR","(<|>)?=?\\s*\\*");Ge("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Ge("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Jk=K((VQe,JK)=>{"use strict";var tke=Object.freeze({loose:!0}),nke=Object.freeze({}),rke=e=>e?typeof e!="object"?tke:e:nke;JK.exports=rke});var AD=K((qQe,QK)=>{"use strict";var ZK=/^[0-9]+$/,YK=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:eYK(t,e);QK.exports={compareIdentifiers:YK,rcompareIdentifiers:ike}});var jn=K((WQe,eJ)=>{"use strict";var Zk=Th(),{MAX_LENGTH:XK,MAX_SAFE_INTEGER:Yk}=jd(),{safeRe:Qk,t:Xk}=zd(),oke=Jk(),{compareIdentifiers:ID}=AD(),ske=(e,t)=>{let n=t.split(".");if(n.length>e.length)return!1;for(let r=0;rXK)throw new TypeError(`version is longer than ${XK} characters`);Zk("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=t.trim().match(n.loose?Qk[Xk.LOOSE]:Qk[Xk.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Yk||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Yk||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Yk||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&ot.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],i=t.prerelease[n];if(Zk("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return ID(r,i)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let r=this.build[n],i=t.build[n];if(Zk("build compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return ID(r,i)}while(++n)}inc(t,n,r){if(t.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let i=`-${n}`.match(this.options.loose?Qk[Xk.PRERELEASELOOSE]:Qk[Xk.PRERELEASE]);if(!i||i[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let o=[n,i];if(r===!1&&(o=[n]),ske(this.prerelease,n)){let s=this.prerelease[n.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};eJ.exports=RD});var Ea=K((HQe,nJ)=>{"use strict";var tJ=jn(),ake=(e,t,n=!1)=>{if(e instanceof tJ)return e;try{return new tJ(e,t)}catch(r){if(!n)return null;throw r}};nJ.exports=ake});var iJ=K((KQe,rJ)=>{"use strict";var cke=Ea(),lke=(e,t)=>{let n=cke(e,t);return n?n.version:null};rJ.exports=lke});var sJ=K((JQe,oJ)=>{"use strict";var uke=Ea(),dke=(e,t)=>{let n=uke(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};oJ.exports=dke});var lJ=K((ZQe,cJ)=>{"use strict";var aJ=jn(),pke=(e,t,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new aJ(e instanceof aJ?e.version:e,n).inc(t,r,i).version}catch{return null}};cJ.exports=pke});var pJ=K((YQe,dJ)=>{"use strict";var uJ=Ea(),fke=(e,t)=>{let n=uJ(e,null,!0),r=uJ(t,null,!0),i=n.compare(r);if(i===0)return null;let o=i>0,s=o?n:r,a=o?r:n,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return n.major!==r.major?u+"major":n.minor!==r.minor?u+"minor":n.patch!==r.patch?u+"patch":"prerelease"};dJ.exports=fke});var mJ=K((QQe,fJ)=>{"use strict";var mke=jn(),gke=(e,t)=>new mke(e,t).major;fJ.exports=gke});var hJ=K((XQe,gJ)=>{"use strict";var hke=jn(),yke=(e,t)=>new hke(e,t).minor;gJ.exports=yke});var bJ=K((eXe,yJ)=>{"use strict";var bke=jn(),vke=(e,t)=>new bke(e,t).patch;yJ.exports=vke});var _J=K((tXe,vJ)=>{"use strict";var _ke=Ea(),wke=(e,t)=>{let n=_ke(e,t);return n&&n.prerelease.length?n.prerelease:null};vJ.exports=wke});var Ai=K((nXe,kJ)=>{"use strict";var wJ=jn(),kke=(e,t,n)=>new wJ(e,n).compare(new wJ(t,n));kJ.exports=kke});var SJ=K((rXe,$J)=>{"use strict";var $ke=Ai(),Ske=(e,t,n)=>$ke(t,e,n);$J.exports=Ske});var EJ=K((iXe,xJ)=>{"use strict";var xke=Ai(),Eke=(e,t)=>xke(e,t,!0);xJ.exports=Eke});var e$=K((oXe,AJ)=>{"use strict";var TJ=jn(),Tke=(e,t,n)=>{let r=new TJ(e,n),i=new TJ(t,n);return r.compare(i)||r.compareBuild(i)};AJ.exports=Tke});var RJ=K((sXe,IJ)=>{"use strict";var Ake=e$(),Ike=(e,t)=>e.sort((n,r)=>Ake(n,r,t));IJ.exports=Ike});var CJ=K((aXe,PJ)=>{"use strict";var Rke=e$(),Pke=(e,t)=>e.sort((n,r)=>Rke(r,n,t));PJ.exports=Pke});var Ah=K((cXe,NJ)=>{"use strict";var Cke=Ai(),Nke=(e,t,n)=>Cke(e,t,n)>0;NJ.exports=Nke});var t$=K((lXe,OJ)=>{"use strict";var Oke=Ai(),Dke=(e,t,n)=>Oke(e,t,n)<0;OJ.exports=Dke});var PD=K((uXe,DJ)=>{"use strict";var Mke=Ai(),Lke=(e,t,n)=>Mke(e,t,n)===0;DJ.exports=Lke});var CD=K((dXe,MJ)=>{"use strict";var Fke=Ai(),Uke=(e,t,n)=>Fke(e,t,n)!==0;MJ.exports=Uke});var n$=K((pXe,LJ)=>{"use strict";var jke=Ai(),zke=(e,t,n)=>jke(e,t,n)>=0;LJ.exports=zke});var r$=K((fXe,FJ)=>{"use strict";var Gke=Ai(),Bke=(e,t,n)=>Gke(e,t,n)<=0;FJ.exports=Bke});var ND=K((mXe,UJ)=>{"use strict";var Vke=PD(),qke=CD(),Wke=Ah(),Hke=n$(),Kke=t$(),Jke=r$(),Zke=(e,t,n,r)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return Vke(e,n,r);case"!=":return qke(e,n,r);case">":return Wke(e,n,r);case">=":return Hke(e,n,r);case"<":return Kke(e,n,r);case"<=":return Jke(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};UJ.exports=Zke});var zJ=K((gXe,jJ)=>{"use strict";var Yke=jn(),Qke=Ea(),{safeRe:i$,t:o$}=zd(),Xke=(e,t)=>{if(e instanceof Yke)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?i$[o$.COERCEFULL]:i$[o$.COERCE]);else{let c=t.includePrerelease?i$[o$.COERCERTLFULL]:i$[o$.COERCERTL],l;for(;(l=c.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||l.index+l[0].length!==n.index+n[0].length)&&(n=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(n===null)return null;let r=n[2],i=n[3]||"0",o=n[4]||"0",s=t.includePrerelease&&n[5]?`-${n[5]}`:"",a=t.includePrerelease&&n[6]?`+${n[6]}`:"";return Qke(`${r}.${i}.${o}${s}${a}`,t)};jJ.exports=Xke});var BJ=K((hXe,GJ)=>{"use strict";var e$e=Ea(),t$e=jd(),n$e=jn(),r$e=(e,t,n)=>{if(!t$e.RELEASE_TYPES.includes(t))return null;let r=i$e(e,n);return r&&o$e(r,t)},i$e=(e,t)=>{let n=e instanceof n$e?e.version:e;return e$e(n,t)},o$e=(e,t)=>{if(s$e(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},s$e=e=>e.startsWith("pre");GJ.exports=r$e});var qJ=K((yXe,VJ)=>{"use strict";var OD=class{constructor(){this.max=1e3,this.map=new Map}get(t){let n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,n)}return this}};VJ.exports=OD});var Ii=K((bXe,JJ)=>{"use strict";var a$e=/\s+/g,DD=class e{constructor(t,n){if(n=l$e(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof MD)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(a$e," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!HJ(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&b$e(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let n=this.set[t];for(let r=0;r0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(y$e,"");let r=((this.options.includePrerelease&&g$e)|(this.options.loose&&h$e))+":"+t,i=WJ.get(r);if(i)return i;let o=this.options.loose,s=o?hr[zn.HYPHENRANGELOOSE]:hr[zn.HYPHENRANGE];t=t.replace(s,I$e(this.options.includePrerelease)),Ot("hyphen replace",t),t=t.replace(hr[zn.COMPARATORTRIM],p$e),Ot("comparator trim",t),t=t.replace(hr[zn.TILDETRIM],f$e),Ot("tilde trim",t),t=t.replace(hr[zn.CARETTRIM],m$e),Ot("caret trim",t);let a=t.split(" ").map(d=>v$e(d,this.options)).join(" ").split(/\s+/).map(d=>A$e(d,this.options));o&&(a=a.filter(d=>(Ot("loose invalid filter",d,this.options),!!d.match(hr[zn.COMPARATORLOOSE])))),Ot("range list",a);let c=new Map,l=a.map(d=>new MD(d,this.options));for(let d of l){if(HJ(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return WJ.set(r,u),u}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(r=>KJ(r,n)&&t.set.some(i=>KJ(i,n)&&r.every(o=>i.every(s=>o.intersects(s,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new u$e(t,this.options)}catch{return!1}for(let n=0;ne.value==="<0.0.0-0",b$e=e=>e.value==="",KJ=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(o=>i.intersects(o,t)),i=r.pop();return n},v$e=(e,t)=>(e=e.replace(hr[zn.BUILD],""),Ot("comp",e,t),e=$$e(e,t),Ot("caret",e),e=w$e(e,t),Ot("tildes",e),e=x$e(e,t),Ot("xrange",e),e=T$e(e,t),Ot("stars",e),e),kn=e=>!e||e.toLowerCase()==="x"||e==="*",_$e=(e,t,n)=>kn(e)&&!kn(t)||kn(t)&&n&&!kn(n),w$e=(e,t)=>e.trim().split(/\s+/).map(n=>k$e(n,t)).join(" "),k$e=(e,t)=>{let n=t.loose?hr[zn.TILDELOOSE]:hr[zn.TILDE],r=t.includePrerelease?"-0":"";return e.replace(n,(i,o,s,a,c)=>{Ot("tilde",e,i,o,s,a,c);let l;return kn(o)?l="":kn(s)?l=`>=${o}.0.0${r} <${+o+1}.0.0-0`:kn(a)?l=`>=${o}.${s}.0${r} <${o}.${+s+1}.0-0`:c?(Ot("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,Ot("tilde return",l),l})},$$e=(e,t)=>e.trim().split(/\s+/).map(n=>S$e(n,t)).join(" "),S$e=(e,t)=>{Ot("caret",e,t);let n=t.loose?hr[zn.CARETLOOSE]:hr[zn.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(i,o,s,a,c)=>{Ot("caret",e,i,o,s,a,c);let l;return kn(o)?l="":kn(s)?l=`>=${o}.0.0${r} <${+o+1}.0.0-0`:kn(a)?o==="0"?l=`>=${o}.${s}.0${r} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${r} <${+o+1}.0.0-0`:c?(Ot("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(Ot("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Ot("caret return",l),l})},x$e=(e,t)=>(Ot("replaceXRanges",e,t),e.split(/\s+/).map(n=>E$e(n,t)).join(" ")),E$e=(e,t)=>{e=e.trim();let n=t.loose?hr[zn.XRANGELOOSE]:hr[zn.XRANGE];return e.replace(n,(r,i,o,s,a,c)=>{if(Ot("xRange",e,r,i,o,s,a,c),_$e(o,s,a))return e;let l=kn(o),u=l||kn(s),d=u||kn(a),p=d;return i==="="&&p&&(i=""),c=t.includePrerelease?"-0":"",l?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&p?(u&&(s=0),a=0,i===">"?(i=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",u?o=+o+1:s=+s+1),i==="<"&&(c="-0"),r=`${i+o}.${s}.${a}${c}`):u?r=`>=${o}.0.0${c} <${+o+1}.0.0-0`:d&&(r=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),Ot("xRange return",r),r})},T$e=(e,t)=>(Ot("replaceStars",e,t),e.trim().replace(hr[zn.STAR],"")),A$e=(e,t)=>(Ot("replaceGTE0",e,t),e.trim().replace(hr[t.includePrerelease?zn.GTE0PRE:zn.GTE0],"")),I$e=e=>(t,n,r,i,o,s,a,c,l,u,d,p)=>(kn(r)?n="":kn(i)?n=`>=${r}.0.0${e?"-0":""}`:kn(o)?n=`>=${r}.${i}.0${e?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${e?"-0":""}`,kn(l)?c="":kn(u)?c=`<${+l+1}.0.0-0`:kn(d)?c=`<${l}.${+u+1}.0-0`:p?c=`<=${l}.${u}.${d}-${p}`:e?c=`<${l}.${u}.${+d+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),R$e=(e,t,n)=>{for(let r=0;r0){let i=e[r].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var Ih=K((vXe,tZ)=>{"use strict";var Rh=Symbol("SemVer ANY"),UD=class e{static get ANY(){return Rh}constructor(t,n){if(n=ZJ(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),FD("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===Rh?this.value="":this.value=this.operator+this.semver.version,FD("comp",this)}parse(t){let n=this.options.loose?YJ[QJ.COMPARATORLOOSE]:YJ[QJ.COMPARATOR],r=t.match(n);if(!r)throw new TypeError(`Invalid comparator: ${t}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new XJ(r[2],this.options.loose):this.semver=Rh}toString(){return this.value}test(t){if(FD("Comparator.test",t,this.options.loose),this.semver===Rh||t===Rh)return!0;if(typeof t=="string")try{t=new XJ(t,this.options)}catch{return!1}return LD(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new eZ(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new eZ(this.value,n).test(t.semver):(n=ZJ(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||LD(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||LD(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};tZ.exports=UD;var ZJ=Jk(),{safeRe:YJ,t:QJ}=zd(),LD=ND(),FD=Th(),XJ=jn(),eZ=Ii()});var Ph=K((_Xe,nZ)=>{"use strict";var P$e=Ii(),C$e=(e,t,n)=>{try{t=new P$e(t,n)}catch{return!1}return t.test(e)};nZ.exports=C$e});var iZ=K((wXe,rZ)=>{"use strict";var N$e=Ii(),O$e=(e,t)=>new N$e(e,t).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));rZ.exports=O$e});var sZ=K((kXe,oZ)=>{"use strict";var D$e=jn(),M$e=Ii(),L$e=(e,t,n)=>{let r=null,i=null,o=null;try{o=new M$e(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!r||i.compare(s)===-1)&&(r=s,i=new D$e(r,n))}),r};oZ.exports=L$e});var cZ=K(($Xe,aZ)=>{"use strict";var F$e=jn(),U$e=Ii(),j$e=(e,t,n)=>{let r=null,i=null,o=null;try{o=new U$e(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!r||i.compare(s)===1)&&(r=s,i=new F$e(r,n))}),r};aZ.exports=j$e});var dZ=K((SXe,uZ)=>{"use strict";var jD=jn(),z$e=Ii(),lZ=Ah(),G$e=(e,t)=>{e=new z$e(e,t);let n=new jD("0.0.0");if(e.test(n)||(n=new jD("0.0.0-0"),e.test(n)))return n;n=null;for(let r=0;r{let a=new jD(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||lZ(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||lZ(n,o))&&(n=o)}return n&&e.test(n)?n:null};uZ.exports=G$e});var fZ=K((xXe,pZ)=>{"use strict";var B$e=Ii(),V$e=(e,t)=>{try{return new B$e(e,t).range||"*"}catch{return null}};pZ.exports=V$e});var s$=K((EXe,yZ)=>{"use strict";var q$e=jn(),hZ=Ih(),{ANY:W$e}=hZ,H$e=Ii(),K$e=Ph(),mZ=Ah(),gZ=t$(),J$e=r$(),Z$e=n$(),Y$e=(e,t,n,r)=>{e=new q$e(e,r),t=new H$e(t,r);let i,o,s,a,c;switch(n){case">":i=mZ,o=J$e,s=gZ,a=">",c=">=";break;case"<":i=gZ,o=Z$e,s=mZ,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(K$e(e,t,r))return!1;for(let l=0;l{f.semver===W$e&&(f=new hZ(">=0.0.0")),d=d||f,p=p||f,i(f.semver,d.semver,r)?d=f:s(f.semver,p.semver,r)&&(p=f)}),d.operator===a||d.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0};yZ.exports=Y$e});var vZ=K((TXe,bZ)=>{"use strict";var Q$e=s$(),X$e=(e,t,n)=>Q$e(e,t,">",n);bZ.exports=X$e});var wZ=K((AXe,_Z)=>{"use strict";var eSe=s$(),tSe=(e,t,n)=>eSe(e,t,"<",n);_Z.exports=tSe});var SZ=K((IXe,$Z)=>{"use strict";var kZ=Ii(),nSe=(e,t,n)=>(e=new kZ(e,n),t=new kZ(t,n),e.intersects(t,n));$Z.exports=nSe});var EZ=K((RXe,xZ)=>{"use strict";var rSe=Ph(),iSe=Ai();xZ.exports=(e,t,n)=>{let r=[],i=null,o=null,s=e.sort((u,d)=>iSe(u,d,n));for(let u of s)rSe(u,t,n)?(o=u,i||(i=u)):(o&&r.push([i,o]),o=null,i=null);i&&r.push([i,null]);let a=[];for(let[u,d]of r)u===d?a.push(u):!d&&u===s[0]?a.push("*"):d?u===s[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length{"use strict";var TZ=Ii(),BD=Ih(),{ANY:zD}=BD,GD=Ph(),VD=Ai(),oSe=(e,t,n={})=>{if(e===t)return!0;e=new TZ(e,n),t=new TZ(t,n);let r=!1;e:for(let i of e.set){for(let o of t.set){let s=aSe(i,o,n);if(r=r||s!==null,s)continue e}if(r)return!1}return!0},sSe=[new BD(">=0.0.0-0")],AZ=[new BD(">=0.0.0")],aSe=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===zD){if(t.length===1&&t[0].semver===zD)return!0;n.includePrerelease?e=sSe:e=AZ}if(t.length===1&&t[0].semver===zD){if(n.includePrerelease)return!0;t=AZ}let r=new Set,i,o;for(let f of e)f.operator===">"||f.operator===">="?i=IZ(i,f,n):f.operator==="<"||f.operator==="<="?o=RZ(o,f,n):r.add(f.semver);if(r.size>1)return null;let s;if(i&&o){if(s=VD(i.semver,o.semver,n),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let f of r){if(i&&!GD(f,String(i),n)||o&&!GD(f,String(o),n))return null;for(let m of t)if(!GD(f,String(m),n))return!1;return!0}let a,c,l,u,d=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let f of t){if(u=u||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",i){if(p&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch&&(p=!1),f.operator===">"||f.operator===">="){if(a=IZ(i,f,n),a===f&&a!==i)return!1}else if(i.operator===">="&&!f.test(i.semver))return!1}if(o){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(c=RZ(o,f,n),c===f&&c!==o)return!1}else if(o.operator==="<="&&!f.test(o.semver))return!1}if(!f.operator&&(o||i)&&s!==0)return!1}return!(i&&l&&!o&&s!==0||o&&u&&!i&&s!==0||p||d)},IZ=(e,t,n)=>{if(!e)return t;let r=VD(e.semver,t.semver,n);return r>0?e:r<0||t.operator===">"&&e.operator===">="?t:e},RZ=(e,t,n)=>{if(!e)return t;let r=VD(e.semver,t.semver,n);return r<0?e:r>0||t.operator==="<"&&e.operator==="<="?t:e};PZ.exports=oSe});var nl=K((CXe,DZ)=>{"use strict";var qD=zd(),NZ=jd(),cSe=jn(),OZ=AD(),lSe=Ea(),uSe=iJ(),dSe=sJ(),pSe=lJ(),fSe=pJ(),mSe=mJ(),gSe=hJ(),hSe=bJ(),ySe=_J(),bSe=Ai(),vSe=SJ(),_Se=EJ(),wSe=e$(),kSe=RJ(),$Se=CJ(),SSe=Ah(),xSe=t$(),ESe=PD(),TSe=CD(),ASe=n$(),ISe=r$(),RSe=ND(),PSe=zJ(),CSe=BJ(),NSe=Ih(),OSe=Ii(),DSe=Ph(),MSe=iZ(),LSe=sZ(),FSe=cZ(),USe=dZ(),jSe=fZ(),zSe=s$(),GSe=vZ(),BSe=wZ(),VSe=SZ(),qSe=EZ(),WSe=CZ();DZ.exports={parse:lSe,valid:uSe,clean:dSe,inc:pSe,diff:fSe,major:mSe,minor:gSe,patch:hSe,prerelease:ySe,compare:bSe,rcompare:vSe,compareLoose:_Se,compareBuild:wSe,sort:kSe,rsort:$Se,gt:SSe,lt:xSe,eq:ESe,neq:TSe,gte:ASe,lte:ISe,cmp:RSe,coerce:PSe,truncate:CSe,Comparator:NSe,Range:OSe,satisfies:DSe,toComparators:MSe,maxSatisfying:LSe,minSatisfying:FSe,minVersion:USe,validRange:jSe,outside:zSe,gtr:GSe,ltr:BSe,intersects:VSe,simplifyRange:qSe,subset:WSe,SemVer:cSe,re:qD.re,src:qD.src,tokens:qD.t,SEMVER_SPEC_VERSION:NZ.SEMVER_SPEC_VERSION,RELEASE_TYPES:NZ.RELEASE_TYPES,compareIdentifiers:OZ.compareIdentifiers,rcompareIdentifiers:OZ.rcompareIdentifiers}});var Y9=K((put,Z9)=>{Z9.exports=require("util").inspect});var y5=K((fut,h5)=>{var U1=typeof Map=="function"&&Map.prototype,R1=Object.getOwnPropertyDescriptor&&U1?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,mS=U1&&R1&&typeof R1.get=="function"?R1.get:null,Q9=U1&&Map.prototype.forEach,j1=typeof Set=="function"&&Set.prototype,P1=Object.getOwnPropertyDescriptor&&j1?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,gS=j1&&P1&&typeof P1.get=="function"?P1.get:null,X9=j1&&Set.prototype.forEach,GPe=typeof WeakMap=="function"&&WeakMap.prototype,vy=GPe?WeakMap.prototype.has:null,BPe=typeof WeakSet=="function"&&WeakSet.prototype,_y=BPe?WeakSet.prototype.has:null,VPe=typeof WeakRef=="function"&&WeakRef.prototype,e5=VPe?WeakRef.prototype.deref:null,qPe=Boolean.prototype.valueOf,WPe=Object.prototype.toString,HPe=Function.prototype.toString,KPe=String.prototype.match,z1=String.prototype.slice,tc=String.prototype.replace,JPe=String.prototype.toUpperCase,t5=String.prototype.toLowerCase,u5=RegExp.prototype.test,n5=Array.prototype.concat,Uo=Array.prototype.join,ZPe=Array.prototype.slice,r5=Math.floor,O1=typeof BigInt=="function"?BigInt.prototype.valueOf:null,C1=Object.getOwnPropertySymbols,D1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,hp=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ir=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===hp||!0)?Symbol.toStringTag:null,d5=Object.prototype.propertyIsEnumerable,i5=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function o5(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||u5.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-r5(-e):r5(e);if(r!==e){var i=String(r),o=z1.call(t,i.length+1);return tc.call(i,n,"$&_")+"."+tc.call(tc.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return tc.call(t,n,"$&_")}var M1=Y9(),s5=M1.custom,a5=f5(s5)?s5:null;h5.exports=function e(t,n,r,i){var o=n||{};if(ec(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ec(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=ec(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ec(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ec(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return g5(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?o5(t,c):c}if(typeof t=="bigint"){var l=String(t)+"n";return a?o5(t,l):l}var u=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=u&&u>0&&typeof t=="object")return L1(t)?"[Array]":"[Object]";var d=mCe(o,r);if(typeof i>"u")i=[];else if(m5(i,t)>=0)return"[Circular]";function p(Y,se,L){if(se&&(i=ZPe.call(i),i.push(se)),L){var ee={depth:o.depth};return ec(o,"quoteStyle")&&(ee.quoteStyle=o.quoteStyle),e(Y,ee,r+1,i)}return e(Y,o,r+1,i)}if(typeof t=="function"&&!c5(t)){var f=oCe(t),m=fS(t,p);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(m.length>0?" { "+Uo.call(m,", ")+" }":"")}if(f5(t)){var g=hp?tc.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):D1.call(t);return typeof t=="object"&&!hp?by(g):g}if(dCe(t)){for(var h="<"+t5.call(String(t.nodeName)),v=t.attributes||[],b=0;b",h}if(L1(t)){if(t.length===0)return"[]";var _=fS(t,p);return d&&!fCe(_)?"["+F1(_,d)+"]":"[ "+Uo.call(_,", ")+" ]"}if(XPe(t)){var w=fS(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!d5.call(t,"cause")?"{ ["+String(t)+"] "+Uo.call(n5.call("[cause]: "+p(t.cause),w),", ")+" }":w.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Uo.call(w,", ")+" }"}if(typeof t=="object"&&s){if(a5&&typeof t[a5]=="function"&&M1)return M1(t,{depth:u-r});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(sCe(t)){var k=[];return Q9&&Q9.call(t,function(Y,se){k.push(p(se,t,!0)+" => "+p(Y,t))}),l5("Map",mS.call(t),k,d)}if(lCe(t)){var x=[];return X9&&X9.call(t,function(Y){x.push(p(Y,t))}),l5("Set",gS.call(t),x,d)}if(aCe(t))return N1("WeakMap");if(uCe(t))return N1("WeakSet");if(cCe(t))return N1("WeakRef");if(tCe(t))return by(p(Number(t)));if(rCe(t))return by(p(O1.call(t)));if(nCe(t))return by(qPe.call(t));if(eCe(t))return by(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!QPe(t)&&!c5(t)){var A=fS(t,p),I=i5?i5(t)===Object.prototype:t instanceof Object||t.constructor===Object,R=t instanceof Object?"":"null prototype",C=!I&&ir&&Object(t)===t&&ir in t?z1.call(nc(t),8,-1):R?"Object":"",j=I||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",z=j+(C||R?"["+Uo.call(n5.call([],C||[],R||[]),": ")+"] ":"");return A.length===0?z+"{}":d?z+"{"+F1(A,d)+"}":z+"{ "+Uo.call(A,", ")+" }"}return String(t)};function p5(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function YPe(e){return tc.call(String(e),/"/g,""")}function L1(e){return nc(e)==="[object Array]"&&(!ir||!(typeof e=="object"&&ir in e))}function QPe(e){return nc(e)==="[object Date]"&&(!ir||!(typeof e=="object"&&ir in e))}function c5(e){return nc(e)==="[object RegExp]"&&(!ir||!(typeof e=="object"&&ir in e))}function XPe(e){return nc(e)==="[object Error]"&&(!ir||!(typeof e=="object"&&ir in e))}function eCe(e){return nc(e)==="[object String]"&&(!ir||!(typeof e=="object"&&ir in e))}function tCe(e){return nc(e)==="[object Number]"&&(!ir||!(typeof e=="object"&&ir in e))}function nCe(e){return nc(e)==="[object Boolean]"&&(!ir||!(typeof e=="object"&&ir in e))}function f5(e){if(hp)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!D1)return!1;try{return D1.call(e),!0}catch{}return!1}function rCe(e){if(!e||typeof e!="object"||!O1)return!1;try{return O1.call(e),!0}catch{}return!1}var iCe=Object.prototype.hasOwnProperty||function(e){return e in this};function ec(e,t){return iCe.call(e,t)}function nc(e){return WPe.call(e)}function oCe(e){if(e.name)return e.name;var t=KPe.call(HPe.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function m5(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return g5(z1.call(e,0,t.maxStringLength),t)+r}var i=tc.call(tc.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,pCe);return p5(i,"single",t)}function pCe(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+JPe.call(t.toString(16))}function by(e){return"Object("+e+")"}function N1(e){return e+" { ? }"}function l5(e,t,n,r){var i=r?F1(n,r):Uo.call(n,", ");return e+" ("+t+") {"+i+"}"}function fCe(e){for(var t=0;t=0)return!1;return!0}function mCe(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=Uo.call(Array(e.indent+1)," ");else return null;return{base:n,prev:Uo.call(Array(t+1),n)}}function F1(e,t){if(e.length===0)return"";var n=` +`+t.prev+t.base;return n+Uo.call(e,","+n)+` +`+t.prev}function fS(e,t){var n=L1(e),r=[];if(n){r.length=e.length;for(var i=0;iie,decodeFieldSignature:()=>B7,decodeMethodSignature:()=>G7,readAssembly:()=>jS});function D1e(e){if(e.length<64||e.readUInt16LE(0)!==23117)return null;let t=e.readUInt32LE(60);if(t+24>e.length||e.readUInt32LE(t)!==17744)return null;let n=e.readUInt16LE(t+6),r=e.readUInt16LE(t+20),i=t+24;if(r===0)return null;let o=e.readUInt16LE(i),s=i+(o===523?112:96),a=[],c=i+r;for(let f=0;fe.length)break;a.push({virtualSize:e.readUInt32LE(m+8),virtualAddress:e.readUInt32LE(m+12),rawAddress:e.readUInt32LE(m+20)})}let l=e.readUInt32LE(s+112);if(l===0)return null;let u=L7(l,a);if(u===null||u+16>e.length)return null;let d=e.readUInt32LE(u+8),p=L7(d,a);return p===null?null:{offset:p,sections:a}}function L7(e,t){for(let n of t)if(e>=n.virtualAddress&&ee.length||e.readUInt32LE(t)!==1112167234)return null;let n=e.readUInt32LE(t+12),r=t+16+n+2,i=e.readUInt16LE(r);r+=2;let o=new Map;for(let c=0;c"||h.startsWith("<"))continue;let v=Y1e(r,i,l,f),b=z7(r,m[3]),_=[],w=[];for(let k of U7(m[4],f,i,4,o.length)){let x=o[k];if(!F7(x[0]))continue;let A=r.string(x[1]);A.startsWith("<")||(_.push(A),w.push(`${A}: ${B7(r,r.blob(x[2]))}`))}for(let k of U7(m[5],f,i,5,s.length)){let x=s[k];if(!F7(x[2]))continue;let A=r.string(x[3]);A.startsWith("<")||/^(get_|set_|add_|remove_)/.test(A)||(_.push(A),w.push(`${A}${G7(r,r.blob(x[4]))}`))}for(let k of u.get(f+1)??[]){let x=r.string(a[k][1]);x.startsWith("<")||(_.push(x),w.push(`${x} { get; set; }`))}for(let k of d.get(f+1)??[]){let x=r.string(c[k][1]);x.startsWith("<")||(_.push(x),w.push(`event ${x}`))}p.push({fullName:v,kind:Z1e(g,b),members:[...new Set(_)],signatures:[...new Set(w)]})}return p}function Z1e(e,t){return e&V1e?"interface":t==="System.Enum"?"enum":t==="System.ValueType"?"struct":t==="System.MulticastDelegate"||t==="System.Delegate"?"delegate":"class"}function Y1e(e,t,n,r){let i=[],o=r;for(let s=0;s<16;s++){let a=t[o];if(!a)break;i.unshift(e.string(a[1]));let c=n.get(o+1);if(c===void 0){let l=e.string(a[2]);return l?`${l}.${i.join("+")}`:i.join("+")}o=c-1}return i.join("+")}function z7(e,t){let n=t&3,r=t>>2;if(r===0)return null;if(n===0){let i=e.table(ie.TypeDef)[r-1];if(!i)return null;let o=e.string(i[2]),s=e.string(i[1]);return o?`${o}.${s}`:s}if(n===1){let i=e.table(ie.TypeRef)[r-1];if(!i)return null;let o=e.string(i[2]),s=e.string(i[1]);return o?`${o}.${s}`:s}return null}function U7(e,t,n,r,i){let o=n[t+1]?.[r]??i+1,s=[];for(let a=e;a`}let o=qo(t,n);n+=o.width;let s=po(e,t,n);n=s.offset;let a=[];for(let c=0;c=t.length);c++){let l=po(e,t,n);n=l.offset,a.push(l.text)}return`${i}(${a.join(", ")}): ${s.text}`}function B7(e,t){return t.length<2?"?":po(e,t,1).text}function po(e,t,n){let r=n,i=t[r++];if(i===void 0)return{text:"?",offset:r};let o=Q1e[i];if(o)return{text:o,offset:r};switch(i){case 15:{let s=po(e,t,r);return{text:`${s.text}*`,offset:s.offset}}case 16:{let s=po(e,t,r);return{text:`ref ${s.text}`,offset:s.offset}}case 29:{let s=po(e,t,r);return{text:`${s.text}[]`,offset:s.offset}}case 69:{let s=po(e,t,r);return{text:s.text,offset:s.offset}}case 17:case 18:{let s=qo(t,r);return r+=s.width,{text:z7(e,s.value)??"object",offset:r}}case 19:case 30:{let s=qo(t,r);return r+=s.width,{text:`${i===19?"T":"M"}${s.value}`,offset:r}}case 21:{let s=po(e,t,r);r=s.offset;let a=qo(t,r);r+=a.width;let c=[];for(let l=0;l`,offset:r}}case 20:{let s=po(e,t,r);r=s.offset;let a=qo(t,r);r+=a.width;for(let c of["sizes","lowBounds"]){let l=qo(t,r);r+=l.width;for(let u=0;u{"use strict";qt={type:"u16"},Ut={type:"u32"},Qt={type:"string"},xL={type:"guid"},kr={type:"blob"},jt=e=>({type:"rid",table:e}),Sn=e=>({type:"coded",family:e}),ie={Module:0,TypeRef:1,TypeDef:2,Field:4,MethodDef:6,Param:8,InterfaceImpl:9,MemberRef:10,Constant:11,CustomAttribute:12,FieldMarshal:13,DeclSecurity:14,ClassLayout:15,FieldLayout:16,StandAloneSig:17,EventMap:18,Event:20,PropertyMap:21,Property:23,MethodSemantics:24,MethodImpl:25,ModuleRef:26,TypeSpec:27,ImplMap:28,FieldRVA:29,Assembly:32,AssemblyRef:35,File:38,ExportedType:39,ManifestResource:40,NestedClass:41,GenericParam:42,MethodSpec:43,GenericParamConstraint:44},L1e={TypeDefOrRef:[ie.TypeDef,ie.TypeRef,ie.TypeSpec],HasConstant:[ie.Field,ie.Param,ie.Property],HasCustomAttribute:[ie.MethodDef,ie.Field,ie.TypeRef,ie.TypeDef,ie.Param,ie.InterfaceImpl,ie.MemberRef,ie.Module,ie.DeclSecurity,ie.Property,ie.Event,ie.StandAloneSig,ie.ModuleRef,ie.TypeSpec,ie.Assembly,ie.AssemblyRef,ie.File,ie.ExportedType,ie.ManifestResource,ie.GenericParam,ie.GenericParamConstraint,ie.MethodSpec],HasFieldMarshal:[ie.Field,ie.Param],HasDeclSecurity:[ie.TypeDef,ie.MethodDef,ie.Assembly],MemberRefParent:[ie.TypeDef,ie.TypeRef,ie.ModuleRef,ie.MethodDef,ie.TypeSpec],HasSemantics:[ie.Event,ie.Property],MethodDefOrRef:[ie.MethodDef,ie.MemberRef],MemberForwarded:[ie.Field,ie.MethodDef],Implementation:[ie.File,ie.AssemblyRef,ie.ExportedType],CustomAttributeType:[null,null,ie.MethodDef,ie.MemberRef,null],ResolutionScope:[ie.Module,ie.ModuleRef,ie.AssemblyRef,ie.TypeRef],TypeOrMethodDef:[ie.TypeDef,ie.MethodDef]},F1e={0:[qt,Qt,xL,xL,xL],1:[Sn("ResolutionScope"),Qt,Qt],2:[Ut,Qt,Qt,Sn("TypeDefOrRef"),jt(ie.Field),jt(ie.MethodDef)],3:[jt(ie.Field)],4:[qt,Qt,kr],5:[jt(ie.MethodDef)],6:[Ut,qt,qt,Qt,kr,jt(ie.Param)],7:[jt(ie.Param)],8:[qt,qt,Qt],9:[jt(ie.TypeDef),Sn("TypeDefOrRef")],10:[Sn("MemberRefParent"),Qt,kr],11:[qt,Sn("HasConstant"),kr],12:[Sn("HasCustomAttribute"),Sn("CustomAttributeType"),kr],13:[Sn("HasFieldMarshal"),kr],14:[qt,Sn("HasDeclSecurity"),kr],15:[qt,Ut,jt(ie.TypeDef)],16:[Ut,jt(ie.Field)],17:[kr],18:[jt(ie.TypeDef),jt(ie.Event)],19:[jt(ie.Event)],20:[qt,Qt,Sn("TypeDefOrRef")],21:[jt(ie.TypeDef),jt(ie.Property)],22:[jt(ie.Property)],23:[qt,Qt,kr],24:[qt,jt(ie.MethodDef),Sn("HasSemantics")],25:[jt(ie.TypeDef),Sn("MethodDefOrRef"),Sn("MethodDefOrRef")],26:[Qt],27:[kr],28:[qt,Sn("MemberForwarded"),Qt,jt(ie.ModuleRef)],29:[Ut,jt(ie.Field)],30:[Ut,Ut],31:[Ut],32:[Ut,qt,qt,qt,qt,Ut,kr,Qt,Qt],33:[Ut],34:[Ut,Ut,Ut],35:[qt,qt,qt,qt,Ut,kr,Qt,Qt,kr],36:[Ut,jt(ie.AssemblyRef)],37:[Ut,Ut,Ut,jt(ie.AssemblyRef)],38:[Ut,Qt,kr],39:[Ut,Ut,Qt,Qt,Sn("Implementation")],40:[Ut,Ut,Qt,Sn("Implementation")],41:[jt(ie.TypeDef),jt(ie.TypeDef)],42:[qt,qt,Sn("TypeOrMethodDef"),Qt],43:[Sn("MethodDefOrRef"),kr],44:[jt(ie.GenericParam),Sn("TypeDefOrRef")]},EL=class{constructor(t,n,r){this.strings=t;this.blobs=n;let i=r.readUInt8(6),o=r.readBigUInt64LE(8),s=new Map,a=24;for(let u=0;u<64;u++)o>>BigInt(u)&1n&&(s.set(u,r.readUInt32LE(a)),a+=4);let c={string:i&1?4:2,guid:i&2?4:2,blob:i&4?4:2},l=u=>{switch(u.type){case"u16":return 2;case"u32":return 4;case"string":return c.string;case"guid":return c.guid;case"blob":return c.blob;case"rid":return(s.get(u.table)??0)<65536?2:4;case"coded":{let d=L1e[u.family],p=Math.ceil(Math.log2(d.length));return Math.max(...d.map(m=>m===null?0:s.get(m)??0))<1<<16-p?2:4}}};for(let[u,d]of s){let p=F1e[u];if(!p)break;let f=p.map(l),m=f.reduce((h,v)=>h+v,0),g=[];for(let h=0;hr.length);h++){let v=[],b=a;for(let _ of f)v.push(_===2?r.readUInt16LE(b):r.readUInt32LE(b)),b+=_;g.push(v),a+=m}this.rows.set(u,g)}}strings;blobs;rows=new Map;table(t){return this.rows.get(t)??[]}string(t){if(t>=this.strings.length)return"";let n=t;for(;n=this.blobs.length)return Buffer.alloc(0);let{value:n,width:r}=qo(this.blobs,t);return this.blobs.subarray(t+r,t+r+n)}};U1e=7,j1e=1,z1e=2,G1e=4,B1e=7,V1e=32,q1e=7,W1e=4,H1e=6,K1e=5;Q1e={1:"void",2:"bool",3:"char",4:"sbyte",5:"byte",6:"short",7:"ushort",8:"int",9:"uint",10:"long",11:"ulong",12:"float",13:"double",14:"string",22:"TypedReference",24:"IntPtr",25:"UIntPtr",28:"object"}});function O(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}function y(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}var sr=P(()=>{});function $r(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}var Ol,Ds=P(()=>{Ol=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{let t=Object.prototype.toString.call(e);if(t==="[object Error]"||t==="[object DOMException]"){let n=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(n.stack=e.stack),e.cause&&!n.cause&&(n.cause=e.cause),e.name&&(n.name=e.name),n}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)}});var Q,_t,Xt,li,Ms,Pp,Dl,Ml,Ll,Fl,Ul,jl,zl,Gl,at=P(()=>{Ds();Q=(()=>{class e extends Error{}return e})(),_t=class e extends Q{constructor(t,n,r,i,o){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get("request-id"),this.workspaceID=i?.get("anthropic-workspace-id"),this.error=n,this.type=o??null}static makeMessage(t,n,r){let i=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):r;return t&&i?`${t} ${i}`:t?`${t} status code (no body)`:i||"(no status code or body)"}static generate(t,n,r,i){if(!t||!i)return new li({message:r,cause:Ol(n)});let o=n,s=o?.error?.type;return t===400?new Dl(t,o,r,i,s):t===401?new Ml(t,o,r,i,s):t===403?new Ll(t,o,r,i,s):t===404?new Fl(t,o,r,i,s):t===409?new Ul(t,o,r,i,s):t===422?new jl(t,o,r,i,s):t===429?new zl(t,o,r,i,s):t>=500?new Gl(t,o,r,i,s):new e(t,o,r,i,s)}},Xt=class extends _t{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},li=class extends _t{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}},Ms=class extends li{constructor({message:t}={}){super({message:t??"Request timed out."})}},Pp=class extends Q{constructor(t,{cause:n}={}){super(t??"Retryable error."),n!==void 0&&(this.cause=n)}},Dl=class extends _t{},Ml=class extends _t{},Ll=class extends _t{},Fl=class extends _t{},Ul=class extends _t{},jl=class extends _t{},zl=class extends _t{},Gl=class extends _t{}});function My(e){return typeof e!="object"?{}:e??{}}function OL(e){if(!e)return!0;for(let t in e)return!1;return!0}function Mee(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function DL(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}var qLe,Dee,ar,NL,qS,Bl,Gi=P(()=>{at();qLe=/^[a-z][a-z0-9+.-]*:/i,Dee=e=>qLe.test(e),ar=e=>(ar=Array.isArray,ar(e)),NL=ar;qS=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new Q(`${e} must be an integer`);if(t<0)throw new Q(`${e} must be a positive integer`);return t},Bl=e=>{try{return JSON.parse(e)}catch{return}}});var fo,Cp=P(()=>{fo=(e,t)=>new Promise(n=>{if(t?.aborted)return n();let r=()=>{clearTimeout(i),n()},i=setTimeout(()=>{t?.removeEventListener("abort",r),n()},e);t?.addEventListener("abort",r,{once:!0})})});var ui,Ly=P(()=>{ui="0.135.0"});function WLe(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function KLe(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:n}of e){let r=n.exec(navigator.userAgent);if(r){let i=r[1]||0,o=r[2]||0,s=r[3]||0;return{browser:t,version:`${i}.${o}.${s}`}}}return null}var jee,HLe,Lee,Fee,Uee,Fy,WS=P(()=>{Ly();jee=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";HLe=()=>{let e=WLe();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ui,"X-Stainless-OS":Fee(Deno.build.os),"X-Stainless-Arch":Lee(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ui,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process?.version??"unknown"};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ui,"X-Stainless-OS":Fee(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Lee(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=KLe();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ui,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ui,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};Lee=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",Fee=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown"),Fy=()=>Uee??(Uee=HLe())});function JLe(e,t){return()=>e.removeEventListener("abort",t)}function Gee(e,t,n){HS.set(e,JLe(t,n))}function Bee(e,t){HS.has(t)&&zee?.register(e,t,t)}function Wo(e){let t=HS.get(e);t&&(HS.delete(e),zee?.unregister(e),t())}var HS,zee,KS=P(()=>{HS=new WeakMap,zee=typeof globalThis.FinalizationRegistry=="function"?new globalThis.FinalizationRegistry(e=>Wo(e)):null});function qee(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function ML(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function JS(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ML({start(){},async pull(n){let{done:r,value:i}=await t.next();r?n.close():n.enqueue(i)},async cancel(){await t.return?.()}})}function ZLe(e){if(e[Symbol.asyncIterator])return e[Symbol.asyncIterator]();let t=e.getReader();return{async next(){try{let n=await t.read();return n?.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){let n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}}}}async function*Uy(e){let t=ZLe(e),n={};Vee?.register(n,t,n);try{for await(let r of{[Symbol.asyncIterator]:()=>t})yield r}finally{Vee?.unregister(n)}}async function ZS(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var Vee,Vl=P(()=>{Vee=typeof FinalizationRegistry>"u"?void 0:new FinalizationRegistry(async e=>{try{await e.return?.()}catch{}})});var jy,Wee,LL=P(()=>{jy=class{},Wee=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)})});var Ls,FL=P(()=>{Ls="1.9.1"});function XLe(e){let t=new Set([e]),n=new Set,r=e.match(Hee);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(c){return c===e};function o(a){return n.add(a),!1}function s(a){return t.add(a),!0}return function(c){if(t.has(c))return!0;if(n.has(c))return!1;let l=c.match(Hee);if(!l)return o(c);let u={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return u.prerelease!=null||i.major!==u.major?o(c):i.major===0?i.minor===u.minor&&i.patch<=u.patch?s(c):o(c):i.minor<=u.minor?s(c):o(c)}}var Hee,Kee,Jee=P(()=>{FL();Hee=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;Kee=XLe(Ls)});function ac(e,t,n,r=!1){var i;let o=Gy[zy]=(i=Gy[zy])!==null&&i!==void 0?i:{version:Ls};if(!r&&o[e]){let s=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(s.stack||s.message),!1}if(o.version!==Ls){let s=new Error(`@opentelemetry/api: Registration of version v${o.version} for ${e} does not match previously registered API v${Ls}`);return n.error(s.stack||s.message),!1}return o[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Ls}.`),!0}function mo(e){var t,n;let r=(t=Gy[zy])===null||t===void 0?void 0:t.version;if(!(!r||!Kee(r)))return(n=Gy[zy])===null||n===void 0?void 0:n[e]}function cc(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Ls}.`);let n=Gy[zy];n&&delete n[e]}var eFe,zy,Gy,Np=P(()=>{FL();Jee();eFe=Ls.split(".")[0],zy=Symbol.for(`opentelemetry.js.api.${eFe}`),Gy=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function By(e,t,n){let r=mo("diag");if(r)return r[e](t,...n)}var YS,Zee=P(()=>{Np();YS=class{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return By("debug",this._namespace,t)}error(...t){return By("error",this._namespace,t)}info(...t){return By("info",this._namespace,t)}warn(...t){return By("warn",this._namespace,t)}verbose(...t){return By("verbose",this._namespace,t)}}});var Sr,UL=P(()=>{(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(Sr||(Sr={}))});function Yee(e,t){eSr.ALL&&(e=Sr.ALL),t=t||{};function n(r,i){let o=t[r];return typeof o=="function"&&e>=i?o.bind(t):function(){}}return{error:n("error",Sr.ERROR),warn:n("warn",Sr.WARN),info:n("info",Sr.INFO),debug:n("debug",Sr.DEBUG),verbose:n("verbose",Sr.VERBOSE)}}var Qee=P(()=>{UL()});var tFe,di,Vy=P(()=>{Zee();Qee();UL();Np();tFe="diag",di=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(i){return function(...o){let s=mo("diag");if(s)return s[i](...o)}}let n=this,r=(i,o={logLevel:Sr.INFO})=>{var s,a,c;if(i===n){let d=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((s=d.stack)!==null&&s!==void 0?s:d.message),!1}typeof o=="number"&&(o={logLevel:o});let l=mo("diag"),u=Yee((a=o.logLevel)!==null&&a!==void 0?a:Sr.INFO,i);if(l&&!o.suppressOverrideMessage){let d=(c=new Error().stack)!==null&&c!==void 0?c:"";l.warn(`Current logger will be overwritten from ${d}`),u.warn(`Current logger will overwrite one already registered from ${d}`)}return ac("diag",u,n,!0)};n.setLogger=r,n.disable=()=>{cc(tFe,n)},n.createComponentLogger=i=>new YS(i),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var QS,Xee=P(()=>{QS=class e{constructor(t){this._entries=t?new Map(t):new Map}getEntry(t){let n=this._entries.get(t);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let r of t)n._entries.delete(r);return n}clear(){return new e}}});function ete(e={}){return new QS(new Map(Object.entries(e)))}var ygt,tte=P(()=>{Vy();Xee();ygt=di.instance()});function XS(e){return Symbol.for(e)}var jL,nte,ex=P(()=>{jL=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,i)=>{let o=new e(n._currentContext);return o._currentContext.set(r,i),o},n.deleteValue=r=>{let i=new e(n._currentContext);return i._currentContext.delete(r),i}}},nte=new jL});var rte,ite,ote=P(()=>{rte={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},ite={set(e,t,n){e!=null&&(e[t]=n)}}});var tx,ste=P(()=>{ex();tx=class{active(){return nte}with(t,n,r,...i){return n.call(r,...i)}bind(t,n){return n}enable(){return this}disable(){return this}}});var zL,nFe,Ho,qy=P(()=>{ste();Np();Vy();zL="context",nFe=new tx,Ho=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return ac(zL,t,di.instance())}active(){return this._getContextManager().active()}with(t,n,r,...i){return this._getContextManager().with(t,n,r,...i)}bind(t,n){return this._getContextManager().bind(t,n)}_getContextManager(){return mo(zL)||nFe}disable(){this._getContextManager().disable(),cc(zL,di.instance())}}});var nx,ate=P(()=>{(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(nx||(nx={}))});var GL,BL,cte,VL=P(()=>{ate();GL="0000000000000000",BL="00000000000000000000000000000000",cte={traceId:BL,spanId:GL,traceFlags:nx.NONE}});var Ko,rx=P(()=>{VL();Ko=class{constructor(t=cte){this._spanContext=t}spanContext(){return this._spanContext}setAttribute(t,n){return this}setAttributes(t){return this}addEvent(t,n){return this}addLink(t){return this}addLinks(t){return this}setStatus(t){return this}updateName(t){return this}end(t){}isRecording(){return!1}recordException(t,n){}}});function ix(e){return e.getValue(qL)||void 0}function lte(){return ix(Ho.getInstance().active())}function Wy(e,t){return e.setValue(qL,t)}function ute(e){return e.deleteValue(qL)}function dte(e,t){return Wy(e,new Ko(t))}function ox(e){var t;return(t=ix(e))===null||t===void 0?void 0:t.spanContext()}var qL,WL=P(()=>{ex();rx();qy();qL=XS("OpenTelemetry Context Key SPAN")});function pte(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r{VL();rx();sx=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])});function oFe(e){return e!==null&&typeof e=="object"&&"spanId"in e&&typeof e.spanId=="string"&&"traceId"in e&&typeof e.traceId=="string"&&"traceFlags"in e&&typeof e.traceFlags=="number"}var KL,Op,JL=P(()=>{qy();WL();rx();HL();KL=Ho.getInstance(),Op=class{startSpan(t,n,r=KL.active()){if(!!n?.root)return new Ko;let o=r&&ox(r);return oFe(o)&&ax(o)?new Ko(o):new Ko}startActiveSpan(t,n,r,i){let o,s,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(o=n,a=r):(o=n,s=r,a=i);let c=s??KL.active(),l=this.startSpan(t,o,c),u=Wy(c,l);return KL.with(u,a,void 0,l)}}});var sFe,cx,mte=P(()=>{JL();sFe=new Op,cx=class{constructor(t,n,r,i){this._provider=t,this.name=n,this.version=r,this.options=i}startSpan(t,n,r){return this._getTracer().startSpan(t,n,r)}startActiveSpan(t,n,r,i){let o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)}_getTracer(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):sFe}}});var lx,gte=P(()=>{JL();lx=class{getTracer(t,n,r){return new Op}}});var aFe,Hy,hte=P(()=>{mte();gte();aFe=new lx,Hy=class{getTracer(t,n,r){var i;return(i=this.getDelegateTracer(t,n,r))!==null&&i!==void 0?i:new cx(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:aFe}setDelegate(t){this._delegate=t}getDelegateTracer(t,n,r){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(t,n,r)}}});var Jo,yte=P(()=>{(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(Jo||(Jo={}))});var xr,bte=P(()=>{(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(xr||(xr={}))});var ln,vte=P(()=>{qy();ln=Ho.getInstance()});var ux,_te=P(()=>{ux=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function YL(e){return e.getValue(ZL)||void 0}function wte(){return YL(Ho.getInstance().active())}function kte(e,t){return e.setValue(ZL,t)}function $te(e){return e.deleteValue(ZL)}var ZL,Ste=P(()=>{qy();ex();ZL=XS("OpenTelemetry Baggage Key")});var QL,cFe,dx,xte=P(()=>{Np();_te();ote();Ste();tte();Vy();QL="propagation",cFe=new ux,dx=class e{constructor(){this.createBaggage=ete,this.getBaggage=YL,this.getActiveBaggage=wte,this.setBaggage=kte,this.deleteBaggage=$te}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return ac(QL,t,di.instance())}inject(t,n,r=ite){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=rte){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){cc(QL,di.instance())}_getGlobalPropagator(){return mo(QL)||cFe}}});var Ky,Ete=P(()=>{xte();Ky=dx.getInstance()});var XL,px,Tte=P(()=>{Np();hte();HL();WL();Vy();XL="trace",px=class e{constructor(){this._proxyTracerProvider=new Hy,this.wrapSpanContext=fte,this.isSpanContextValid=ax,this.deleteSpan=ute,this.getSpan=ix,this.getActiveSpan=lte,this.getSpanContext=ox,this.setSpan=Wy,this.setSpanContext=dte}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=ac(XL,this._proxyTracerProvider,di.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return mo(XL)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){cc(XL,di.instance()),this._proxyTracerProvider=new Hy}}});var pi,Ate=P(()=>{Tte();pi=px.getInstance()});var Zo=P(()=>{yte();bte();vte();Ete();Ate()});function Pte(e){let t=0;for(let i of e)t+=i.length;let n=new Uint8Array(t),r=0;for(let i of e)n.set(i,r),r+=i.length;return n}function Dp(e){let t;return(Ite??(t=new globalThis.TextEncoder,Ite=t.encode.bind(t)))(e)}function ql(e){let t;return(Rte??(t=new globalThis.TextDecoder,Rte=t.decode.bind(t)))(e)}var Ite,Rte,Mp=P(()=>{});function lFe(e,t){for(let i=t??0;i{sr();Mp();Jy=(()=>{class e{constructor(){fi.set(this,void 0),mi.set(this,void 0),O(this,fi,new Uint8Array,"f"),O(this,mi,null,"f")}decode(n){if(n==null)return[];let r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?Dp(n):n;O(this,fi,Pte([y(this,fi,"f"),r]),"f");let i=[],o;for(;(o=lFe(y(this,fi,"f"),y(this,mi,"f")))!=null;){if(o.carriage&&y(this,mi,"f")==null){O(this,mi,o.index,"f");continue}if(y(this,mi,"f")!=null&&(o.index!==y(this,mi,"f")+1||o.carriage)){i.push(ql(y(this,fi,"f").subarray(0,y(this,mi,"f")-1))),O(this,fi,y(this,fi,"f").subarray(y(this,mi,"f")),"f"),O(this,mi,null,"f");continue}let s=y(this,mi,"f")!==null?o.preceding-1:o.preceding,a=ql(y(this,fi,"f").subarray(0,s));i.push(a),O(this,fi,y(this,fi,"f").subarray(o.index),"f"),O(this,mi,null,"f")}return i}flush(){return y(this,fi,"f").length?this.decode(` +`):[]}}return fi=new WeakMap,mi=new WeakMap,e.NEWLINE_CHARS=new Set([` +`,"\r"]),e.NEWLINE_REGEXP=/\r\n|[\n\r]/g,e})()});var je,Wl=P(()=>{je=e=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0}});function Lp(){}function fx(e,t,n){return!t||mx[e]>mx[n]?Lp:t[e].bind(t)}function nF(e,t){let n=Cte.get(e);if(n&&n[0]===t)return n[1];let r={error:fx("error",e,t),warn:fx("warn",e,t),info:fx("info",e,t),debug:fx("debug",e,t)};return Cte.set(e,[t,r]),r}function Te(e){let t=e.logger,n=e.logLevel??"off";return t?nF(t,n):uFe}function hx(){let e=je("ANTHROPIC_LOG");return(!tF||e!==Nte)&&(Nte=e,tF=nF(console,gx(e,"process.env['ANTHROPIC_LOG']",nF(console,Zy))??Zy)),tF}function Yo(e,t,n){e.debug!==Lp&&e.debug(t,dFe(n))}var Zy,mx,gx,uFe,Cte,Nte,tF,dFe,qn=P(()=>{Gi();Wl();Zy="warn",mx={off:0,error:200,warn:300,info:400,debug:500},gx=(e,t,n)=>{if(e){if(Mee(mx,e))return e;n.warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(mx))}`)}};uFe={error:Lp,warn:Lp,info:Lp,debug:Lp},Cte=new WeakMap;dFe=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="authorization"||t.toLowerCase()==="proxy-authorization"||t.toLowerCase()==="api-key"||t.toLowerCase()==="x-api-key"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e)});async function*Ote(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Q("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Q("Attempted to iterate over a response with no body");let n=new rF,r=new Jy,i=Uy(e.body);for await(let o of i)for(let s of r.decode(o)){let a=n.decode(s);a&&(yield a)}for(let o of r.flush()){let s=n.decode(o);s&&(yield s)}}function pFe(e,t){let n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}var Yy,Cn,rF,lc=P(()=>{sr();at();Vl();eF();Vl();Ds();Gi();Mp();qn();at();KS();Cn=(()=>{class e{constructor(n,r,i){this.iterator=n,Yy.set(this,void 0),this.controller=r,O(this,Yy,i,"f")}static rawEvents(n,r=new AbortController){return Ote(n,r)}static fromSSEResponse(n,r,i){let o=!1,s=i?Te(i):console;async function*a(){if(o)throw new Q("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let c=!1;try{for await(let l of Ote(n,r)){if(l.event==="completion")try{yield JSON.parse(l.data)}catch(u){throw s.error("Could not parse message into JSON:",l.data),s.error("From chunk:",l.raw),u}if(l.event==="message_start"||l.event==="message_delta"||l.event==="message_stop"||l.event==="content_block_start"||l.event==="content_block_delta"||l.event==="content_block_stop"||l.event==="message"||l.event==="user.message"||l.event==="user.interrupt"||l.event==="user.tool_confirmation"||l.event==="user.custom_tool_result"||l.event==="user.tool_result"||l.event==="agent.message"||l.event==="agent.thinking"||l.event==="agent.tool_use"||l.event==="agent.tool_result"||l.event==="agent.mcp_tool_use"||l.event==="agent.mcp_tool_result"||l.event==="agent.custom_tool_use"||l.event==="agent.thread_context_compacted"||l.event==="session.status_running"||l.event==="session.status_idle"||l.event==="session.status_rescheduled"||l.event==="session.status_terminated"||l.event==="session.error"||l.event==="session.deleted"||l.event==="session.updated"||l.event==="span.model_request_start"||l.event==="span.model_request_end"||l.event==="span.outcome_evaluation_start"||l.event==="span.outcome_evaluation_ongoing"||l.event==="span.outcome_evaluation_end"||l.event==="user.define_outcome"||l.event==="agent.thread_message_received"||l.event==="agent.thread_message_sent"||l.event==="agent.session_thread_message_received"||l.event==="agent.session_thread_message_sent"||l.event==="session.thread_created"||l.event==="session.thread_status_created"||l.event==="session.thread_status_running"||l.event==="session.thread_status_idle"||l.event==="session.thread_status_rescheduled"||l.event==="session.thread_status_terminated"||l.event==="event_start"||l.event==="event_delta"||l.event==="system.message"||l.event==="workflow_run.created"||l.event==="workflow_run.status_running"||l.event==="workflow_run.status_idle"||l.event==="workflow_run.status_ended"||l.event==="workflow_run.error"||l.event==="workflow_run.phase_started"||l.event==="workflow_run.phase_ended")try{yield JSON.parse(l.data)}catch(u){throw s.error("Could not parse message into JSON:",l.data),s.error("From chunk:",l.raw),u}if(l.event!=="ping"&&l.event==="error"){let u=Bl(l.data)??l.data,d=u?.error?.type;throw new _t(void 0,u,void 0,n.headers,d)}}c=!0}catch(l){if($r(l))return;throw l}finally{c||r.abort(),Wo(r)}}return new e(a,r,i)}static fromReadableStream(n,r,i){let o=!1;async function*s(){let c=new Jy,l=Uy(n);for await(let u of l)for(let d of c.decode(u))yield d;for(let u of c.flush())yield u}async function*a(){if(o)throw new Q("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let c=!1;try{for await(let l of s())c||l&&(yield JSON.parse(l));c=!0}catch(l){if($r(l))return;throw l}finally{c||r.abort(),Wo(r)}}return new e(a,r,i)}[(Yy=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let n=[],r=[],i=this[Symbol.asyncIterator](),o=s=>({next:()=>{if(s.length===0){let a=i.next();n.push(a),r.push(a)}return s.shift()}});return[new e(()=>o(n),this.controller,y(this,Yy,"f")),new e(()=>o(r),this.controller,y(this,Yy,"f"))]}toReadableStream(){let n=this,r;return ML({async start(){r=n[Symbol.asyncIterator]()},async pull(i){try{let{value:o,done:s}=await r.next();if(s)return i.close();let a=Dp(JSON.stringify(o)+` +`);i.enqueue(a)}catch(o){i.error(o)}},async cancel(){await r.return?.()}})}}return e})();rF=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(t),t.startsWith(":"))return null;let[n,r,i]=pFe(t,":");return i.startsWith(" ")&&(i=i.substring(1)),n==="event"?this.event=i:n==="data"&&this.data.push(i),null}}});function*fFe(e){if(!e)return;if(Dte in e){let{values:r,nulls:i}=e;yield*r.entries();for(let o of i)yield[o,null];return}let t=!1,n;e instanceof Headers?n=e.entries():NL(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let r of n){let i=r[0];if(typeof i!="string")throw new TypeError("expected header name to be a string");let o=NL(r[1])?r[1]:[r[1]],s=!1;for(let a of o)a!==void 0&&(t&&!s&&(s=!0,yield[i,yx]),yield[i,a])}}var Dte,yx,mFe,iF,T,$e=P(()=>{Gi();Dte=Symbol.for("brand.privateNullableHeaders");yx=Symbol("clear"),mFe=new Set(["x-stainless-helper"]),iF=(e,t)=>{let n=e?e.split(",").map(r=>r.trim()).filter(Boolean):[];for(let r of t.split(",").map(i=>i.trim()))r&&!n.includes(r)&&n.push(r);return n.join(", ")},T=e=>{let t=new Headers,n=new Set;for(let r of e){let i=new Set;for(let[o,s]of fFe(r)){let a=o.toLowerCase();if(mFe.has(a)){if(s===yx)continue;s===null?(t.delete(o),n.add(a)):(t.set(o,iF(t.get(o),s)),n.delete(a));continue}(s===yx||!i.has(a))&&(t.delete(o),i.add(a),s===yx)||(s===null?(t.delete(o),n.add(a)):(t.append(o,s),n.delete(a)))}}return{[Dte]:!0,values:t,nulls:n}}});function Lte(e){let{tracerProvider:t,propagation:n,traces:r}=e===!1?{traces:!1}:e??TFe(),{enabled:i,contentMode:o,maxContentBytes:s}=typeof r=="boolean"?{enabled:r}:r??{};return Object.freeze({tracerProvider:t,propagation:n??!0,traces:Object.freeze({enabled:i??!0,contentMode:o==="content"?"content":"metadata_only",maxContentBytes:s!==void 0&&Number.isInteger(s)&&s>=1?s:EFe})})}function TFe(){return{propagation:je("ANTHROPIC_OPEN_TELEMETRY_PROPAGATION")?.toLowerCase()!=="false",traces:{enabled:je("ANTHROPIC_OPEN_TELEMETRY")?.toLowerCase()!=="false",contentMode:je("ANTHROPIC_OPEN_TELEMETRY_TRACES_CONTENT_MODE")?.toLowerCase()==="content"?"content":"metadata_only",maxContentBytes:Number(/^\d+$/.exec(je("ANTHROPIC_OPEN_TELEMETRY_TRACES_MAX_CONTENT_BYTES")??"")?.[0]??NaN)}}}function Fte(e,t,n){if(!e.traces.enabled)return;let r=n!==void 0?`${Mte}.${n}`:Mte;return(e.tracerProvider??pi.getTracerProvider()).getTracer(r,t)}function nt(e,t){try{return t()}catch(n){e&&Te(e).debug("could not record telemetry",n);return}}function $(e,t,n,r){if(n?.__span)return n.__span;let i=e._tracer;if(i)return nt(e,()=>{let o=Date.now(),s=r?.attributes?.[xFe],a=n?.openTelemetry?.conversationId??(typeof s=="string"?s:void 0),c=i.startSpan(t,{kind:Jo.CLIENT,attributes:{[Hl]:e._genAIProviderName,...AFe(e.baseURL),...a!=null?{[Qy]:a}:void 0,...r?.route!=null?{[bFe]:r.route}:void 0,...r?.attributes}});if(!(!c.isRecording()&&!(e.openTelemetry.propagation?Object.keys(Bte(c)).length>0:pi.isSpanContextValid(c.spanContext()))))return{...r,span:c,name:t,startTime:o}})}function Ute(e,t){if(e.createdIDAttribute===void 0||typeof t!="object"||t===null)return;let n=t[e.createdIDField??"id"];typeof n=="string"&&e.span.setAttribute(e.createdIDAttribute,n)}function AFe(e){try{let{hostname:t,port:n,protocol:r}=new URL(e);return{[vFe]:t.replace(/^\[(.*)\]$/,"$1"),[_Fe]:n?Number(n):r==="http:"?80:443}}catch{return{}}}function jte(e,t,n,r=!1){if(e.attempts=(e.attempts??0)+1,e.attempts>1){e.span.setAttribute(yFe,e.attempts-1);return}e.span.setAttribute(hFe,t);try{let{protocol:i,host:o,pathname:s,search:a}=new URL(n),c=RFe(a.slice(1),e.queryParams,e.contentQueryParams);if(e.span.setAttributes({[SFe]:i.slice(0,-1),[kFe]:s}),c?.content&&!r)return;e.span.setAttributes({...c!==void 0?{[$Fe]:c.value}:void 0,[wFe]:`${i}//${o}${s}${c!==void 0?`?${c.value}`:""}`})}catch{}}function RFe(e,t,n){if(!e||!t?.length)return;let r=!1,i=e.split("&").filter(o=>{try{let s=decodeURIComponent(o.split("=",1)[0]),a=t.includes(s)||!s.endsWith("[]")?s:s.slice(0,-2);return t.includes(a)?(r||(r=IFe.includes(a)||!!n?.includes(a)),!0):!1}catch{return!1}});return i.length?{value:i.join("&"),content:r}:void 0}function zte(e,t){let n=T([t]).values;for(let[r,i]of Object.entries(Bte(e)))n.set(r,i);return n}function uc(e,t){if(e.isRecording()){switch(PFe(e,t),t.status){case"success":e.setStatus({code:xr.OK});break;case"error":Bi(e,t.error);break}e.end()}}function oF(e,t,n){let r=e[Symbol.asyncIterator],i=!1,o=c=>{if(!i){i=!0,t.removeEventListener("abort",s);try{n.onEnd(c)}catch{}}},s=()=>o({reason:"canceled"});if(t.aborted)return s();t.addEventListener("abort",s,{once:!0});let a=!1;e[Symbol.asyncIterator]=function(){let c=r.call(this);if(a)return c;a=!0,t.removeEventListener("abort",s);let l={async next(){let u;try{u=await c.next()}catch(d){throw o({reason:"failed",error:d}),d}if(u.done)o({reason:t.aborted?"canceled":"completed"});else if(!i)try{n.onItem?.(u.value)}catch{}return u},async return(u){return s(),await c.return?.(u)??{done:!0,value:u}},async throw(u){if(s(),c.throw)return c.throw(u);throw u},[Symbol.asyncIterator]:()=>l};return l}}function Gte(e,t,n){if(!e.isRecording())return;e.setAttribute(bx,n.response.status);let r=t instanceof Cn;oF(t,n.controller.signal,{onEnd(i){i.reason==="failed"?Bi(e,i.error):i.reason==="completed"&&!r&&e.setStatus({code:xr.OK}),e.end()}})}function PFe(e,t){let n=t.response?.status??(t.status==="error"&&t.error instanceof _t?t.error.status:void 0);n!==void 0&&e.setAttribute(bx,n)}function Bi(e,t,n){t instanceof Xt||$r(t)||(e.setStatus({code:xr.ERROR}),e.setAttribute(gFe,n??CFe(t)))}function Bte(e){let t={};return Ky.inject(pi.setSpan(ln.active(),e),t),t}function CFe(e){if(e instanceof Ms)return"client_timeout_error";if(e instanceof li)return"connection_error";if(e instanceof _t){if(e.type)return e.type;if(e.status!==void 0)return String(e.status)}return"client_error"}var Mte,gFe,Qy,Hl,hFe,yFe,bx,bFe,vFe,_Fe,wFe,kFe,$Fe,SFe,xFe,EFe,IFe,X=P(()=>{Zo();at();lc();Ds();$e();Wl();qn();Mte="com.anthropic.sdk.typescript",gFe="error.type",Qy="gen_ai.conversation.id",Hl="gen_ai.provider.name",hFe="http.request.method",yFe="http.request.resend_count",bx="http.response.status_code",bFe="http.route",vFe="server.address",_Fe="server.port",wFe="url.full",kFe="url.path",$Fe="url.query",SFe="url.scheme",xFe="anthropic.session.thread.id",EFe=75e4;IFe=["email","path_prefix","expected_content_sha256"]});var sF,aF,cF,Vte,lF=P(()=>{sF="RFC3986",aF=e=>String(e),cF={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:aF},Vte="RFC1738"});function Wte(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function dF(e,t){if(ar(e)){let n=[];for(let r=0;r{lF();Gi();vx=(e,t)=>(vx=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),vx(e,t)),Qo=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),uF=1024,qte=(e,t,n,r,i)=>{if(e.length===0)return e;let o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a=uF?o.slice(a,a+uF):o,l=[];for(let u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===Vte&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=Qo[d];continue}if(d<2048){l[l.length]=Qo[192|d>>6]+Qo[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=Qo[224|d>>12]+Qo[128|d>>6&63]+Qo[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=Qo[240|d>>18]+Qo[128|d>>12&63]+Qo[128|d>>6&63]+Qo[128|d&63]}s+=l.join("")}return s}});function NFe(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"}function Yte(e,t,n,r,i,o,s,a,c,l,u,d,p,f,m,g,h,v){let b=e,_=v,w=0,k=!1;for(;(_=_.get(pF))!==void 0&&!k;){let C=_.get(e);if(w+=1,typeof C<"u"){if(C===w)throw new RangeError("Cyclic object value");k=!0}typeof _.get(pF)>"u"&&(w=0)}if(typeof l=="function"?b=l(t,b):b instanceof Date?b=p?.(b):n==="comma"&&ar(b)&&(b=dF(b,function(C){return C instanceof Date?p?.(C):C})),b===null){if(o)return c&&!g?c(t,xn.encoder,h,"key",f):t;b=""}if(NFe(b)||Wte(b)){if(c){let C=g?t:c(t,xn.encoder,h,"key",f);return[m?.(C)+"="+m?.(c(b,xn.encoder,h,"value",f))]}return[m?.(t)+"="+m?.(String(b))]}let x=[];if(typeof b>"u")return x;let A;if(n==="comma"&&ar(b))g&&c&&(b=dF(b,c)),A=[{value:b.length>0?b.join(",")||null:void 0}];else if(ar(l))A=l;else{let C=Object.keys(b);A=u?C.sort(u):C}let I=a?String(t).replace(/\./g,"%2E"):String(t),R=r&&ar(b)&&b.length===1?I+"[]":I;if(i&&ar(b)&&b.length===0)return R+"[]";for(let C=0;C"u"?e.encodeDotInKeys?!0:xn.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:xn.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:xn.allowEmptyArrays,arrayFormat:o,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:xn.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?xn.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:xn.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:xn.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:xn.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:xn.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:xn.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:xn.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:xn.strictNullHandling}}function Qte(e,t={}){let n=e,r=OFe(t),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):ar(r.filter)&&(o=r.filter,i=o);let s=[];if(typeof n!="object"||n===null)return"";let a=Jte[r.arrayFormat],c=a==="comma"&&r.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);let l=new WeakMap;for(let p=0;p0?d+u:""}var Jte,Zte,Kte,xn,pF,Xte=P(()=>{Hte();lF();Gi();Jte={brackets(e){return String(e)+"[]"},comma:"comma",indices(e,t){return String(e)+"["+t+"]"},repeat(e){return String(e)}},Zte=function(e,t){Array.prototype.push.apply(e,ar(t)?t:[t])},xn={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:qte,encodeValuesOnly:!1,format:sF,formatter:aF,indices:!1,serializeDate(e){return(Kte??(Kte=Function.prototype.call.bind(Date.prototype.toISOString)))(e)},skipNulls:!1,strictNullHandling:!1};pF={}});function ene(e){return Qte(e,{arrayFormat:"brackets"})}var fF=P(()=>{Xte()});var Xo={};Cr(Xo,{child_process:()=>mF,crypto:()=>Fs,fs:()=>Us,os:()=>MFe,path:()=>Pe,stream:()=>_x,util:()=>gF});var mF,Fs,Us,MFe,Pe,_x,gF,qr=P(()=>{mF=$t(require("node:child_process"),1),Fs=$t(require("node:crypto"),1),Us=$t(require("node:fs"),1),MFe=$t(require("node:os"),1),Pe=$t(require("node:path"),1),_x=$t(require("node:stream"),1),gF=$t(require("node:util"),1)});function kx(e){if(!e)return;let t;try{t=new URL(e)}catch(r){throw new mt(`Invalid token endpoint base URL "${e}": ${r}`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(t.protocol==="http:"&&(n==="localhost"||n==="127.0.0.1"||n==="::1")))throw new mt(`Refusing to send credential over non-https token endpoint "${e}"`)}async function $x(e,t){let n=await FFe(e),r;try{r=JSON.parse(n)}catch{throw new mt(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,Wr(n),t)}if(!r.access_token)throw new mt(`Token endpoint response missing access_token: ${JSON.stringify(Wr(r))}`,e.status,Wr(r),t);if(r.token_type&&r.token_type.toLowerCase()!=="bearer")throw new mt(`Token endpoint response: unsupported token_type "${r.token_type}" (want Bearer)`,e.status,Wr(r),t);return r}function Wr(e){if(e==null)return e;if(typeof e=="string"){let t;try{t=JSON.parse(e)}catch{return e.length<=hF?e:e.slice(0,hF)+`... <${e.length-hF} more chars>`}return JSON.stringify(Wr(t))}if(typeof e=="object"&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))LFe.has(n)&&(t[n]=r);return t}return null}async function Sx(e,t=n=>console.warn(`anthropic-sdk: ${n}`)){if(typeof process>"u"||process.platform==="win32")return;let{fs:n}=await Promise.resolve().then(()=>(qr(),Xo)),r=e,i;try{r=await n.promises.realpath(e),i=await n.promises.stat(r)}catch{return}let o=i.mode&511;if(o&18)throw new mt(`Credentials file at ${r} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${r}\`.`);if(o&36)throw new mt(`Credentials file at ${r} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${r}\` before retrying.`);typeof process.getuid=="function"&&i.uid!==process.getuid()&&t(`credentials file at ${r} is owned by uid ${i.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function xx(e,t){let{fs:n,path:r}=await Promise.resolve().then(()=>(qr(),Xo)),i=r.dirname(e);await n.promises.mkdir(i,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await n.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(t,null,2)),await s.sync()}finally{await s.close()}await n.promises.rename(o,e)}catch(s){throw await n.promises.unlink(o).catch(()=>{}),s}try{let s=await n.promises.open(i,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function FFe(e){if(!e.body)return"";let t=e.body.getReader(),n=[],r=0;for(;;){let{done:o,value:s}=await t.read();if(o)break;if(r+s.length>tne){let a=tne-r;a>0&&n.push(s.subarray(0,a)),await t.cancel();break}n.push(s),r+=s.length}let i;if(n.length===1)i=n[0];else{i=new Uint8Array(n.reduce((s,a)=>s+a.length,0));let o=0;for(let s of n)i.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(i)}var nne,rne,wx,Kl,ine,one,Fp,sne,tne,hF,LFe,mt,Up=P(()=>{at();nne="urn:ietf:params:oauth:grant-type:jwt-bearer",rne="refresh_token",wx="/v1/oauth/token",Kl="oauth-2025-04-20",ine="oidc-federation-2026-04-01",one=120,Fp=30,sne=5,tne=1<<20;hF=2e3,LFe=new Set(["error","error_description","error_uri"]);mt=class extends Q{constructor(t,n=null,r=null,i=null){super(t),this.statusCode=n,this.body=r,this.requestId=i}}});function go(){return Math.floor(Date.now()/1e3)}var Xy=P(()=>{});var Ex,ane=P(()=>{Up();Xy();Ex=class{constructor(t,n){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=t,this.onAdvisoryRefreshError=n}async getToken(){let t=this.nextForce;this.nextForce=!1;let n=this.cached;if(t||n==null)return(await this.refresh(t)).token;if(n.expiresAt==null)return n.token;let r=n.expiresAt-go();return r>one?n.token:r>Fp?(this.backgroundRefresh(),n.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(t=!1){return this.pendingRefresh&&!t?this.pendingRefresh:this.doRefresh(t)}backgroundRefresh(){this.pendingRefresh||go()-this.lastAdvisoryError{this.lastAdvisoryError=go(),this.onAdvisoryRefreshError?.(t)})}doRefresh(t=!1){return this.pendingRefresh=this.provider(t?{forceRefresh:!0}:void 0).then(n=>(this.cached=n,this.pendingRefresh=null,n),n=>{throw this.pendingRefresh=null,n}),this.pendingRefresh}}});var cne,jp,eb,Jl,Tx,lne,js,une,Ax,dne,pne,fne,mne,gne,hne,yne,zp,bne,vne,_ne,wne,kne,$ne,Sne,xne,Ene,Tne,Ane,Ine,Rne,Ix,Pne,UFe,jFe,zFe,Cne,Nne,One,Dne,Mne,Lne,Fne,Une,tb,jne,zne,Gne,Bne,Vne,qne,zs=P(()=>{X();X();cne="gen_ai.agent.name",jp="gen_ai.input.messages",eb="gen_ai.operation.name",Jl="gen_ai.output.messages",Tx="gen_ai.output.type",lne="gen_ai.request.max_tokens",js="gen_ai.request.model",une="gen_ai.request.reasoning.level",Ax="gen_ai.request.stop_sequences",dne="gen_ai.request.stream",pne="gen_ai.request.temperature",fne="gen_ai.request.top_k",mne="gen_ai.request.top_p",gne="gen_ai.response.id",hne="gen_ai.response.model",yne="gen_ai.response.time_to_first_chunk",zp="gen_ai.system_instructions",bne="gen_ai.tool.call.arguments",vne="gen_ai.tool.call.id",_ne="gen_ai.tool.description",wne="gen_ai.tool.name",kne="gen_ai.tool.type",$ne="gen_ai.usage.cache_write.input_tokens",Sne="gen_ai.usage.cache_read.input_tokens",xne="gen_ai.usage.input_tokens",Ene="gen_ai.usage.output_tokens",Tne="gen_ai.usage.reasoning.output_tokens",Ane="chat",Ine="execute_tool",Rne="invoke_agent",Ix="json",Pne="function",UFe="anthropic.request.id",jFe="anthropic.organization.id",zFe="anthropic.workspace.id",Cne="anthropic.beta",Nne="anthropic.content.truncated",One="anthropic.message.stop_reason",Dne="anthropic.message.count_tokens.input_tokens",Mne="anthropic.request.service_tier",Lne="anthropic.response.service_tier",Fne="anthropic.thinking.budget_tokens",Une="anthropic.thinking.type",tb="anthropic.tool_result.content",jne="anthropic.toolset.name",zne="anthropic.usage.cache_creation.ephemeral_1h_input_tokens",Gne="anthropic.usage.cache_creation.ephemeral_5m_input_tokens",Bne="anthropic.usage.compaction.input_tokens",Vne="anthropic.usage.compaction.output_tokens",qne=[[UFe,"request-id"],[jFe,"anthropic-organization-id"],[zFe,"anthropic-workspace-id"]]});function rb(e,t,n,r){let i=e.span,o=e.requestContentSize;if(n!==void 0&&o!==void 0){let a=JSON.stringify([{role:"assistant",parts:Rx(n)}]);if(o+3*a.length<=r||o+Px(a)<=r){i.setAttribute(Jl,a);return}}let s=vF(i,{[Ax]:t.stop_sequences?.length?[...t.stop_sequences]:void 0,[zp]:t.system===void 0?void 0:Rx(t.system),[jp]:t.messages.map(a=>({role:a.role,parts:Rx(a.content)})),[Jl]:n===void 0?void 0:[{role:"assistant",parts:Rx(n)}]},r);n===void 0&&(e.requestContentSize=s)}function Rx(e){return typeof e=="string"?[{type:"text",content:e}]:e?.map(GFe)??[]}function GFe(e){switch(e.type){case"text":return{type:"text",content:e.text};case"thinking":return{type:"reasoning",content:e.thinking};case"tool_use":return{type:"tool_call",id:e.id,name:e.name,arguments:e.input,...typeof e.toolset_name=="string"?{anthropic_toolset_name:e.toolset_name}:void 0};case"server_tool_use":return{type:"tool_call",id:e.id,name:e.name,arguments:e.input};case"mcp_tool_use":return{type:"tool_call",id:e.id,name:e.name,arguments:e.input,anthropic_mcp_server_name:e.server_name};case"tool_result":return{type:"tool_call_response",id:e.tool_use_id,response:bF(e.content)};default:return typeof e.type!="string"?{type:"anthropic_unknown"}:e.type.endsWith("_tool_result")&&"tool_use_id"in e?{type:"tool_call_response",id:e.tool_use_id,response:BFe(e.content)}:{type:`anthropic_${e.type}`}}}function bF(e){return e==null?[]:typeof e=="string"?[{type:"text",text:e}]:e.map(t=>t.type==="text"||t.type==="search_result"?nb(t):typeof t.type!="string"?{type:"unknown"}:{type:t.type})}function BFe(e){return e==null?[]:typeof e=="string"?[{type:"text",text:e}]:Array.isArray(e)?e.map(t=>t.type==="text"||t.type==="search_result"||t.type==="web_search_result"?nb(t):typeof t.type!="string"?{type:"unknown"}:{type:t.type}):[nb(e)]}function nb(e){if(Array.isArray(e))return e.map(nb);if(typeof e!="object"||e===null)return e;let{type:t,file_type:n}=e;if(t==="image"||t==="document")return{type:t};let r=t==="text_editor_code_execution_view_result"&&(n==="image"||n==="pdf");return Object.fromEntries(Object.entries(e).filter(([i])=>!i.startsWith("encrypted_")&&!(i==="content"&&r)).map(([i,o])=>[i,nb(o)]))}function vF(e,t,n){let{[Ax]:r,[zp]:i,[jp]:o,[Jl]:s,[tb]:a,...c}=t,l={[zp]:i,[jp]:o,[Jl]:s},u={},d=a?.map(w=>JSON.stringify(w)),f=3*([...r??[],...d??[]].reduce((w,k)=>w+k.length+1,2)+yF(c,u)+yF(l,u))<=n?w=>3*w.length:Px,m=()=>Object.keys(l).reduce((w,k)=>w+f(u[k]??""),0),g=r?.reduce((w,k)=>w+f(k),0)??0,h=r!==void 0&&g<=n,v=h?g:0,b=r!==void 0&&!h;for(let w of Object.keys(c)){let k=f(u[w]??"");k>n?(delete u[w],b=!0):v+=k}let _=m();if(v+_>n){let{truncated:w,...k}=VFe(l,v+_-n);b||(b=w),yF(k,u),_=m()}if(v+=_,d!==void 0){let w=WFe(d,n-v,f);u[tb]=w.json,v+=w.size,b||(b=w.truncated)}b&&e.setAttribute(Nne,!0),h&&e.setAttribute(Ax,r);for(let[w,k]of Object.entries(u))e.setAttribute(w,k);return v}function yF(e,t){let n=0;for(let[r,i]of Object.entries(e))i!==void 0&&(t[r]=JSON.stringify(i),n+=t[r].length);return n}function VFe(e,t){let n=l=>l?.map(u=>({...u,parts:[...u.parts]})),r=e[zp]?.slice(),i=n(e[jp]),o=n(e[Jl]),s=[r??[],...[...i??[],...o??[]].map(({parts:l})=>l)],a=s.reduce((l,u)=>l+u.length,0),c=!1;for(let l of s){let u=0;for(;t>0&&u65535?2:1,d=l!==92?u:o[2+a]==="u"?6:2;if(c+=l<128?d:l<2048?2:l<65536?3:4,c>r)break;a+=d,s+=u}return t.slice(0,s)}function WFe(e,t,n){let r=[],i=2;for(let o of e){let s=i+(r.length===0?0:1)+n(o);if(s>t)break;r.push(o),i=s}return{json:"["+r.join(",")+"]",size:i,truncated:r.length=55296&&r<56320&&(e.charCodeAt(n+1)&64512)===56320?(t+=4,n++):t+=3}return t}var Cx=P(()=>{zs()});function Nx(e,t,n,r){e.setAttribute(gne,t.id),e.setAttribute(hne,t.model),e.setAttribute(xne,n.input_tokens+(n.cache_read_input_tokens??0)+(n.cache_creation_input_tokens??0)),n.cache_creation_input_tokens!=null&&e.setAttribute($ne,n.cache_creation_input_tokens),n.cache_read_input_tokens!=null&&e.setAttribute(Sne,n.cache_read_input_tokens);let i=n.cache_creation;if(i!=null&&(e.setAttribute(Gne,i.ephemeral_5m_input_tokens),e.setAttribute(zne,i.ephemeral_1h_input_tokens)),n.service_tier!=null&&e.setAttribute(Lne,n.service_tier),!r)return;e.setAttribute(Ene,n.output_tokens);let o=n.output_tokens_details;o!=null&&e.setAttribute(Tne,o.thinking_tokens);let s=n.iterations?.filter(a=>a.type==="compaction")??[];s.length>0&&(e.setAttribute(Bne,s.reduce((a,c)=>a+c.input_tokens+c.cache_read_input_tokens+c.cache_creation_input_tokens,0)),e.setAttribute(Vne,s.reduce((a,c)=>a+c.output_tokens,0))),t.stop_reason!=null&&e.setAttribute(One,t.stop_reason)}var _F=P(()=>{zs()});function Zl(e,t,n){if(t.isRecording())try{let r=n.status==="error"?n.error:void 0,i=n.response?.headers??(r instanceof _t?r.headers:void 0);for(let[o,s]of qne){let a=i?.get(s);a&&t.setAttribute(o,a)}}catch(r){Te(e).debug("could not record the API call on its span",r)}}function Gs(e,t,n){let r={[eb]:Ane,[js]:t.model};try{let i=(T([e._options.defaultHeaders,n]).values.get("anthropic-beta")??"").split(",").map(a=>a.trim()).filter(Boolean);i.length&&(r[Cne]=i),r[lne]=t.max_tokens,t.temperature!=null&&(r[pne]=t.temperature),t.top_p!=null&&(r[mne]=t.top_p),t.top_k!=null&&(r[fne]=t.top_k),t.stream===!0&&(r[dne]=!0),t.output_config?.format?.type==="json_schema"&&(r[Tx]=Ix);let o=t.output_config?.effort;o!=null&&(r[une]=o),t.service_tier!=null&&(r[Mne]=t.service_tier);let s=t.thinking;s!=null&&(r[Une]=s.type),s?.type==="enabled"&&(r[Fne]=s.budget_tokens)}catch(i){Te(e).debug("could not record the request on its span",i)}return{route:"/v1/messages",attributes:r}}function ib(e,t,n){if(!t?.span.isRecording())return t;try{let{contentMode:r,maxContentBytes:i}=e.openTelemetry.traces;r==="content"&&rb(t,n,void 0,i)}catch(r){Te(e).debug("could not record the request on its span",r)}return t}function ob(e,t,n,r){if(!t?.span.isRecording()||r instanceof Cn)return;let i=t.span;try{Nx(i,r,r.usage,!0);let{contentMode:o,maxContentBytes:s}=e.openTelemetry.traces;o==="content"&&rb(t,n,r.content,s)}catch(o){Te(e).debug("could not record the response on its span",o)}}function sb(e,t,n){try{t?.span.setAttribute(Dne,n.input_tokens)}catch(r){Te(e).debug("could not record the response on its span",r)}}function wF(e,t,n){try{t?.span.setAttributes({[cne]:n.agent.name,[js]:n.agent.model.id})}catch(r){Te(e).debug("could not record the response on its span",r)}}var Wne=P(()=>{at();lc();$e();qn();zs();Cx();_F()});function Hne(){let e=new Set(["traceparent","tracestate","baggage"]);try{for(let t of Ky.fields())e.add(t.toLowerCase())}catch(t){hx().debug("could not record telemetry",t)}return e}var Kne=P(()=>{Zo();qn()});function Ox(e){let t=Hne(),n=Array.from(e.entries()).filter(([r])=>t.has(r));for(let[r]of n)e.delete(r);return n}function kF(e){return(t,n,r)=>{let i=new Headers(t.headers),o=Ox(i);return e({...t,headers:i},s=>{let a=new Headers(s.headers);for(let[c,l]of o)a.set(c,l);return n({...s,headers:a})},r)}}var Jne=P(()=>{Kne()});function Gp(e,t,n,r){if(!(!t.span.isRecording()||e.openTelemetry.traces.contentMode!=="content"))try{rb(t,n,r.content,e.openTelemetry.traces.maxContentBytes)}catch(i){Te(e).debug("could not record the streamed message on its span",i)}}function $F(e,t,n,r){r.options.__span?.name==="anthropic.messages.create"&&n instanceof Cn?HFe(e,t,n,r):Gte(t,n,r)}function HFe(e,t,n,r){if(!t.isRecording())return;t.setAttribute(bx,r.response.status);let i=r.options.__span,o=i?.startTime,s,a,c=!1,l=!1,u=!1;oF(n,r.controller.signal,{onItem(d){try{switch(d.type){case"message_start":{let{id:p,model:f,stop_reason:m}=d.message;s={id:p,model:f,stop_reason:m},a={...d.message.usage};break}case"content_block_start":s&&d.content_block.type==="fallback"&&(s.model=d.content_block.to.model);break;case"message_delta":s&&a&&(a.output_tokens=d.usage.output_tokens,d.usage.input_tokens!=null&&(a.input_tokens=d.usage.input_tokens),d.usage.cache_creation_input_tokens!=null&&(a.cache_creation_input_tokens=d.usage.cache_creation_input_tokens),d.usage.cache_read_input_tokens!=null&&(a.cache_read_input_tokens=d.usage.cache_read_input_tokens),d.usage.output_tokens_details!=null&&(a.output_tokens_details=d.usage.output_tokens_details),"iterations"in d.usage&&d.usage.iterations!=null&&(a.iterations=d.usage.iterations),d.delta.stop_reason!=null&&(s.stop_reason=d.delta.stop_reason),l=!0);break;case"message_stop":u=!0;break;case"content_block_delta":!c&&o!==void 0&&t.setAttribute(yne,(Date.now()-o)/1e3),c=!0;break;case"content_block_stop":break;default:}}catch(p){Te(e).debug("could not record the stream on its span",p)}},onEnd(d){try{s&&a&&Nx(t,s,a,l||u)}catch(f){Te(e).debug("could not record the stream on its span",f)}let p=i?.failure;!u&&i?.streamed&&p===void 0&&Gp(e,i,i.streamed.body,i.streamed.message),d.reason==="failed"?Bi(t,d.error):p!==void 0?Bi(t,p,"client_error"):d.reason==="completed"&&(u?t.setStatus({code:xr.OK}):Bi(t,new Q("The stream ended before message_stop."),"api_error")),nt(e,()=>t.end())}})}var Zne=P(()=>{Zo();at();lc();X();qn();zs();Cx();_F()});function SF(e,t,n){return e._tracer?.startSpan("anthropic.environment.work",{kind:Jo.INTERNAL,attributes:{[Hl]:e._genAIProviderName,"anthropic.environment.id":t.environment_id,"anthropic.environment.work.id":t.id,"anthropic.session.id":t.data.id}},n)}function Dx(e,t){e?.isRecording()&&(t.aborted||e.setStatus({code:xr.OK}),e.end())}function Mx(e,t,n){e?.isRecording()&&(t.aborted||Bi(e,n),e.end())}async function xF(e,t,n,r){if(!t)return r();try{await ln.with(pi.setSpan(ln.active(),t),r)}catch(i){throw nt(e,()=>Mx(t,n,i)),i}nt(e,()=>Dx(t,n))}var Yne=P(()=>{Zo();X();zs()});function Lx(e){return{[es]:e}}function Bs(e){return typeof e=="object"&&e!==null&&ho in e}function EF(e,t){let n=new Set;if(e)for(let r of e)Bs(r)&&n.add(r[ho]);if(t)for(let r of t){Bs(r)&&n.add(r[ho]);let i=r.content;if(Array.isArray(i))for(let o of i){Bs(o)&&n.add(o[ho]);let s=o?.tool?.definition;Bs(s)&&n.add(s[ho])}}return Array.from(n)}function Fx(e,t){let n=EF(e,t);return n.length===0?{}:{[es]:n.join(", ")}}function Ux(e){return Bs(e)?{[es]:e[ho]}:{}}var es,Bp,ho,gi=P(()=>{es="x-stainless-helper",Bp="x-stainless-helper-method";ho=Symbol("anthropic.sdk.stainlessHelper")});function TF(e,t,n){if(!e._tracer)return;let r=t.output_config?.format?.type==="json_schema"||t.output_format?.type==="json_schema";return e._tracer.startSpan("anthropic.messages.tool_runner",{kind:Jo.INTERNAL,attributes:{[eb]:Rne,[Hl]:e._genAIProviderName,[js]:t.model,...r?{[Tx]:Ix}:void 0,...n!=null?{[Qy]:n}:void 0}})}async function Vp(e,t,n,r,i){let o=e._tracer;if(!o)return i();let{signal:s,conversationId:a,sessionID:c,parentContext:l=ln.active()}=r,u="description"in t?t.description:void 0,d={[eb]:Ine,[Hl]:e._genAIProviderName,[wne]:n.name,..."toolset_name"in n&&typeof n.toolset_name=="string"?{[jne]:n.toolset_name}:void 0,...u?{[_ne]:u}:void 0,[vne]:n.id,[kne]:Pne,...a!=null?{[Qy]:a}:void 0,...c!=null?{"anthropic.session.id":c}:void 0,..."session_thread_id"in n&&n.session_thread_id!=null?{"anthropic.session.thread.id":n.session_thread_id}:void 0},p=n.type==="agent.tool_use"?"anthropic.tool_use":Bs(t)&&t[ho]==="mcpTool"?"anthropic.mcp_tool_use":"anthropic.custom_tool_use",f=nt(e,()=>o.startSpan(`${p} ${n.name}`,{kind:Jo.INTERNAL,attributes:d},l));if(!f)return i();let m;try{return m=await ln.with(pi.setSpan(l,f),i),m}finally{let g=m!==void 0&&!m.isError,h=!g&&s?.aborted===!0,{contentMode:v,maxContentBytes:b}=e.openTelemetry.traces;if(v==="content"&&f.isRecording())try{vF(f,{[bne]:n.input,[tb]:m&&!h?bF(m.content):void 0},b)}catch(_){Te(e).debug("could not record the tool run on its span",_)}nt(e,()=>{g?f.setStatus({code:xr.OK}):h||Bi(f,m,"tool_error"),f.end()})}}var Qne=P(()=>{Zo();gi();X();qn();zs();Cx()});var Hr=P(()=>{Wne();Jne();Zne();Yne();Qne()});var Xne,AF=P(()=>{at();Xne=e=>{if(typeof globalThis.Buffer<"u"){let t=globalThis.Buffer.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(typeof atob<"u"){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r{jx=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return jx=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^n()&15>>+r/4).toString(16))}});var ere=P(()=>{Gi();AF();Wl();qn();IF();Cp();fF()});function tre(e){if(!e)throw new Error("profile name is empty");if(e==="."||e==="..")throw new Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw new Error(`profile name "${e}" must not contain path separators`);if(!KFe.test(e))throw new Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var zx,KFe,nre,rre,RF,JFe,ire,PF=P(()=>{WS();ere();zx="1.0",KFe=/^[A-Za-z0-9_.-]+$/;nre=async e=>{var t,n;let r=await RF();if(r===null)return null;let i=e??await ire();if(i===null)return null;tre(i);let{fs:o,path:s}=await Promise.resolve().then(()=>(qr(),Xo)),a=s.join(r,"configs",`${i}.json`),c;try{c=await o.promises.readFile(a,"utf-8")}catch(d){if(d?.code!=="ENOENT")throw new Error(`failed to read config file ${a}: ${d}`);c=null}if(c===null){let d=je("ANTHROPIC_ORGANIZATION_ID"),p=je("ANTHROPIC_IDENTITY_TOKEN_FILE"),f=je("ANTHROPIC_FEDERATION_RULE_ID");return f&&d?{fromFile:!1,config:{organization_id:d,workspace_id:je("ANTHROPIC_WORKSPACE_ID"),base_url:je("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:f,service_account_id:je("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:p?{source:"file",path:p}:void 0,scope:je("ANTHROPIC_SCOPE")}}}:null}let l;try{l=JSON.parse(c)}catch(d){throw new Error(`failed to parse config file ${a}: ${d}`)}if(!l.authentication)throw new Error(`config file ${a} is missing "authentication"`);let u=l.authentication.type;if(u!=="oidc_federation"&&u!=="user_oauth")throw new Error(`authentication.type "${u}" is not a known authentication type`);if(l.organization_id??(l.organization_id=je("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=je("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=je("ANTHROPIC_BASE_URL")),(t=l.authentication).scope??(t.scope=je("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let d=je("ANTHROPIC_IDENTITY_TOKEN_FILE");d&&(l.authentication.identity_token={source:"file",path:d})}l.authentication.federation_rule_id||(l.authentication.federation_rule_id=je("ANTHROPIC_FEDERATION_RULE_ID")??""),(n=l.authentication).service_account_id??(n.service_account_id=je("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}},rre=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let n=await RF();if(!n)return null;let r=t??await ire();if(!r)return null;tre(r);let{path:i}=await Promise.resolve().then(()=>(qr(),Xo));return i.join(n,"credentials",`${r}.json`)},RF=async()=>{if(!JFe())return null;let{path:e}=await Promise.resolve().then(()=>(qr(),Xo)),t=je("ANTHROPIC_CONFIG_DIR");if(t)return t;if(Fy()["X-Stainless-OS"]==="Windows"){let o=je("APPDATA");if(o)return e.join(o,"Anthropic");let s=je("USERPROFILE");return s?e.join(s,"AppData","Roaming","Anthropic"):null}let r=je("XDG_CONFIG_HOME");if(r)return e.join(r,"anthropic");let i=je("HOME");return i?e.join(i,".config","anthropic"):null},JFe=()=>{let e=Fy()["X-Stainless-Runtime"];return e==="node"||e==="deno"},ire=async()=>{let e=await RF();if(!e)return null;let t=je("ANTHROPIC_PROFILE");if(t)return t;let{fs:n,path:r}=await Promise.resolve().then(()=>(qr(),Xo)),i=r.join(e,"active_config");try{return(await n.promises.readFile(i,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read ${i}: ${o}`);return"default"}}});function CF(e){if(!e)throw new Q("Identity token file path is empty");return async()=>{let{fs:t}=await Promise.resolve().then(()=>(qr(),Xo)),n;try{n=await t.promises.readFile(e,"utf-8")}catch(i){throw new Q(`Failed to read identity token file at ${e}: ${i}`)}let r=n.trim();if(!r)throw new Q(`Identity token file at ${e} is empty`);return r}}function ore(e){if(!e)throw new Q("Identity token value is empty");return()=>e}var sre=P(()=>{at()});function are(e){return async()=>{kx(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16*1024)throw new mt(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let n={grant_type:nne,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};e.serviceAccountId&&(n.service_account_id=e.serviceAccountId),e.workspaceId&&(n.workspace_id=e.workspaceId);let r=`${e.baseURL}${wx}`,i;try{i=await e.fetch(r,{method:"POST",redirect:"manual",headers:{"Content-Type":"application/json","anthropic-beta":`${Kl},${ine}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${ui} oidcFederationProvider`},body:JSON.stringify(n)})}catch(c){throw new mt(`Failed to reach token endpoint ${r}: ${c}`)}let o=i.headers.get("Request-Id");if(!i.ok){let c=await i.text().catch(()=>""),l=Wr(c),u="";throw i.status===401&&(u=` Ensure your federation rule matches your identity token. ${e.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new mt(`Token exchange failed with status ${i.status}${o?` (request-id ${o})`:""}: ${l}${u}`,i.status,l,o)}let s=await $x(i,o),a=Number(s.expires_in);if(!Number.isFinite(a))throw new mt(`Token endpoint response missing required fields: ${JSON.stringify(Wr(s))}`,i.status,Wr(s),o);return{token:s.access_token,expiresAt:go()+a}}}var cre=P(()=>{Up();Xy();Ly()});function lre(e){return async t=>{let{fs:n}=await Promise.resolve().then(()=>(qr(),Xo));await Sx(e.credentialsPath,e.onSafetyWarning);let r;try{r=await n.promises.readFile(e.credentialsPath,"utf-8")}catch(h){throw new mt(`Credentials file not found at ${e.credentialsPath}: ${h}`)}let i;try{i=JSON.parse(r)}catch(h){throw new mt(`Credentials file at ${e.credentialsPath} is not valid JSON: ${h}`)}let o=i.access_token;if(!o)throw new mt(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let s=i.expires_at;if(!t?.forceRefresh&&(s==null||go()"");throw new mt(`User OAuth refresh failed (HTTP ${u.status}): ${Wr(h)}`,u.status,Wr(h),d)}let p=await $x(u,d),f=Number(p.expires_in);if(!Number.isFinite(f))throw new mt(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Wr(p))}`,u.status,Wr(p),d);let m=go()+f,g=p.refresh_token||a;return await xx(e.credentialsPath,{...i,version:zx,type:"oauth_token",access_token:p.access_token,expires_at:m,refresh_token:g}),{token:p.access_token,expiresAt:m}}}var ure=P(()=>{PF();Up();Xy();Ly()});function NF(e,t){let n=e.authentication.credentials_path??null,r=(e.base_url||t.baseURL).replace(/\/+$/,""),i=ZFe(e,n,r,t),o={};return e.workspace_id&&e.authentication.type==="user_oauth"&&(o["anthropic-workspace-id"]=e.workspace_id),{provider:i,extraHeaders:o,baseURL:e.base_url||void 0}}async function dre(e,t){let n=await nre(t);if(!n)return null;let{config:r,fromFile:i}=n,o=r.authentication.credentials_path||!i?r:{...r,authentication:{...r.authentication,credentials_path:await rre(r,t)??void 0}};return NF(o,e)}function ZFe(e,t,n,r){switch(e.authentication.type){case"oidc_federation":{let i=e.authentication,o=YFe(i);if(!o)throw new mt("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!i.federation_rule_id)throw new mt("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new mt("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let s=are({identityTokenProvider:o,federationRuleId:i.federation_rule_id,organizationId:e.organization_id,serviceAccountId:i.service_account_id,workspaceId:e.workspace_id,baseURL:n,fetch:r.fetch,userAgent:r.userAgent});return t?QFe(s,t,r.onCacheWriteError,r.onSafetyWarning):s}case"user_oauth":{if(!t)throw new mt("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return lre({credentialsPath:t,clientId:e.authentication.client_id,baseURL:n,fetch:r.fetch,userAgent:r.userAgent,onSafetyWarning:r.onSafetyWarning})}default:{let i=e.authentication.type;throw new mt(`authentication.type "${i}" is not a known authentication type`)}}}function YFe(e){if(e.identity_token){let r=e.identity_token.source;if(r!=="file")throw new mt(`identity_token.source "${r}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new mt('identity_token.source "file" requires a non-empty path');return CF(e.identity_token.path)}let t=je("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return CF(t);let n=je("ANTHROPIC_IDENTITY_TOKEN");return n?ore(n):null}function QFe(e,t,n,r){return async i=>{let{fs:o}=await Promise.resolve().then(()=>(qr(),Xo));await Sx(t,r);let s;try{let c=await o.promises.readFile(t,"utf-8");s=JSON.parse(c);let l=s?.access_token;if(l&&!i?.forceRefresh){let u=s?.expires_at;if(u==null||go(){Wl();PF();Up();Xy();sre();cre();ure()});async function Gx(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:i,startTime:o}=t,s=await(async()=>{if(t.options.stream)return Te(e).debug("response",n.status,n.url,n.headers,n.body),Cn.fromSSEResponse(n,t.controller,e);if(n.status===204)return null;if(t.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let p=await n.json();return ab(p,n)}return await n.text()})().finally(()=>{!t.options.stream&&!t.options.__binaryResponse&&Wo(t.controller)});return Yo(Te(e),`[${r}] response parsed`,{retryOfRequestLogID:i,url:n.url,status:n.status,body:s,durationMs:Date.now()-o}),s}function ab(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperties(e,{_request_id:{value:t.headers.get("request-id"),enumerable:!1},_workspace_id:{value:t.headers.get("anthropic-workspace-id"),enumerable:!1}})}var Bx=P(()=>{lc();qn();KS()});function OF(e){return typeof e=="object"&&e!==null&&mre.has(e)}function gre(e){let t=new Set;for(;typeof e=="object"&&e!==null&&!t.has(e);){if(t.add(e),OF(e)||$r(e)||e instanceof li||e instanceof Pp)return!0;e=e.cause}return!1}function DF(e,t,n,r){return async(i,o={})=>{if(t.length===0)return e.call(void 0,i,o);let s=o.headers instanceof Headers?o.headers:new Headers(o.headers),a=await eUe(e,t,n,r)({...o,headers:s,url:typeof i=="string"?i:i instanceof URL?i.href:i.url});if(a.bodyUsed||a.body?.locked)throw new Q("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return a}}function XFe(e,t){let n=new WeakMap;return{options:e,logger:t?Te(t):hx(),parse(r){if(e?.stream&&r.ok)return fre(r,e,t);let i=n.get(r);return i||(i=fre(r,e,t),n.set(r,i)),i}}}async function fre(e,t,n){if(e.bodyUsed||e.body?.locked)throw new Q("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(t?.stream&&e.ok)return Cn.fromSSEResponse(e.clone(),new AbortController,n);if(e.status===204)return null;if(t?.__binaryResponse)return e;let i=e.headers.get("content-type")?.split(";")[0]?.trim();return i?.includes("application/json")||i?.endsWith("+json")?e.headers.get("content-length")==="0"?void 0:ab(await e.clone().json(),e):await e.clone().text()}function eUe(e,t,n,r){let i=async({url:s,...a})=>{try{return await e.call(void 0,s,a)}catch(c){let l=Ol(c);throw mre.add(l),l}},o=XFe(n,r);for(let s=t.length-1;s>=0;s--){let a=t[s],c=i;i=async l=>a(l,c,o)}return i}var mre,hre=P(()=>{Ds();Bx();qn();at();lc();mre=new WeakSet});function Yl(e,t,n){return LF(),new File(e,t??"",n)}function cb(e,t){let n=typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"";return t?n.split(/[\\/]/).pop()||void 0:n}function tUe(e){let t=typeof e=="function"?e:e.fetch,n=yre.get(t);if(n)return n;let r=(async()=>{try{let i="Response"in t?t.Response:(await t("data:,")).constructor,o=new FormData;return o.toString()!==await new i(o).text()}catch{return!0}})();return yre.set(t,r),r}var LF,lb,Nn,yre,nUe,MF,hi=P(()=>{Vl();X();LF=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};lb=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",Nn=async(e,t,n=!0)=>{try{return{...e,body:await nUe(e.body,t,n)}}catch(r){let i=e.__span?.span;throw i&&nt(typeof t=="function"?void 0:t,()=>uc(i,{status:"error",options:e,error:r})),r}},yre=new WeakMap;nUe=async(e,t,n=!0)=>{if(!await tUe(t))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let r=new FormData;return await Promise.all(Object.entries(e||{}).map(([i,o])=>MF(r,i,o,n))),r},MF=async(e,t,n,r)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")e.append(t,String(n));else if(n instanceof Response){let i={},o=n.headers.get("Content-Type");o&&(i={type:o}),e.append(t,Yl([await n.blob()],cb(n,r),i))}else if(lb(n))e.append(t,Yl([await new Response(JS(n)).blob()],cb(n,r)));else if(n instanceof Blob){let o=typeof File<"u"&&n instanceof File?n.name:cb(n,r);e.append(t,Yl([n],o,{type:n.type}))}else if(Array.isArray(n))await Promise.all(n.map(i=>MF(e,t+"[]",i,r)));else{if(typeof n.then=="function")throw new TypeError(`Received a Promise for "${t}"; await it first, e.g. \`await toFile(...)\``);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n))throw new TypeError(`Received ${n.constructor.name} for "${t}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``);if(typeof n=="object")await Promise.all(Object.entries(n).map(([i,o])=>MF(e,`${t}[${i}]`,o,r)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}}});var Er,Ql,Vx=P(()=>{sr();Bx();X();hi();Hr();Ql=(()=>{class e extends Promise{constructor(n,r,i=Gx){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=i,Er.set(this,void 0),O(this,Er,n,"f")}_thenUnwrap(n){return new e(y(this,Er,"f"),this.responsePromise,async(r,i)=>ab(n(await this.parseResponse(r,i),i),i.response))}asResponse(){return this.responsePromise.then(n=>{let r=n.options.__span?.span;if(r&&!this.parsedPromise){let i={status:"success",...n,data:void 0};Zl(y(this,Er,"f"),r,i),nt(y(this,Er,"f"),()=>uc(r,i))}return n.response})}async withResponse(){let[n,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:n,response:r,request_id:r.headers.get("request-id"),workspace_id:r.headers.get("anthropic-workspace-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(n=>this.parseResponseTraced(n))),this.parsedPromise}async parseResponseTraced(n){let r=n.options.__span;if(!r)return this.parseResponse(y(this,Er,"f"),n);let{span:i}=r,o;try{o=await this.parseResponse(y(this,Er,"f"),n)}catch(a){let c={status:"error",...n,error:a};throw Zl(y(this,Er,"f"),i,c),nt(y(this,Er,"f"),()=>uc(i,c)),a}let s={status:"success",...n,data:o};return nt(y(this,Er,"f"),()=>Ute(r,o)),Zl(y(this,Er,"f"),i,s),n.options.stream&&lb(o)?nt(y(this,Er,"f"),()=>$F(y(this,Er,"f"),i,o,n)):nt(y(this,Er,"f"),()=>uc(i,s)),o}then(n,r){return this.parse().then(n,r)}catch(n){return this.parse().catch(n)}finally(n){return this.parse().finally(n)}}return Er=new WeakMap,e})()});var ub,FF,db,gt,G,qx,oe=P(()=>{sr();at();Bx();Vx();X();Gi();FF=(()=>{class e{constructor(n,r,i,o){ub.set(this,void 0),O(this,ub,n,"f"),this.options=o,this.response=r,this.body=i}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let n=this.nextPageRequestOptions();if(!n)throw new Q("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");let r=this.options.__span;return await y(this,ub,"f").requestAPIList(this.constructor,{...n,__span:r&&$(y(this,ub,"f"),r.name,{openTelemetry:this.options.openTelemetry},{route:r.route,queryParams:r.queryParams,contentQueryParams:r.contentQueryParams,attributes:r.attributes})})}async*iterPages(){let n=this;for(yield n;n.hasNextPage();)n=await n.getNextPage(),yield n}async*[(ub=new WeakMap,Symbol.asyncIterator)](){for await(let n of this.iterPages())for(let r of n.getPaginatedItems())yield r}}return e})(),db=(()=>{class e extends Ql{constructor(n,r,i){super(n,r,async(o,s)=>new i(o,s.response,await Gx(o,s),s.options))}async*[Symbol.asyncIterator](){let n=await this;for await(let r of n)yield r}}return e})(),gt=class extends FF{constructor(t,n,r,i){super(t,n,r,i),this.data=r.data||[],this.has_more=r.has_more||!1,this.first_id=r.first_id||null,this.last_id=r.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let n=this.first_id;return n?{...this.options,query:{...My(this.options.query),before_id:n}}:null}let t=this.last_id;return t?{...this.options,query:{...My(this.options.query),after_id:t}}:null}},G=class extends FF{constructor(t,n,r,i){super(t,n,r,i),this.data=r.data||[],this.next_page=r.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.nextPageRequestOptions()!=null}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...My(this.options.query),page:t}}:null}},qx=class extends FF{constructor(t,n,r,i){super(t,n,r,i),this.data=r.data||[],this.next_page=r.next_page||null,this.prev_page=r.prev_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.nextPageRequestOptions()!=null}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...My(this.options.query),page:t}}:null}}});async function pb(e,t,n){if(LF(),e=await e,t||(t=e instanceof File?e.name:cb(e,!0)),iUe(e))return e instanceof File&&t==null&&n==null?e:Yl([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(oUe(e)){let i=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),Yl(await UF(i),t,n)}let r=await UF(e);if(!n?.type){let i=r.find(o=>typeof o=="object"&&"type"in o&&o.type);typeof i=="string"&&(n={...n,type:i})}return Yl(r,t,n)}async function UF(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(bre(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(lb(e))for await(let n of e)t.push(...await UF(n));else{let n=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${sUe(e)}`)}return t}function sUe(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}var bre,iUe,oUe,vre=P(()=>{hi();hi();bre=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",iUe=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&bre(e),oUe=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function"});var jF=P(()=>{vre()});var _re=P(()=>{});var N,ne=P(()=>{N=class{constructor(t){this._client=t}}});function zF(e,t){let{user_profile_id:n,workspace_id:r,tools:i,messages:o}=e;return T([{...n!=null?{"anthropic-user-profile-id":n}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},Fx(i,o),t?.headers])}function wre(e,t,n){if(!e._tracer)return;let r=zF(t,n);return $(e,"anthropic.messages.create",n,Gs(e,{...t,stream:!0},r))}var GF=P(()=>{$e();gi();X();Hr()});var qp=P(()=>{at()});var BF=P(()=>{lc()});function kre(e){return e?.output_config?.format}function VF(e,t,n){let r=kre(t);return!t||!("parse"in(r??{}))?{...e,content:e.content.map(i=>i.type==="text"?Object.defineProperty({...i},"parsed_output",{value:null,enumerable:!1}):i),parsed_output:null}:qF(e,t,n)}function qF(e,t,n){let r=null,i=e.content.map(o=>{if(o.type==="text"){let s=cUe(t,o.text);return r===null&&(r=s),Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1})}return o});return{...e,content:i,parsed_output:r}}function cUe(e,t){let n=kre(e);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(t):JSON.parse(t)}catch(r){throw new Q(`Failed to parse structured output: ${r}`)}}var WF=P(()=>{at()});var lUe,uUe,dUe,pUe,$re,Sre=P(()=>{lUe=e=>{let t=0,n=[];for(;t=a&&e[d]==="\\";)u++,d--;if(u%2===0)break;c++}l?t=e.length:(n.push({type:"string",value:e.slice(a,c)}),t=c+1);continue}if(r&&/\s/.test(r)){t++;continue}let o=/[0-9]/;if(r&&o.test(r)||r==="-"||r==="."){let a="";for(r==="-"&&(a+=r,r=e[++t]);r&&(o.test(r)||r==="."||r==="e"||r==="E"||(r==="-"||r==="+")&&(a[a.length-1]==="e"||a[a.length-1]==="E"));)a+=r,r=e[++t];n.push({type:"number",value:a,unterminated:t===e.length});continue}let s=/[a-z]/i;if(r&&s.test(r)){let a="";for(;r&&s.test(r)&&t!==e.length;)a+=r,r=e[++t];if(a=="true"||a=="false"||a==="null")n.push({type:"name",value:a});else{t++;continue}continue}t++}return n},uUe=e=>{let t=[];for(let o of e)(o.type==="brace"||o.type==="paren")&&(o.value==="{"||o.value==="["?t.push(o.value):t.pop());let n=t[t.length-1],r=e.length,i=/^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?$/;for(;r>0;){let o=e[r-1];switch(o.type){case"separator":r--;continue;case"number":if(o.unterminated||!i.test(o.value)){r--;continue}break;case"string":let s=e[r-2];if(n==="{"&&(s?.type==="delimiter"||s?.type==="brace"&&s.value==="{")){r--;continue}break;case"delimiter":r--;break}break}return e.slice(0,r)},dUe=e=>{let t=[];return e.map(n=>{n.type==="brace"&&(n.value==="{"?t.push("}"):t.splice(t.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(n=>{n==="}"?e.push({type:"brace",value:"}"}):n==="]"&&e.push({type:"paren",value:"]"})}),e},pUe=e=>{let t="";return e.map(n=>{n.type==="string"?t+='"'+n.value+'"':t+=n.value}),t},$re=e=>JSON.parse(pUe(dUe(uUe(lUe(e)))))});function Wx(e,t){let n={};for(let o of Object.keys(e))o!=="input"&&(n[o]=e[o]);Object.defineProperty(n,dc,{value:t,enumerable:!1,writable:!0});let r,i=!1;return Object.defineProperty(n,"input",{enumerable:!0,configurable:!0,get(){return i||(r=t?$re(t):{},i=!0),r}}),n}var dc,HF=P(()=>{Sre();dc="__json_buf"});function XF(e){return e.type==="tool_use"||e.type==="server_tool_use"}var Vi,pc,ts,fb,Hx,mb,gb,Kx,hb,ns,yb,Jx,Zx,Xl,Yx,Qx,Xx,bb,eu,Kr,KF,xre,JF,ZF,YF,QF,Ere,Tre,Are=P(()=>{sr();gi();Ds();qp();BF();WF();GF();Hr();HF();Tre=(()=>{class e{constructor(n,r){Vi.add(this),this.messages=[],this.receivedMessages=[],pc.set(this,void 0),ts.set(this,null),this.controller=new AbortController,fb.set(this,void 0),Hx.set(this,()=>{}),mb.set(this,()=>{}),gb.set(this,void 0),Kx.set(this,()=>{}),hb.set(this,()=>{}),ns.set(this,{}),yb.set(this,!1),Jx.set(this,!1),Zx.set(this,!1),Xl.set(this,!1),Yx.set(this,void 0),Qx.set(this,void 0),Xx.set(this,void 0),bb.set(this,void 0),eu.set(this,void 0),Kr.set(this,void 0),JF.set(this,i=>{if(O(this,Jx,!0,"f"),y(this,Kr,"f")&&(y(this,Kr,"f").streamed=void 0),$r(i)&&(i=new Xt),i instanceof Xt)return O(this,Zx,!0,"f"),this._emit("abort",i);if(i instanceof Q)return this._emit("error",i);if(i instanceof Error){let o=new Q(i.message);return o.cause=i,this._emit("error",o)}return this._emit("error",new Q(String(i)))}),O(this,fb,new Promise((i,o)=>{O(this,Hx,i,"f"),O(this,mb,o,"f")}),"f"),O(this,gb,new Promise((i,o)=>{O(this,Kx,i,"f"),O(this,hb,o,"f")}),"f"),y(this,fb,"f").catch(()=>{}),y(this,gb,"f").catch(()=>{}),O(this,ts,n,"f"),O(this,bb,r?.logger??console,"f"),O(this,eu,r?.client,"f")}get response(){return y(this,Yx,"f")}get request_id(){return y(this,Qx,"f")}get workspace_id(){return y(this,Xx,"f")}async withResponse(){O(this,Xl,!0,"f");let n=await y(this,fb,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id"),workspace_id:n.headers.get("anthropic-workspace-id")}}static fromReadableStream(n){let r=new e(null);return r._run(()=>r._fromReadableStream(n)),r}static createMessage(n,r,i,{logger:o,client:s}={}){let a=new e(r,{logger:o,client:s});for(let c of r.messages)a._addMessageParam(c);return O(a,ts,{...r,stream:!0},"f"),a._run(()=>a._createMessage(n,{...r,stream:!0},{...i,headers:{...i?.headers,[Bp]:"stream"}})),a}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},y(this,JF,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,r=!0){this.receivedMessages.push(n),r&&this._emit("message",n)}async _createMessage(n,r,i){let o=i?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{y(this,Vi,"m",ZF).call(this),O(this,Kr,i?.__span??(y(this,eu,"f")&&wre(y(this,eu,"f"),r,i)),"f");let{response:a,data:c}=await n.create({...r,stream:!0},{...i,__span:y(this,Kr,"f"),signal:this.controller.signal}).withResponse();try{this._connected(a)}catch(l){throw y(this,Kr,"f")&&(y(this,Kr,"f").failure=l),c.controller.abort(),l}for await(let l of c)try{y(this,Vi,"m",YF).call(this,l)}catch(u){throw y(this,Kr,"f")&&(y(this,Kr,"f").failure=u),u}if(c.controller.signal?.aborted)throw new Xt;y(this,Vi,"m",QF).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(n){this.ended||(O(this,Yx,n,"f"),O(this,Qx,n?.headers.get("request-id"),"f"),O(this,Xx,n?.headers.get("anthropic-workspace-id"),"f"),y(this,Hx,"f").call(this,n),this._emit("connect"))}get ended(){return y(this,yb,"f")}get errored(){return y(this,Jx,"f")}get aborted(){return y(this,Zx,"f")}abort(){this.controller.abort()}on(n,r){return(y(this,ns,"f")[n]||(y(this,ns,"f")[n]=[])).push({listener:r}),this}off(n,r){let i=y(this,ns,"f")[n];if(!i)return this;let o=i.findIndex(s=>s.listener===r);return o>=0&&i.splice(o,1),this}once(n,r){return(y(this,ns,"f")[n]||(y(this,ns,"f")[n]=[])).push({listener:r,once:!0}),this}emitted(n){return new Promise((r,i)=>{O(this,Xl,!0,"f"),n!=="error"&&this.once("error",i),this.once(n,r)})}async done(){O(this,Xl,!0,"f"),await y(this,gb,"f")}get currentMessage(){return y(this,pc,"f")}async finalMessage(){return await this.done(),y(this,Vi,"m",KF).call(this)}async finalText(){return await this.done(),y(this,Vi,"m",xre).call(this)}_emit(n,...r){if(y(this,yb,"f"))return;n==="end"&&(O(this,yb,!0,"f"),y(this,Kx,"f").call(this));let i=y(this,ns,"f")[n];if(i&&(y(this,ns,"f")[n]=i.filter(o=>!o.once),i.forEach(({listener:o})=>o(...r))),n==="abort"){let o=r[0];!y(this,Xl,"f")&&!i?.length&&Promise.reject(o),y(this,mb,"f").call(this,o),y(this,hb,"f").call(this,o),this._emit("end");return}if(n==="error"){let o=r[0];!y(this,Xl,"f")&&!i?.length&&Promise.reject(o),y(this,mb,"f").call(this,o),y(this,hb,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",y(this,Vi,"m",KF).call(this))}async _fromReadableStream(n,r){let i=r?.signal,o;i&&(i.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),i.addEventListener("abort",o));try{y(this,Vi,"m",ZF).call(this),this._connected(null);let s=Cn.fromReadableStream(n,this.controller);for await(let a of s)y(this,Vi,"m",YF).call(this,a);if(s.controller.signal?.aborted)throw new Xt;y(this,Vi,"m",QF).call(this)}finally{i&&o&&i.removeEventListener("abort",o)}}[(pc=new WeakMap,ts=new WeakMap,fb=new WeakMap,Hx=new WeakMap,mb=new WeakMap,gb=new WeakMap,Kx=new WeakMap,hb=new WeakMap,ns=new WeakMap,yb=new WeakMap,Jx=new WeakMap,Zx=new WeakMap,Xl=new WeakMap,Yx=new WeakMap,Qx=new WeakMap,Xx=new WeakMap,bb=new WeakMap,eu=new WeakMap,Kr=new WeakMap,JF=new WeakMap,Vi=new WeakSet,KF=function(){if(this.receivedMessages.length===0)throw new Q("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},xre=function(){if(this.receivedMessages.length===0)throw new Q("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(r.length===0)throw new Q("stream ended without producing a content block with type=text");return r.join(" ")},ZF=function(){this.ended||O(this,pc,void 0,"f")},YF=function(r){if(this.ended)return;let i=y(this,Vi,"m",Ere).call(this,r);if(this._emit("_rawEvent",r),!!i)switch(this._emit("streamEvent",r,i),r.type){case"content_block_delta":{let o=i.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{XF(o)&&y(this,ns,"f").inputJson?.length&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}default:r.delta}break}case"message_stop":{y(this,eu,"f")&&y(this,Kr,"f")&&y(this,ts,"f")&&Gp(y(this,eu,"f"),y(this,Kr,"f"),y(this,ts,"f"),i),this._addMessageParam(i),this._addMessage(VF(i,y(this,ts,"f"),{logger:y(this,bb,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{O(this,pc,i,"f"),y(this,Kr,"f")&&y(this,ts,"f")&&(y(this,Kr,"f").streamed={body:y(this,ts,"f"),message:i});break}case"content_block_start":case"message_delta":break}},QF=function(){if(this.ended)throw new Q("stream has ended, this shouldn't happen");let r=y(this,pc,"f");if(!r)throw new Q("request ended without sending any chunks");return O(this,pc,void 0,"f"),VF(r,y(this,ts,"f"),{logger:y(this,bb,"f")})},Ere=function(r){let i=y(this,pc,"f");if(r.type==="message_start"){if(i)throw new Q(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(i)switch(r.type){case"message_stop":return i;case"message_delta":return i.stop_reason=r.delta.stop_reason,i.stop_sequence=r.delta.stop_sequence,i.stop_details=r.delta.stop_details,i.usage.output_tokens=r.usage.output_tokens,r.delta.container!=null&&(i.container=r.delta.container),r.usage.input_tokens!=null&&(i.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(i.usage.server_tool_use=r.usage.server_tool_use),r.usage.output_tokens_details!=null&&(i.usage.output_tokens_details=r.usage.output_tokens_details),i;case"content_block_start":return i.content.push({...r.content_block}),i;case"content_block_delta":{let o=i.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(i.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(i.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&XF(o)){let s=(o[dc]||"")+r.delta.partial_json;i.content[r.index]=Wx(o,s)}break}case"thinking_delta":{o?.type==="thinking"&&(i.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(i.content[r.index]={...o,signature:r.delta.signature});break}default:r.delta}return i}case"content_block_stop":{let o=i.content.at(r.index);return o&&XF(o)&&dc in o&&Object.defineProperty(o,"input",{value:o.input,enumerable:!0,configurable:!0,writable:!0}),i}default:return i}},Symbol.asyncIterator)](){let n=[],r=[],i=!1;return this.on("_rawEvent",o=>{let s=r.shift();s?s.resolve(o):n.push(o)}),this.on("end",()=>{i=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{i=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{i=!0;for(let s of r)s.reject(o);r.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((s,a)=>r.push({resolve:s,reject:a})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Cn(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}return e})()});var eE,eU=P(()=>{at();Vl();eF();eE=(()=>{class e{constructor(n,r,i){this.iterator=n,this.response=i,this.controller=r}async*decoder(){let n=this.iterator;if(!n)throw new Q("Cannot iterate over a consumed stream.");this.iterator=void 0;let r=new Jy;for await(let i of n)for(let o of r.decode(i))yield JSON.parse(o);for(let i of r.flush())yield JSON.parse(i)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(n,r){if(!n.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Q("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Q("Attempted to iterate over a response with no body");return new e(Uy(n.body),r,n)}}return e})()});function Rre(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Ire,fUe,E,me=P(()=>{at();Ire=Object.freeze(Object.create(null)),fUe=(e=Rre)=>function(n,...r){if(n.length===1)return n[0];let i=!1,o=[],s=n.reduce((u,d,p)=>{/[?#]/.test(d)&&(i=!0);let f=r[p],m=(i?encodeURIComponent:e)(""+f);return p!==r.length&&(f==null||typeof f=="object"&&f.toString===Object.getPrototypeOf(Object.getPrototypeOf(f.hasOwnProperty??Ire)??Ire)?.toString)&&(m=f+"",o.push({start:u.length+d.length,length:m.length,error:`Value of type ${Object.prototype.toString.call(f).slice(8,-1)} is not a valid path parameter`})),!i&&m===""&&o.push({start:u.length+d.length,length:0,error:`Value "" can't be safely passed as a path parameter`}),u+d+(p===r.length?"":m)},""),a=s.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,l;for(;(l=c.exec(a))!==null;)o.push({start:l.index,length:l[0].length,error:`Value "${l[0]}" can't be safely passed as a path parameter`});if(o.sort((u,d)=>u.start-d.start),o.length>0){let u=[];for(let p of o)for(let f=p.start;fp??" ").join("");throw new Q(`Path parameters result in path with invalid segments: ${o.map(p=>p.error).join(` `)} ${s} -${d}`)}return s},N=JCe(wQ)});var mp,_M=j(()=>{Se();De();Ne();Me();mp=class extends Z{retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/deployment_runs/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}}});var gp,SM=j(()=>{Se();De();Ne();Me();gp=class extends Z{create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/deployments?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/deployments/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/deployments/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/deployments?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/deployments/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}pause(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/deployments/${t}/pause?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}run(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/deployments/${t}/run?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}unpause(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/deployments/${t}/unpause?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var hp,xM=j(()=>{Se();De();Ne();Me();hp=class extends Z{create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/dreams?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/dreams/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/dreams?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/dreams/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}cancel(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/dreams/${t}/cancel?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});function Bh(e){return{[Mo]:e}}function O_(e){return typeof e=="object"&&e!==null&&Vh in e}function EM(e,t){let n=new Set;if(e)for(let i of e)O_(i)&&n.add(i[Vh]);if(t)for(let i of t){O_(i)&&n.add(i[Vh]);let r=i.content;if(Array.isArray(r))for(let o of r)O_(o)&&n.add(o[Vh])}return Array.from(n)}function L_(e,t){let n=EM(e,t);return n.length===0?{}:{[Mo]:n.join(", ")}}function F_(e){return O_(e)?{[Mo]:e[Vh]}:{}}var Mo,M_,Vh,eo=j(()=>{Mo="x-stainless-helper",M_="x-stainless-helper-method";Vh=Symbol("anthropic.sdk.stainlessHelper")});var yp,TM=j(()=>{Se();De();Ne();eo();gs();Me();yp=class extends Z{list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/files?beta=true",le,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/files/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}download(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/files/${t}/content?beta=true`,{...i,headers:I([{Accept:"application/binary",...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/files/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}upload(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/files?beta=true",xi({body:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},F_(o.file),n?.headers])},this._client))}}});var bp,IM=j(()=>{Se();De();Ne();Me();bp=class extends Z{retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/models/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/models?beta=true",pn,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}}});var vp,AM=j(()=>{Se();De();Ne();Me();vp=class extends Z{create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/user_profiles?beta=true",{body:r,...n,headers:I([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString()},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(N`/v1/user_profiles/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/user_profiles/${t}?beta=true`,{body:o,...i,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/user_profiles?beta=true",le,{query:r,...n,headers:I([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString()},n?.headers])})}createEnrollmentURL(t,n={},i){let{betas:r}=n??{};return this._client.post(N`/v1/user_profiles/${t}/enrollment_url?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},i?.headers])})}}});var _Q=q(ei=>{"use strict";var nPe=ei&&ei.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})();Object.defineProperty(ei,"__esModule",{value:!0});var fn=256,RM=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var n="",i=0;i>>18&63),n+=this._encodeByte(r>>>12&63),n+=this._encodeByte(r>>>6&63),n+=this._encodeByte(r>>>0&63)}var o=t.length-i;if(o>0){var r=t[i]<<16|(o===2?t[i+1]<<8:0);n+=this._encodeByte(r>>>18&63),n+=this._encodeByte(r>>>12&63),o===2?n+=this._encodeByte(r>>>6&63):n+=this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var n=this._getPaddingLength(t),i=t.length-n,r=new Uint8Array(this.maxDecodedLength(i)),o=0,s=0,a=0,c=0,l=0,u=0,d=0;s>>4,r[o++]=l<<4|u>>>2,r[o++]=u<<6|d,a|=c&fn,a|=l&fn,a|=u&fn,a|=d&fn;if(s>>4,a|=c&fn,a|=l&fn),s>>2,a|=u&fn),s>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},e.prototype._decodeChar=function(t){var n=fn;return n+=(42-t&t-44)>>>8&-fn+t-43+62,n+=(46-t&t-48)>>>8&-fn+t-47+63,n+=(47-t&t-58)>>>8&-fn+t-48+52,n+=(64-t&t-91)>>>8&-fn+t-65+0,n+=(96-t&t-123)>>>8&-fn+t-97+26,n},e.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var i=t.length-1;i>=0&&t[i]===this._paddingCharacter;i--)n++;if(t.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},e})();ei.Coder=RM;var qh=new RM;function rPe(e){return qh.encode(e)}ei.encode=rPe;function iPe(e){return qh.decode(e)}ei.decode=iPe;var kQ=(function(e){nPe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(n){var i=n;return i+=65,i+=25-n>>>8&6,i+=51-n>>>8&-75,i+=61-n>>>8&-13,i+=62-n>>>8&49,String.fromCharCode(i)},t.prototype._decodeChar=function(n){var i=fn;return i+=(44-n&n-46)>>>8&-fn+n-45+62,i+=(94-n&n-96)>>>8&-fn+n-95+63,i+=(47-n&n-58)>>>8&-fn+n-48+52,i+=(64-n&n-91)>>>8&-fn+n-65+0,i+=(96-n&n-123)>>>8&-fn+n-97+26,i},t})(RM);ei.URLSafeCoder=kQ;var $Q=new kQ;function oPe(e){return $Q.encode(e)}ei.encodeURLSafe=oPe;function sPe(e){return $Q.decode(e)}ei.decodeURLSafe=sPe;ei.encodedLength=function(e){return qh.encodedLength(e)};ei.maxDecodedLength=function(e){return qh.maxDecodedLength(e)};ei.decodedLength=function(e){return qh.decodedLength(e)}});var xQ=q((SQ,U_)=>{(function(e,t){var n={};t(n);var i=n.default;for(var r in n)i[r]=n[r];typeof U_=="object"&&typeof U_.exports=="object"?U_.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):e.sha256=i})(SQ,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(d,p,f,m,g){for(var h,b,y,w,k,_,S,x,E,T,A,L,F;g>=64;){for(h=p[0],b=p[1],y=p[2],w=p[3],k=p[4],_=p[5],S=p[6],x=p[7],T=0;T<16;T++)A=m+T*4,d[T]=(f[A]&255)<<24|(f[A+1]&255)<<16|(f[A+2]&255)<<8|f[A+3]&255;for(T=16;T<64;T++)E=d[T-2],L=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10,E=d[T-15],F=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3,d[T]=(L+d[T-7]|0)+(F+d[T-16]|0);for(T=0;T<64;T++)L=(((k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7))+(k&_^~k&S)|0)+(x+(t[T]+d[T]|0)|0)|0,F=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&b^h&y^b&y)|0,x=S,S=_,_=k,k=w+L|0,w=y,y=b,b=h,h=L+F|0;p[0]+=h,p[1]+=b,p[2]+=y,p[3]+=w,p[4]+=k,p[5]+=_,p[6]+=S,p[7]+=x,m+=64,g-=64}return m}var i=(function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var p=0;p0){for(;this.bufferLength<64&&f>0;)this.buffer[this.bufferLength++]=p[m++],f--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(f>=64&&(m=n(this.temp,this.state,p,m,f),f%=64);f>0;)this.buffer[this.bufferLength++]=p[m++],f--;return this},d.prototype.finish=function(p){if(!this.finished){var f=this.bytesHashed,m=this.bufferLength,g=f/536870912|0,h=f<<3,b=f%64<56?64:128;this.buffer[m]=128;for(var y=m+1;y>>24&255,this.buffer[b-7]=g>>>16&255,this.buffer[b-6]=g>>>8&255,this.buffer[b-5]=g>>>0&255,this.buffer[b-4]=h>>>24&255,this.buffer[b-3]=h>>>16&255,this.buffer[b-2]=h>>>8&255,this.buffer[b-1]=h>>>0&255,n(this.temp,this.state,this.buffer,0,b),this.finished=!0}for(var y=0;y<8;y++)p[y*4+0]=this.state[y]>>>24&255,p[y*4+1]=this.state[y]>>>16&255,p[y*4+2]=this.state[y]>>>8&255,p[y*4+3]=this.state[y]>>>0&255;return this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d.prototype._saveState=function(p){for(var f=0;fthis.blockSize)new i().update(p).finish(f).clean();else for(var m=0;m1&&p.update(d),f&&p.update(f),p.update(m),p.finish(d),m[0]++}var c=new Uint8Array(e.digestLength);function l(d,p,f,m){p===void 0&&(p=c),m===void 0&&(m=32);for(var g=new Uint8Array([1]),h=s(p,d),b=new r(h),y=new Uint8Array(b.digestLength),w=y.length,k=new Uint8Array(m),_=0;_>>24&255,b[1]=S>>>16&255,b[2]=S>>>8&255,b[3]=S>>>0&255,g.reset(),g.update(p),g.update(b),g.finish(w);for(var x=0;x{"use strict";Object.defineProperty(NM,"__esModule",{value:!0});NM.timingSafeEqual=aPe;function EQ(e,t=""){if(!e)throw new Error(t)}function aPe(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),EQ(e instanceof DataView),EQ(t instanceof DataView);let n=e.byteLength,i=0,r=-1;for(;++r{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.Webhook=wp.WebhookVerificationError=void 0;var IQ=_Q(),cPe=xQ(),lPe=TQ(),AQ=300,CM=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},Fa=class e extends CM{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};wp.WebhookVerificationError=Fa;var j_=class e{constructor(t,n){if(n?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,i=>i.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=IQ.decode(t)}if(this.key.length===0)throw new Error("Secret can't be empty.")}verify(t,n,i){var r;let o=(r=i?.jsonParse)!==null&&r!==void 0?r:!0,s={};for(let g of Object.keys(n))s[g.toLowerCase()]=n[g];let a=s["webhook-id"],c=s["webhook-signature"],l=s["webhook-timestamp"];if(!c||!a||!l)throw new Fa("Missing required headers");let u=this.verifyTimestamp(l),p=this.sign(a,u,t).split(",")[1],f=c.split(" "),m=new globalThis.TextEncoder;for(let g of f){let[h,b]=g.split(",");if(h==="v1"&&(0,lPe.timingSafeEqual)(m.encode(b),m.encode(p))){let y=t.toString();return y===""?void 0:o?JSON.parse(y):void 0}}throw new Fa("No matching signature found")}sign(t,n,i){if(typeof i!="string")if(i.constructor.name==="Buffer")i=i.toString();else throw new Error("Expected payload to be of type string or Buffer.");let r=new TextEncoder,o=Math.floor(n.getTime()/1e3),s=r.encode(`${t}.${o}.${i}`);return`v1,${IQ.encode(cPe.hmac(this.key,s))}`}verifyTimestamp(t){let n=Math.floor(Date.now()/1e3),i=parseInt(t,10);if(Number.isNaN(i))throw new Fa("Invalid Signature Headers");if(n-i>AQ)throw new Fa("Message timestamp too old");if(i>n+AQ)throw new Fa("Message timestamp too new");return new Date(i*1e3)}};wp.Webhook=j_;j_.prefix="whsec_"});var NQ,kp,PM=j(()=>{Se();NQ=gt(RQ(),1),kp=class extends Z{parseUnverified(t){return JSON.parse(t)}unwrap(t,n){let i=n?.headers;if(i==null)throw new Error("Webhook headers are required in order to verify the signature");let r=n.key===void 0?this._client.webhookKey:n.key;if(!r)throw new Error("Webhook key must not be null or empty in order to unwrap");return new NQ.Webhook(r).verify(t,i),JSON.parse(t)}}});var $p,DM=j(()=>{Se();De();Ne();Me();$p=class extends Z{list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/agents/${t}/versions?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var Tl,OM=j(()=>{Se();DM();DM();De();Ne();Me();Tl=class extends Z{constructor(){super(...arguments),this.versions=new $p(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/agents?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.get(N`/v1/agents/${t}?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/agents/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/agents?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/agents/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Tl.Versions=$p});function Ua(e,t){if(!e)return()=>{};if(e.aborted)return t.abort(),()=>{};let n=()=>t.abort();return e.addEventListener("abort",n),()=>e.removeEventListener("abort",n)}var z_=j(()=>{});function An(e,t){return e instanceof Dt&&e.status===t}function CQ(e){return e instanceof Dt&&typeof e.status=="number"&&e.status>=400&&e.status<500}function ja(e){return CQ(e)&&!An(e,408)&&!An(e,409)&&!An(e,429)}function G_(e,t,n){return Math.min(t*2**e,n)}function MM(e,t){return e+Math.random()*(t-e)}function V_(e){return e*(1-Math.random()*.25)}var _p=j(()=>{kt()});function B_(e,{authToken:t,helper:n}){if(!t)throw new J(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(t)}`);let i=e,r=i._options.defaultHeaders,o=i._authState?.extraHeaders,s=o?Object.fromEntries(Object.entries(o).filter(([c])=>{let l=c.toLowerCase();return l!=="authorization"&&l!=="x-api-key"})):void 0,a=I([s,r,{[Mo]:n}]);return e.withOptions({apiKey:null,authToken:t,baseURL:e.baseURL,credentials:void 0,defaultHeaders:a})}var LM=j(()=>{kt();Ne();eo()});function yPe(e){return G_(e,mPe,gPe)}function bPe(){let t=globalThis.process?.env?.HOSTNAME;return t?`${t}-${T_()}`:T_()}var Sp,q_,Ei,W_,H_,K_,Wh,Hh,xp,Ep,J_,Tp,Kh,fPe,mPe,gPe,hPe,za,FM,Z_=j(()=>{gr();kt();Xi();cp();aM();z_();Ne();_p();LM();_p();fPe=999,mPe=1e3,gPe=6e4,hPe=3e5,za=class{constructor(t){Sp.set(this,void 0),q_.set(this,!1),Ei.set(this,void 0),W_.set(this,void 0),H_.set(this,void 0),K_.set(this,void 0),Wh.set(this,void 0),Hh.set(this,void 0),xp.set(this,void 0),this.client=t.client,this.environmentId=t.environmentId,this.environmentKey=t.environmentKey,this.workerId=t.workerId??bPe(),M(this,Sp,B_(t.client,{authToken:t.environmentKey,helper:"environments-work-poller"}),"f"),M(this,H_,t.autoStop??!0,"f"),M(this,K_,t.drain??!1,"f"),M(this,Wh,t.blockMs===void 0?fPe:t.blockMs,"f"),M(this,Hh,t.reclaimOlderThanMs??null,"f"),M(this,xp,t.requestOptions,"f"),M(this,Ei,new AbortController,"f"),M(this,W_,Ua(t.signal,v(this,Ei,"f")),"f")}get signal(){return v(this,Ei,"f").signal}abort(){v(this,Ei,"f").abort()}async*[(Sp=new WeakMap,q_=new WeakMap,Ei=new WeakMap,W_=new WeakMap,H_=new WeakMap,K_=new WeakMap,Wh=new WeakMap,Hh=new WeakMap,xp=new WeakMap,Symbol.asyncIterator)](){if(v(this,q_,"f"))throw new J("Cannot iterate over a consumed WorkPoller");M(this,q_,!0,"f");let t=qe(this.client);t.info("poller starting",{component:"work-poller",environment_id:this.environmentId});let n=new FM(t,this.environmentId);try{let i=0;for(;!v(this,Ei,"f").signal.aborted;){let r;try{r=await v(this,Sp,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...v(this,Wh,"f")!==null?{block_ms:v(this,Wh,"f")}:{},...v(this,Hh,"f")!==null?{reclaim_older_than_ms:v(this,Hh,"f")}:{}},{headers:I([v(this,xp,"f")?.headers]),signal:v(this,Ei,"f").signal})}catch(o){if(v(this,Ei,"f").signal.aborted)return;if(ja(o))throw t.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=V_(yPe(i));t.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),i++,await Yi(s,v(this,Ei,"f").signal);continue}if(i=0,r==null){if(v(this,K_,"f"))return;n.onEmptyPoll(),await Yi(MM(1e3,3e3),v(this,Ei,"f").signal);continue}n.onClaim(),t.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:r.id,work_type:r.data.type});try{await v(this,Sp,"f").beta.environments.work.ack(r.id,{environment_id:r.environment_id},{headers:I([v(this,xp,"f")?.headers]),signal:v(this,Ei,"f").signal})}catch(o){t.error("ack failed",{work_id:r.id,error:String(o)});continue}try{yield r}finally{if(v(this,H_,"f"))try{await v(this,Sp,"f").beta.environments.work.stop(r.id,{environment_id:r.environment_id},{headers:I([v(this,xp,"f")?.headers])})}catch(o){An(o,409)||t.warn("stop failed",{work_id:r.id,error:String(o)})}}}}finally{v(this,W_,"f").call(this)}}};FM=class{constructor(t,n){Ep.set(this,void 0),J_.set(this,void 0),Tp.set(this,void 0),Kh.set(this,0),M(this,Ep,t,"f"),M(this,J_,n,"f")}onEmptyPoll(){let t=Date.now(),n={component:"work-poller",environment_id:v(this,J_,"f")};v(this,Tp,"f")===void 0?(M(this,Tp,M(this,Kh,t,"f"),"f"),v(this,Ep,"f").info("idle; polling for work",n)):t-v(this,Kh,"f")>=hPe?(M(this,Kh,t,"f"),v(this,Ep,"f").info(`still polling; idle for ${Math.round((t-v(this,Tp,"f"))/1e3)}s`,n)):v(this,Ep,"f").debug("poll returned no work",n)}onClaim(){M(this,Tp,void 0,"f")}};Ep=new WeakMap,J_=new WeakMap,Tp=new WeakMap,Kh=new WeakMap});var Ip,Ga,Ap,Y_,PQ=j(()=>{gr();Y_=class{constructor(){Ip.set(this,[]),Ga.set(this,[]),Ap.set(this,!1)}push(t){if(v(this,Ap,"f"))return!1;let n=v(this,Ga,"f").shift();return n?n({done:!1,value:t}):v(this,Ip,"f").push(t),!0}close(){if(!v(this,Ap,"f"))for(M(this,Ap,!0,"f");v(this,Ga,"f").length>0;)v(this,Ga,"f").shift()({done:!0,value:void 0})}next(t){return v(this,Ip,"f").length>0?Promise.resolve({done:!1,value:v(this,Ip,"f").shift()}):v(this,Ap,"f")||t?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(n=>{let i=o=>{t?.removeEventListener("abort",r),n(o)},r=()=>{let o=v(this,Ga,"f").indexOf(i);o>=0&&v(this,Ga,"f").splice(o,1),n({done:!0,value:void 0})};v(this,Ga,"f").push(i),t?.addEventListener("abort",r,{once:!0})})}tryShift(){return v(this,Ip,"f").shift()}};Ip=new WeakMap,Ga=new WeakMap,Ap=new WeakMap});var Ae,Il=j(()=>{Ae=class extends Error{constructor(t){let n=typeof t=="string"?t:t.map(i=>i.type==="text"?i.text:`[${i.type}]`).join(" ");super(n),this.name="ToolError",this.content=t}}});function UM(e){return"name"in e?e.name:"mcp_server_name"in e?e.mcp_server_name:e.type}function vPe(e){return e instanceof Ae?e.content:`Error: ${e instanceof Error?e.message:String(e)}`}async function DQ(e,t,n){try{let i=e.parse?e.parse(t):t;return{content:await e.run(i,n),isError:!1}}catch(i){return{content:vPe(i),isError:!0}}}var OQ=j(()=>{Il()});function BQ(e){return e.type==="session.status_idle"&&e.stop_reason?.type==="end_turn"}function TPe(e,t,n){return e.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:e.id,is_error:t,content:n}:{type:"user.tool_result",tool_use_id:e.id,is_error:t,content:n}}function IPe(e){if(typeof e=="string")return[{type:"text",text:e||"(no output)"}];let t=e.map(n=>n.type==="text"?{type:"text",text:n.text||"(no output)"}:n.type==="image"||n.type==="document"?n:n.type==="search_result"?{type:"search_result",source:n.source,title:n.title,content:n.content.map(i=>({type:"text",text:i.text})),citations:{enabled:n.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(n)});return t.length>0?t:[{type:"text",text:"(no output)"}]}var Jh,rS,Rp,Al,to,Kt,Q_,jn,X_,Zh,iS,mn,Cp,ti,Pp,Va,Np,hs,oS,Yh,Ti,eS,GQ,MQ,LQ,FQ,jM,UQ,tS,nS,zM,jQ,VQ,zQ,wPe,kPe,$Pe,_Pe,SPe,xPe,EPe,GM,Ba,sS=j(()=>{gr();kt();Xi();cp();_p();z_();PQ();Ne();eo();OQ();zQ=500,wPe=1e4,kPe=12e4,$Pe=3e4,_Pe=1e3,SPe=3e4,xPe=5*6e4,EPe=6e4;GM=class{constructor(t,n){Jh.set(this,void 0),rS.set(this,void 0),Rp.set(this,new Set),Al.set(this,!1),to.set(this,void 0),M(this,Jh,t,"f"),M(this,rS,n,"f")}noteEvent(t){t.type!=="user.tool_confirmation"&&(BQ(t)?this.arm():this.disarm())}block(t){v(this,Rp,"f").add(t),v(this,to,"f")!==void 0&&(M(this,Al,!0,"f"),clearTimeout(v(this,to,"f")),M(this,to,void 0,"f"))}unblock(t){v(this,Rp,"f").delete(t),v(this,Rp,"f").size===0&&v(this,Al,"f")&&this.arm()}arm(){if(!(v(this,Jh,"f")<=0)){if(v(this,Rp,"f").size>0){M(this,Al,!0,"f");return}M(this,Al,!1,"f"),v(this,to,"f")!==void 0&&clearTimeout(v(this,to,"f")),M(this,to,setTimeout(v(this,rS,"f"),v(this,Jh,"f")),"f")}}disarm(){M(this,Al,!1,"f"),v(this,to,"f")!==void 0&&(clearTimeout(v(this,to,"f")),M(this,to,void 0,"f"))}};Jh=new WeakMap,rS=new WeakMap,Rp=new WeakMap,Al=new WeakMap,to=new WeakMap;Ba=class{constructor(t,n){Kt.add(this),Q_.set(this,!1),jn.set(this,void 0),X_.set(this,void 0),Zh.set(this,void 0),iS.set(this,void 0),mn.set(this,void 0),Cp.set(this,new Set),ti.set(this,new Set),Pp.set(this,new Map),Va.set(this,new Map),Np.set(this,new Y_),hs.set(this,0),oS.set(this,xPe),Yh.set(this,null),Ti.set(this,void 0),this.client=n.client,this.sessionId=t,this.tools=n.tools,this.maxIdleMs=n.maxIdleMs??EPe,M(this,mn,qe(n.client),"f"),M(this,iS,new Map(n.tools.map(i=>[UM(i),i])),"f"),M(this,jn,new AbortController,"f"),M(this,X_,Ua(n.signal,v(this,jn,"f")),"f"),M(this,Zh,n.requestOptions,"f"),M(this,Ti,new GM(this.maxIdleMs,()=>{v(this,mn,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),v(this,jn,"f").abort()}),"f")}get signal(){return v(this,jn,"f").signal}abort(){v(this,jn,"f").abort()}_setSendRetryWindow(t){M(this,oS,t,"f")}async*[(Q_=new WeakMap,jn=new WeakMap,X_=new WeakMap,Zh=new WeakMap,iS=new WeakMap,mn=new WeakMap,Cp=new WeakMap,ti=new WeakMap,Pp=new WeakMap,Va=new WeakMap,Np=new WeakMap,hs=new WeakMap,oS=new WeakMap,Yh=new WeakMap,Ti=new WeakMap,Kt=new WeakSet,Symbol.asyncIterator)](){if(v(this,Q_,"f"))throw new J("Cannot iterate over a consumed SessionToolRunner");M(this,Q_,!0,"f"),v(this,mn,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let t=v(this,Kt,"m",GQ).call(this).catch(n=>{v(this,jn,"f").signal.aborted||v(this,mn,"f").error("stream loop failed",{error:String(n)}),v(this,jn,"f").abort()});try{for(;;){let i=await v(this,Np,"f").next(v(this,jn,"f").signal);if(i.done)break;yield i.value}await t;let n;for(;(n=v(this,Np,"f").tryShift())!==void 0;)yield n}finally{v(this,jn,"f").abort(),v(this,Ti,"f").disarm(),await t;try{await v(this,Kt,"m",VQ).call(this)}catch(n){v(this,mn,"f").warn("drain failed",{error:String(n)})}v(this,Np,"f").close();for(let n of this.tools)try{await n.close?.()}catch(i){v(this,mn,"f").warn("tool.close failed",{tool:UM(n),error:String(i)})}v(this,X_,"f").call(this)}}};eS=function(){return{...v(this,Zh,"f"),headers:I([Bh("session-tool-runner"),v(this,Zh,"f")?.headers]),signal:v(this,jn,"f").signal}},GQ=async function(){let t=v(this,jn,"f"),n=zQ;for(;!t.signal.aborted;){try{let i=await this.client.beta.sessions.events.stream(this.sessionId,{},v(this,Kt,"m",eS).call(this));await v(this,Kt,"m",MQ).call(this);for await(let r of i)if(n=zQ,await v(this,Kt,"m",FQ).call(this,r))return}catch(i){if(t.signal.throwIfAborted(),ja(i))throw v(this,mn,"f").error("permanent stream failure, shutting down",{error:String(i)}),t.abort(),i;v(this,mn,"f").warn("stream disconnected, reconnecting",{error:String(i),backoff_ms:n})}t.signal.throwIfAborted(),await Yi(n,t.signal),n=Math.min(n*2,wPe)}},MQ=async function(){let t=v(this,jn,"f"),n=[],i=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},v(this,Kt,"m",eS).call(this)))v(this,Kt,"m",LQ).call(this,s,n),i=BQ(s)}catch(s){t.signal.throwIfAborted(),v(this,mn,"f").warn("reconcile list failed",{error:String(s)});for(let a of n)v(this,Cp,"f").delete(a.id);return}let r=n.filter(s=>!v(this,ti,"f").has(s.id));v(this,Ti,"f").disarm();for(let s of r)await v(this,Kt,"m",jM).call(this,s);for(let s of[...v(this,Va,"f").values()]){let a=v(this,Pp,"f").get(s.id);a!==void 0&&await v(this,Kt,"m",tS).call(this,s,a)}let o=r.filter(s=>!v(this,ti,"f").has(s.id)&&!v(this,Va,"f").has(s.id));i&&o.length===0?v(this,Ti,"f").arm():v(this,Ti,"f").disarm()},LQ=function(t,n){t.type==="agent.tool_use"||t.type==="agent.custom_tool_use"?(v(this,Cp,"f").add(t.id),v(this,ti,"f").has(t.id)||n.push(t)):t.type==="user.tool_result"?v(this,ti,"f").add(t.tool_use_id):t.type==="user.custom_tool_result"?v(this,ti,"f").add(t.custom_tool_use_id):t.type==="user.tool_confirmation"&&(v(this,ti,"f").has(t.tool_use_id)||v(this,Pp,"f").set(t.tool_use_id,t.result))},FQ=async function(t){switch(v(this,Ti,"f").noteEvent(t),t.type){case"agent.tool_use":case"agent.custom_tool_use":return v(this,Cp,"f").has(t.id)||(v(this,Cp,"f").add(t.id),await v(this,Kt,"m",jM).call(this,t)),!1;case"user.tool_confirmation":return await v(this,Kt,"m",UQ).call(this,t),!1;case"user.tool_result":return v(this,ti,"f").add(t.tool_use_id),!1;case"user.custom_tool_result":return v(this,ti,"f").add(t.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return v(this,mn,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),v(this,jn,"f").abort(),!0;default:return!1}},jM=async function(t){let n=t.evaluated_permission,i=n==="deny"?"deny":v(this,Pp,"f").get(t.id);if(i===void 0){n===void 0||n==="allow"?await v(this,Kt,"m",zM).call(this,t,void 0):v(this,Va,"f").has(t.id)||(v(this,mn,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),v(this,Va,"f").set(t.id,t),v(this,Ti,"f").block(t.id));return}await v(this,Kt,"m",tS).call(this,t,i)},UQ=async function(t){v(this,Pp,"f").set(t.tool_use_id,t.result);let n=v(this,Va,"f").get(t.tool_use_id);n!==void 0&&await v(this,Kt,"m",tS).call(this,n,t.result)},tS=async function(t,n){let i=v(this,Va,"f").delete(t.id);if(n==="allow"){v(this,mn,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),i||v(this,Ti,"f").block(t.id);try{await v(this,Kt,"m",zM).call(this,t,"allow")}finally{v(this,Ti,"f").unblock(t.id)}return}i&&v(this,Ti,"f").unblock(t.id),v(this,ti,"f").add(t.id),v(this,mn,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),v(this,Kt,"m",nS).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:"deny"})},nS=function(t){v(this,Np,"f").push(t)},zM=async function(t,n){var i,r;if(!v(this,ti,"f").has(t.id)){v(this,mn,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),M(this,hs,(i=v(this,hs,"f"),i++,i),"f");try{let o=v(this,iS,"f").get(t.name);if(!o){v(this,mn,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),v(this,Kt,"m",nS).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:n});return}let s,a,c=new AbortController,l=Ua(v(this,jn,"f").signal,c),u=setTimeout(()=>c.abort(),kPe);try{let f=await DQ(o,t.input,{toolUse:t,toolUseBlock:t,signal:c.signal});s=f.content,a=f.isError}finally{clearTimeout(u),l()}let d=TPe(t,a,IPe(s)),p=await v(this,Kt,"m",jQ).call(this,d,t.id);v(this,Kt,"m",nS).call(this,{event:t,result:d,toolUseId:t.id,name:t.name,isError:a,posted:p,confirmation:n})}finally{M(this,hs,(r=v(this,hs,"f"),r--,r),"f"),v(this,hs,"f")===0&&v(this,Yh,"f")?.call(this)}}},jQ=async function(t,n){let i=v(this,jn,"f"),r=Date.now(),o,s=0;for(;;){s++,i.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[t]},v(this,Kt,"m",eS).call(this)),v(this,ti,"f").add(n),!0}catch(a){if(o=a,ja(a))break;let c=v(this,oS,"f")-(Date.now()-r);if(c<=0)break;let l=Math.min(V_(G_(s-1,_Pe,SPe)),c);v(this,mn,"f").warn("tool result send failed; retrying",{tool_use_id:n,attempt:s,backoff_ms:l,error:String(a)}),await Yi(l,i.signal)}}return v(this,mn,"f").error("failed to send tool result",{tool_use_id:n,attempts:s,error:String(o)}),!1},VQ=async function(){v(this,hs,"f")!==0&&(await Promise.race([new Promise(t=>M(this,Yh,t,"f")),Yi($Pe)]),M(this,Yh,null,"f"),v(this,hs,"f")>0&&v(this,mn,"f").warn("drain timeout exceeded"))}});function aS(e,t){if(!(e>=Qh))throw new J(`${t} must be at least ${Qh}ms (got ${e}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`)}var Xh,Qh,cS=j(()=>{kt();Xh=15e3,Qh=5e3});var qQ=j(()=>{cM()});function Rl(e){if(e.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${e.name}" must be an object, but got ${e.inputSchema.type}`);return{type:"custom",name:e.name,input_schema:e.inputSchema,description:e.description,run:e.run,parse:t=>t,...e.close?{close:e.close}:{}}}var WQ=j(()=>{VM();qQ()});function Dp(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}var BM=j(()=>{});function lS(e,t){let n=xe.relative(e,t);return n===""||!n.startsWith(".."+xe.sep)&&n!==".."&&!xe.isAbsolute(n)}async function qM(e,t){for(let n of e)if(lS(await ey(xe.resolve(n)),t))return n}function ny(e){let t=e?.code;return typeof t=="string"?t:void 0}async function ey(e){let t=[],n=e,i=0;for(;;){let r;try{r=await Nl.realpath(n)}catch(o){let s;try{s=(await Nl.lstat(n)).isSymbolicLink()}catch(a){let c=ny(a);if(c!=="ENOENT"&&c!=="ENOTDIR")throw a;let l=xe.dirname(n);if(l===n)throw a;t.push(xe.basename(n)),n=l;continue}if(!s)throw o;if(++i>RPe)throw Object.assign(new Error("too many levels of symbolic links"),{code:"ELOOP"});n=xe.resolve(xe.dirname(n),await Nl.readlink(n));continue}return t.length?xe.join(r,...t.reverse()):r}}async function HQ(e,t,n){let i=n?.allowedRoots??[],r=await ey(xe.resolve(e)),o;try{o=await ey(xe.resolve(r,t))}catch(a){throw new Ae(Op(a,`path ${JSON.stringify(t)}`))}if(lS(r,o)||await qM(i,o)!==void 0)return o;let s=i.length?"the session's working directory and its other permitted directories":"the session's working directory";throw new Ae(`path ${JSON.stringify(t)} is outside ${s}`)}async function WM(e,t){let n=xe.dirname(e),i=xe.join(n,`.tmp-${process.pid}-${Oa.randomUUID()}`),r=await Nl.stat(e).then(s=>s.mode&511,()=>{}),o;try{o=await Nl.open(i,"wx",APe),r!==void 0&&await o.chmod(r),await o.writeFile(t,"utf-8"),await o.sync(),await o.close(),o=void 0,await Nl.rename(i,e)}catch(s){throw o&&await o.close().catch(()=>{}),await Nl.unlink(i).catch(()=>{}),s}}function Op(e,t){let n=ny(e);switch(n){case"ENOENT":return`${t}: no such file or directory`;case"EACCES":case"EPERM":return`${t}: permission denied`;case"ENOTDIR":return`${t}: not a directory`;case"EISDIR":return`${t}: is a directory`;case"ELOOP":return`${t}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${t}: file name too long`;case"ENOSPC":return`${t}: no space left on device`;case"EMFILE":case"ENFILE":return`${t}: too many open files`;default:return`${t}: ${n!==void 0?`i/o error (${n})`:"i/o error"}`}}var Nl,ty,APe,RPe,HM=j(()=>{Mr();Il();Nl=fs.promises,ty=448,APe=384;RPe=40});async function JQ(e){let{client:t,sessionId:n}=e;if(!t)return async()=>{};let i=qe(t),r=e.session;if(!r){if(n===void 0)return async()=>{};i.warn("AgentToolContext.sessionId is deprecated and costs an extra session fetch; fetch the session once and set `session` instead",{component:"agent-tool-context"}),r=await t.beta.sessions.retrieve(n)}let o=xe.resolve(e.workdir,"skills"),s=[];for(let a of r.agent.skills)try{let c=await t.beta.skills.versions.retrieve(a.version,{skill_id:a.skill_id}),l=xe.basename(c.name.trim());(l===""||l==="."||l==="..")&&(l=a.skill_id);let u=xe.resolve(o,l);if(u!==o&&!u.startsWith(o+xe.sep)){i.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:c.name});continue}let d=await t.beta.skills.versions.download(c.id,{skill_id:a.skill_id});await Ii.rm(u,{recursive:!0,force:!0}),await Ii.mkdir(u,{recursive:!0,mode:ty}),s.push(u),await ZM(d,u),i.info("downloaded skill",{component:"agent-tool-context",skill_id:a.skill_id,version:c.id,dest:u})}catch(c){i.warn("failed to download skill",{component:"agent-tool-context",skill_id:a.skill_id,error:String(c)})}return async()=>{for(let a of s)await Ii.rm(a,{recursive:!0,force:!0}).catch(c=>{i.warn("failed to clean up skill",{component:"agent-tool-context",dest:a,error:String(c)})})}}function CPe(e){for(let t of e){let n=t.trim();if(n&&(xe.isAbsolute(n)||n.split(/[\\/]/).includes("..")))throw new J(`refusing to extract unsafe archive member: ${n}`)}}function KQ(e){let t=e.split(` -`);return t[t.length-1]===""&&t.pop(),t}function DPe(e,t){return/^[\x20-\x7E]+$/.test(t)&&!/[\\^#]/.test(t)&&!(e==="unzip"&&t.startsWith("-"))}function OPe(e,t,n){let i=KQ(t),r=KQ(n);if(i.length!==r.length)throw new J(JM);let o=[],s=[];return i.forEach((a,c)=>{if(PPe[e].has(r[c].charAt(0))){o.push(a);return}if(!DPe(e,a))throw new J(`refusing to extract archive: cannot safely exclude member ${JSON.stringify(a)}`);s.push(a)}),{plain:o,special:s}}async function ZQ(e){for(let t of await Ii.readdir(e,{withFileTypes:!0}))if(t.isDirectory())await ZQ(xe.join(e,t.name));else if(!t.isFile())throw new J(JM)}async function KM(e,t){try{let{stdout:n}=await NPe(e,t);return n}catch(n){throw ny(n)==="ENOENT"?new J(`skill extraction requires the \`${e}\` command, but it was not found on PATH`):n}}function MPe(e){let t,n=!1;for(let i of e){let r=i.trim().split("/").filter(s=>s!==""&&s!==".");if(r.length===0)continue;let o=r[0];if(t===void 0)t=o;else if(o!==t)return"";r.length>1&&(n=!0)}return t!==void 0&&n?t:""}async function ZM(e,t){let n=xe.join(t,`.skill-archive-${process.pid}-${Date.now()}`);if(!e.body)throw new J("skill download response had no body");await y_.promises.pipeline(y_.Readable.fromWeb(e.body),fs.createWriteStream(n));let i=xe.join(xe.dirname(t),`.skill-stage-${process.pid}-${Date.now()}`),r=xe.join(xe.dirname(t),`.skill-exclude-${process.pid}-${Date.now()}`);try{let o=await FPe(n,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,a=s?"unzip":"tar",c=await KM(a,s?["-Z1",n]:["-tf",n]),l=await KM(a,s?["-Z","--h","--t",n]:["-tvf",n]),{plain:u,special:d}=OPe(a,c,l);CPe([...u,...d]);let p=MPe(u);await Ii.mkdir(i,{recursive:!0,mode:ty}),u.length>0&&await KM(a,await LPe(a,n,i,d,r)),await ZQ(i);let f=p?xe.join(i,p):i,m=await Ii.readdir(f).catch(g=>{throw ny(g)==="ENOENT"?new J(JM):g});for(let g of m)await Ii.rename(xe.join(f,g),xe.join(t,g))}finally{await Ii.rm(n,{force:!0}),await Ii.rm(r,{force:!0}),await Ii.rm(i,{recursive:!0,force:!0})}}async function LPe(e,t,n,i,r){let o=i.map(s=>s.replace(/[*?[\\]/g,"\\$&"));return e==="unzip"?["-oq",t,"-d",n,...o.length>0?["-x",...o]:[]]:o.length===0?["-xf",t,"-C",n]:(await Ii.writeFile(r,o.join(` +${d}`)}return s},E=fUe(Rre)});var Wp,tU=P(()=>{ne();oe();$e();X();eU();qp();me();Wp=class extends N{create(t,n){let{user_profile_id:r,workspace_id:i,...o}=t;return this._client.post("/v1/messages/batches",{body:o,...n,headers:T([{...r!=null?{"anthropic-user-profile-id":r}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),__span:$(this._client,"anthropic.messages.batches.create",n,{route:"/v1/messages/batches",attributes:{"anthropic.message.batch.request_count":o.requests?.length},createdIDAttribute:"anthropic.message.batch.id"})})}retrieve(t,n={},r){let{workspace_id:i}=n??{};return this._client.get(E`/v1/messages/batches/${t}`,{...r,headers:T([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),__span:$(this._client,"anthropic.messages.batches.retrieve",r,{route:"/v1/messages/batches/{message_batch_id}",attributes:{"anthropic.message.batch.id":t}})})}list(t={},n){let{workspace_id:r,...i}=t??{};return this._client.getAPIList("/v1/messages/batches",gt,{query:i,...n,headers:T([{...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers]),__span:$(this._client,"anthropic.messages.batches.list",n,{route:"/v1/messages/batches",queryParams:["after_id","before_id","limit"]})})}delete(t,n={},r){let{workspace_id:i}=n??{};return this._client.delete(E`/v1/messages/batches/${t}`,{...r,headers:T([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),__span:$(this._client,"anthropic.messages.batches.delete",r,{route:"/v1/messages/batches/{message_batch_id}",attributes:{"anthropic.message.batch.id":t}})})}cancel(t,n={},r){let{workspace_id:i}=n??{};return this._client.post(E`/v1/messages/batches/${t}/cancel`,{...r,headers:T([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),__span:$(this._client,"anthropic.messages.batches.cancel",r,{route:"/v1/messages/batches/{message_batch_id}/cancel",attributes:{"anthropic.message.batch.id":t}})})}async results(t,n={},r){let i=await this.retrieve(t,n,r);if(!i.results_url)throw new Q(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{workspace_id:o}=n??{};return this._client.get(i.results_url,{...r,headers:T([{Accept:"application/binary",...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),stream:!0,__binaryResponse:!0,__span:$(this._client,"anthropic.messages.batches.results",r,{route:"/v1/messages/batches/{message_batch_id}/results",attributes:{"anthropic.message.batch.id":t}})})._thenUnwrap((s,a)=>eE.fromResponse(a.response,a.controller))}}});var tE,nU=P(()=>{tE={"claude-opus-4@20250514":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});var vb,Pre,gUe,rU=P(()=>{ne();$e();X();Hr();zs();GF();Are();WF();tU();tU();nU();vb=(()=>{class e extends N{constructor(){super(...arguments),this.batches=new Wp(this._client)}create(n,r){let{user_profile_id:i,workspace_id:o,...s}=n;s.model in Pre&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${Pre[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),gUe.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let a=r?.timeout??this._client._options.timeout;if(!s.stream&&a==null){let d=tE[s.model]??void 0;a=this._client.calculateNonstreamingTimeout(s.max_tokens,d)}let c=zF(n,r),l=this._client._tracer&&$(this._client,"anthropic.messages.create",r,Gs(this._client,s,c));ib(this._client,l,s);let u=this._client.post("/v1/messages",{body:s,timeout:a??6e5,...r,__span:l,headers:c,stream:n.stream??!1});return l?u._thenUnwrap(d=>(ob(this._client,l,s,d),d)):u}parse(n,r){return this.create(n,r).then(i=>qF(i,n,{logger:this._client.logger??console}))}stream(n,r){let i=n;return Tre.createMessage(this,i,r,{logger:this._client.logger??console,client:this._client})}countTokens(n,r){let{user_profile_id:i,workspace_id:o,...s}=n,a=T([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),c=$(this._client,"anthropic.messages.count_tokens",r,{route:"/v1/messages/count_tokens",attributes:{[js]:s.model}}),l=this._client.post("/v1/messages/count_tokens",{body:s,...r,__span:c,headers:a});return c?l._thenUnwrap(u=>(sb(this._client,c,u),u)):l}}return e.Batches=Wp,e})(),Pre={"claude-sonnet-4-5":"November 30th, 2026","claude-sonnet-4-5-20250929":"November 30th, 2026"},gUe=["claude-mythos-preview","claude-opus-4-6"]});var Hp,iU=P(()=>{ne();oe();$e();X();me();Hp=class extends N{retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(E`/v1/deployment_runs/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.deployment_runs.retrieve",r,{route:"/v1/deployment_runs/{deployment_run_id}",attributes:{"anthropic.deployment_run.id":t}})})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",G,{query:o,...n,headers:T([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),__span:$(this._client,"anthropic.deployment_runs.list",n,{route:"/v1/deployment_runs",queryParams:["created_at[gt]","created_at[gte]","created_at[lt]","created_at[lte]","deployment_id","has_error","limit","page","trigger_type"]})})}}});var Kp,oU=P(()=>{ne();oe();$e();X();me();Kp=class extends N{create(t,n){let{betas:r,workspace_id:i,...o}=t;return this._client.post("/v1/deployments?beta=true",{body:o,...n,headers:T([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),__span:$(this._client,"anthropic.deployments.create",n,{route:"/v1/deployments",createdIDAttribute:"anthropic.deployment.id"})})}retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(E`/v1/deployments/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.deployments.retrieve",r,{route:"/v1/deployments/{deployment_id}",attributes:{"anthropic.deployment.id":t}})})}update(t,n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post(E`/v1/deployments/${t}?beta=true`,{body:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.deployments.update",r,{route:"/v1/deployments/{deployment_id}",attributes:{"anthropic.deployment.id":t}})})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/deployments?beta=true",G,{query:o,...n,headers:T([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),__span:$(this._client,"anthropic.deployments.list",n,{route:"/v1/deployments",queryParams:["agent_id","created_at[gte]","created_at[lte]","include_archived","limit","page","status"]})})}archive(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(E`/v1/deployments/${t}/archive?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.deployments.archive",r,{route:"/v1/deployments/{deployment_id}/archive",attributes:{"anthropic.deployment.id":t}})})}pause(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(E`/v1/deployments/${t}/pause?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.deployments.pause",r,{route:"/v1/deployments/{deployment_id}/pause",attributes:{"anthropic.deployment.id":t}})})}run(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(E`/v1/deployments/${t}/run?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.deployments.run",r,{route:"/v1/deployments/{deployment_id}/run",attributes:{"anthropic.deployment.id":t}})})}unpause(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(E`/v1/deployments/${t}/unpause?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.deployments.unpause",r,{route:"/v1/deployments/{deployment_id}/unpause",attributes:{"anthropic.deployment.id":t}})})}}});var Jp,sU=P(()=>{ne();oe();$e();X();me();Jp=class extends N{create(t,n){let{betas:r,workspace_id:i,...o}=t;return this._client.post("/v1/dreams?beta=true",{body:o,...n,headers:T([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),__span:$(this._client,"anthropic.dreams.create",n,{route:"/v1/dreams",createdIDAttribute:"anthropic.dream.id"})})}retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(E`/v1/dreams/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.dreams.retrieve",r,{route:"/v1/dreams/{dream_id}",attributes:{"anthropic.dream.id":t}})})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/dreams?beta=true",G,{query:o,...n,headers:T([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),__span:$(this._client,"anthropic.dreams.list",n,{route:"/v1/dreams",queryParams:["created_at[gt]","created_at[lt]","include_archived","limit","page","statuses"]})})}archive(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(E`/v1/dreams/${t}/archive?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.dreams.archive",r,{route:"/v1/dreams/{dream_id}/archive",attributes:{"anthropic.dream.id":t}})})}cancel(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(E`/v1/dreams/${t}/cancel?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.dreams.cancel",r,{route:"/v1/dreams/{dream_id}/cancel",attributes:{"anthropic.dream.id":t}})})}}});var Zp,aU=P(()=>{ne();oe();$e();X();gi();hi();me();Zp=class extends N{list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/files?beta=true",G,{query:o,...n,headers:T([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),__span:$(this._client,"anthropic.files.list",n,{route:"/v1/files",queryParams:["ids","limit","page","scope_id"]})})}delete(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.delete(E`/v1/files/${t}?beta=true`,{...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.files.delete",r,{route:"/v1/files/{file_id}",attributes:{"anthropic.file.id":t}})})}download(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(E`/v1/files/${t}/content?beta=true`,{...r,headers:T([{Accept:"application/binary",...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__binaryResponse:!0,__span:$(this._client,"anthropic.files.download",r,{route:"/v1/files/{file_id}/content",attributes:{"anthropic.file.id":t}})})}retrieveMetadata(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(E`/v1/files/${t}?beta=true`,{...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.files.retrieve_metadata",r,{route:"/v1/files/{file_id}",attributes:{"anthropic.file.id":t}})})}upload(t,n){let{betas:r,workspace_id:i,...o}=t;return this._client.post("/v1/files?beta=true",Nn({body:o,...n,headers:T([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},Ux(o.file),n?.headers]),__span:$(this._client,"anthropic.files.upload",n,{route:"/v1/files",createdIDAttribute:"anthropic.file.id"})},this._client))}}});var Yp,cU=P(()=>{ne();oe();$e();X();me();Yp=class extends N{retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(E`/v1/models/${t}?beta=true`,{...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.models.retrieve",r,{route:"/v1/models/{model_id}",attributes:{"anthropic.model.id":t}})})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/models?beta=true",gt,{query:o,...n,headers:T([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),__span:$(this._client,"anthropic.models.list",n,{route:"/v1/models",queryParams:["after_id","before_id","lifecycle","limit"]})})}}});var Qp,lU=P(()=>{ne();oe();$e();X();me();Qp=class extends N{create(t,n){let{betas:r,workspace_id:i,...o}=t;return this._client.post("/v1/user_profiles?beta=true",{body:o,...n,headers:T([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),__span:$(this._client,"anthropic.user_profiles.create",n,{route:"/v1/user_profiles",createdIDAttribute:"anthropic.user_profile.id"})})}retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(E`/v1/user_profiles/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.user_profiles.retrieve",r,{route:"/v1/user_profiles/{user_profile_id}",attributes:{"anthropic.user_profile.id":t}})})}update(t,n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post(E`/v1/user_profiles/${t}?beta=true`,{body:s,...r,headers:T([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.user_profiles.update",r,{route:"/v1/user_profiles/{user_profile_id}",attributes:{"anthropic.user_profile.id":t}})})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/user_profiles?beta=true",G,{query:o,...n,headers:T([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),__span:$(this._client,"anthropic.user_profiles.list",n,{route:"/v1/user_profiles",queryParams:["limit","order","order_by","page"]})})}createEnrollmentURL(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(E`/v1/user_profiles/${t}/enrollment_url?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.user_profiles.create_enrollment_url",r,{route:"/v1/user_profiles/{user_profile_id}/enrollment_url",attributes:{"anthropic.user_profile.id":t}})})}}});var Ore=K(yi=>{"use strict";var kUe=yi&&yi.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(yi,"__esModule",{value:!0});var yn=256,uU=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var n="",r=0;r>>18&63),n+=this._encodeByte(i>>>12&63),n+=this._encodeByte(i>>>6&63),n+=this._encodeByte(i>>>0&63)}var o=t.length-r;if(o>0){var i=t[r]<<16|(o===2?t[r+1]<<8:0);n+=this._encodeByte(i>>>18&63),n+=this._encodeByte(i>>>12&63),o===2?n+=this._encodeByte(i>>>6&63):n+=this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var n=this._getPaddingLength(t),r=t.length-n,i=new Uint8Array(this.maxDecodedLength(r)),o=0,s=0,a=0,c=0,l=0,u=0,d=0;s>>4,i[o++]=l<<4|u>>>2,i[o++]=u<<6|d,a|=c&yn,a|=l&yn,a|=u&yn,a|=d&yn;if(s>>4,a|=c&yn,a|=l&yn),s>>2,a|=u&yn),s>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},e.prototype._decodeChar=function(t){var n=yn;return n+=(42-t&t-44)>>>8&-yn+t-43+62,n+=(46-t&t-48)>>>8&-yn+t-47+63,n+=(47-t&t-58)>>>8&-yn+t-48+52,n+=(64-t&t-91)>>>8&-yn+t-65+0,n+=(96-t&t-123)>>>8&-yn+t-97+26,n},e.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var r=t.length-1;r>=0&&t[r]===this._paddingCharacter;r--)n++;if(t.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},e})();yi.Coder=uU;var _b=new uU;function $Ue(e){return _b.encode(e)}yi.encode=$Ue;function SUe(e){return _b.decode(e)}yi.decode=SUe;var Cre=(function(e){kUe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(n){var r=n;return r+=65,r+=25-n>>>8&6,r+=51-n>>>8&-75,r+=61-n>>>8&-13,r+=62-n>>>8&49,String.fromCharCode(r)},t.prototype._decodeChar=function(n){var r=yn;return r+=(44-n&n-46)>>>8&-yn+n-45+62,r+=(94-n&n-96)>>>8&-yn+n-95+63,r+=(47-n&n-58)>>>8&-yn+n-48+52,r+=(64-n&n-91)>>>8&-yn+n-65+0,r+=(96-n&n-123)>>>8&-yn+n-97+26,r},t})(uU);yi.URLSafeCoder=Cre;var Nre=new Cre;function xUe(e){return Nre.encode(e)}yi.encodeURLSafe=xUe;function EUe(e){return Nre.decode(e)}yi.decodeURLSafe=EUe;yi.encodedLength=function(e){return _b.encodedLength(e)};yi.maxDecodedLength=function(e){return _b.maxDecodedLength(e)};yi.decodedLength=function(e){return _b.decodedLength(e)}});var Mre=K((Dre,nE)=>{(function(e,t){var n={};t(n);var r=n.default;for(var i in n)r[i]=n[i];typeof nE=="object"&&typeof nE.exports=="object"?nE.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):e.sha256=r})(Dre,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(d,p,f,m,g){for(var h,v,b,_,w,k,x,A,I,R,C,j,z;g>=64;){for(h=p[0],v=p[1],b=p[2],_=p[3],w=p[4],k=p[5],x=p[6],A=p[7],R=0;R<16;R++)C=m+R*4,d[R]=(f[C]&255)<<24|(f[C+1]&255)<<16|(f[C+2]&255)<<8|f[C+3]&255;for(R=16;R<64;R++)I=d[R-2],j=(I>>>17|I<<15)^(I>>>19|I<<13)^I>>>10,I=d[R-15],z=(I>>>7|I<<25)^(I>>>18|I<<14)^I>>>3,d[R]=(j+d[R-7]|0)+(z+d[R-16]|0);for(R=0;R<64;R++)j=(((w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7))+(w&k^~w&x)|0)+(A+(t[R]+d[R]|0)|0)|0,z=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&v^h&b^v&b)|0,A=x,x=k,k=w,w=_+j|0,_=b,b=v,v=h,h=j+z|0;p[0]+=h,p[1]+=v,p[2]+=b,p[3]+=_,p[4]+=w,p[5]+=k,p[6]+=x,p[7]+=A,m+=64,g-=64}return m}var r=(function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var p=0;p0){for(;this.bufferLength<64&&f>0;)this.buffer[this.bufferLength++]=p[m++],f--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(f>=64&&(m=n(this.temp,this.state,p,m,f),f%=64);f>0;)this.buffer[this.bufferLength++]=p[m++],f--;return this},d.prototype.finish=function(p){if(!this.finished){var f=this.bytesHashed,m=this.bufferLength,g=f/536870912|0,h=f<<3,v=f%64<56?64:128;this.buffer[m]=128;for(var b=m+1;b>>24&255,this.buffer[v-7]=g>>>16&255,this.buffer[v-6]=g>>>8&255,this.buffer[v-5]=g>>>0&255,this.buffer[v-4]=h>>>24&255,this.buffer[v-3]=h>>>16&255,this.buffer[v-2]=h>>>8&255,this.buffer[v-1]=h>>>0&255,n(this.temp,this.state,this.buffer,0,v),this.finished=!0}for(var b=0;b<8;b++)p[b*4+0]=this.state[b]>>>24&255,p[b*4+1]=this.state[b]>>>16&255,p[b*4+2]=this.state[b]>>>8&255,p[b*4+3]=this.state[b]>>>0&255;return this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d.prototype._saveState=function(p){for(var f=0;fthis.blockSize)new r().update(p).finish(f).clean();else for(var m=0;m1&&p.update(d),f&&p.update(f),p.update(m),p.finish(d),m[0]++}var c=new Uint8Array(e.digestLength);function l(d,p,f,m){p===void 0&&(p=c),m===void 0&&(m=32);for(var g=new Uint8Array([1]),h=s(p,d),v=new i(h),b=new Uint8Array(v.digestLength),_=b.length,w=new Uint8Array(m),k=0;k>>24&255,v[1]=x>>>16&255,v[2]=x>>>8&255,v[3]=x>>>0&255,g.reset(),g.update(p),g.update(v),g.finish(_);for(var A=0;A{"use strict";Object.defineProperty(dU,"__esModule",{value:!0});dU.timingSafeEqual=TUe;function Lre(e,t=""){if(!e)throw new Error(t)}function TUe(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),Lre(e instanceof DataView),Lre(t instanceof DataView);let n=e.byteLength,r=0,i=-1;for(;++i{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});Xp.Webhook=Xp.WebhookVerificationError=void 0;var Ure=Ore(),AUe=Mre(),IUe=Fre(),jre=300,pU=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},fc=class e extends pU{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};Xp.WebhookVerificationError=fc;var rE=class e{constructor(t,n){if(n?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,r=>r.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=Ure.decode(t)}if(this.key.length===0)throw new Error("Secret can't be empty.")}verify(t,n,r){var i;let o=(i=r?.jsonParse)!==null&&i!==void 0?i:!0,s={};for(let g of Object.keys(n))s[g.toLowerCase()]=n[g];let a=s["webhook-id"],c=s["webhook-signature"],l=s["webhook-timestamp"];if(!c||!a||!l)throw new fc("Missing required headers");let u=this.verifyTimestamp(l),p=this.sign(a,u,t).split(",")[1],f=c.split(" "),m=new globalThis.TextEncoder;for(let g of f){let[h,v]=g.split(",");if(h==="v1"&&(0,IUe.timingSafeEqual)(m.encode(v),m.encode(p))){let b=t.toString();return b===""?void 0:o?JSON.parse(b):void 0}}throw new fc("No matching signature found")}sign(t,n,r){if(typeof r!="string")if(r.constructor.name==="Buffer")r=r.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,o=Math.floor(n.getTime()/1e3),s=i.encode(`${t}.${o}.${r}`);return`v1,${Ure.encode(AUe.hmac(this.key,s))}`}verifyTimestamp(t){let n=Math.floor(Date.now()/1e3),r=parseInt(t,10);if(Number.isNaN(r))throw new fc("Invalid Signature Headers");if(n-r>jre)throw new fc("Message timestamp too old");if(r>n+jre)throw new fc("Message timestamp too new");return new Date(r*1e3)}};Xp.Webhook=rE;rE.prefix="whsec_"});var Gre,ef,fU=P(()=>{ne();Gre=$t(zre(),1),ef=class extends N{parseUnverified(t){return JSON.parse(t)}unwrap(t,n){let r=n?.headers;if(r==null)throw new Error("Webhook headers are required in order to verify the signature");let i=n.key===void 0?this._client.webhookKey:n.key;if(!i)throw new Error("Webhook key must not be null or empty in order to unwrap");return new Gre.Webhook(i).verify(t,r),JSON.parse(t)}}});var tf,mU=P(()=>{ne();oe();$e();X();me();tf=class extends N{list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(E`/v1/agents/${t}/versions?beta=true`,G,{query:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.agents.versions.list",r,{route:"/v1/agents/{agent_id}/versions",queryParams:["limit","page"],attributes:{"gen_ai.agent.id":t}})})}}});var iE,gU=P(()=>{ne();mU();mU();oe();$e();X();me();iE=(()=>{class e extends N{constructor(){super(...arguments),this.versions=new tf(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/agents?beta=true",{body:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.agents.create",r,{route:"/v1/agents",createdIDAttribute:"gen_ai.agent.id"})})}retrieve(n,r={},i){let{betas:o,workspace_id:s,...a}=r??{};return this._client.get(E`/v1/agents/${n}?beta=true`,{query:a,...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.agents.retrieve",i,{route:"/v1/agents/{agent_id}",queryParams:["version"],attributes:{"gen_ai.agent.id":n}})})}update(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(E`/v1/agents/${n}?beta=true`,{body:a,...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.agents.update",i,{route:"/v1/agents/{agent_id}",attributes:{"gen_ai.agent.id":n}})})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/agents?beta=true",G,{query:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.agents.list",r,{route:"/v1/agents",queryParams:["created_at[gte]","created_at[lte]","include_archived","limit","page"]})})}archive(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(E`/v1/agents/${n}/archive?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.agents.archive",i,{route:"/v1/agents/{agent_id}/archive",attributes:{"gen_ai.agent.id":n}})})}}return e.Versions=tf,e})()});function mc(e,t){if(!e)return()=>{};if(e.aborted)return t.abort(),()=>{};let n=()=>t.abort();return e.addEventListener("abort",n),()=>e.removeEventListener("abort",n)}var oE=P(()=>{});function Wn(e,t){return e instanceof _t&&e.status===t}function NUe(e){return e instanceof _t&&typeof e.status=="number"&&e.status>=400&&e.status<500}function tu(e){return NUe(e)&&!Wn(e,408)&&!Wn(e,409)&&!Wn(e,429)}function sE(e,t,n){return Math.min(t*2**e,n)}function Bre(e,t){return e+Math.random()*(t-e)}function aE(e){return e*(1-Math.random()*.25)}var wb=P(()=>{at()});function cE(e,{authToken:t,helper:n}){if(!t)throw new Q(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(t)}`);let r=e._options.defaultHeaders,i=e._authState?.extraHeaders,o=i?Object.fromEntries(Object.entries(i).filter(([a])=>{let c=a.toLowerCase();return c!=="authorization"&&c!=="x-api-key"})):void 0,s=T([o,r,{[es]:n}]);return e.withOptions({apiKey:null,authToken:t,baseURL:e.baseURL,credentials:void 0,defaultHeaders:s})}var hU=P(()=>{at();$e();gi()});function FUe(e){return sE(e,DUe,MUe)}function jUe(){let t=globalThis.process?.env?.HOSTNAME;return t?`${t}-${jx()}`:jx()}var nf,lE,Jr,uE,dE,pE,kb,$b,rf,of,fE,sf,Sb,OUe,DUe,MUe,LUe,xb,UUe,yU=P(()=>{sr();Zo();at();qn();Cp();IF();oE();$e();X();wb();hU();Hr();OUe=999,DUe=1e3,MUe=6e4,LUe=3e5,xb=(()=>{class e{constructor(n){nf.set(this,void 0),lE.set(this,!1),Jr.set(this,void 0),uE.set(this,void 0),dE.set(this,void 0),pE.set(this,void 0),kb.set(this,void 0),$b.set(this,void 0),rf.set(this,void 0),this.client=n.client,this.environmentId=n.environmentId,this.environmentKey=n.environmentKey,this.workerId=n.workerId??jUe(),O(this,nf,cE(n.client,{authToken:n.environmentKey,helper:"environments-work-poller"}),"f"),O(this,dE,n.autoStop??!0,"f"),O(this,pE,n.drain??!1,"f"),O(this,kb,n.blockMs===void 0?OUe:n.blockMs,"f"),O(this,$b,n.reclaimOlderThanMs??null,"f"),O(this,rf,n.requestOptions,"f"),O(this,Jr,new AbortController,"f"),O(this,uE,mc(n.signal,y(this,Jr,"f")),"f")}get signal(){return y(this,Jr,"f").signal}abort(){y(this,Jr,"f").abort()}async*[(nf=new WeakMap,lE=new WeakMap,Jr=new WeakMap,uE=new WeakMap,dE=new WeakMap,pE=new WeakMap,kb=new WeakMap,$b=new WeakMap,rf=new WeakMap,Symbol.asyncIterator)](){if(y(this,lE,"f"))throw new Q("Cannot iterate over a consumed WorkPoller");O(this,lE,!0,"f");let n=ln.active(),r=Te(this.client);r.info("poller starting",{component:"work-poller",environment_id:this.environmentId});let i=new UUe(r,this.environmentId);try{let o=0;for(;!y(this,Jr,"f").signal.aborted;){let s;try{s=await y(this,nf,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...y(this,kb,"f")!==null?{block_ms:y(this,kb,"f")}:{},...y(this,$b,"f")!==null?{reclaim_older_than_ms:y(this,$b,"f")}:{}},{headers:T([y(this,rf,"f")?.headers]),signal:y(this,Jr,"f").signal})}catch(a){if(y(this,Jr,"f").signal.aborted)return;if(tu(a))throw r.error("poll failed permanently, stopping poller",{error:String(a)}),a;let c=aE(FUe(o));r.warn("poll failed, backing off",{error:String(a),backoff_ms:c}),o++,await fo(c,y(this,Jr,"f").signal);continue}if(o=0,s==null){if(y(this,pE,"f"))return;i.onEmptyPoll(),await fo(Bre(1e3,3e3),y(this,Jr,"f").signal);continue}i.onClaim(),this._workSpan=nt(this.client,()=>SF(this.client,s,n)),r.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:s.id,work_type:s.data.type});try{await y(this,nf,"f").beta.environments.work.ack(s.id,{environment_id:s.environment_id},{headers:T([y(this,rf,"f")?.headers]),signal:y(this,Jr,"f").signal})}catch(a){r.error("ack failed",{work_id:s.id,error:String(a)}),nt(this.client,()=>Mx(this._workSpan,y(this,Jr,"f").signal,a));continue}try{yield s,n=ln.active()}finally{if(y(this,dE,"f"))try{await y(this,nf,"f").beta.environments.work.stop(s.id,{environment_id:s.environment_id},{headers:T([y(this,rf,"f")?.headers])})}catch(a){Wn(a,409)||r.warn("stop failed",{work_id:s.id,error:String(a)})}nt(this.client,()=>Dx(this._workSpan,y(this,Jr,"f").signal))}}}finally{y(this,uE,"f").call(this)}}}return e})();UUe=(()=>{class e{constructor(n,r){of.set(this,void 0),fE.set(this,void 0),sf.set(this,void 0),Sb.set(this,0),O(this,of,n,"f"),O(this,fE,r,"f")}onEmptyPoll(){let n=Date.now(),r={component:"work-poller",environment_id:y(this,fE,"f")};y(this,sf,"f")===void 0?(O(this,sf,O(this,Sb,n,"f"),"f"),y(this,of,"f").info("idle; polling for work",r)):n-y(this,Sb,"f")>=LUe?(O(this,Sb,n,"f"),y(this,of,"f").info(`still polling; idle for ${Math.round((n-y(this,sf,"f"))/1e3)}s`,r)):y(this,of,"f").debug("poll returned no work",r)}onClaim(){O(this,sf,void 0,"f")}}return of=new WeakMap,fE=new WeakMap,sf=new WeakMap,Sb=new WeakMap,e})()});var af,gc,cf,Vre,qre=P(()=>{sr();Vre=(()=>{class e{constructor(){af.set(this,[]),gc.set(this,[]),cf.set(this,!1)}push(n){if(y(this,cf,"f"))return!1;let r=y(this,gc,"f").shift();return r?r({done:!1,value:n}):y(this,af,"f").push(n),!0}close(){if(!y(this,cf,"f"))for(O(this,cf,!0,"f");y(this,gc,"f").length>0;)y(this,gc,"f").shift()({done:!0,value:void 0})}next(n){return y(this,af,"f").length>0?Promise.resolve({done:!1,value:y(this,af,"f").shift()}):y(this,cf,"f")||n?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(r=>{let i=s=>{n?.removeEventListener("abort",o),r(s)},o=()=>{let s=y(this,gc,"f").indexOf(i);s>=0&&y(this,gc,"f").splice(s,1),r({done:!0,value:void 0})};y(this,gc,"f").push(i),n?.addEventListener("abort",o,{once:!0})})}tryShift(){return y(this,af,"f").shift()}}return af=new WeakMap,gc=new WeakMap,cf=new WeakMap,e})()});var Ue,lf=P(()=>{Ue=(()=>{class e extends Error{constructor(n){let r=typeof n=="string"?n:n.map(i=>i.type==="text"?i.text:`[${i.type}]`).join(" ");super(r),this.name="ToolError",this.content=n}}return e})()});function Eb(e){return e.replace(BUe,"\uFFFD")}function qUe(e,t=Wre){return Kre(Eb(e).replace(GUe," ").trim(),t)}function WUe(e){return qUe(e,VUe)}function Vs(e){return WUe(e).replace(/[' ]+/g," ").trim()}function mE(e){return`Error: ${e instanceof Error?e.message:String(e)}`}function Hre(e){return Kre(Eb(mE(e)),Wre)}function Kre(e,t){if(e.length<=t)return e;let n=0,r=0;for(let i of e){if(r===t)break;r+=1,n+=i.length}return e.slice(0,n)}function Jre(e){return typeof e=="string"?Eb(e):e.filter(t=>t.type==="text"&&t.text!=="").map(t=>({...t,text:Eb(t.text)}))}var zUe,GUe,BUe,Wre,VUe,gE=P(()=>{zUe="\\x00-\\x1f\\x7f-\\x9f\\u061c\\u200e\\u200f\\u2028\\u2029\\u202a-\\u202e\\u2066-\\u2069",GUe=new RegExp(`[${zUe}]+`,"g"),BUe=/[\uD800-\uDFFF]/gu;Wre=4096,VUe=200});function bU(e){return"name"in e?e.name:"mcp_server_name"in e?e.mcp_server_name:e.type}function HUe(e){return e instanceof Ue?e.content:mE(e)}async function hE(e,t,n){try{let r=e.parse?e.parse(t):t;return{content:await e.run(r,n),isError:!1}}catch(r){return{content:HUe(r),isError:!0}}}var vU=P(()=>{lf();gE()});function iie(e){return e.type!=="session.status_idle"?!1:e.stop_reason?.type!=="requires_action"}function nje(e,t,n){return e.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:e.id,is_error:t,content:n}:{type:"user.tool_result",tool_use_id:e.id,is_error:t,content:n}}function rje(e){if(typeof e=="string")return[{type:"text",text:e||"(no output)"}];let t=e.map(n=>n.type==="text"?{type:"text",text:n.text||"(no output)"}:n.type==="image"||n.type==="document"?n:n.type==="search_result"?{type:"search_result",source:n.source,title:n.title,content:n.content.map(r=>({type:"text",text:r.text})),citations:{enabled:n.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(n)});return t.length>0?t:[{type:"text",text:"(no output)"}]}var Tb,yE,uf,nu,yo,zt,bE,On,vE,df,_E,bn,pf,bi,ff,hc,mf,qs,wE,Ab,vi,kE,Ib,Rb,$E,Zre,Yre,Qre,_U,Xre,wU,eie,SE,xE,kU,tie,nie,rie,KUe,JUe,ZUe,YUe,QUe,XUe,eje,tje,Pb,$U=P(()=>{sr();Zo();at();qn();Cp();wb();oE();qre();$e();gi();vU();Hr();rie=500,KUe=1e4,JUe=12e4,ZUe=3e4,YUe=1e3,QUe=3e4,XUe=5*6e4,eje=6e4;tje=(()=>{class e{constructor(n,r){Tb.set(this,void 0),yE.set(this,void 0),uf.set(this,new Set),nu.set(this,!1),yo.set(this,void 0),O(this,Tb,n,"f"),O(this,yE,r,"f")}noteEvent(n){n.type!=="user.tool_confirmation"&&(iie(n)?this.arm():this.disarm())}block(n){y(this,uf,"f").add(n),y(this,yo,"f")!==void 0&&(O(this,nu,!0,"f"),clearTimeout(y(this,yo,"f")),O(this,yo,void 0,"f"))}unblock(n){y(this,uf,"f").delete(n),y(this,uf,"f").size===0&&y(this,nu,"f")&&this.arm()}arm(){if(!(y(this,Tb,"f")<=0)){if(y(this,uf,"f").size>0){O(this,nu,!0,"f");return}O(this,nu,!1,"f"),y(this,yo,"f")!==void 0&&clearTimeout(y(this,yo,"f")),O(this,yo,setTimeout(y(this,yE,"f"),y(this,Tb,"f")),"f")}}disarm(){O(this,nu,!1,"f"),y(this,yo,"f")!==void 0&&(clearTimeout(y(this,yo,"f")),O(this,yo,void 0,"f"))}}return Tb=new WeakMap,yE=new WeakMap,uf=new WeakMap,nu=new WeakMap,yo=new WeakMap,e})(),Pb=(()=>{class e{constructor(n,r){zt.add(this),bE.set(this,!1),On.set(this,void 0),vE.set(this,void 0),df.set(this,void 0),_E.set(this,void 0),bn.set(this,void 0),pf.set(this,new Set),bi.set(this,new Set),ff.set(this,new Map),hc.set(this,new Map),mf.set(this,new Vre),qs.set(this,0),wE.set(this,XUe),Ab.set(this,null),vi.set(this,void 0),kE.set(this,void 0),Ib.set(this,void 0),Rb.set(this,!1),this.client=r.client,this.sessionId=n,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??eje,O(this,bn,Te(r.client),"f"),O(this,_E,new Map(r.tools.map(i=>[bU(i),i])),"f"),O(this,On,new AbortController,"f"),O(this,vE,mc(r.signal,y(this,On,"f")),"f"),O(this,df,r.requestOptions,"f"),O(this,vi,new tje(this.maxIdleMs,()=>{y(this,bn,"f").info("session idle after its turn ended; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),y(this,On,"f").abort()}),"f")}get signal(){return y(this,On,"f").signal}abort(){y(this,On,"f").abort()}_setSendRetryWindow(n){O(this,wE,n,"f")}async*[(bE=new WeakMap,On=new WeakMap,vE=new WeakMap,df=new WeakMap,_E=new WeakMap,bn=new WeakMap,pf=new WeakMap,bi=new WeakMap,ff=new WeakMap,hc=new WeakMap,mf=new WeakMap,qs=new WeakMap,wE=new WeakMap,Ab=new WeakMap,vi=new WeakMap,kE=new WeakMap,Ib=new WeakMap,Rb=new WeakMap,zt=new WeakSet,Symbol.asyncIterator)](){if(y(this,bE,"f"))throw new Q("Cannot iterate over a consumed SessionToolRunner");O(this,bE,!0,"f"),O(this,kE,this.client._tracer?ln.active():void 0,"f"),y(this,bn,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let n=y(this,zt,"m",Zre).call(this).catch(r=>{y(this,On,"f").signal.aborted||y(this,bn,"f").error("stream loop failed",{error:String(r)}),y(this,On,"f").abort()});try{for(;;){let i=await y(this,mf,"f").next(y(this,On,"f").signal);if(i.done)break;yield i.value}await n;let r;for(;(r=y(this,mf,"f").tryShift())!==void 0;)yield r}finally{y(this,On,"f").abort(),y(this,vi,"f").disarm(),await n;try{await y(this,zt,"m",nie).call(this)}catch(r){y(this,bn,"f").warn("drain failed",{error:String(r)})}y(this,mf,"f").close();for(let r of this.tools)try{await r.close?.()}catch(i){y(this,bn,"f").warn("tool.close failed",{tool:bU(r),error:String(i)})}y(this,vE,"f").call(this)}}}return $E=function(){return{...y(this,df,"f"),headers:T([Lx("session-tool-runner"),y(this,df,"f")?.headers]),signal:y(this,On,"f").signal}},Zre=async function(){let n=y(this,On,"f"),r=rie;for(;!n.signal.aborted;){try{let i=await this.client.beta.sessions.events.stream(this.sessionId,{},y(this,zt,"m",$E).call(this));await y(this,zt,"m",Yre).call(this);for await(let o of i)if(r=rie,await y(this,zt,"m",Xre).call(this,o))return}catch(i){if(n.signal.throwIfAborted(),tu(i))throw y(this,bn,"f").error("permanent stream failure, shutting down",{error:String(i)}),n.abort(),i;y(this,bn,"f").warn("stream disconnected, reconnecting",{error:String(i),backoff_ms:r})}n.signal.throwIfAborted(),await fo(r,n.signal),r=Math.min(r*2,KUe)}},Yre=async function(){let n=y(this,On,"f"),r=[],i=!1;O(this,Rb,!1,"f");try{for await(let a of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},y(this,zt,"m",$E).call(this)))y(this,zt,"m",Qre).call(this,a,r),a.type!=="user.tool_confirmation"&&(i=iie(a))}catch(a){n.signal.throwIfAborted(),y(this,bn,"f").warn("reconcile list failed",{error:String(a)});for(let c of r)y(this,pf,"f").delete(c.id);return}O(this,Rb,!0,"f");let o=r.filter(a=>!y(this,bi,"f").has(a.id));y(this,vi,"f").disarm();for(let a of o)await y(this,zt,"m",wU).call(this,a);for(let a of[...y(this,hc,"f").values()]){let c=y(this,ff,"f").get(a.id);c!==void 0&&await y(this,zt,"m",SE).call(this,a,c)}let s=o.filter(a=>!y(this,bi,"f").has(a.id)&&!y(this,hc,"f").has(a.id));i&&s.length===0?y(this,vi,"f").arm():y(this,vi,"f").disarm()},Qre=function(n,r){y(this,zt,"m",_U).call(this,n),n.type==="agent.tool_use"||n.type==="agent.custom_tool_use"?(y(this,pf,"f").add(n.id),y(this,bi,"f").has(n.id)||r.push(n)):n.type==="user.tool_result"?y(this,bi,"f").add(n.tool_use_id):n.type==="user.custom_tool_result"?y(this,bi,"f").add(n.custom_tool_use_id):n.type==="user.tool_confirmation"&&(y(this,bi,"f").has(n.tool_use_id)||y(this,ff,"f").set(n.tool_use_id,n.result))},_U=function(n){if(!(!this.client._tracer||y(this,Ib,"f")!==void 0))switch(n.type){case"session.thread_status_running":case"session.thread_status_idle":case"session.thread_status_rescheduled":case"session.thread_status_terminated":O(this,Ib,n.session_thread_id,"f")}},Xre=async function(n){switch(y(this,vi,"f").noteEvent(n),y(this,Rb,"f")&&y(this,zt,"m",_U).call(this,n),n.type){case"agent.tool_use":case"agent.custom_tool_use":return y(this,pf,"f").has(n.id)||(y(this,pf,"f").add(n.id),await y(this,zt,"m",wU).call(this,n)),!1;case"user.tool_confirmation":return await y(this,zt,"m",eie).call(this,n),!1;case"user.tool_result":return y(this,bi,"f").add(n.tool_use_id),!1;case"user.custom_tool_result":return y(this,bi,"f").add(n.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return y(this,bn,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),y(this,On,"f").abort(),!0;default:return!1}},wU=async function(n){let r=n.evaluated_permission,i=r==="deny"?"deny":y(this,ff,"f").get(n.id);if(i===void 0){r===void 0||r==="allow"?await y(this,zt,"m",kU).call(this,n,void 0):y(this,hc,"f").has(n.id)||(y(this,bn,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:n.name,tool_use_id:n.id}),y(this,hc,"f").set(n.id,n),y(this,vi,"f").block(n.id));return}await y(this,zt,"m",SE).call(this,n,i)},eie=async function(n){y(this,ff,"f").set(n.tool_use_id,n.result);let r=y(this,hc,"f").get(n.tool_use_id);r!==void 0&&await y(this,zt,"m",SE).call(this,r,n.result)},SE=async function(n,r){let i=y(this,hc,"f").delete(n.id);if(r==="allow"){y(this,bn,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:n.name,tool_use_id:n.id}),i||y(this,vi,"f").block(n.id);try{await y(this,zt,"m",kU).call(this,n,"allow")}finally{y(this,vi,"f").unblock(n.id)}return}i&&y(this,vi,"f").unblock(n.id),y(this,bi,"f").add(n.id),y(this,bn,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:n.name,tool_use_id:n.id}),y(this,zt,"m",xE).call(this,{event:n,toolUseId:n.id,name:n.name,isError:!1,posted:!1,confirmation:"deny"})},xE=function(n){y(this,mf,"f").push(n)},kU=async function(n,r){var i,o;if(!y(this,bi,"f").has(n.id)){y(this,bn,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:n.name,tool_use_id:n.id}),O(this,qs,(i=y(this,qs,"f"),i++,i),"f");try{let s=y(this,_E,"f").get(n.name);if(!s){y(this,bn,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:n.name,tool_use_id:n.id}),r==="allow"&&y(this,vi,"f").disarm(),y(this,zt,"m",xE).call(this,{event:n,toolUseId:n.id,name:n.name,isError:!1,posted:!1,confirmation:r});return}let a,c,l=y(this,df,"f")?.openTelemetry?.conversationId??(n.session_thread_id||y(this,Ib,"f")),u=new AbortController,d=mc(y(this,On,"f").signal,u),p=setTimeout(()=>u.abort(),JUe);try{let g={signal:y(this,On,"f").signal,conversationId:l,sessionID:this.sessionId,parentContext:y(this,kE,"f")},h=await Vp(this.client,s,n,g,async()=>{let v=await hE(s,n.input,{toolUse:n,toolUseBlock:n,signal:u.signal}),b=rje(v.content),_=this.client._tracer?b.map((w,k)=>{let x=typeof v.content=="string"?void 0:v.content[k];return x&&x.type!=="text"&&w.type==="text"?x:w}):b;return{sent:b,content:_,isError:v.isError}});a=h.sent,c=h.isError}finally{clearTimeout(p),d()}let f=nje(n,c,a),m=await y(this,zt,"m",tie).call(this,f,n.id,l);y(this,zt,"m",xE).call(this,{event:n,result:f,toolUseId:n.id,name:n.name,isError:c,posted:m,confirmation:r})}finally{O(this,qs,(o=y(this,qs,"f"),o--,o),"f"),y(this,qs,"f")===0&&y(this,Ab,"f")?.call(this)}}},tie=async function(n,r,i){let o=y(this,On,"f"),s=Date.now(),a,c=0;for(;;){c++,o.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[n]},{...y(this,zt,"m",$E).call(this),openTelemetry:{conversationId:i}}),y(this,bi,"f").add(r),!0}catch(l){if(a=l,tu(l))break;let u=y(this,wE,"f")-(Date.now()-s);if(u<=0)break;let d=Math.min(aE(sE(c-1,YUe,QUe)),u);y(this,bn,"f").warn("tool result send failed; retrying",{tool_use_id:r,attempt:c,backoff_ms:d,error:String(l)}),await fo(d,o.signal)}}return y(this,bn,"f").error("failed to send tool result",{tool_use_id:r,attempts:c,error:String(a)}),!1},nie=async function(){y(this,qs,"f")!==0&&(await Promise.race([new Promise(n=>O(this,Ab,n,"f")),fo(ZUe)]),O(this,Ab,null,"f"),y(this,qs,"f")>0&&y(this,bn,"f").warn("drain timeout exceeded"))},e})()});function EE(e,t){if(!(e>=Cb))throw new Q(`${t} must be at least ${Cb}ms (got ${e}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`)}var Nb,Cb,TE=P(()=>{at();Nb=15e3,Cb=5e3});function ru(e){if(e.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${e.name}" must be an object, but got ${e.inputSchema.type}`);return{type:"custom",name:e.name,input_schema:e.inputSchema,description:e.description,run:e.run,parse:t=>t,...e.close?{close:e.close}:{}}}var oie=P(()=>{});function gf(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}var SU=P(()=>{});function AE(e,t){let n=Pe.relative(e,t);return n===""||!n.startsWith(".."+Pe.sep)&&n!==".."&&!Pe.isAbsolute(n)}async function xU(e,t){for(let n of e)if(AE(await Ob(Pe.resolve(n)),t))return n}function Mb(e){let t=e?.code;return typeof t=="string"?t:void 0}async function Ob(e){let t=[],n=e,r=0;for(;;){let i;try{i=await iu.realpath(n)}catch(o){let s;try{s=(await iu.lstat(n)).isSymbolicLink()}catch(a){let c=Mb(a);if(c!=="ENOENT"&&c!=="ENOTDIR")throw a;let l=Pe.dirname(n);if(l===n)throw a;t.push(Pe.basename(n)),n=l;continue}if(!s)throw o;if(++r>oje)throw Object.assign(new Error("too many levels of symbolic links"),{code:"ELOOP"});n=Pe.resolve(Pe.dirname(n),await iu.readlink(n));continue}return t.length?Pe.join(i,...t.reverse()):i}}async function sie(e,t,n){let r=n?.allowedRoots??[],i=await Ob(Pe.resolve(e)),o;try{o=await Ob(Pe.resolve(i,t))}catch(a){throw new Ue(hf(a,`path ${JSON.stringify(t)}`))}if(AE(i,o)||await xU(r,o)!==void 0)return o;let s=r.length?"the session's working directory and its other permitted directories":"the session's working directory";throw new Ue(`path ${JSON.stringify(t)} is outside ${s}`)}async function EU(e,t){let n=Pe.dirname(e),r=Pe.join(n,`.tmp-${process.pid}-${Fs.randomUUID()}`),i=await iu.stat(e).then(s=>s.mode&511,()=>{}),o;try{o=await iu.open(r,"wx",ije),i!==void 0&&await o.chmod(i),await o.writeFile(t,"utf-8"),await o.sync(),await o.close(),o=void 0,await iu.rename(r,e)}catch(s){throw o&&await o.close().catch(()=>{}),await iu.unlink(r).catch(()=>{}),s}}function hf(e,t){let n=Mb(e);switch(n){case"ENOENT":return`${t}: no such file or directory`;case"EACCES":case"EPERM":return`${t}: permission denied`;case"ENOTDIR":return`${t}: not a directory`;case"EISDIR":return`${t}: is a directory`;case"ELOOP":return`${t}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${t}: file name too long`;case"ENOSPC":return`${t}: no space left on device`;case"EMFILE":case"ENFILE":return`${t}: too many open files`;default:return`${t}: ${n!==void 0?`i/o error (${n})`:"i/o error"}`}}var iu,Db,ije,oje,TU=P(()=>{qr();lf();iu=Us.promises,Db=448,ije=384;oje=40});async function cie(e){let{client:t,sessionId:n}=e;if(!t)return async()=>{};let r=Te(t),i=e.session;if(!i){if(n===void 0)return async()=>{};r.warn("AgentToolContext.sessionId is deprecated and costs an extra session fetch; fetch the session once and set `session` instead",{component:"agent-tool-context"}),i=await t.beta.sessions.retrieve(n)}let o=Pe.resolve(e.workdir,"skills"),s=[];for(let a of i.agent.skills)try{let c=await t.beta.skills.versions.retrieve(a.version,{skill_id:a.skill_id}),l=Pe.basename(c.name.trim());(l===""||l==="."||l==="..")&&(l=a.skill_id);let u=Pe.resolve(o,l);if(u!==o&&!u.startsWith(o+Pe.sep)){r.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:c.name});continue}let d=await t.beta.skills.versions.download(c.id,{skill_id:a.skill_id});await qi.rm(u,{recursive:!0,force:!0}),await qi.mkdir(u,{recursive:!0,mode:Db}),s.push(u),await RU(d,u),r.info("downloaded skill",{component:"agent-tool-context",skill_id:a.skill_id,version:c.id,dest:u})}catch(c){r.warn("failed to download skill",{component:"agent-tool-context",skill_id:a.skill_id,error:String(c)})}return async()=>{for(let a of s)await qi.rm(a,{recursive:!0,force:!0}).catch(c=>{r.warn("failed to clean up skill",{component:"agent-tool-context",dest:a,error:String(c)})})}}function aje(e){for(let t of e){let n=t.trim();if(n&&(Pe.isAbsolute(n)||n.split(/[\\/]/).includes("..")))throw new Q(`refusing to extract unsafe archive member: ${n}`)}}function aie(e){let t=e.split(` +`);return t[t.length-1]===""&&t.pop(),t}function lje(e,t){return/^[\x20-\x7E]+$/.test(t)&&!/[\\^#]/.test(t)&&!(e==="unzip"&&t.startsWith("-"))}function uje(e,t,n){let r=aie(t),i=aie(n);if(r.length!==i.length)throw new Q(IU);let o=[],s=[];return r.forEach((a,c)=>{if(cje[e].has(i[c].charAt(0))){o.push(a);return}if(!lje(e,a))throw new Q(`refusing to extract archive: cannot safely exclude member ${JSON.stringify(a)}`);s.push(a)}),{plain:o,special:s}}async function lie(e){for(let t of await qi.readdir(e,{withFileTypes:!0}))if(t.isDirectory())await lie(Pe.join(e,t.name));else if(!t.isFile())throw new Q(IU)}async function AU(e,t){try{let{stdout:n}=await sje(e,t);return n}catch(n){throw Mb(n)==="ENOENT"?new Q(`skill extraction requires the \`${e}\` command, but it was not found on PATH`):n}}function dje(e){let t,n=!1;for(let r of e){let i=r.trim().split("/").filter(s=>s!==""&&s!==".");if(i.length===0)continue;let o=i[0];if(t===void 0)t=o;else if(o!==t)return"";i.length>1&&(n=!0)}return t!==void 0&&n?t:""}async function RU(e,t){let n=Pe.join(t,`.skill-archive-${process.pid}-${Date.now()}`);if(!e.body)throw new Q("skill download response had no body");await _x.promises.pipeline(_x.Readable.fromWeb(e.body),Us.createWriteStream(n));let r=Pe.join(Pe.dirname(t),`.skill-stage-${process.pid}-${Date.now()}`),i=Pe.join(Pe.dirname(t),`.skill-exclude-${process.pid}-${Date.now()}`);try{let o=await fje(n,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,a=s?"unzip":"tar",c=await AU(a,s?["-Z1",n]:["-tf",n]),l=await AU(a,s?["-Z","--h","--t",n]:["-tvf",n]),{plain:u,special:d}=uje(a,c,l);aje([...u,...d]);let p=dje(u);await qi.mkdir(r,{recursive:!0,mode:Db}),u.length>0&&await AU(a,await pje(a,n,r,d,i)),await lie(r);let f=p?Pe.join(r,p):r,m=await qi.readdir(f).catch(g=>{throw Mb(g)==="ENOENT"?new Q(IU):g});for(let g of m)await qi.rename(Pe.join(f,g),Pe.join(t,g))}finally{await qi.rm(n,{force:!0}),await qi.rm(i,{force:!0}),await qi.rm(r,{recursive:!0,force:!0})}}async function pje(e,t,n,r,i){let o=r.map(s=>s.replace(/[*?[\\]/g,"\\$&"));return e==="unzip"?["-oq",t,"-d",n,...o.length>0?["-x",...o]:[]]:o.length===0?["-xf",t,"-C",n]:(await qi.writeFile(i,o.join(` `)+` -`,{flag:"wx",mode:384}),["-xf",t,"-C",n,"-X",r])}async function FPe(e,t){let n=await Ii.open(e,"r");try{let i=Buffer.alloc(t),{bytesRead:r}=await n.read(i,0,t,0);return i.subarray(0,r)}finally{await n.close()}}var Ii,NPe,JM,PPe,YQ=j(()=>{Mr();kt();Xi();HM();Ii=fs.promises,NPe=nM.promisify(tM.execFile);JM="skill archive listing is inconsistent; refusing to extract",PPe={unzip:new Set(["-","d","?"]),tar:new Set(["-","d","C"])}});function QM(e){return e.startsWith("/")&&!e.split("/").includes("..")}function GPe(){return YM!==0}async function VPe(e){let t=[],n=e;for(;;){try{await $n.stat(n);break}catch(r){let o=r.code;if(o!=="ENOENT"&&o!=="ENOTDIR"&&o!=="ELOOP")throw r}t.push(n);let i=xe.dirname(n);if(i===n)break;n=i}for(let i of t.reverse())try{await $n.mkdir(i,{mode:tX})}catch(r){if(r.code!=="EEXIST")throw r}}async function QQ(e,t){let n=xe.relative(e,t);if(n==="")return;let i=e;for(let r of n.split(xe.sep)){i=xe.join(i,r);try{await $n.mkdir(i,{mode:tX})}catch(o){if(o.code!=="EEXIST")throw o}}}async function BPe(e,t,n){let i=n?jPe:UPe,r=xe.join(xe.dirname(e),`.fs-${Oa.randomBytes(8).toString("hex")}.tmp`),o;try{o=await $n.open(r,Mp.O_WRONLY|Mp.O_CREAT|Mp.O_EXCL|YM,i),await o.writeFile(t),await o.close(),o=void 0,await $n.rename(r,e)}catch(s){throw o&&await o.close().catch(()=>{}),await $n.unlink(r).catch(()=>{}),s}}async function nX(e,t){let n;try{n=await $n.open(t,Mp.O_RDONLY|YM|zPe)}catch(i){let r=i.code;throw r==="ELOOP"||r==="EMLINK"?new Je(Je.IS_A_SYMLINK,e):i}try{if(!(await n.stat()).isFile())throw new Je(Je.NOT_A_FILE,e)}catch(i){throw await n.close().catch(()=>{}),i}return n}async function qPe(e){let t=Oa.createHash("sha256"),n=await nX(xe.basename(e),e),i=new Uint8Array(1024*1024);try{for(;;){let{bytesRead:r}=await n.read(i,0,i.length);if(r===0)break;t.update(i.subarray(0,r))}}finally{await n.close()}return t.digest("hex")}async function XQ(e,t,n){if(!await HPe(t,n))return[];let i=[];return await rX(n,(r,o)=>{o.isFile()&&i.push([xe.relative(e,r).split(xe.sep).join("/"),r])}),i.sort(),i}async function WPe(e,t,n){let i=s=>xe.relative(e,s).split(xe.sep).join("/"),r;try{r=await $n.lstat(n,{bigint:!0})}catch(s){let a=s.code;if(a==="ENOENT"||a==="ENOTDIR")return new Set;throw s}if(r.isSymbolicLink())return new Set([i(n)]);if(!r.isDirectory())throw new Je(Je.NOT_A_DIRECTORY,t);let o=new Set;return await rX(n,(s,a)=>{a.isSymbolicLink()&&o.add(i(s))}),o}async function HPe(e,t){let n;try{n=await $n.lstat(t,{bigint:!0})}catch(i){let r=i.code;if(r==="ENOENT"||r==="ENOTDIR")return!1;throw i}if(!n.isDirectory())throw new Je(Je.NOT_A_DIRECTORY,e);return!0}async function rX(e,t){let n=[e];for(;n.length;){let i=n.pop(),r;try{r=await $n.readdir(i,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")continue;throw o}for(let o of r){let s=xe.join(i,o.name);t(s,o),o.isDirectory()&&!o.isSymbolicLink()&&n.push(s)}}}function KPe(e,t){return t.mtimeNs===e.mtimeNs&&t.ctimeNs===e.ctimeNs&&t.size===e.size}function JPe(e,t){return(e.mtimeNs>e.ctimeNs?e.mtimeNs:e.ctimeNs){Mr();xl();$n=fs.promises,Mp=fs.constants,tX=448,UPe=384,jPe=448,YM=Mp.O_NOFOLLOW??0,zPe=Mp.O_NONBLOCK??0,Je=class extends Error{constructor(t,n){super(`path ${JSON.stringify(n)} ${t}`),this.name="FileStoreError",this.reason=t,this.relPath=n}};Je.ESCAPES_ROOT="escapes the store root";Je.IS_A_SYMLINK="is a symlink";Je.NOT_A_FILE="is not a regular file";Je.NOT_A_DIRECTORY="is not a directory";Je.NOT_UTF8="is not valid utf-8";Je.MOVE_DESTINATION_EXISTS="already exists";Lp=class e{constructor(t,n,i=!1){this.hashes=new Map,this.rootPath=t,this.removedOnDispose=n,this.decoder=i?new TextDecoder("utf-8",{fatal:!0}):void 0}static async open(t,n){if(!GPe())throw new Error("FileStore requires O_NOFOLLOW support on this platform");let i=!1;try{await $n.lstat(t)}catch(r){if(r.code!=="ENOENT")throw r;i=!0}return new e(xe.resolve(t),i,n?.utf8??!1)}async createRoot(){await VPe(this.rootPath)}root(){return{path:this.rootPath,removedOnDispose:this.removedOnDispose}}async dispose(){this.removedOnDispose&&await $n.rm(this.rootPath,{recursive:!0,force:!0})}async put(t,n,i){let r=t.replace(/\\/g,"/");if(r.endsWith("/")||r.endsWith("/.")||r===""||r===".")throw new Je(Je.NOT_A_FILE,t);let o=this.resolveUnderRoot(t),s=typeof n=="string"?Ma(n):n;this.requireUtf8(t,s),await QQ(this.rootPath,xe.dirname(o)),await BPe(o,s,i?.executable??!1)}async get(t){let n=this.resolveUnderRoot(t),i;try{i=await nX(t,n)}catch(o){if(o.code==="ENOENT")return null;throw o}let r;try{let o=await i.readFile();r=new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}finally{await i.close()}return this.requireUtf8(t,r),r}async ls(t="/"){let n=this.resolveUnderRoot(t);return new Set((await XQ(this.rootPath,t,n)).map(([i])=>i))}async findSymlinks(t="/"){let n=this.resolveUnderRoot(t);return WPe(this.rootPath,t,n)}async hashtree(t="/"){let n=this.resolveUnderRoot(t),i=uS.nowNs(),r=Object.create(null);for(let[o,s]of await XQ(this.rootPath,t,n)){let a=await this.hashViaCache(o,s,i);a!==null&&(r[o]=a)}return r}async hashFile(t){let n=this.resolveUnderRoot(t),i;try{i=await $n.lstat(n,{bigint:!0})}catch(o){if(o.code==="ENOENT")return null;throw o}if(i.isSymbolicLink())throw new Je(Je.IS_A_SYMLINK,t);if(!i.isFile())throw new Je(Je.NOT_A_FILE,t);let r=xe.relative(this.rootPath,n).split(xe.sep).join("/");return this.hashViaCache(r,n,uS.nowNs())}async move(t,n){let i=this.resolveUnderRoot(t),r=this.resolveUnderRoot(n);if(i===this.rootPath||r===this.rootPath)return;if(await $n.stat(r).then(()=>!0,()=>!1))throw new Je(Je.MOVE_DESTINATION_EXISTS,n);await QQ(this.rootPath,xe.dirname(r)),await $n.rename(i,r)}async remove(t){let n=this.resolveUnderRoot(t);if(n===this.rootPath)return;let i;try{i=await $n.lstat(n,{bigint:!0})}catch(r){if(r.code==="ENOENT")return;throw r}if(i.isDirectory())await $n.rm(n,{recursive:!0,force:!0});else try{await $n.unlink(n)}catch(r){if(r.code!=="ENOENT")throw r}}resolveUnderRoot(t){let n=t.replace(/\\/g,"/").replace(/^\/+/,""),i=n.split("/").filter(r=>r!==""&&r!==".");if(xe.posix.isAbsolute(n)||i.includes(".."))throw new Je(Je.ESCAPES_ROOT,t);return i.length===0?this.rootPath:xe.join(this.rootPath,...i)}requireUtf8(t,n){if(this.decoder)try{this.decoder.decode(n)}catch{throw new Je(Je.NOT_UTF8,t)}}async hashViaCache(t,n,i){let r;try{r=await $n.lstat(n,{bigint:!0})}catch(a){if(a.code==="ENOENT")return null;throw a}if(!r.isFile())return null;let o=this.hashes.get(t),s;if(o!==void 0&&KPe(o,r))s=o.sha;else try{s=await uS.hashFile(n)}catch(a){let c=a.code;if(c==="ENOENT"||a instanceof Je||c==="ELOOP"||c==="EMLINK")return null;throw a}return JPe(r,i)&&this.hashes.set(t,{mtimeNs:r.mtimeNs,ctimeNs:r.ctimeNs,size:r.size,sha:s}),s}};Lp.isPathLegal=QM;ZPe=2000000000n,uS={hashFile:qPe,timestampTrustMarginNs:ZPe,nowNs:()=>BigInt(Date.now())*1000000n},iX=Lp,eX=Symbol.asyncDispose;eX&&Object.defineProperty(Lp.prototype,eX,{value:Lp.prototype.dispose,configurable:!0,writable:!0})});function pX(e){return Oa.createHash("sha256").update(`version ${yX} -${e}`,"utf-8").digest("hex")}function Up(e){return typeof e=="object"&&e!==null&&typeof e.code=="string"}async function iDe(e,t){if(!t){await e;return}let n,i=new Promise(r=>{n=r,t.aborted&&r()});t.addEventListener("abort",n,{once:!0});try{await Promise.race([e,i])}finally{t.removeEventListener("abort",n)}}var $t,Wa,gS,ry,hS,ct,Fp,fS,qa,fX,mS,mX,gX,XM,tL,sX,aX,eL,cX,lX,dS,pS,uX,dX,hX,Cl,yX,YPe,QPe,XPe,eDe,tDe,nDe,rDe,ys,nL,yS,bX=j(()=>{gr();Mr();kt();Xi();xl();_p();oX();cS();cS();hX=3e4,Cl=".anthropic-memory-store",yX=1;YPe=3e4,QPe=100,XPe=20,eDe=16,tDe=32,nDe=8,rDe=50,ys=class extends J{constructor(t,n){super(t),this.name="SessionMemoryError",n!==void 0&&(this.cause=n)}},nL=class{constructor(t,n,i){this.mode=t,this.cap=n,this.waiveWindow=i,this.attempted=0,this.capped=0,this.suppressed=0}takeSlot(){return this.attempted>=this.cap?(this.capped++,!1):(this.attempted++,!0)}},yS=class{constructor(t,n){$t.add(this),Wa.set(this,void 0),gS.set(this,void 0),ry.set(this,void 0),hS.set(this,void 0),ct.set(this,void 0),Fp.set(this,void 0),fS.set(this,!1),qa.set(this,[]),M(this,Wa,t,"f"),M(this,gS,n.workdir,"f"),M(this,ry,n.syncIntervalMs??Xh,"f"),aS(v(this,ry,"f"),"syncIntervalMs"),M(this,hS,n.syncDeletions??"enabled","f"),M(this,ct,qe(t),"f"),M(this,Fp,Date.now(),"f")}get roots(){return v(this,qa,"f").map(t=>t.files.root().path)}get readOnlyRoots(){return v(this,qa,"f").filter(t=>t.readOnly).map(t=>t.files.root().path)}async download(t){for(let n of t.resources){if(n.type!=="memory_store")continue;let i=v(this,$t,"m",fX).call(this,n),r;try{if(r={memoryStoreId:n.memory_store_id,files:await iX.open(i,{utf8:!0}),readOnly:n.access==="read_only",baseline:new Map,refusedShas:new Map,pendingDeletes:new Map},!r.files.root().removedOnDispose)throw new ys(`something already exists at the memory store's path: ${i} (memory_store_id=${n.memory_store_id}); it must not exist when the session starts`);try{await r.files.createRoot()}catch(o){throw Up(o)?new ys(`cannot create the memory store's folder: ${i} (memory_store_id=${n.memory_store_id}): ${o}; the worker host must make this mount path writable`,o):o}await v(this,$t,"m",tL).call(this,r),v(this,ct,"f").info("downloaded memories",{count:r.baseline.size,memory_store_id:r.memoryStoreId,dest:r.files.root().path}),v(this,qa,"f").push(r)}catch(o){throw r&&await r.files.dispose().catch(()=>{}),o instanceof ys?o:new ys(`failed to download memory store memory_store_id=${n.memory_store_id}: ${o}`,o)}}M(this,Fp,Date.now(),"f")}async finish(){if(v(this,fS,"f"))throw new J("finish() was already called: it is the session's last sync and runs once");M(this,fS,!0,"f"),await this.syncAll(!0)}async syncAll(t){await Promise.all(v(this,qa,"f").map(n=>v(this,$t,"m",mX).call(this,n,t))),M(this,Fp,Date.now(),"f")}async syncIfDue(){Date.now()-v(this,Fp,"f")v(this,$t,"m",gX).call(this,n,t)))}async dispose(){for(let t of v(this,qa,"f")){let n=t.files.root();try{let i=await v(this,$t,"m",mS).call(this,t);if(!i.markerOk&&Object.keys(i.files).length>0){v(this,ct,"f").warn(`${i.distrustReason}; leaving the memory store folder on disk`,{root:n.path,memory_store_id:t.memoryStoreId});continue}await t.files.dispose()}catch(i){if(!(i instanceof Je)&&!Up(i))throw i;v(this,ct,"f").warn("failed to remove the memory store folder",{root:t.files.root().path,memory_store_id:t.memoryStoreId,error:String(i)});continue}n.removedOnDispose&&v(this,ct,"f").info("removed memory store dir",{dest:n.path,memory_store_id:t.memoryStoreId})}}};Wa=new WeakMap,gS=new WeakMap,ry=new WeakMap,hS=new WeakMap,ct=new WeakMap,Fp=new WeakMap,fS=new WeakMap,qa=new WeakMap,$t=new WeakSet,fX=function(t){if(t.mount_path){if(!QM(t.mount_path))throw new ys(`memory store mount_path is not a clean absolute path: ${JSON.stringify(t.mount_path)} (memory_store_id=${t.memory_store_id})`);return t.mount_path}return xe.join(v(this,gS,"f"),"memory",t.name||t.memory_store_id)},mS=async function(t){let n=await t.files.hashtree(),i=n[Cl];return delete n[Cl],i===pX(t.memoryStoreId)?{files:n,markerOk:!0,distrustReason:null}:{files:n,markerOk:!1,distrustReason:i!==void 0?"the marker file does not match this store":"the marker file is gone"}},mX=async function(t,n){try{let i=await v(this,$t,"m",mS).call(this,t),r=i.files;if(!i.markerOk){if(Object.keys(r).length>0){v(this,ct,"f").warn(`${i.distrustReason}; leaving the memory store folder as found and not syncing`,{root:t.files.root().path,memory_store_id:t.memoryStoreId});return}await v(this,$t,"m",XM).call(this,t,"the folder or its marker is gone");return}if(Object.keys(r).length===0&&t.baseline.size>1){await v(this,$t,"m",XM).call(this,t,"every memory file is gone at once");return}let o=new Map;for await(let[u,d]of v(this,$t,"m",dS).call(this,t.memoryStoreId))o.set(u,d);let s=new nL(v(this,hS,"f"),Math.max(nDe,Math.min(rDe,Math.floor(t.baseline.size/4))),n),a=[],c=new Map,l=[...new Set([...o.keys(),...Object.keys(r),...t.baseline.keys()])].sort();for(let u of l){let d=o.get(u),p=r[u],f=t.baseline.get(u),m;p===void 0&&f!==void 0&&d!==void 0&&d.content_sha256===f&&!t.readOnly?m=await v(this,$t,"m",uX).call(this,t,u,d,f,s):m=await v(this,$t,"m",sX).call(this,t,u,d,p,a),m!==void 0&&c.set(u,m)}t.baseline=c,await v(this,$t,"m",cX).call(this,t,a),s.suppressed>0&&v(this,ct,"f").debug("remote deletes are disabled; locally deleted memories stay on the server",{count:s.suppressed,memory_store_id:t.memoryStoreId}),s.capped>0&&v(this,ct,"f").warn(`delete cap reached: ${s.mode==="log_only"?"would send":"sent"} ${s.attempted} deletes, held ${s.capped} for later syncs`,{memory_store_id:t.memoryStoreId})}catch(i){v(this,ct,"f").warn("memory sync failed",{memory_store_id:t.memoryStoreId,error:String(i)})}},gX=async function(t,n){let i=new Map,r=new Set,o=async()=>{if(t.readOnly)return;let s=await v(this,$t,"m",mS).call(this,t);if(!s.markerOk){v(this,ct,"f").warn(`${s.distrustReason}; not uploading anything from the memory store folder`,{root:t.files.root().path,memory_store_id:t.memoryStoreId});return}for(let[l,u]of Object.entries(s.files))u!==t.baseline.get(l)&&t.refusedShas.get(l)!==u&&(i.set(l,u),r.add(l));if(i.size===0||n?.aborted)return;let a=new Map;for await(let[l,u]of v(this,$t,"m",dS).call(this,t.memoryStoreId)){if(n?.aborted)return;a.set(l,u)}let c=[];for(let l of[...i.keys()].sort()){let u=i.get(l),d=t.baseline.get(l),p=a.get(l);if(p!==void 0&&p.content_sha256===u){t.baseline.set(l,p.content_sha256),r.delete(l);continue}if(p!==void 0&&p.content_sha256!==d){v(this,ct,"f").warn("memory changed both locally and remotely; the flush leaves the remote version",{path:l,memory_store_id:t.memoryStoreId}),r.delete(l);continue}c.push([l,u,p])}await v(this,$t,"m",lX).call(this,t,c,r,n)};try{await iDe(o(),n),n?.aborted&&r.size>0&&v(this,ct,"f").warn(`memory flush cut off part-way; ${r.size} of ${i.size} changed files had not finished uploading`,{memory_store_id:t.memoryStoreId})}catch(s){v(this,ct,"f").warn("memory flush failed",{memory_store_id:t.memoryStoreId,error:String(s)})}},XM=async function(t,n){v(this,ct,"f").warn(`${n}; re-downloading the memory store folder instead of syncing`,{root:t.files.root().path,memory_store_id:t.memoryStoreId}),await t.files.createRoot(),await v(this,$t,"m",tL).call(this,t)},tL=async function(t){t.baseline=new Map,t.pendingDeletes.clear(),await t.files.put(Cl,`version ${yX} -${t.memoryStoreId}`);for await(let[n,i]of v(this,$t,"m",dS).call(this,t.memoryStoreId,"full"))await v(this,$t,"m",eL).call(this,t,n,i.content??"")&&t.baseline.set(n,i.content_sha256)},sX=async function(t,n,i,r,o){let s=t.baseline.get(n);if(r!==void 0&&t.pendingDeletes.delete(n),!i){if(r===void 0){t.pendingDeletes.delete(n);return}if(s!==void 0){if(r===s){let d=await v(this,$t,"m",aX).call(this,t,n,s);if(d===void 0)return;if(d===s)return s;r=d}t.readOnly?v(this,ct,"f").warn("memory deleted remotely but edited locally; keeping the file, which a read-only store cannot push",{path:n,memory_store_id:t.memoryStoreId}):t.refusedShas.get(n)!==r&&v(this,ct,"f").info("memory deleted remotely but edited locally; re-creating it from the file",{path:n,memory_store_id:t.memoryStoreId})}return t.readOnly||t.refusedShas.get(n)===r?void 0:await v(this,$t,"m",pS).call(this,t,n,r,void 0)}let a=i.content_sha256,c=a!==s,l=r!==void 0&&r!==s&&r!==a,u=!t.readOnly&&l;return r===void 0&&s!==void 0?(c&&(v(this,ct,"f").warn("memory deleted locally but changed remotely; restoring the remote version",{path:n,memory_store_id:t.memoryStoreId}),t.pendingDeletes.delete(n),o.push([n,i])),s):c?r===a?a:(l&&v(this,ct,"f").warn("memory changed both locally and remotely; keeping the remote version",{path:n,memory_store_id:t.memoryStoreId}),o.push([n,i]),s):u?t.refusedShas.get(n)===r?a:await v(this,$t,"m",pS).call(this,t,n,r,i)??a:a},aX=async function(t,n,i){let r;try{r=await t.files.hashFile(n)}catch(o){if(!(o instanceof Je)&&!Up(o))throw o;return i}if(r!==null){if(r!==i)return r;try{await t.files.remove(n)}catch(o){if(!(o instanceof Je)&&!Up(o))throw o;return v(this,ct,"f").warn("failed to remove memory deleted remotely",{path:n,memory_store_id:t.memoryStoreId,error:String(o)}),i}}},eL=async function(t,n,i){try{await t.files.put(n,i)}catch(r){if(!(r instanceof Je)&&!Up(r))throw r;return v(this,ct,"f").warn("failed to write memory",{path:n,memory_store_id:t.memoryStoreId,error:String(r)}),!1}return!0},cX=async function(t,n){if(n.length===0)return;let i=async(s,a)=>{let c;try{c=await v(this,Wa,"f").beta.memoryStores.memories.retrieve(a.id,{memory_store_id:t.memoryStoreId,view:"full"})}catch(l){if(An(l,404))return;v(this,ct,"f").warn("failed to fetch memory content",{path:s,memory_store_id:t.memoryStoreId,error:String(l)});return}await v(this,$t,"m",eL).call(this,t,s,c.content??"")&&t.baseline.set(s,c.content_sha256)},r=n[Symbol.iterator](),o=async()=>{for(let[s,a]of r)await i(s,a)};await Promise.all(Array.from({length:Math.min(eDe,n.length)},o))},lX=async function(t,n,i,r){let o=n[Symbol.iterator](),s=async()=>{for(let[a,c,l]of o){if(r?.aborted)return;let u=await v(this,$t,"m",pS).call(this,t,a,c,l);i.delete(a),u!==void 0&&t.baseline.set(a,u)}};await Promise.all(Array.from({length:Math.min(tDe,n.length)},s))},dS=async function*(t,n="basic"){let i=n==="basic"?QPe:XPe;for await(let r of v(this,Wa,"f").beta.memoryStores.memories.list(t,{view:n,limit:i})){if(r.type!=="memory")continue;let o=r.path.replace(/^\/+/,"");if(o===Cl){v(this,ct,"f").warn("the server listed the reserved marker path; skipping",{path:r.path,memory_store_id:t});continue}yield[o,r]}},pS=async function e(t,n,i,r){try{let o=await t.files.get(n);if(o===null)return;let s=Sl(o),a=r?await v(this,Wa,"f").beta.memoryStores.memories.update(r.id,{memory_store_id:t.memoryStoreId,content:s,precondition:{type:"content_sha256",content_sha256:r.content_sha256}}):await v(this,Wa,"f").beta.memoryStores.memories.create(t.memoryStoreId,{path:"/"+n,content:s});return t.refusedShas.delete(n),a.content_sha256}catch(o){if(r&&An(o,404))return await v(this,$t,"m",e).call(this,t,n,i,void 0);let s=o instanceof Je||An(o,400)||An(o,413);r&&An(o,409)?v(this,ct,"f").warn("memory changed both locally and remotely; the upload was refused and the local edit loses",{path:n,memory_store_id:t.memoryStoreId}):s&&i!==void 0?(t.refusedShas.set(n,i),v(this,ct,"f").warn("the server rejected this memory file, so it stays un-synced until its content changes",{path:n,memory_store_id:t.memoryStoreId,rejection:String(o)})):v(this,ct,"f").warn("failed to upload memory",{path:n,memory_store_id:t.memoryStoreId,error:String(o)});return}},uX=async function(t,n,i,r,o){if(o.mode==="disabled")return o.suppressed++,r;let s=t.pendingDeletes.get(n);if(s===void 0&&(s=Date.now(),t.pendingDeletes.set(n,s)),!o.waiveWindow&&Date.now()-s_S,BashTimeoutError:()=>$S,DEFAULT_MEMORY_SYNC_INTERVAL_MS:()=>Xh,MARKER_PATH:()=>Cl,MEMORY_FLUSH_TIMEOUT_MS:()=>hX,MIN_MEMORY_SYNC_INTERVAL_MS:()=>Qh,SessionMemoryError:()=>ys,SessionMemoryStores:()=>yS,betaAgentToolset20260401:()=>dDe,betaBashTool:()=>AX,betaEditTool:()=>CX,betaGlobTool:()=>PX,betaGrepTool:()=>DX,betaReadTool:()=>RX,betaWriteTool:()=>NX,extractSkillArchive:()=>ZM,resolvePath:()=>zp,setupSkills:()=>JQ});function TX(e){return e===void 0?oDe:e}function Ll(e){if(e!==void 0)throw new J("The `unrestrictedPaths` option you passed to the agent toolset (AgentToolContext) is no longer supported. The toolset's file tools (read, write, edit, glob, grep) are now always confined to the working directory plus the directories listed in `allowedRoots`. Remove `unrestrictedPaths` from your context; to let the file tools reach any other directory, add it to `allowedRoots`.")}function dDe(e){return[AX(e),RX(e),NX(e),CX(e),PX(e),DX(e)]}async function zp(e,t){return Ll(e.unrestrictedPaths),HQ(e.workdir,t,{allowedRoots:e.allowedRoots??[]})}function IX(e,t){return qM(e.readOnlyRoots??[],t)}function pDe(){let e={};for(let[t,n]of Object.entries(process.env))t.startsWith("ANTHROPIC_")||(e[t]=n);return e}function AX(e){Ll(e.unrestrictedPaths);let t,n=Promise.resolve();return Rl({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:async({command:i,restart:r,timeout_ms:o},s)=>{let a=n,c=Dp();n=c.promise;try{await a}catch{}try{if(r&&(t?.close(),t=void 0),!i){if(r)return"bash session restarted";throw new Ae("bash: command is required")}t??(t=new _S(e.workdir,e.env));try{let{output:l,exitCode:u}=await t.exec(i,{timeoutMs:o??EX,signal:s?.signal});if(u!==0)throw new Ae(l||`exit ${u}`);return l}catch(l){throw l instanceof Ae?l:(t.close(),t=void 0,new Ae(`bash: ${l instanceof Error?l.message:String(l)}`))}}finally{c.resolve()}},close:()=>{t?.close(),t=void 0}})}function RX(e){return Ll(e.unrestrictedPaths),Rl({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:async({file_path:t,view_range:n})=>{if(!t)throw new Ae("read: file_path is required");let i=await zp(e,t);if(n?.length&&n.length!==2)throw new Ae("read: view_range must be [start_line, end_line]");let r;try{let u=await Rn.stat(i);if(!u.isFile())throw new Ae(`read: ${t} is not a regular file`);let d=TX(e.maxFileBytes);if(d!==null&&u.size>d){if(!n?.length)throw new Ae(`read: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. Use the view_range parameter to read specific line ranges, e.g. view_range: [1, 500].`);let[p,f]=n;return await fDe(i,t,p,f,d)}r=await Rn.readFile(i,"utf8")}catch(u){throw u instanceof Ae?u:new Ae(`read: ${Op(u,t)}`)}if(!n?.length)return r;let[o,s]=n,a=r.split(` +`,{flag:"wx",mode:384}),["-xf",t,"-C",n,"-X",i])}async function fje(e,t){let n=await qi.open(e,"r");try{let r=Buffer.alloc(t),{bytesRead:i}=await n.read(r,0,t,0);return r.subarray(0,i)}finally{await n.close()}}var qi,sje,IU,cje,uie=P(()=>{qr();at();qn();TU();qi=Us.promises,sje=gF.promisify(mF.execFile);IU="skill archive listing is inconsistent; refusing to extract",cje={unzip:new Set(["-","d","?"]),tar:new Set(["-","d","C"])}});function NU(e){return e.startsWith("/")&&!e.split("/").includes("..")}function yje(){return CU!==0}async function bje(e){let t=[],n=e;for(;;){try{await En.stat(n);break}catch(i){let o=i.code;if(o!=="ENOENT"&&o!=="ENOTDIR"&&o!=="ELOOP")throw i}t.push(n);let r=Pe.dirname(n);if(r===n)break;n=r}for(let r of t.reverse())try{await En.mkdir(r,{mode:mie})}catch(i){if(i.code!=="EEXIST")throw i}}async function die(e,t){let n=Pe.relative(e,t);if(n==="")return;let r=e;for(let i of n.split(Pe.sep)){r=Pe.join(r,i);try{await En.mkdir(r,{mode:mie})}catch(o){if(o.code!=="EEXIST")throw o}}}async function vje(e,t,n){let r=n?gje:mje,i=Pe.join(Pe.dirname(e),`.fs-${Fs.randomBytes(8).toString("hex")}.tmp`),o;try{o=await En.open(i,yf.O_WRONLY|yf.O_CREAT|yf.O_EXCL|CU,r),await o.writeFile(t),await o.close(),o=void 0,await En.rename(i,e)}catch(s){throw o&&await o.close().catch(()=>{}),await En.unlink(i).catch(()=>{}),s}}async function gie(e,t){let n;try{n=await En.open(t,yf.O_RDONLY|CU|hje)}catch(r){let i=r.code;throw i==="ELOOP"||i==="EMLINK"?new Et(Et.IS_A_SYMLINK,e):r}try{if(!(await n.stat()).isFile())throw new Et(Et.NOT_A_FILE,e)}catch(r){throw await n.close().catch(()=>{}),r}return n}async function _je(e){let t=Fs.createHash("sha256"),n=await gie(Pe.basename(e),e),r=new Uint8Array(1024*1024);try{for(;;){let{bytesRead:i}=await n.read(r,0,r.length);if(i===0)break;t.update(r.subarray(0,i))}}finally{await n.close()}return t.digest("hex")}async function pie(e,t,n){if(!await kje(t,n))return[];let r=[];return await hie(n,(i,o)=>{o.isFile()&&r.push([Pe.relative(e,i).split(Pe.sep).join("/"),i])}),r.sort(),r}async function wje(e,t,n){let r=s=>Pe.relative(e,s).split(Pe.sep).join("/"),i;try{i=await En.lstat(n,{bigint:!0})}catch(s){let a=s.code;if(a==="ENOENT"||a==="ENOTDIR")return new Set;throw s}if(i.isSymbolicLink())return new Set([r(n)]);if(!i.isDirectory())throw new Et(Et.NOT_A_DIRECTORY,t);let o=new Set;return await hie(n,(s,a)=>{a.isSymbolicLink()&&o.add(r(s))}),o}async function kje(e,t){let n;try{n=await En.lstat(t,{bigint:!0})}catch(r){let i=r.code;if(i==="ENOENT"||i==="ENOTDIR")return!1;throw r}if(!n.isDirectory())throw new Et(Et.NOT_A_DIRECTORY,e);return!0}async function hie(e,t){let n=[e];for(;n.length;){let r=n.pop(),i;try{i=await En.readdir(r,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")continue;throw o}for(let o of i){let s=Pe.join(r,o.name);t(s,o),o.isDirectory()&&!o.isSymbolicLink()&&n.push(s)}}}function $je(e,t){return t.mtimeNs===e.mtimeNs&&t.ctimeNs===e.ctimeNs&&t.size===e.size}function Sje(e,t){return(e.mtimeNs>e.ctimeNs?e.mtimeNs:e.ctimeNs){qr();Mp();En=Us.promises,yf=Us.constants,mie=448,mje=384,gje=448,CU=yf.O_NOFOLLOW??0,hje=yf.O_NONBLOCK??0,Et=(()=>{class e extends Error{constructor(n,r){super(`path ${JSON.stringify(r)} ${n}`),this.name="FileStoreError",this.reason=n,this.relPath=r}}return e.ESCAPES_ROOT="escapes the store root",e.IS_A_SYMLINK="is a symlink",e.NOT_A_FILE="is not a regular file",e.NOT_A_DIRECTORY="is not a directory",e.NOT_UTF8="is not valid utf-8",e.MOVE_DESTINATION_EXISTS="already exists",e})();PU=(()=>{class e{constructor(n,r,i=!1){this.hashes=new Map,this.rootPath=n,this.removedOnDispose=r,this.decoder=i?new TextDecoder("utf-8",{fatal:!0}):void 0}static async open(n,r){if(!yje())throw new Error("FileStore requires O_NOFOLLOW support on this platform");let i=!1;try{await En.lstat(n)}catch(o){if(o.code!=="ENOENT")throw o;i=!0}return new e(Pe.resolve(n),i,r?.utf8??!1)}async createRoot(){await bje(this.rootPath)}root(){return{path:this.rootPath,removedOnDispose:this.removedOnDispose}}async dispose(){this.removedOnDispose&&await En.rm(this.rootPath,{recursive:!0,force:!0})}async put(n,r,i){let o=n.replace(/\\/g,"/");if(o.endsWith("/")||o.endsWith("/.")||o===""||o===".")throw new Et(Et.NOT_A_FILE,n);let s=this.resolveUnderRoot(n),a=typeof r=="string"?Dp(r):r;this.requireUtf8(n,a),await die(this.rootPath,Pe.dirname(s)),await vje(s,a,i?.executable??!1)}async get(n){let r=this.resolveUnderRoot(n),i;try{i=await gie(n,r)}catch(s){if(s.code==="ENOENT")return null;throw s}let o;try{let s=await i.readFile();o=new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}finally{await i.close()}return this.requireUtf8(n,o),o}async ls(n="/"){let r=this.resolveUnderRoot(n);return new Set((await pie(this.rootPath,n,r)).map(([i])=>i))}async findSymlinks(n="/"){let r=this.resolveUnderRoot(n);return wje(this.rootPath,n,r)}async hashtree(n="/"){let r=this.resolveUnderRoot(n),i=IE.nowNs(),o=Object.create(null);for(let[s,a]of await pie(this.rootPath,n,r)){let c=await this.hashViaCache(s,a,i);c!==null&&(o[s]=c)}return o}async hashFile(n){let r=this.resolveUnderRoot(n),i;try{i=await En.lstat(r,{bigint:!0})}catch(s){if(s.code==="ENOENT")return null;throw s}if(i.isSymbolicLink())throw new Et(Et.IS_A_SYMLINK,n);if(!i.isFile())throw new Et(Et.NOT_A_FILE,n);let o=Pe.relative(this.rootPath,r).split(Pe.sep).join("/");return this.hashViaCache(o,r,IE.nowNs())}async move(n,r){let i=this.resolveUnderRoot(n),o=this.resolveUnderRoot(r);if(i===this.rootPath||o===this.rootPath)return;if(await En.stat(o).then(()=>!0,()=>!1))throw new Et(Et.MOVE_DESTINATION_EXISTS,r);await die(this.rootPath,Pe.dirname(o)),await En.rename(i,o)}async remove(n){let r=this.resolveUnderRoot(n);if(r===this.rootPath)return;let i;try{i=await En.lstat(r,{bigint:!0})}catch(o){if(o.code==="ENOENT")return;throw o}if(i.isDirectory())await En.rm(r,{recursive:!0,force:!0});else try{await En.unlink(r)}catch(o){if(o.code!=="ENOENT")throw o}}resolveUnderRoot(n){let r=n.replace(/\\/g,"/").replace(/^\/+/,""),i=r.split("/").filter(o=>o!==""&&o!==".");if(Pe.posix.isAbsolute(r)||i.includes(".."))throw new Et(Et.ESCAPES_ROOT,n);return i.length===0?this.rootPath:Pe.join(this.rootPath,...i)}requireUtf8(n,r){if(this.decoder)try{this.decoder.decode(r)}catch{throw new Et(Et.NOT_UTF8,n)}}async hashViaCache(n,r,i){let o;try{o=await En.lstat(r,{bigint:!0})}catch(c){if(c.code==="ENOENT")return null;throw c}if(!o.isFile())return null;let s=this.hashes.get(n),a;if(s!==void 0&&$je(s,o))a=s.sha;else try{a=await IE.hashFile(r)}catch(c){let l=c.code;if(l==="ENOENT"||c instanceof Et||l==="ELOOP"||l==="EMLINK")return null;throw c}return Sje(o,i)&&this.hashes.set(n,{mtimeNs:o.mtimeNs,ctimeNs:o.ctimeNs,size:o.size,sha:a}),a}}return e.isPathLegal=NU,e})();xje=2000000000n,IE={hashFile:_je,timestampTrustMarginNs:xje,nowNs:()=>BigInt(Date.now())*1000000n},yie=PU,fie=Symbol.asyncDispose;fie&&Object.defineProperty(PU.prototype,fie,{value:PU.prototype.dispose,configurable:!0,writable:!0})});function Aie(e){return Fs.createHash("sha256").update(`version ${Rie} +${e}`,"utf-8").digest("hex")}function vf(e){return typeof e=="object"&&e!==null&&typeof e.code=="string"}async function Nje(e,t){if(!t){await e;return}let n,r=new Promise(i=>{n=i,t.aborted&&i()});t.addEventListener("abort",n,{once:!0});try{await Promise.race([e,r])}finally{t.removeEventListener("abort",n)}}var wt,yc,RE,Lb,PE,dt,bf,CE,bc,vie,NE,_ie,wie,OU,DU,MU,kie,$ie,LU,Sie,xie,OE,DE,Eie,Tie,Iie,ou,Rie,Eje,Tje,Aje,Ije,Rje,Pje,Cje,Ws,FU,Pie,Cie=P(()=>{sr();qr();at();qn();Mp();wb();bie();TE();TE();Iie=3e4,ou=".anthropic-memory-store",Rie=1;Eje=3e4,Tje=100,Aje=20,Ije=16,Rje=32,Pje=8,Cje=50,Ws=class extends Q{constructor(t,n){super(t),this.name="SessionMemoryError",n!==void 0&&(this.cause=n)}},FU=class{constructor(t,n,r){this.mode=t,this.cap=n,this.waiveWindow=r,this.attempted=0,this.capped=0,this.suppressed=0}takeSlot(){return this.attempted>=this.cap?(this.capped++,!1):(this.attempted++,!0)}},Pie=(()=>{class e{constructor(n,r){wt.add(this),yc.set(this,void 0),RE.set(this,void 0),Lb.set(this,void 0),PE.set(this,void 0),dt.set(this,void 0),bf.set(this,void 0),CE.set(this,!1),bc.set(this,[]),O(this,yc,n,"f"),O(this,RE,r.workdir,"f"),O(this,Lb,r.syncIntervalMs??Nb,"f"),EE(y(this,Lb,"f"),"syncIntervalMs"),O(this,PE,r.syncDeletions??"enabled","f"),O(this,dt,Te(n),"f"),O(this,bf,Date.now(),"f")}get roots(){return y(this,bc,"f").map(n=>n.files.root().path)}get readOnlyRoots(){return y(this,bc,"f").filter(n=>n.readOnly).map(n=>n.files.root().path)}async download(n){for(let r of n.resources){if(r.type!=="memory_store")continue;let i=y(this,wt,"m",vie).call(this,r),o;try{if(o={memoryStoreId:r.memory_store_id,files:await yie.open(i,{utf8:!0}),readOnly:r.access==="read_only",baseline:new Map,refusedShas:new Map,pendingDeletes:new Map,sentShas:new Map},!o.files.root().removedOnDispose)throw new Ws(`something already exists at the memory store's path: ${i} (memory_store_id=${r.memory_store_id}); it must not exist when the session starts`);try{await o.files.createRoot()}catch(s){throw vf(s)?new Ws(`cannot create the memory store's folder: ${i} (memory_store_id=${r.memory_store_id}): ${s}; the worker host must make this mount path writable`,s):s}await y(this,wt,"m",MU).call(this,o),y(this,dt,"f").info("downloaded memories",{count:o.baseline.size,memory_store_id:o.memoryStoreId,dest:o.files.root().path}),y(this,bc,"f").push(o)}catch(s){throw o&&await o.files.dispose().catch(()=>{}),s instanceof Ws?s:new Ws(`failed to download memory store memory_store_id=${r.memory_store_id}: ${s}`,s)}}O(this,bf,Date.now(),"f")}async finish(){if(y(this,CE,"f"))throw new Q("finish() was already called: it is the session's last sync and runs once");O(this,CE,!0,"f"),await this.syncAll(!0)}async syncAll(n){await Promise.all(y(this,bc,"f").map(r=>y(this,wt,"m",_ie).call(this,r,n))),O(this,bf,Date.now(),"f")}async syncIfDue(){Date.now()-y(this,bf,"f")y(this,wt,"m",wie).call(this,r,n)))}async dispose(){for(let n of y(this,bc,"f")){let r=n.files.root();try{let i=await y(this,wt,"m",NE).call(this,n);if(!i.markerOk&&Object.keys(i.files).length>0){y(this,dt,"f").warn(`${i.distrustReason}; leaving the memory store folder on disk`,{root:r.path,memory_store_id:n.memoryStoreId});continue}await n.files.dispose()}catch(i){if(!(i instanceof Et)&&!vf(i))throw i;y(this,dt,"f").warn("failed to remove the memory store folder",{root:n.files.root().path,memory_store_id:n.memoryStoreId,error:String(i)});continue}r.removedOnDispose&&y(this,dt,"f").info("removed memory store dir",{dest:r.path,memory_store_id:n.memoryStoreId})}}}return yc=new WeakMap,RE=new WeakMap,Lb=new WeakMap,PE=new WeakMap,dt=new WeakMap,bf=new WeakMap,CE=new WeakMap,bc=new WeakMap,wt=new WeakSet,vie=function(n){if(n.mount_path){if(!NU(n.mount_path))throw new Ws(`memory store mount_path is not a clean absolute path: ${JSON.stringify(n.mount_path)} (memory_store_id=${n.memory_store_id})`);return n.mount_path}return Pe.join(y(this,RE,"f"),"memory",n.name||n.memory_store_id)},NE=async function(n){let r=await n.files.hashtree(),i=r[ou];return delete r[ou],i===Aie(n.memoryStoreId)?{files:r,markerOk:!0,distrustReason:null}:{files:r,markerOk:!1,distrustReason:i!==void 0?"the marker file does not match this store":"the marker file is gone"}},_ie=async function(n,r){try{let i=await y(this,wt,"m",NE).call(this,n),o=i.files;if(!i.markerOk){if(Object.keys(o).length>0){y(this,dt,"f").warn(`${i.distrustReason}; leaving the memory store folder as found and not syncing`,{root:n.files.root().path,memory_store_id:n.memoryStoreId});return}await y(this,wt,"m",OU).call(this,n,"the folder or its marker is gone");return}let s=new Map;for await(let[d,p]of y(this,wt,"m",OE).call(this,n.memoryStoreId))s.set(d,p);if(y(this,wt,"m",DU).call(this,n,s),Object.keys(o).length===0&&n.baseline.size>1){await y(this,wt,"m",OU).call(this,n,"every memory file is gone at once");return}let a=new FU(y(this,PE,"f"),Math.max(Pje,Math.min(Cje,Math.floor(n.baseline.size/4))),r),c=[],l=new Map,u=[...new Set([...s.keys(),...Object.keys(o),...n.baseline.keys()])].sort();for(let d of u){let p=s.get(d),f=o[d],m=n.baseline.get(d),g;f===void 0&&m!==void 0&&p!==void 0&&p.content_sha256===m&&!n.readOnly?g=await y(this,wt,"m",Eie).call(this,n,d,p,m,a):g=await y(this,wt,"m",kie).call(this,n,d,p,f,c),g!==void 0&&l.set(d,g)}n.baseline=l,await y(this,wt,"m",Sie).call(this,n,c),a.suppressed>0&&y(this,dt,"f").debug("remote deletes are disabled; locally deleted memories stay on the server",{count:a.suppressed,memory_store_id:n.memoryStoreId}),a.capped>0&&y(this,dt,"f").warn(`delete cap reached: ${a.mode==="log_only"?"would send":"sent"} ${a.attempted} deletes, held ${a.capped} for later syncs`,{memory_store_id:n.memoryStoreId})}catch(i){y(this,dt,"f").warn("memory sync failed",{memory_store_id:n.memoryStoreId,error:String(i)})}},wie=async function(n,r){let i=new Map,o=new Set,s=async()=>{if(n.readOnly)return;let a=await y(this,wt,"m",NE).call(this,n);if(!a.markerOk){y(this,dt,"f").warn(`${a.distrustReason}; not uploading anything from the memory store folder`,{root:n.files.root().path,memory_store_id:n.memoryStoreId});return}for(let[u,d]of Object.entries(a.files))(d!==n.baseline.get(u)||n.sentShas.has(u))&&n.refusedShas.get(u)!==d&&(i.set(u,d),o.add(u));if(i.size===0||r?.aborted)return;let c=new Map;for await(let[u,d]of y(this,wt,"m",OE).call(this,n.memoryStoreId)){if(r?.aborted)return;c.set(u,d)}y(this,wt,"m",DU).call(this,n,c);let l=[];for(let u of[...i.keys()].sort()){let d=i.get(u),p=n.baseline.get(u),f=c.get(u);if(d===p){o.delete(u);continue}if(f!==void 0&&f.content_sha256===d){n.baseline.set(u,f.content_sha256),o.delete(u);continue}if(f!==void 0&&f.content_sha256!==p){y(this,dt,"f").warn("memory changed both locally and remotely; the flush leaves the remote version",{path:u,memory_store_id:n.memoryStoreId}),o.delete(u);continue}l.push([u,d,f])}await y(this,wt,"m",xie).call(this,n,l,o,r)};try{await Nje(s(),r),r?.aborted&&o.size>0&&y(this,dt,"f").warn(`memory flush cut off part-way; ${o.size} of ${i.size} changed files had not finished uploading`,{memory_store_id:n.memoryStoreId})}catch(a){y(this,dt,"f").warn("memory flush failed",{memory_store_id:n.memoryStoreId,error:String(a)})}},OU=async function(n,r){y(this,dt,"f").warn(`${r}; re-downloading the memory store folder instead of syncing`,{root:n.files.root().path,memory_store_id:n.memoryStoreId}),await n.files.createRoot(),await y(this,wt,"m",MU).call(this,n)},DU=function(n,r){for(let[i,o]of n.sentShas)r.get(i)?.content_sha256===o&&n.baseline.set(i,o);n.sentShas.clear()},MU=async function(n){n.baseline=new Map,n.sentShas.clear(),n.pendingDeletes.clear(),await n.files.put(ou,`version ${Rie} +${n.memoryStoreId}`);for await(let[r,i]of y(this,wt,"m",OE).call(this,n.memoryStoreId,"full"))await y(this,wt,"m",LU).call(this,n,r,i.content??"")&&n.baseline.set(r,i.content_sha256)},kie=async function(n,r,i,o,s){let a=n.baseline.get(r);if(o!==void 0&&n.pendingDeletes.delete(r),!i){if(o===void 0){n.pendingDeletes.delete(r);return}if(a!==void 0){if(o===a){let p=await y(this,wt,"m",$ie).call(this,n,r,a);if(p===void 0)return;if(p===a)return a;o=p}n.readOnly?y(this,dt,"f").warn("memory deleted remotely but edited locally; keeping the file, which a read-only store cannot push",{path:r,memory_store_id:n.memoryStoreId}):n.refusedShas.get(r)!==o&&y(this,dt,"f").info("memory deleted remotely but edited locally; re-creating it from the file",{path:r,memory_store_id:n.memoryStoreId})}return n.readOnly||n.refusedShas.get(r)===o?void 0:await y(this,wt,"m",DE).call(this,n,r,o,void 0)}let c=i.content_sha256,l=c!==a,u=o!==void 0&&o!==a&&o!==c,d=!n.readOnly&&u;return o===void 0&&a!==void 0?(l&&(y(this,dt,"f").warn("memory deleted locally but changed remotely; restoring the remote version",{path:r,memory_store_id:n.memoryStoreId}),n.pendingDeletes.delete(r),s.push([r,i])),a):l?o===c?c:(u&&y(this,dt,"f").warn("memory changed both locally and remotely; keeping the remote version",{path:r,memory_store_id:n.memoryStoreId}),s.push([r,i]),a):d?n.refusedShas.get(r)===o?c:await y(this,wt,"m",DE).call(this,n,r,o,i)??c:c},$ie=async function(n,r,i){let o;try{o=await n.files.hashFile(r)}catch(s){if(!(s instanceof Et)&&!vf(s))throw s;return i}if(o!==null){if(o!==i)return o;try{await n.files.remove(r)}catch(s){if(!(s instanceof Et)&&!vf(s))throw s;return y(this,dt,"f").warn("failed to remove memory deleted remotely",{path:r,memory_store_id:n.memoryStoreId,error:String(s)}),i}}},LU=async function(n,r,i){try{await n.files.put(r,i)}catch(o){if(!(o instanceof Et)&&!vf(o))throw o;return y(this,dt,"f").warn("failed to write memory",{path:r,memory_store_id:n.memoryStoreId,error:String(o)}),!1}return!0},Sie=async function(n,r){if(r.length===0)return;let i=async(a,c)=>{let l;try{l=await y(this,yc,"f").beta.memoryStores.memories.retrieve(c.id,{memory_store_id:n.memoryStoreId,view:"full"})}catch(u){if(Wn(u,404))return;y(this,dt,"f").warn("failed to fetch memory content",{path:a,memory_store_id:n.memoryStoreId,error:String(u)});return}await y(this,wt,"m",LU).call(this,n,a,l.content??"")&&n.baseline.set(a,l.content_sha256)},o=r[Symbol.iterator](),s=async()=>{for(let[a,c]of o)await i(a,c)};await Promise.all(Array.from({length:Math.min(Ije,r.length)},s))},xie=async function(n,r,i,o){let s=r[Symbol.iterator](),a=async()=>{for(let[c,l,u]of s){if(o?.aborted)return;let d=await y(this,wt,"m",DE).call(this,n,c,l,u);i.delete(c),d!==void 0&&n.baseline.set(c,d)}};await Promise.all(Array.from({length:Math.min(Rje,r.length)},a))},OE=async function*(n,r="basic"){let i=r==="basic"?Tje:Aje;for await(let o of y(this,yc,"f").beta.memoryStores.memories.list(n,{view:r,limit:i})){if(o.type!=="memory")continue;let s=o.path.replace(/^\/+/,"");if(s===ou){y(this,dt,"f").warn("the server listed the reserved marker path; skipping",{path:o.path,memory_store_id:n});continue}yield[s,o]}},DE=async function t(n,r,i,o){try{let s=await n.files.get(r);if(s===null)return;let a=ql(s);n.sentShas.set(r,Fs.createHash("sha256").update(a,"utf-8").digest("hex"));let c=o?await y(this,yc,"f").beta.memoryStores.memories.update(o.id,{memory_store_id:n.memoryStoreId,content:a,precondition:{type:"content_sha256",content_sha256:o.content_sha256}}):await y(this,yc,"f").beta.memoryStores.memories.create(n.memoryStoreId,{path:"/"+r,content:a});return n.refusedShas.delete(r),n.sentShas.delete(r),c.content_sha256}catch(s){if(o&&Wn(s,404))return await y(this,wt,"m",t).call(this,n,r,i,void 0);let a=s instanceof Et||Wn(s,400)||Wn(s,413);o&&Wn(s,409)?y(this,dt,"f").warn("memory changed both locally and remotely; the upload was refused and the local edit loses",{path:r,memory_store_id:n.memoryStoreId}):a&&i!==void 0?(n.refusedShas.set(r,i),y(this,dt,"f").warn("the server rejected this memory file, so it stays un-synced until its content changes",{path:r,memory_store_id:n.memoryStoreId,rejection:String(s)})):y(this,dt,"f").warn("failed to upload memory",{path:r,memory_store_id:n.memoryStoreId,error:String(s)});return}},Eie=async function(n,r,i,o,s){if(s.mode==="disabled")return s.suppressed++,o;let a=n.pendingDeletes.get(r);if(a===void 0&&(a=Date.now(),n.pendingDeletes.set(r,a)),!s.waiveWindow&&Date.now()-aBie,BashTimeoutError:()=>jE,DEFAULT_MEMORY_SYNC_INTERVAL_MS:()=>Nb,MARKER_PATH:()=>ou,MEMORY_FLUSH_TIMEOUT_MS:()=>Iie,MIN_MEMORY_SYNC_INTERVAL_MS:()=>Cb,SessionMemoryError:()=>Ws,SessionMemoryStores:()=>Pie,betaAgentToolset20260401:()=>jje,betaBashTool:()=>Vie,betaEditTool:()=>Hie,betaGlobTool:()=>Kie,betaGrepTool:()=>Jie,betaReadTool:()=>qie,betaWriteTool:()=>Wie,extractSkillArchive:()=>RU,resolvePath:()=>wf,setupSkills:()=>cie});function zie(e){return e===void 0?Oje:e}function uu(e){if(e!==void 0)throw new Q("The `unrestrictedPaths` option you passed to the agent toolset (AgentToolContext) is no longer supported. The toolset's file tools (read, write, edit, glob, grep) are now always confined to the working directory plus the directories listed in `allowedRoots`. Remove `unrestrictedPaths` from your context; to let the file tools reach any other directory, add it to `allowedRoots`.")}function jje(e){return[Vie(e),qie(e),Wie(e),Hie(e),Kie(e),Jie(e)]}async function wf(e,t){return uu(e.unrestrictedPaths),sie(e.workdir,t,{allowedRoots:e.allowedRoots??[]})}function Gie(e,t){return xU(e.readOnlyRoots??[],t)}function zje(){let e={};for(let[t,n]of Object.entries(process.env))t.startsWith("ANTHROPIC_")||(e[t]=n);return e}function Vie(e){uu(e.unrestrictedPaths);let t,n=Promise.resolve();return ru({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:async({command:r,restart:i,timeout_ms:o},s)=>{let a=n,c=gf();n=c.promise;try{await a}catch{}try{if(i&&(t?.close(),t=void 0),!r){if(i)return"bash session restarted";throw new Ue("bash: command is required")}t??(t=new Bie(e.workdir,e.env));try{let{output:l,exitCode:u}=await t.exec(r,{timeoutMs:o??jie,signal:s?.signal});if(u!==0)throw new Ue(l||`exit ${u}`);return l}catch(l){throw l instanceof Ue?l:(t.close(),t=void 0,new Ue(`bash: ${l instanceof Error?l.message:String(l)}`))}}finally{c.resolve()}},close:()=>{t?.close(),t=void 0}})}function qie(e){return uu(e.unrestrictedPaths),ru({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:async({file_path:t,view_range:n})=>{if(!t)throw new Ue("read: file_path is required");let r=await wf(e,t);if(n?.length&&n.length!==2)throw new Ue("read: view_range must be [start_line, end_line]");let i;try{let u=await Dn.stat(r);if(!u.isFile())throw new Ue(`read: ${t} is not a regular file`);let d=zie(e.maxFileBytes);if(d!==null&&u.size>d){if(!n?.length)throw new Ue(`read: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. Use the view_range parameter to read specific line ranges, e.g. view_range: [1, 500].`);let[p,f]=n;return await Gje(r,t,p,f,d)}i=await Dn.readFile(r,"utf8")}catch(u){throw u instanceof Ue?u:new Ue(`read: ${hf(u,t)}`)}if(!n?.length)return i;let[o,s]=n,a=i.split(` `),c=Math.max(0,o-1),l=s>0?s:a.length;return a.slice(c,l).join(` -`)}})}async function fDe(e,t,n,i,r){let o=new iL(t,n,i,r);if(o.rangeIsEmpty())return"";let s=cy.createReadStream(e,{highWaterMark:sDe});try{for await(let a of s)if(o.collectFrom(a),o.rangeIsCollected())break}finally{s.destroy()}return o.text()}function NX(e){return Ll(e.unrestrictedPaths),Rl({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:async({file_path:t,content:n})=>{if(!t)throw new Ae("write: file_path is required");let i=await zp(e,t),r=await IX(e,i);if(r!==void 0)throw new Ae(`write: ${t} is inside read-only directory ${r}`);try{await Rn.mkdir(br.dirname(i),{recursive:!0,mode:ty}),await WM(i,n??"")}catch(o){throw new Ae(`write: ${Op(o,t)}`)}return`wrote ${Buffer.byteLength(n??"")} bytes to ${t}`}})}function CX(e){return Ll(e.unrestrictedPaths),Rl({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:async({file_path:t,old_string:n,new_string:i,replace_all:r})=>{if(!t)throw new Ae("edit: file_path is required");if(!n)throw new Ae("edit: old_string is required");let o=await zp(e,t),s=await IX(e,o);if(s!==void 0)throw new Ae(`edit: ${t} is inside read-only directory ${s}`);let a;try{let u=await Rn.stat(o);if(!u.isFile())throw new Ae(`edit: ${t} is not a regular file`);let d=TX(e.maxFileBytes);if(d!==null&&u.size>d)throw new Ae(`edit: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. The edit tool loads the whole file and cannot modify a file this large.`);a=await Rn.readFile(o,"utf8")}catch(u){throw u instanceof Ae?u:new Ae(`edit: ${Op(u,t)}`)}let c=a.split(n).length-1;if(c===0)throw new Ae(`edit: old_string not found in ${t}`);let l;if(r)l=a.split(n).join(i);else{if(c>1)throw new Ae(`edit: old_string appears ${c} times in ${t} (must be unique)`);l=a.replace(n,()=>i)}try{await WM(o,l)}catch(u){throw new Ae(`edit: write: ${Op(u,t)}`)}return`edited ${t} (${r?c:1} replacement(s))`}})}function mDe(e){return e.split(/[\\/{},]/).includes("..")}function PX(e){return Ll(e.unrestrictedPaths),Rl({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:async({pattern:t,path:n})=>{if(!t)throw new Ae("glob: pattern is required");if(br.isAbsolute(t))throw new Ae("glob: absolute pattern not permitted; pass a relative pattern (and optionally path)");if(mDe(t))throw new Ae('glob: ".." is not permitted in the pattern');let i=n?await zp(e,n):br.resolve(e.workdir),r=n?i:await ey(i),o=[],s=OX;try{for await(let a of uDe(t,{cwd:i,withFileTypes:!0,exclude:c=>c.name===".git"||c.name==="node_modules"})){if(s--<=0)break;if(!a.isFile())continue;let c=br.join(a.parentPath,a.name),l;try{l=await Rn.realpath(c)}catch{continue}if(!lS(r,l))continue;let u=0;try{u=(await Rn.stat(c)).mtimeMs}catch{}o.push({path:c,mtime:u})}}catch(a){throw new Ae(`glob: ${a instanceof Error?a.message:String(a)}`)}return o.length===0?"no matches":(o.sort((a,c)=>c.mtime-a.mtime),o.slice(0,cDe).map(a=>a.path).join(` -`))}})}function DX(e){return Ll(e.unrestrictedPaths),Rl({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:async({pattern:t,path:n},i)=>{if(!t)throw new Ae("grep: pattern is required");let r=br.resolve(e.workdir);n&&(r=await zp(e,n));let o=await vDe();return o?gDe(o,t,r,i?.signal):hDe(t,r,i?.signal)}})}function gDe(e,t,n,i){return new Promise((r,o)=>{let s=oL.spawn(e,["-n","--no-heading","-e",t,"--",n],{...i?{signal:i}:{}}),a="",c="",l=!1;s.stdout.on("data",u=>{l||(a+=u,a.length>ay&&(l=!0,a=a.slice(0,ay),s.kill("SIGKILL")))}),s.stderr.on("data",u=>c+=u),s.on("close",u=>{if(i?.aborted)return o(new Ae("grep: aborted"));if(l)return r(a+` -[output truncated at ${ay} bytes]`);if(u===0)return r(a);if(u===1)return r("no matches");o(new Ae(`grep: rg failed: ${c||`exit ${u}`}`))}),s.on("error",u=>{if(i?.aborted)return o(new Ae("grep: aborted"));o(new Ae(`grep: rg failed: ${u.message}`))})})}async function hDe(e,t,n){let i;try{i=new RegExp(e)}catch(c){throw new Ae(`grep: invalid regex: ${c instanceof Error?c.message:String(c)}`)}let r=[],o=ay,s=c=>(o-=c.length+1,o<0?(r.push(`[output truncated at ${ay} bytes]`),!1):(r.push(c),!0));if((await Rn.stat(t).catch(()=>null))?.isFile()?await $X(t,i,s):await bDe(t,"",c=>$X(br.join(t,c),i,s),n),n?.aborted)throw new Ae("grep: aborted");return r.length===0?"no matches":r.join(` -`)}async function $X(e,t,n){let i=cy.createReadStream(e,{encoding:"utf8"}),r=xX.createInterface({input:i,crlfDelay:1/0}),o=0;try{for await(let s of r)if(o++,!(s.length>aDe)&&t.test(s)&&!n(`${e}:${o}:${s}`))return!1}catch{}finally{i.destroy()}return!0}async function bDe(e,t,n,i){let r=OX;async function o(s,a){if(a>yDe)return!0;if(i?.aborted)return!1;let c;try{c=await Rn.readdir(br.join(e,s),{withFileTypes:!0})}catch{return!0}for(let l of c){if(l.name===".git"||l.name==="node_modules")continue;if(r--<=0||i?.aborted)return!1;let u=s?br.join(s,l.name):l.name;if(l.isDirectory()){if(!await o(u,a+1))return!1}else if(l.isFile()&&await n(u)===!1)return!1}return!0}await o(t,0)}async function vDe(){let e=(process.env.PATH??"").split(br.delimiter);for(let t of e){let n=br.join(t,"rg");try{return await Rn.access(n,cy.constants.X_OK),n}catch{}}return null}var Rn,cy,br,oL,SX,xX,bS,yr,Ur,iy,Pl,Ai,rL,vS,oy,wS,kS,Ol,Ml,jp,Dl,sy,Ha,_X,vX,wX,EX,oDe,sDe,kX,ay,aDe,cDe,$S,lDe,uDe,_S,iL,yDe,OX,LX=j(()=>{gr();Rn=gt(require("node:fs/promises"),1),cy=gt(require("node:fs"),1),br=gt(require("node:path"),1),oL=gt(require("node:child_process"),1),SX=gt(require("node:crypto"),1),xX=gt(require("node:readline"),1);kt();Il();WQ();BM();HM();YQ();bX();wX=100*1024,EX=12e4,oDe=256*1024,sDe=64*1024,kX=Buffer.from(` -`),ay=100*1024,aDe=2e3,cDe=200,$S=class extends J{constructor(t){super(`bash command timed out after ${t}ms`),this.name="BashTimeoutError",this.timeoutMs=t}},lDe=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,uDe=Rn.glob;_S=class{constructor(t,n=pDe()){bS.add(this),yr.set(this,void 0),Ur.set(this,""),iy.set(this,!1),Pl.set(this,!1),Ai.set(this,null),M(this,yr,oL.spawn("/bin/bash",["--noprofile","--norc"],{cwd:t,env:{...n,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),v(this,yr,"f").stdout.setEncoding("utf8"),v(this,yr,"f").stderr.setEncoding("utf8"),v(this,yr,"f").stdout.on("data",i=>v(this,bS,"m",rL).call(this,i)),v(this,yr,"f").stderr.on("data",i=>v(this,bS,"m",rL).call(this,i)),v(this,yr,"f").once("close",()=>{M(this,Pl,!0,"f");let i=v(this,Ai,"f");M(this,Ai,null,"f"),i?.resolve()})}get closed(){return v(this,Pl,"f")}async exec(t,n={}){if(v(this,Pl,"f"))throw new J("bash session terminated");let i=n.timeoutMs??EX,r=n.signal;r?.throwIfAborted(),M(this,Ur,"","f"),M(this,iy,!1,"f");let o=`__ANT_CMD_${SX.randomUUID()}_DONE__`,s=`${o.slice(0,8)}''${o.slice(8)}`,a=`{ ${t} -} &1; printf '\\n${s}%d\\n' $? -`;if(v(this,yr,"f").stdin.write(a),v(this,Ur,"f").indexOf(o)<0){let{promise:f,resolve:m}=Dp();M(this,Ai,{sentinel:o,resolve:m},"f");let g,h;try{await Promise.race([f,new Promise((b,y)=>{g=setTimeout(()=>y(new $S(i)),i)}),new Promise((b,y)=>{r&&(h=()=>y(r.reason),r.addEventListener("abort",h,{once:!0}))})])}finally{g&&clearTimeout(g),h&&r&&r.removeEventListener("abort",h),M(this,Ai,null,"f")}}let c=v(this,Ur,"f").indexOf(o);if(c<0)throw new J("bash session terminated");let u=v(this,Ur,"f").slice(c+o.length).match(/^(-?\d+)/),d=u?parseInt(u[1],10):-1,p=v(this,Ur,"f").slice(0,c).replace(lDe,"").replace(/\n+$/,"");return v(this,iy,"f")&&(p=`[output truncated] -${p}`),{output:p,exitCode:d}}close(){if(v(this,Pl,"f"))return;M(this,Pl,!0,"f");let t=v(this,Ai,"f");M(this,Ai,null,"f"),t?.resolve(),v(this,yr,"f").stdout.destroy(),v(this,yr,"f").stderr.destroy(),v(this,yr,"f").stdin.destroy();try{process.kill(-v(this,yr,"f").pid,"SIGKILL")}catch{v(this,yr,"f").kill("SIGKILL")}v(this,yr,"f").unref()}};yr=new WeakMap,Ur=new WeakMap,iy=new WeakMap,Pl=new WeakMap,Ai=new WeakMap,bS=new WeakSet,rL=function(t){if(M(this,Ur,v(this,Ur,"f")+t,"f"),v(this,Ur,"f").length>wX&&(M(this,Ur,v(this,Ur,"f").slice(v(this,Ur,"f").length-wX),"f"),M(this,iy,!0,"f")),v(this,Ai,"f")&&v(this,Ur,"f").indexOf(v(this,Ai,"f").sentinel)>=0){let n=v(this,Ai,"f");M(this,Ai,null,"f"),n.resolve()}};iL=class{constructor(t,n,i,r){vS.add(this),oy.set(this,void 0),wS.set(this,void 0),kS.set(this,void 0),Ol.set(this,void 0),Ml.set(this,void 0),jp.set(this,void 0),Dl.set(this,0),sy.set(this,[]),Ha.set(this,0),M(this,oy,t,"f"),M(this,wS,n,"f"),M(this,kS,i,"f"),M(this,Ol,Math.max(0,n-1),"f"),M(this,Ml,i>0?i:1/0,"f"),M(this,jp,r,"f")}rangeIsEmpty(){return v(this,Ml,"f")<=v(this,Ol,"f")}rangeIsCollected(){return v(this,Dl,"f")>=v(this,Ml,"f")}collectFrom(t){var n;let i=0;for(;i=v(this,Ol,"f")&&v(this,vS,"m",_X).call(this,t.subarray(i,o),r>=0),r<0)break;M(this,Dl,(n=v(this,Dl,"f"),n++,n),"f"),i=r+1}}text(){return Buffer.concat(v(this,sy,"f"),v(this,Ha,"f")).toString("utf8")}};oy=new WeakMap,wS=new WeakMap,kS=new WeakMap,Ol=new WeakMap,Ml=new WeakMap,jp=new WeakMap,Dl=new WeakMap,sy=new WeakMap,Ha=new WeakMap,vS=new WeakSet,_X=function(t,n){if(v(this,sy,"f").push(t),M(this,Ha,v(this,Ha,"f")+t.length,"f"),n&&v(this,Dl,"f")+1v(this,jp,"f"))throw v(this,vS,"m",vX).call(this)},vX=function(){return v(this,Ml,"f")-v(this,Ol,"f")===1?new Ae(`read: line ${v(this,Ol,"f")+1} of ${v(this,oy,"f")} alone exceeds ${v(this,jp,"f")}-byte limit. The read tool cannot return part of a line, so view_range cannot narrow this further.`):new Ae(`read: view_range [${v(this,wS,"f")}, ${v(this,kS,"f")}] of ${v(this,oy,"f")} exceeds ${v(this,jp,"f")}-byte limit. Narrow the view_range to read a smaller portion.`)};yDe=40,OX=5e4});function $De(e){return e.resources.some(t=>t.type==="memory_store")}function _De(e){if(!e)return null;let t;try{let i=e.replace(/-/g,"+").replace(/_/g,"/"),r=i.padEnd(Math.ceil(i.length/4)*4,"=");t=JSON.parse(Sl(W5(r)))}catch{return null}if(t===null||typeof t!="object"||Array.isArray(t))return null;let n=t.sessions_token;return typeof n=="string"&&n!==""?n:null}async function UX(e,t){let n;try{return await Promise.race([e.then(()=>!1,()=>!1),new Promise(i=>{n=setTimeout(()=>i(!0),t)})])}finally{n!==void 0&&clearTimeout(n)}}async function SDe(e,t,n,i){try{await e.beta.environments.work.stop(t.id,{environment_id:t.environment_id,force:!0},{...i,headers:I([i?.headers])})}catch(r){An(r,409)||n.error("force-stop on exit failed",{work_id:t.id,error:String(r)})}}function xDe(e){let t=e instanceof Dt?e.error:void 0;for(let n of["error","details","current_state"]){if(!BO(t))return{};t=t[n]}return BO(t)?t:{}}async function EDe(e,t,n,i,r,o){let s=FX,a=wDe,c=Date.now(),l=kDe,u=async()=>{let d=new AbortController,p=Ua(n.signal,d),f=setTimeout(()=>d.abort(),s);try{let m=await e.beta.environments.work.heartbeat(t.id,{environment_id:t.environment_id,expected_last_heartbeat:l},{...r,headers:I([r?.headers]),signal:d.signal});c=Date.now(),l=m.last_heartbeat,m.ttl_seconds>0&&(a=m.ttl_seconds*1e3,s=Math.max(1e3,Math.min(a/2,FX)),o?.(a)),(m.state==="stopping"||m.state==="stopped")&&(i.info("heartbeat signals shutdown",{work_id:t.id,state:m.state}),n.finish("control_plane_stop")),m.lease_extended||(i.warn("lease not extended, shutting down",{work_id:t.id}),n.finish("control_plane_stop"))}catch(m){if(n.signal.throwIfAborted(),An(m,412)){let g=xDe(m);i.error("lease lost: heartbeat precondition failed",{work_id:t.id,server_state:g.state,server_ttl_seconds:g.ttl_seconds,server_last_heartbeat:g.last_heartbeat}),n.finish("lease_lost");return}if(ja(m))throw i.error("permanent heartbeat failure",{work_id:t.id,error:String(m)}),n.finish("heartbeat_rejected"),m;if(Date.now()-c>a){i.error("lease assumed lost: no successful heartbeat in ttl",{work_id:t.id,ttl_ms:a,error:String(m)}),n.finish("assumed_lost");return}i.warn("transient heartbeat failure",{work_id:t.id,error:String(m)})}finally{clearTimeout(f),p()}};for(await u();!n.signal.aborted;)await Yi(s,n.signal),n.signal.throwIfAborted(),await u()}var SS,ly,sL,uy,Gp,FX,wDe,kDe,Vp,aL,cL=j(()=>{gr();kt();Xi();iM();xl();pp();cp();_p();z_();hr();Ne();sS();Z_();LM();cS();FX=3e4,wDe=9e4,kDe="NO_HEARTBEAT";Vp=class{constructor(t){if(SS.add(this),ly.set(this,void 0),t.unrestrictedPaths!==void 0)throw new J("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory.");this.client=t.client,this.environmentId=t.environmentId,this.environmentKey=t.environmentKey,this.tools=t.tools,this.workdir=t.workdir??process.cwd(),this.maxFileBytes=t.maxFileBytes,this.maxIdleMs=t.maxIdleMs,t.memorySyncIntervalMs!=null&&aS(t.memorySyncIntervalMs,"memorySyncIntervalMs"),this.memorySyncIntervalMs=t.memorySyncIntervalMs,this.memorySyncDeletions=t.memorySyncDeletions??"enabled",this.workerId=t.workerId,this.requestOptions=t.requestOptions,M(this,ly,t.signal,"f")}async run(t){let{environmentId:n,environmentKey:i}=this;if(n===void 0||i===void 0)throw new J("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let r=t??v(this,ly,"f"),o=new za({client:this.client,environmentId:n,environmentKey:i,...this.workerId!==void 0?{workerId:this.workerId}:{},...r?{signal:r}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let s of o)try{await v(this,SS,"m",sL).call(this,s,i,o.signal)}catch(a){if(o.signal?.aborted)throw a;qe(this.client).error("work item failed",{work_id:s.id,error:String(a)})}}async handleItem(t){let n=t?.workId??ze("ANTHROPIC_WORK_ID"),i=t?.environmentId??ze("ANTHROPIC_ENVIRONMENT_ID"),r=t?.sessionId??ze("ANTHROPIC_SESSION_ID"),o=(t?.environmentKey??this.environmentKey??ze("ANTHROPIC_ENVIRONMENT_KEY"))||void 0,s=t?.workSecret||ze("ANTHROPIC_WORK_SECRET")||null;if(!n)throw new J("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!i)throw new J("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!r)throw new J("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!o&&!s)throw new J("handleItem: environmentKey is required when there is no work secret \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let a={id:n,environment_id:i,secret:s,data:{type:"session",id:r}};await v(this,SS,"m",sL).call(this,a,o,t?.signal??v(this,ly,"f"))}};ly=new WeakMap,SS=new WeakSet,sL=async function(t,n,i){let r=qe(this.client),o=_De(t.secret),s=o??n;if(s===void 0)throw new J("handleItem: the work item carried a secret payload but no sessions token could be extracted, and there is no environment key to fall back to; the poller must issue a secret whose payload carries `sessions_token`, or provide the environment key (pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY)");t.secret&&o===null&&r.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key",{work_id:t.id});let a=B_(this.client,{authToken:s,helper:"environments-worker"}),c=t.data.id,l=new AbortController,u=Ua(i,l),d=new aL(l),p=await Promise.resolve().then(()=>(LX(),MX)),f,m,g=EDe(a,t,d,r,this.requestOptions,w=>{f=w,m?._setSendRetryWindow(w)}).catch(w=>{l.signal.aborted||r.error("heartbeat loop failed",{work_id:t.id,error:String(w)}),l.abort()}),h=async()=>{},b,y=!1;try{if(t.data.type!=="session"){r.debug("skipping non-session work item",{work_id:t.id,type:t.data.type});return}let w=await a.beta.sessions.retrieve(c);if(o===null&&this.memorySyncIntervalMs!==null&&$De(w))throw new p.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${t.id}, session_id=${c}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`);let k={workdir:this.workdir,client:a,session:w,...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}};try{h=await p.setupSkills(k)}catch(S){r.warn("skill setup failed",{session_id:c,work_id:t.id,error:String(S)})}o!==null&&this.memorySyncIntervalMs!==null?(b=new p.SessionMemoryStores(a,{workdir:this.workdir,...this.memorySyncIntervalMs!==void 0?{syncIntervalMs:this.memorySyncIntervalMs}:{},syncDeletions:this.memorySyncDeletions}),await b.download(w),k.allowedRoots=b.roots,k.readOnlyRoots=b.readOnlyRoots):r.debug("memory stores disabled for this item",{work_id:t.id});let _=typeof this.tools=="function"?this.tools(k):this.tools??p.betaAgentToolset20260401(k);m=new Ba(c,{client:a,tools:_,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:l.signal}),f!==void 0&&m._setSendRetryWindow(f);for await(let S of m)b&&await b.syncIfDue();y=!l.signal.aborted}finally{try{await h().catch(w=>{r.warn("skill cleanup failed",{session_id:c,work_id:t.id,error:String(w)})})}finally{if(b){let w=p.MEMORY_FLUSH_TIMEOUT_MS;y&&await UX(b.finish(),w)&&r.warn(`final memory sync cut off after ${w}ms; the flush that follows still uploads changed files`,{session_id:c,work_id:t.id});let k=new AbortController;await UX(b.flushWrites(k.signal),w)&&(k.abort(),r.warn(`memory flush cut off after ${w}ms; changed files it had not uploaded yet are not saved`,{session_id:c,work_id:t.id})),await b.dispose().catch(S=>{r.warn("memory store cleanup failed",{session_id:c,work_id:t.id,error:String(S)})})}}d.finish("runner_done"),u(),await g,d.lost?r.info("lease lost; released without stopping it",{session_id:c,work_id:t.id}):await SDe(a,t,r,this.requestOptions)}};aL=class{constructor(t){uy.set(this,void 0),Gp.set(this,void 0),M(this,uy,t,"f")}get signal(){return v(this,uy,"f").signal}finish(t){M(this,Gp,v(this,Gp,"f")??t,"f"),v(this,uy,"f").abort()}get lost(){return v(this,Gp,"f")==="lease_lost"||v(this,Gp,"f")==="assumed_lost"}};uy=new WeakMap,Gp=new WeakMap});var Ka,lL=j(()=>{Se();De();Ne();Me();Z_();cL();Z_();cL();Ka=class extends Z{retrieve(t,n,i){let{environment_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/environments/${r}/work/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{environment_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/environments/${r}/work/${t}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(N`/v1/environments/${t}/work?beta=true`,le,{query:o,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}ack(t,n,i){let{environment_id:r,betas:o}=n;return this._client.post(N`/v1/environments/${r}/work/${t}/ack?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}heartbeat(t,n,i){let{environment_id:r,desired_ttl_seconds:o,expected_last_heartbeat:s,betas:a}=n;return this._client.post(N`/v1/environments/${r}/work/${t}/heartbeat?beta=true`,{query:{desired_ttl_seconds:o,expected_last_heartbeat:s},...i,headers:I([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}poll(t,n={},i){let{betas:r,"Anthropic-Worker-ID":o,...s}=n??{};return this._client.get(N`/v1/environments/${t}/work/poll?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"Anthropic-Worker-ID":o}:void 0},i?.headers])})}stats(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/environments/${t}/work/stats?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}stop(t,n,i){let{environment_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/environments/${r}/work/${t}/stop?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}poller(t){return new za({...t,client:this._client})}worker(t){return new Vp({...t,client:this._client})}};Ka.WorkPoller=za;Ka.EnvironmentWorker=Vp});var Fl,uL=j(()=>{Se();lL();lL();De();Ne();Me();Fl=class extends Z{constructor(){super(...arguments),this.work=new Ka(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/environments?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/environments/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/environments/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/environments?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/environments/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/environments/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Fl.Work=Ka});var Bp,dL=j(()=>{Se();De();Ne();Me();Bp=class extends Z{create(t,n,i){let{view:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/memory_stores/${t}/memories?beta=true`,{query:{view:r},body:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}retrieve(t,n,i){let{memory_store_id:r,betas:o,workspace_id:s,...a}=n;return this._client.get(N`/v1/memory_stores/${r}/memories/${t}?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{memory_store_id:r,view:o,betas:s,workspace_id:a,...c}=n;return this._client.post(N`/v1/memory_stores/${r}/memories/${t}?beta=true`,{query:{view:o},body:c,...i,headers:I([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/memory_stores/${t}/memories?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{memory_store_id:r,expected_content_sha256:o,betas:s,workspace_id:a}=n;return this._client.delete(N`/v1/memory_stores/${r}/memories/${t}?beta=true`,{query:{expected_content_sha256:o},...i,headers:I([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}}});var qp,pL=j(()=>{Se();De();Ne();Me();qp=class extends Z{retrieve(t,n,i){let{memory_store_id:r,betas:o,workspace_id:s,...a}=n;return this._client.get(N`/v1/memory_stores/${r}/memory_versions/${t}?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/memory_stores/${t}/memory_versions?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}redact(t,n,i){let{memory_store_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/memory_stores/${r}/memory_versions/${t}/redact?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}});var Ja,fL=j(()=>{Se();dL();dL();pL();pL();De();Ne();Me();Ja=class extends Z{constructor(){super(...arguments),this.memories=new Bp(this._client),this.memoryVersions=new qp(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/memory_stores?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/memory_stores/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/memory_stores/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/memory_stores?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/memory_stores/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/memory_stores/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Ja.Memories=Bp;Ja.MemoryVersions=qp});var Wp=j(()=>{kt()});var Hp,mL=j(()=>{kt();lp();fM();Hp=class e{constructor(t,n){this.iterator=t,this.controller=n}async*decoder(){let t=new ms;for await(let n of this.iterator)for(let i of t.decode(n))yield JSON.parse(i);for(let n of t.flush())yield JSON.parse(n)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(t,n){if(!t.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new J("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new J("Attempted to iterate over a response with no body");return new e(Nh(t.body),n)}}});var Kp,gL=j(()=>{Se();De();Ne();mL();Wp();Me();Kp=class extends Z{create(t,n){let{betas:i,user_profile_id:r,workspace_id:o,...s}=t;return this._client.post("/v1/messages/batches?beta=true",{body:s,...n,headers:I([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...r!=null?{"anthropic-user-profile-id":r}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/messages/batches/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/messages/batches?beta=true",pn,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/messages/batches/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}cancel(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/messages/batches/${t}/cancel?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}async results(t,n={},i){let r=await this.retrieve(t,n,i);if(!r.results_url)throw new J(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{betas:o,workspace_id:s}=n??{};return this._client.get(r.results_url,{...i,headers:I([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary",...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((a,c)=>Hp.fromResponse(c.response,c.controller))}}});var xS,hL=j(()=>{xS={"claude-opus-4@20250514":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function jX(e){return e?.output_format??e?.output_config?.format}function yL(e,t,n){let i=jX(t);return!t||!("parse"in(i??{}))?{...e,content:e.content.map(r=>{if(r.type==="text"){let o=Object.defineProperty({...r},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return r}),parsed_output:null}:bL(e,t,n)}function bL(e,t,n){let i=null,r=e.content.map(o=>{if(o.type==="text"){let s=PDe(t,o.text);i===null&&(i=s);let a=Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),s},enumerable:!1})}return o});return{...e,content:r,parsed_output:i}}function PDe(e,t){let n=jX(e);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(t):JSON.parse(t)}catch(i){throw new J(`Failed to parse structured output: ${i}`)}}var vL=j(()=>{kt()});var wL=j(()=>{Lh()});var DDe,Jp,ODe,MDe,zX,GX=j(()=>{DDe=e=>{let t=0,n=[];for(;t{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case"separator":return e=e.slice(0,e.length-1),Jp(e);break;case"number":let n=t.value[t.value.length-1];if(n==="."||n==="-"||n==="+"||n==="e"||n==="E")return e=e.slice(0,e.length-1),Jp(e);case"string":let i=e[e.length-2];if(i?.type==="delimiter")return e=e.slice(0,e.length-1),Jp(e);if(i?.type==="brace"&&i.value==="{")return e=e.slice(0,e.length-1),Jp(e);break;case"delimiter":return e=e.slice(0,e.length-1),Jp(e);break}return e},ODe=e=>{let t=[];return e.map(n=>{n.type==="brace"&&(n.value==="{"?t.push("}"):t.splice(t.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(n=>{n==="}"?e.push({type:"brace",value:"}"}):n==="]"&&e.push({type:"paren",value:"]"})}),e},MDe=e=>{let t="";return e.map(n=>{n.type==="string"?t+='"'+n.value+'"':t+=n.value}),t},zX=e=>JSON.parse(MDe(ODe(Jp(DDe(e)))))});function ES(e,t){let n={};for(let o of Object.keys(e))o!=="input"&&(n[o]=e[o]);Object.defineProperty(n,Za,{value:t,enumerable:!1,writable:!0});let i,r=!1;return Object.defineProperty(n,"input",{enumerable:!0,configurable:!0,get(){return r||(i=t?zX(t):{},r=!0),i}}),n}var Za,kL=j(()=>{GX();Za="__json_buf"});function TL(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}var jr,Ya,Zp,dy,TS,py,fy,IS,my,Lo,gy,AS,RS,Ul,NS,CS,PS,hy,$L,VX,yy,_L,SL,xL,BX,EL,DS,WX=j(()=>{gr();eo();Wp();Da();hr();wL();vL();kL();DS=class e{constructor(t,n){jr.add(this),this.messages=[],this.receivedMessages=[],Ya.set(this,void 0),Zp.set(this,null),this.controller=new AbortController,dy.set(this,void 0),TS.set(this,()=>{}),py.set(this,()=>{}),fy.set(this,void 0),IS.set(this,()=>{}),my.set(this,()=>{}),Lo.set(this,{}),gy.set(this,!1),AS.set(this,!1),RS.set(this,!1),Ul.set(this,!1),NS.set(this,void 0),CS.set(this,void 0),PS.set(this,void 0),hy.set(this,void 0),yy.set(this,i=>{if(M(this,AS,!0,"f"),Yr(i)&&(i=new In),i instanceof In)return M(this,RS,!0,"f"),this._emit("abort",i);if(i instanceof J)return this._emit("error",i);if(i instanceof Error){let r=new J(i.message);return r.cause=i,this._emit("error",r)}return this._emit("error",new J(String(i)))}),M(this,dy,new Promise((i,r)=>{M(this,TS,i,"f"),M(this,py,r,"f")}),"f"),M(this,fy,new Promise((i,r)=>{M(this,IS,i,"f"),M(this,my,r,"f")}),"f"),v(this,dy,"f").catch(()=>{}),v(this,fy,"f").catch(()=>{}),M(this,Zp,t,"f"),M(this,hy,n?.logger??console,"f")}get response(){return v(this,NS,"f")}get request_id(){return v(this,CS,"f")}get workspace_id(){return v(this,PS,"f")}async withResponse(){M(this,Ul,!0,"f");let t=await v(this,dy,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id"),workspace_id:t.headers.get("anthropic-workspace-id")}}static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,i,{logger:r}={}){let o=new e(n,{logger:r});for(let s of n.messages)o._addMessageParam(s);return M(o,Zp,{...n,stream:!0},"f"),o._run(()=>o._createMessage(t,{...n,stream:!0},{...i,headers:{...i?.headers,[M_]:"stream"}})),o}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},v(this,yy,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,i){let r=i?.signal,o;r&&(r.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),r.addEventListener("abort",o));try{v(this,jr,"m",_L).call(this);let{response:s,data:a}=await t.create({...n,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(s);for await(let c of a)v(this,jr,"m",SL).call(this,c);if(a.controller.signal?.aborted)throw new In;v(this,jr,"m",xL).call(this)}finally{r&&o&&r.removeEventListener("abort",o)}}_connected(t){this.ended||(M(this,NS,t,"f"),M(this,CS,t?.headers.get("request-id"),"f"),M(this,PS,t?.headers.get("anthropic-workspace-id"),"f"),v(this,TS,"f").call(this,t),this._emit("connect"))}get ended(){return v(this,gy,"f")}get errored(){return v(this,AS,"f")}get aborted(){return v(this,RS,"f")}abort(){this.controller.abort()}on(t,n){return(v(this,Lo,"f")[t]||(v(this,Lo,"f")[t]=[])).push({listener:n}),this}off(t,n){let i=v(this,Lo,"f")[t];if(!i)return this;let r=i.findIndex(o=>o.listener===n);return r>=0&&i.splice(r,1),this}once(t,n){return(v(this,Lo,"f")[t]||(v(this,Lo,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,i)=>{M(this,Ul,!0,"f"),t!=="error"&&this.once("error",i),this.once(t,n)})}async done(){M(this,Ul,!0,"f"),await v(this,fy,"f")}get currentMessage(){return v(this,Ya,"f")}async finalMessage(){return await this.done(),v(this,jr,"m",$L).call(this)}async finalText(){return await this.done(),v(this,jr,"m",VX).call(this)}_emit(t,...n){if(v(this,gy,"f"))return;t==="end"&&(M(this,gy,!0,"f"),v(this,IS,"f").call(this));let i=v(this,Lo,"f")[t];if(i&&(v(this,Lo,"f")[t]=i.filter(r=>!r.once),i.forEach(({listener:r})=>r(...n))),t==="abort"){let r=n[0];!v(this,Ul,"f")&&!i?.length&&Promise.reject(r),v(this,py,"f").call(this,r),v(this,my,"f").call(this,r),this._emit("end");return}if(t==="error"){let r=n[0];!v(this,Ul,"f")&&!i?.length&&Promise.reject(r),v(this,py,"f").call(this,r),v(this,my,"f").call(this,r),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",v(this,jr,"m",$L).call(this))}async _fromReadableStream(t,n){let i=n?.signal,r;i&&(i.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),i.addEventListener("abort",r));try{v(this,jr,"m",_L).call(this),this._connected(null);let o=Fr.fromReadableStream(t,this.controller);for await(let s of o)v(this,jr,"m",SL).call(this,s);if(o.controller.signal?.aborted)throw new In;v(this,jr,"m",xL).call(this)}finally{i&&r&&i.removeEventListener("abort",r)}}[(Ya=new WeakMap,Zp=new WeakMap,dy=new WeakMap,TS=new WeakMap,py=new WeakMap,fy=new WeakMap,IS=new WeakMap,my=new WeakMap,Lo=new WeakMap,gy=new WeakMap,AS=new WeakMap,RS=new WeakMap,Ul=new WeakMap,NS=new WeakMap,CS=new WeakMap,PS=new WeakMap,hy=new WeakMap,yy=new WeakMap,jr=new WeakSet,$L=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},VX=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(n.length===0)throw new J("stream ended without producing a content block with type=text");return n.join(" ")},_L=function(){this.ended||M(this,Ya,void 0,"f")},SL=function(n){if(this.ended)return;let i=v(this,jr,"m",BX).call(this,n);switch(this._emit("streamEvent",n,i),n.type){case"content_block_delta":{let r=i.content.at(-1);switch(n.delta.type){case"text_delta":{r.type==="text"&&this._emit("text",n.delta.text,r.text||"");break}case"citations_delta":{r.type==="text"&&this._emit("citation",n.delta.citation,r.citations??[]);break}case"input_json_delta":{if(TL(r)&&v(this,Lo,"f").inputJson?.length){let o;try{o=r.input}catch(s){v(this,yy,"f").call(this,v(this,jr,"m",EL).call(this,r,s));break}this._emit("inputJson",n.delta.partial_json,o)}break}case"thinking_delta":{r.type==="thinking"&&this._emit("thinking",n.delta.thinking,r.thinking);break}case"signature_delta":{r.type==="thinking"&&this._emit("signature",r.signature);break}case"compaction_delta":{r.type==="compaction"&&r.content&&this._emit("compaction",r.content);break}default:n.delta}break}case"message_stop":{this._addMessageParam(i),this._addMessage(yL(i,v(this,Zp,"f"),{logger:v(this,hy,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{M(this,Ya,i,"f");break}case"content_block_start":case"message_delta":break}},xL=function(){if(this.ended)throw new J("stream has ended, this shouldn't happen");let n=v(this,Ya,"f");if(!n)throw new J("request ended without sending any chunks");return M(this,Ya,void 0,"f"),yL(n,v(this,Zp,"f"),{logger:v(this,hy,"f")})},BX=function(n){let i=v(this,Ya,"f");if(n.type==="message_start"){if(i)throw new J(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!i)throw new J(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return i;case"message_delta":return i.stop_reason=n.delta.stop_reason,i.stop_sequence=n.delta.stop_sequence,i.stop_details=n.delta.stop_details,i.usage.output_tokens=n.usage.output_tokens,n.delta.container!=null&&(i.container=n.delta.container),n.context_management!=null&&(i.context_management=n.context_management),n.input_transformations!=null&&(i.input_transformations=n.input_transformations),n.usage.input_tokens!=null&&(i.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(i.usage.server_tool_use=n.usage.server_tool_use),n.usage.iterations!=null&&(i.usage.iterations=n.usage.iterations),n.usage.fallback_credit!=null&&(i.usage.fallback_credit=n.usage.fallback_credit),n.usage.output_tokens_details!=null&&(i.usage.output_tokens_details=n.usage.output_tokens_details),i;case"content_block_start":return i.content.push(n.content_block),n.content_block.type==="fallback"&&(i.model=n.content_block.to.model),i;case"content_block_delta":{let r=i.content.at(n.index);switch(n.delta.type){case"text_delta":{r?.type==="text"&&(i.content[n.index]={...r,text:(r.text||"")+n.delta.text});break}case"citations_delta":{r?.type==="text"&&(i.content[n.index]={...r,citations:[...r.citations??[],n.delta.citation]});break}case"input_json_delta":{if(r&&TL(r)){let o=(r[Za]||"")+n.delta.partial_json;i.content[n.index]=ES(r,o)}break}case"thinking_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,thinking:r.thinking+n.delta.thinking});break}case"signature_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,signature:n.delta.signature});break}case"compaction_delta":{r?.type==="compaction"&&(i.content[n.index]={...r,content:(r.content||"")+n.delta.content,encrypted_content:n.delta.encrypted_content});break}default:n.delta}return i}case"content_block_stop":{let r=i.content.at(n.index);if(r&&TL(r)&&Za in r){let o;try{o=r.input}catch(s){o={},v(this,yy,"f").call(this,v(this,jr,"m",EL).call(this,r,s))}Object.defineProperty(r,"input",{value:o,enumerable:!0,configurable:!0,writable:!0})}return i}}},EL=function(n,i){let r=n[Za];return new J(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${i}. JSON: ${r}`)},Symbol.asyncIterator)](){let t=[],n=[],i=!1;return this.on("streamEvent",r=>{let o=n.shift();o?o.resolve(r):t.push(r)}),this.on("end",()=>{i=!0;for(let r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((o,s)=>n.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Fr(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var HX,KX=j(()=>{HX=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: -1. Task Overview -The user's core request and success criteria -Any clarifications or constraints they specified -2. Current State -What has been completed so far -Files created, modified, or analyzed (with paths if relevant) -Key outputs or artifacts produced -3. Important Discoveries -Technical constraints or requirements uncovered -Decisions made and their rationale -Errors encountered and how they were resolved -What approaches were tried that didn't work (and why) -4. Next Steps -Specific actions needed to complete the task -Any blockers or open questions to resolve -Priority order if multiple steps remain -5. Context to Preserve -User preferences or style requirements -Domain-specific details that aren't obvious -Any promises made to the user -Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. -Wrap your summary in tags.`});async function FDe(e,t=e.messages.at(-1),n){if(!t||t.role!=="assistant"||!t.content||typeof t.content=="string")return null;let i=t.content.filter(s=>s.type==="tool_use");if(i.length===0)return null;let r=jDe(e);return{role:"user",content:await Promise.all(i.map(async s=>{let a=e.tools.find(c=>("name"in c?c.name:"mcp_server_name"in c?c.mcp_server_name:c.type)===s.name);if(!a||!("run"in a)||!r.has(s.name))return UDe(s);try{let c=s.input;"parse"in a&&a.parse&&(c=a.parse(c));let l=await a.run(c,{toolUse:s,toolUseBlock:s,signal:n?.signal});return{type:"tool_result",tool_use_id:s.id,content:l}}catch(c){return{type:"tool_result",tool_use_id:s.id,content:c instanceof Ae?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function UDe(e){return{type:"tool_result",tool_use_id:e.id,content:`Error: Tool '${e.name}' not found`,is_error:!0}}function jDe(e){let t=new Set;for(let n of e.tools)"run"in n&&t.add(n.name);for(let n of e.messages)if(!(n.role!=="system"||typeof n.content=="string"))for(let i of n.content)zDe(i,t);return t}function zDe(e,t){switch(e.type){case"tool_removal":case"tool_addition":GDe(e,t);break}}function GDe(e,t){let n=VDe(e.tool);n!==void 0&&(e.type==="tool_removal"?t.delete(n):t.add(n))}function VDe(e){if(e.type==="tool_reference")return e.name}function BDe(e){if(e===null)return"stop";switch(e){case"tool_use":return"run_tools";case"pause_turn":case"compaction":return"resume";case"end_turn":case"stop_sequence":case"max_tokens":case"model_context_window_exceeded":case"refusal":return"stop";default:return"stop"}}var by,Yp,jl,Jt,zr,ni,bs,Qa,vy,JX,IL,Qp,AL=j(()=>{gr();Il();kt();Ne();BM();hr();KX();eo();Qp=class{constructor(t,n,i){by.add(this),this.client=t,Yp.set(this,!1),jl.set(this,!1),Jt.set(this,void 0),zr.set(this,void 0),ni.set(this,void 0),bs.set(this,void 0),Qa.set(this,void 0),vy.set(this,0),M(this,Jt,{params:{...n,messages:structuredClone(n.messages)}},"f");let r=EM(n.tools,n.messages);M(this,zr,{...i,headers:I([Bh("BetaToolRunner"),r.length?{[Mo]:r.join(", ")}:void 0,i?.headers])},"f"),M(this,Qa,Dp(),"f"),n.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(Yp=new WeakMap,jl=new WeakMap,Jt=new WeakMap,zr=new WeakMap,ni=new WeakMap,bs=new WeakMap,Qa=new WeakMap,vy=new WeakMap,by=new WeakSet,JX=async function(){let n=v(this,Jt,"f").params.compactionControl;if(!n||!n.enabled)return!1;let i=0;if(v(this,ni,"f")!==void 0)try{let l=await v(this,ni,"f");i=l.usage.input_tokens+(l.usage.cache_creation_input_tokens??0)+(l.usage.cache_read_input_tokens??0)+l.usage.output_tokens}catch{return!1}let r=n.contextTokenThreshold??1e5;if(id.type!=="tool_use");u.length===0?a.pop():l.content=u}}let c=await this.client.beta.messages.create({model:o,messages:[...a,{role:"user",content:[{type:"text",text:s}]}],max_tokens:v(this,Jt,"f").params.max_tokens},{signal:v(this,zr,"f").signal,headers:I([v(this,zr,"f").headers,Bh("compaction")])});if(c.content[0]?.type!=="text")throw new J("Expected text response for compaction");return v(this,Jt,"f").params.messages=[{role:"user",content:c.content}],!0},Symbol.asyncIterator)](){var t;if(v(this,Yp,"f"))throw new J("Cannot iterate over a consumed stream");M(this,Yp,!0,"f"),M(this,jl,!0,"f"),M(this,bs,void 0,"f");try{for(;;){let n;try{if(v(this,Jt,"f").params.max_iterations&&v(this,vy,"f")>=v(this,Jt,"f").params.max_iterations)break;M(this,jl,!1,"f"),M(this,bs,void 0,"f"),M(this,vy,(t=v(this,vy,"f"),t++,t),"f"),M(this,ni,void 0,"f");let{max_iterations:i,compactionControl:r,...o}=v(this,Jt,"f").params;if(o.stream?(n=this.client.beta.messages.stream({...o},v(this,zr,"f")),M(this,ni,n.finalMessage(),"f"),v(this,ni,"f").catch(()=>{}),yield n):(M(this,ni,this.client.beta.messages.create({...o,stream:!1},v(this,zr,"f")),"f"),yield v(this,ni,"f")),!await v(this,by,"m",JX).call(this)){if(!v(this,jl,"f")){let c=await v(this,ni,"f"),l=BDe(c.stop_reason);v(this,Jt,"f").params.messages.push({role:c.role,content:c.content});let{container:u}=v(this,Jt,"f").params;if(c.container&&(u==null?v(this,Jt,"f").params.container=c.container.id:typeof u=="object"&&u.id==null&&(v(this,Jt,"f").params.container={...u,id:c.container.id})),l==="stop")break;if(l==="resume")continue}let a=await v(this,by,"m",IL).call(this,v(this,Jt,"f").params.messages.at(-1));if(a)v(this,Jt,"f").params.messages.push(a);else if(!v(this,jl,"f"))break}}finally{n&&n.abort()}}if(!v(this,ni,"f"))throw new J("ToolRunner concluded without a message from the server");v(this,Qa,"f").resolve(await v(this,ni,"f"))}catch(n){throw M(this,Yp,!1,"f"),v(this,Qa,"f").promise.catch(()=>{}),v(this,Qa,"f").reject(n),M(this,Qa,Dp(),"f"),n}}setMessagesParams(t){typeof t=="function"?v(this,Jt,"f").params=t(v(this,Jt,"f").params):v(this,Jt,"f").params=t,M(this,jl,!0,"f"),M(this,bs,void 0,"f")}setRequestOptions(t){typeof t=="function"?M(this,zr,t(v(this,zr,"f")),"f"):M(this,zr,{...v(this,zr,"f"),...t},"f")}async generateToolResponse(t=v(this,zr,"f").signal){let n=await v(this,ni,"f")??this.params.messages.at(-1);return n?v(this,by,"m",IL).call(this,n,t):null}done(){return v(this,Qa,"f").promise}async runUntilDone(){if(!v(this,Yp,"f"))for await(let t of this);return this.done()}get params(){return v(this,Jt,"f").params}pushMessages(...t){this.setMessagesParams(n=>({...n,messages:[...n.messages,...t]}))}then(t,n){return this.runUntilDone().then(t,n)}};IL=async function(t,n=v(this,zr,"f").signal){return v(this,bs,"f")!==void 0?v(this,bs,"f"):(M(this,bs,FDe(v(this,Jt,"f").params,t,{...v(this,zr,"f"),signal:n}),"f"),v(this,bs,"f"))}});function YX(e){if(!e.output_format)return e;if(e.output_config?.format)throw new J("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:t,...n}=e;return{...n,output_config:{...e.output_config,format:t}}}var ZX,qDe,vs,RL=j(()=>{Wp();gL();Se();hL();Ne();eo();vL();WX();AL();Il();gL();AL();Il();ZX={},qDe=["claude-mythos-preview","claude-opus-4-6"],vs=class extends Z{constructor(){super(...arguments),this.batches=new Kp(this._client)}create(t,n){let i=YX(t),{betas:r,user_profile_id:o,workspace_id:s,...a}=i;a.model in ZX&&console.warn(`The model '${a.model}' is deprecated and will reach end-of-life on ${ZX[a.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),qDe.includes(a.model)&&a.thinking&&a.thinking.type==="enabled"&&console.warn(`Using Claude with ${a.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=n?.timeout??this._client._options.timeout;if(!a.stream&&c==null){let u=xS[a.model]??void 0;c=this._client.calculateNonstreamingTimeout(a.max_tokens,u)}let l=L_(a.tools,a.messages);return this._client.post("/v1/messages?beta=true",{body:a,timeout:c??6e5,...n,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-user-profile-id":o}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},l,n?.headers]),stream:i.stream??!1})}parse(t,n){return n={...n,headers:I([{"anthropic-beta":[...t.betas??[],"structured-outputs-2025-12-15"].toString()},n?.headers])},this.create(t,n).then(i=>bL(i,t,{logger:this._client.logger??console}))}stream(t,n){return DS.createMessage(this,t,n)}countTokens(t,n){let i=YX(t),{betas:r,user_profile_id:o,workspace_id:s,...a}=i;return this._client.post("/v1/messages/count_tokens?beta=true",{body:a,...n,headers:I([{"anthropic-beta":[...r??[],"token-counting-2024-11-01"].toString(),...o!=null?{"anthropic-user-profile-id":o}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},n?.headers])})}toolRunner(t,n){return new Qp(this._client,t,n)}};vs.Batches=Kp;vs.BetaToolRunner=Qp;vs.ToolError=Ae});var Xp,NL=j(()=>{Se();De();Me();Xp=class extends Z{retrieve(t,n){return this._client.get(N`/v1/organizations/api_keys/${t}?beta=true`,n)}update(t,n,i){return this._client.post(N`/v1/organizations/api_keys/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/api_keys?beta=true",pn,{query:t,...n})}}});var ef,CL=j(()=>{Se();ef=class extends Z{retrieve(t){return this._client.get("/v1/organizations/compliance_settings?beta=true",t)}update(t,n){return this._client.post("/v1/organizations/compliance_settings?beta=true",{body:t,...n})}}});var tf,PL=j(()=>{Se();De();Me();tf=class extends Z{create(t,n){return this._client.post("/v1/organizations/external_keys?beta=true",{body:t,...n})}retrieve(t,n){return this._client.get(N`/v1/organizations/external_keys/${t}?beta=true`,n)}update(t,n,i){return this._client.post(N`/v1/organizations/external_keys/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/external_keys?beta=true",le,{query:t,...n})}delete(t,n){return this._client.delete(N`/v1/organizations/external_keys/${t}?beta=true`,n)}validate(t,n){return this._client.post(N`/v1/organizations/external_keys/${t}/validate?beta=true`,n)}}});var nf,DL=j(()=>{Se();De();Me();nf=class extends Z{create(t,n){return this._client.post("/v1/organizations/invites?beta=true",{body:t,...n})}retrieve(t,n){return this._client.get(N`/v1/organizations/invites/${t}?beta=true`,n)}list(t={},n){return this._client.getAPIList("/v1/organizations/invites?beta=true",pn,{query:t,...n})}delete(t,n){return this._client.delete(N`/v1/organizations/invites/${t}?beta=true`,n)}}});var rf,OL=j(()=>{Se();De();rf=class extends Z{list(t={},n){return this._client.getAPIList("/v1/organizations/rate_limits?beta=true",le,{query:t,...n})}}});var of,ML=j(()=>{Se();De();Me();of=class extends Z{retrieve(t,n){return this._client.get(N`/v1/organizations/users/${t}?beta=true`,n)}update(t,n,i){return this._client.post(N`/v1/organizations/users/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/users?beta=true",pn,{query:t,...n})}remove(t,n){return this._client.delete(N`/v1/organizations/users/${t}?beta=true`,n)}}});var sf,LL=j(()=>{Se();De();Ne();Me();sf=class extends Z{create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/federation_issuers?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(N`/v1/organizations/federation_issuers/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/federation_issuers/${t}?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true",le,{query:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r}=n??{};return this._client.post(N`/v1/organizations/federation_issuers/${t}/archive?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}}});var af,FL=j(()=>{Se();De();Ne();Me();af=class extends Z{list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(N`/v1/organizations/federation_rules/${t}/workspaces?beta=true`,le,{query:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}add(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/federation_rules/${t}/workspaces?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}remove(t,n,i){let{federation_rule_id:r,betas:o}=n;return this._client.delete(N`/v1/organizations/federation_rules/${r}/workspaces/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}});var zl,UL=j(()=>{Se();FL();FL();De();Ne();Me();zl=class extends Z{constructor(){super(...arguments),this.workspaces=new af(this._client)}create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/federation_rules?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(N`/v1/organizations/federation_rules/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/federation_rules/${t}?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/organizations/federation_rules?beta=true",le,{query:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r}=n??{};return this._client.post(N`/v1/organizations/federation_rules/${t}/archive?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}};zl.Workspaces=af});var Xa,jL=j(()=>{Se();LL();LL();UL();UL();Xa=class extends Z{constructor(){super(...arguments),this.issuers=new sf(this._client),this.rules=new zl(this._client)}};Xa.Issuers=sf;Xa.Rules=zl});var cf,zL=j(()=>{Se();De();Ne();Me();cf=class extends Z{list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(N`/v1/organizations/service_accounts/${t}/workspaces?beta=true`,le,{query:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}add(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/service_accounts/${t}/workspaces?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}remove(t,n,i){let{service_account_id:r,betas:o}=n;return this._client.delete(N`/v1/organizations/service_accounts/${r}/workspaces/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}});var Gl,GL=j(()=>{Se();zL();zL();De();Ne();Me();Gl=class extends Z{constructor(){super(...arguments),this.workspaces=new cf(this._client)}create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/service_accounts?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(N`/v1/organizations/service_accounts/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/service_accounts/${t}?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/organizations/service_accounts?beta=true",le,{query:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r}=n??{};return this._client.post(N`/v1/organizations/service_accounts/${t}/archive?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}};Gl.Workspaces=cf});var lf,VL=j(()=>{Se();De();Me();lf=class extends Z{retrieve(t,n,i){let{workspace_id:r}=n;return this._client.get(N`/v1/organizations/workspaces/${r}/members/${t}?beta=true`,i)}update(t,n,i){let{workspace_id:r,...o}=n;return this._client.post(N`/v1/organizations/workspaces/${r}/members/${t}?beta=true`,{body:o,...i})}list(t,n={},i){return this._client.getAPIList(N`/v1/organizations/workspaces/${t}/members?beta=true`,pn,{query:n,...i})}add(t,n,i){return this._client.post(N`/v1/organizations/workspaces/${t}/members?beta=true`,{body:n,...i})}remove(t,n,i){let{workspace_id:r}=n;return this._client.delete(N`/v1/organizations/workspaces/${r}/members/${t}?beta=true`,i)}}});var uf,BL=j(()=>{Se();De();Me();uf=class extends Z{list(t,n={},i){return this._client.getAPIList(N`/v1/organizations/workspaces/${t}/rate_limits?beta=true`,le,{query:n,...i})}}});var df,qL=j(()=>{Se();De();Ne();Me();df=class extends Z{retrieve(t,n,i){let{workspace_id:r,betas:o}=n;return this._client.get(N`/v1/organizations/workspaces/${r}/service_accounts/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}update(t,n,i){let{workspace_id:r,betas:o,...s}=n;return this._client.post(N`/v1/organizations/workspaces/${r}/service_accounts/${t}?beta=true`,{body:s,...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(N`/v1/organizations/workspaces/${t}/service_accounts?beta=true`,le,{query:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}add(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/workspaces/${t}/service_accounts?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}remove(t,n,i){let{workspace_id:r,betas:o}=n;return this._client.delete(N`/v1/organizations/workspaces/${r}/service_accounts/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}});var ws,WL=j(()=>{Se();VL();VL();BL();BL();qL();qL();De();Ne();Me();ws=class extends Z{constructor(){super(...arguments),this.rateLimits=new uf(this._client),this.members=new lf(this._client),this.serviceAccounts=new df(this._client)}create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/workspaces?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n){return this._client.get(N`/v1/organizations/workspaces/${t}?beta=true`,n)}update(t,n,i){return this._client.post(N`/v1/organizations/workspaces/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/workspaces?beta=true",pn,{query:t,...n})}archive(t,n){return this._client.post(N`/v1/organizations/workspaces/${t}/archive?beta=true`,n)}};ws.RateLimits=uf;ws.Members=lf;ws.ServiceAccounts=df});var vr,HL=j(()=>{Se();NL();NL();CL();CL();PL();PL();DL();DL();OL();OL();ML();ML();jL();jL();GL();GL();WL();WL();vr=class extends Z{constructor(){super(...arguments),this.apiKeys=new Xp(this._client),this.externalKeys=new tf(this._client),this.federation=new Xa(this._client),this.invites=new nf(this._client),this.serviceAccounts=new Gl(this._client),this.users=new of(this._client),this.workspaces=new ws(this._client),this.rateLimits=new rf(this._client),this.complianceSettings=new ef(this._client)}retrieve(t){return this._client.get("/v1/organizations/me?beta=true",t)}};vr.APIKeys=Xp;vr.ExternalKeys=tf;vr.Federation=Xa;vr.Invites=nf;vr.ServiceAccounts=Gl;vr.Users=of;vr.Workspaces=ws;vr.RateLimits=rf;vr.ComplianceSettings=ef});var Vl,KL=j(()=>{Se();De();Ne();Me();sS();sS();Vl=class extends Z{list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/sessions/${t}/events?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}send(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/sessions/${t}/events?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}stream(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.get(N`/v1/sessions/${t}/events/stream?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),stream:!0})}toolRunner(t,n){return new Ba(t,{...n,client:this._client})}};Vl.SessionToolRunner=Ba});var pf,JL=j(()=>{Se();De();Ne();Me();pf=class extends Z{retrieve(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/sessions/${r}/resources/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{session_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/sessions/${r}/resources/${t}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/sessions/${t}/resources?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.delete(N`/v1/sessions/${r}/resources/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}add(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/sessions/${t}/resources?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var ff,ZL=j(()=>{Se();De();Ne();Me();ff=class extends Z{list(t,n,i){let{session_id:r,betas:o,workspace_id:s,...a}=n;return this._client.getAPIList(N`/v1/sessions/${r}/threads/${t}/events?beta=true`,le,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}stream(t,n,i){let{session_id:r,betas:o,workspace_id:s,...a}=n;return this._client.get(N`/v1/sessions/${r}/threads/${t}/stream?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),stream:!0})}}});var Bl,YL=j(()=>{Se();ZL();ZL();De();Ne();Me();Bl=class extends Z{constructor(){super(...arguments),this.events=new ff(this._client)}retrieve(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/sessions/${r}/threads/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/sessions/${t}/threads?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/sessions/${r}/threads/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}};Bl.Events=ff});var ks,QL=j(()=>{Se();KL();KL();JL();JL();YL();YL();De();Ne();Me();ks=class extends Z{constructor(){super(...arguments),this.events=new Vl(this._client),this.resources=new pf(this._client),this.threads=new Bl(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/sessions?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/sessions/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/sessions/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/sessions?beta=true",P_,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/sessions/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/sessions/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};ks.Events=Vl;ks.Resources=pf;ks.Threads=Bl});var mf,XL=j(()=>{Se();De();Ne();gs();Me();mf=class extends Z{create(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/skills/${t}/versions?beta=true`,xi({body:s,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])},this._client,!1))}retrieve(t,n,i){let{skill_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/skills/${r}/versions/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/skills/${t}/versions?beta=true`,le,{query:s,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{skill_id:r,betas:o,workspace_id:s}=n;return this._client.delete(N`/v1/skills/${r}/versions/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}download(t,n,i){let{skill_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/skills/${r}/versions/${t}/content?beta=true`,{...i,headers:I([{Accept:"application/binary",...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__binaryResponse:!0})}}});var ql,eF=j(()=>{Se();XL();XL();De();Ne();gs();Me();ql=class extends Z{constructor(){super(...arguments),this.versions=new mf(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/skills?beta=true",xi({body:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])},this._client,!1))}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/skills/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/skills?beta=true",le,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/skills/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};ql.Versions=mf});var gf,tF=j(()=>{Se();De();Ne();Me();gf=class extends Z{create(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/tunnels/${t}/certificates?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}retrieve(t,n,i){let{tunnel_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/tunnels/${r}/certificates/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/tunnels/${t}/certificates?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n,i){let{tunnel_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/tunnels/${r}/certificates/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}});var Wl,nF=j(()=>{Se();tF();tF();De();Ne();Me();Wl=class extends Z{constructor(){super(...arguments),this.certificates=new gf(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/tunnels?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/tunnels/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/tunnels?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/tunnels/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}revealToken(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/tunnels/${t}/reveal_token?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}rotateToken(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/tunnels/${t}/rotate_token?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Wl.Certificates=gf});var hf,rF=j(()=>{Se();De();Ne();Me();hf=class extends Z{create(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/vaults/${t}/credentials?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}retrieve(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/vaults/${r}/credentials/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{vault_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/vaults/${r}/credentials/${t}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/vaults/${t}/credentials?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.delete(N`/v1/vaults/${r}/credentials/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}archive(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/vaults/${r}/credentials/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}mcpOAuthValidate(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/vaults/${r}/credentials/${t}/mcp_oauth_validate?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}});var Hl,iF=j(()=>{Se();rF();rF();De();Ne();Me();Hl=class extends Z{constructor(){super(...arguments),this.credentials=new hf(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/vaults?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/vaults/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/vaults/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/vaults?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/vaults/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/vaults/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Hl.Credentials=hf});var jt,oF=j(()=>{Se();_M();_M();SM();SM();xM();xM();TM();TM();IM();IM();AM();AM();PM();PM();OM();OM();uL();uL();fL();fL();RL();RL();HL();HL();QL();QL();eF();eF();nF();nF();iF();iF();jt=class extends Z{constructor(){super(...arguments),this.models=new bp(this._client),this.messages=new vs(this._client),this.agents=new Tl(this._client),this.environments=new Fl(this._client),this.sessions=new ks(this._client),this.deployments=new gp(this._client),this.deploymentRuns=new mp(this._client),this.vaults=new Hl(this._client),this.memoryStores=new Ja(this._client),this.files=new yp(this._client),this.skills=new ql(this._client),this.webhooks=new kp(this._client),this.userProfiles=new vp(this._client),this.dreams=new hp(this._client),this.tunnels=new Wl(this._client),this.organization=new vr(this._client)}};jt.Models=bp;jt.Messages=vs;jt.Agents=Tl;jt.Environments=Fl;jt.Sessions=ks;jt.Deployments=gp;jt.DeploymentRuns=mp;jt.Vaults=Hl;jt.MemoryStores=Ja;jt.Files=yp;jt.Skills=ql;jt.Webhooks=kp;jt.UserProfiles=vp;jt.Dreams=hp;jt.Tunnels=Wl;jt.Organization=vr});var Kl,sF=j(()=>{Se();Ne();Kl=class extends Z{create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers]),stream:t.stream??!1})}}});var Jl,aF=j(()=>{Se();De();Ne();eo();gs();Me();Jl=class extends Z{list(t={},n){let{workspace_id:i,...r}=t??{};return this._client.getAPIList("/v1/files",le,{query:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},i){let{workspace_id:r}=n??{};return this._client.delete(N`/v1/files/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}download(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(N`/v1/files/${t}/content`,{...i,headers:I([{Accept:"application/binary",...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(N`/v1/files/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}upload(t,n){let{workspace_id:i,...r}=t;return this._client.post("/v1/files",xi({body:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},F_(r.file),n?.headers])},this._client))}}});function QX(e){return e?.output_config?.format}function cF(e,t,n){let i=QX(t);return!t||!("parse"in(i??{}))?{...e,content:e.content.map(r=>r.type==="text"?Object.defineProperty({...r},"parsed_output",{value:null,enumerable:!1}):r),parsed_output:null}:lF(e,t,n)}function lF(e,t,n){let i=null,r=e.content.map(o=>{if(o.type==="text"){let s=kOe(t,o.text);return i===null&&(i=s),Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1})}return o});return{...e,content:r,parsed_output:i}}function kOe(e,t){let n=QX(e);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(t):JSON.parse(t)}catch(i){throw new J(`Failed to parse structured output: ${i}`)}}var uF=j(()=>{kt()});function hF(e){return e.type==="tool_use"||e.type==="server_tool_use"}var Ri,ec,yf,wy,OS,ky,$y,MS,_y,Fo,Sy,LS,FS,Zl,US,jS,zS,xy,dF,XX,pF,fF,mF,gF,e7,GS,t7=j(()=>{gr();eo();Da();hr();Wp();wL();uF();kL();GS=class e{constructor(t,n){Ri.add(this),this.messages=[],this.receivedMessages=[],ec.set(this,void 0),yf.set(this,null),this.controller=new AbortController,wy.set(this,void 0),OS.set(this,()=>{}),ky.set(this,()=>{}),$y.set(this,void 0),MS.set(this,()=>{}),_y.set(this,()=>{}),Fo.set(this,{}),Sy.set(this,!1),LS.set(this,!1),FS.set(this,!1),Zl.set(this,!1),US.set(this,void 0),jS.set(this,void 0),zS.set(this,void 0),xy.set(this,void 0),pF.set(this,i=>{if(M(this,LS,!0,"f"),Yr(i)&&(i=new In),i instanceof In)return M(this,FS,!0,"f"),this._emit("abort",i);if(i instanceof J)return this._emit("error",i);if(i instanceof Error){let r=new J(i.message);return r.cause=i,this._emit("error",r)}return this._emit("error",new J(String(i)))}),M(this,wy,new Promise((i,r)=>{M(this,OS,i,"f"),M(this,ky,r,"f")}),"f"),M(this,$y,new Promise((i,r)=>{M(this,MS,i,"f"),M(this,_y,r,"f")}),"f"),v(this,wy,"f").catch(()=>{}),v(this,$y,"f").catch(()=>{}),M(this,yf,t,"f"),M(this,xy,n?.logger??console,"f")}get response(){return v(this,US,"f")}get request_id(){return v(this,jS,"f")}get workspace_id(){return v(this,zS,"f")}async withResponse(){M(this,Zl,!0,"f");let t=await v(this,wy,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id"),workspace_id:t.headers.get("anthropic-workspace-id")}}static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,i,{logger:r}={}){let o=new e(n,{logger:r});for(let s of n.messages)o._addMessageParam(s);return M(o,yf,{...n,stream:!0},"f"),o._run(()=>o._createMessage(t,{...n,stream:!0},{...i,headers:{...i?.headers,[M_]:"stream"}})),o}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},v(this,pF,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,i){let r=i?.signal,o;r&&(r.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),r.addEventListener("abort",o));try{v(this,Ri,"m",fF).call(this);let{response:s,data:a}=await t.create({...n,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(s);for await(let c of a)v(this,Ri,"m",mF).call(this,c);if(a.controller.signal?.aborted)throw new In;v(this,Ri,"m",gF).call(this)}finally{r&&o&&r.removeEventListener("abort",o)}}_connected(t){this.ended||(M(this,US,t,"f"),M(this,jS,t?.headers.get("request-id"),"f"),M(this,zS,t?.headers.get("anthropic-workspace-id"),"f"),v(this,OS,"f").call(this,t),this._emit("connect"))}get ended(){return v(this,Sy,"f")}get errored(){return v(this,LS,"f")}get aborted(){return v(this,FS,"f")}abort(){this.controller.abort()}on(t,n){return(v(this,Fo,"f")[t]||(v(this,Fo,"f")[t]=[])).push({listener:n}),this}off(t,n){let i=v(this,Fo,"f")[t];if(!i)return this;let r=i.findIndex(o=>o.listener===n);return r>=0&&i.splice(r,1),this}once(t,n){return(v(this,Fo,"f")[t]||(v(this,Fo,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,i)=>{M(this,Zl,!0,"f"),t!=="error"&&this.once("error",i),this.once(t,n)})}async done(){M(this,Zl,!0,"f"),await v(this,$y,"f")}get currentMessage(){return v(this,ec,"f")}async finalMessage(){return await this.done(),v(this,Ri,"m",dF).call(this)}async finalText(){return await this.done(),v(this,Ri,"m",XX).call(this)}_emit(t,...n){if(v(this,Sy,"f"))return;t==="end"&&(M(this,Sy,!0,"f"),v(this,MS,"f").call(this));let i=v(this,Fo,"f")[t];if(i&&(v(this,Fo,"f")[t]=i.filter(r=>!r.once),i.forEach(({listener:r})=>r(...n))),t==="abort"){let r=n[0];!v(this,Zl,"f")&&!i?.length&&Promise.reject(r),v(this,ky,"f").call(this,r),v(this,_y,"f").call(this,r),this._emit("end");return}if(t==="error"){let r=n[0];!v(this,Zl,"f")&&!i?.length&&Promise.reject(r),v(this,ky,"f").call(this,r),v(this,_y,"f").call(this,r),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",v(this,Ri,"m",dF).call(this))}async _fromReadableStream(t,n){let i=n?.signal,r;i&&(i.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),i.addEventListener("abort",r));try{v(this,Ri,"m",fF).call(this),this._connected(null);let o=Fr.fromReadableStream(t,this.controller);for await(let s of o)v(this,Ri,"m",mF).call(this,s);if(o.controller.signal?.aborted)throw new In;v(this,Ri,"m",gF).call(this)}finally{i&&r&&i.removeEventListener("abort",r)}}[(ec=new WeakMap,yf=new WeakMap,wy=new WeakMap,OS=new WeakMap,ky=new WeakMap,$y=new WeakMap,MS=new WeakMap,_y=new WeakMap,Fo=new WeakMap,Sy=new WeakMap,LS=new WeakMap,FS=new WeakMap,Zl=new WeakMap,US=new WeakMap,jS=new WeakMap,zS=new WeakMap,xy=new WeakMap,pF=new WeakMap,Ri=new WeakSet,dF=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},XX=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(n.length===0)throw new J("stream ended without producing a content block with type=text");return n.join(" ")},fF=function(){this.ended||M(this,ec,void 0,"f")},mF=function(n){if(this.ended)return;let i=v(this,Ri,"m",e7).call(this,n);switch(this._emit("streamEvent",n,i),n.type){case"content_block_delta":{let r=i.content.at(-1);switch(n.delta.type){case"text_delta":{r.type==="text"&&this._emit("text",n.delta.text,r.text||"");break}case"citations_delta":{r.type==="text"&&this._emit("citation",n.delta.citation,r.citations??[]);break}case"input_json_delta":{hF(r)&&v(this,Fo,"f").inputJson?.length&&this._emit("inputJson",n.delta.partial_json,r.input);break}case"thinking_delta":{r.type==="thinking"&&this._emit("thinking",n.delta.thinking,r.thinking);break}case"signature_delta":{r.type==="thinking"&&this._emit("signature",r.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(i),this._addMessage(cF(i,v(this,yf,"f"),{logger:v(this,xy,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{M(this,ec,i,"f");break}case"content_block_start":case"message_delta":break}},gF=function(){if(this.ended)throw new J("stream has ended, this shouldn't happen");let n=v(this,ec,"f");if(!n)throw new J("request ended without sending any chunks");return M(this,ec,void 0,"f"),cF(n,v(this,yf,"f"),{logger:v(this,xy,"f")})},e7=function(n){let i=v(this,ec,"f");if(n.type==="message_start"){if(i)throw new J(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!i)throw new J(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return i;case"message_delta":return i.stop_reason=n.delta.stop_reason,i.stop_sequence=n.delta.stop_sequence,i.stop_details=n.delta.stop_details,i.usage.output_tokens=n.usage.output_tokens,n.delta.container!=null&&(i.container=n.delta.container),n.usage.input_tokens!=null&&(i.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(i.usage.server_tool_use=n.usage.server_tool_use),n.usage.output_tokens_details!=null&&(i.usage.output_tokens_details=n.usage.output_tokens_details),i;case"content_block_start":return i.content.push({...n.content_block}),i;case"content_block_delta":{let r=i.content.at(n.index);switch(n.delta.type){case"text_delta":{r?.type==="text"&&(i.content[n.index]={...r,text:(r.text||"")+n.delta.text});break}case"citations_delta":{r?.type==="text"&&(i.content[n.index]={...r,citations:[...r.citations??[],n.delta.citation]});break}case"input_json_delta":{if(r&&hF(r)){let o=(r[Za]||"")+n.delta.partial_json;i.content[n.index]=ES(r,o)}break}case"thinking_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,thinking:r.thinking+n.delta.thinking});break}case"signature_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,signature:n.delta.signature});break}default:n.delta}return i}case"content_block_stop":{let r=i.content.at(n.index);return r&&hF(r)&&Za in r&&Object.defineProperty(r,"input",{value:r.input,enumerable:!0,configurable:!0,writable:!0}),i}}},Symbol.asyncIterator)](){let t=[],n=[],i=!1;return this.on("streamEvent",r=>{let o=n.shift();o?o.resolve(r):t.push(r)}),this.on("end",()=>{i=!0;for(let r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((o,s)=>n.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Fr(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var bf,yF=j(()=>{Se();De();Ne();mL();Wp();Me();bf=class extends Z{create(t,n){let{user_profile_id:i,workspace_id:r,...o}=t;return this._client.post("/v1/messages/batches",{body:o,...n,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(N`/v1/messages/batches/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}list(t={},n){let{workspace_id:i,...r}=t??{};return this._client.getAPIList("/v1/messages/batches",pn,{query:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},i){let{workspace_id:r}=n??{};return this._client.delete(N`/v1/messages/batches/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}cancel(t,n={},i){let{workspace_id:r}=n??{};return this._client.post(N`/v1/messages/batches/${t}/cancel`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}async results(t,n={},i){let r=await this.retrieve(t,n,i);if(!r.results_url)throw new J(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{workspace_id:o}=n??{};return this._client.get(r.results_url,{...i,headers:I([{Accept:"application/binary",...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,a)=>Hp.fromResponse(a.response,a.controller))}}});var tc,n7,_Oe,bF=j(()=>{Se();Ne();eo();t7();uF();yF();yF();hL();tc=class extends Z{constructor(){super(...arguments),this.batches=new bf(this._client)}create(t,n){let{user_profile_id:i,workspace_id:r,...o}=t;o.model in n7&&console.warn(`The model '${o.model}' is deprecated and will reach end-of-life on ${n7[o.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),_Oe.includes(o.model)&&o.thinking&&o.thinking.type==="enabled"&&console.warn(`Using Claude with ${o.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let s=n?.timeout??this._client._options.timeout;if(!o.stream&&s==null){let c=xS[o.model]??void 0;s=this._client.calculateNonstreamingTimeout(o.max_tokens,c)}let a=L_(o.tools,o.messages);return this._client.post("/v1/messages",{body:o,timeout:s??6e5,...n,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},a,n?.headers]),stream:t.stream??!1})}parse(t,n){return this.create(t,n).then(i=>lF(i,t,{logger:this._client.logger??console}))}stream(t,n){return GS.createMessage(this,t,n,{logger:this._client.logger??console})}countTokens(t,n){let{user_profile_id:i,workspace_id:r,...o}=t;return this._client.post("/v1/messages/count_tokens",{body:o,...n,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}},n7={},_Oe=["claude-mythos-preview","claude-opus-4-6"];tc.Batches=bf});var Yl,vF=j(()=>{Se();De();Ne();Me();Yl=class extends Z{retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/models/${t}`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/models",pn,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}}});var vf,wF=j(()=>{Se();De();Ne();gs();Me();vf=class extends Z{create(t,n,i){let{workspace_id:r,...o}=n;return this._client.post(N`/v1/skills/${t}/versions`,xi({body:o,...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])},this._client,!1))}retrieve(t,n,i){let{skill_id:r,workspace_id:o}=n;return this._client.get(N`/v1/skills/${r}/versions/${t}`,{...i,headers:I([{...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t,n={},i){let{workspace_id:r,...o}=n??{};return this._client.getAPIList(N`/v1/skills/${t}/versions`,le,{query:o,...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}delete(t,n,i){let{skill_id:r,workspace_id:o}=n;return this._client.delete(N`/v1/skills/${r}/versions/${t}`,{...i,headers:I([{...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var nc,kF=j(()=>{Se();wF();wF();De();Ne();gs();Me();nc=class extends Z{constructor(){super(...arguments),this.versions=new vf(this._client)}create(t,n){let{workspace_id:i,...r}=t;return this._client.post("/v1/skills",xi({body:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])},this._client,!1))}retrieve(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(N`/v1/skills/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}list(t={},n){let{workspace_id:i,...r}=t??{};return this._client.getAPIList("/v1/skills",le,{query:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},i){let{workspace_id:r}=n??{};return this._client.delete(N`/v1/skills/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}};nc.Versions=vf});var r7=j(()=>{yQ();oF();sF();aF();bF();vF();kF()});var $F,_F,VS,i7,SF,xF,Ot,no,EF=j(()=>{gr();hr();cp();Da();p_();m_();lp();WO();eM();Ah();kt();dp();G5();aQ();fQ();De();kM();r7();N_();sF();aF();vF();oF();bF();kF();p_();Ne();pp();Xi();hr();SF="\\n\\nHuman:",xF="\\n\\nAssistant:",Ot=class{get credentials(){return this._authState.provider}constructor({baseURL:t=ze("ANTHROPIC_BASE_URL"),apiKey:n,authToken:i,webhookKey:r=ze("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...o}={}){if($F.add(this),this._requestAuthFlags=new WeakMap,VS.set(this,void 0),n===void 0&&(n=o.profile!=null?null:ze("ANTHROPIC_API_KEY")??null),i===void 0&&(i=o.profile!=null?null:ze("ANTHROPIC_AUTH_TOKEN")??null),o.profile!=null&&(o.credentials!=null||o.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let s={apiKey:n,authToken:i,webhookKey:r,...o,baseURL:t||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&b5())throw new J(`It looks like you're running in a browser-like environment. +`)}})}async function Gje(e,t,n,r,i){let o=new Bje(t,n,r,i);if(o.rangeIsEmpty())return"";let s=Gb.createReadStream(e,{highWaterMark:Dje});try{for await(let a of s)if(o.collectFrom(a),o.rangeIsCollected())break}finally{s.destroy()}return o.text()}function Wie(e){return uu(e.unrestrictedPaths),ru({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:async({file_path:t,content:n})=>{if(!t)throw new Ue("write: file_path is required");let r=await wf(e,t),i=await Gie(e,r);if(i!==void 0)throw new Ue(`write: ${t} is inside read-only directory ${i}`);try{await Dn.mkdir(Ar.dirname(r),{recursive:!0,mode:Db}),await EU(r,n??"")}catch(o){throw new Ue(`write: ${hf(o,t)}`)}return`wrote ${Buffer.byteLength(n??"")} bytes to ${t}`}})}function Hie(e){return uu(e.unrestrictedPaths),ru({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:async({file_path:t,old_string:n,new_string:r,replace_all:i})=>{if(!t)throw new Ue("edit: file_path is required");if(!n)throw new Ue("edit: old_string is required");let o=await wf(e,t),s=await Gie(e,o);if(s!==void 0)throw new Ue(`edit: ${t} is inside read-only directory ${s}`);let a;try{let u=await Dn.stat(o);if(!u.isFile())throw new Ue(`edit: ${t} is not a regular file`);let d=zie(e.maxFileBytes);if(d!==null&&u.size>d)throw new Ue(`edit: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. The edit tool loads the whole file and cannot modify a file this large.`);a=await Dn.readFile(o,"utf8")}catch(u){throw u instanceof Ue?u:new Ue(`edit: ${hf(u,t)}`)}let c=a.split(n).length-1;if(c===0)throw new Ue(`edit: old_string not found in ${t}`);let l;if(i)l=a.split(n).join(r);else{if(c>1)throw new Ue(`edit: old_string appears ${c} times in ${t} (must be unique)`);l=a.replace(n,()=>r)}try{await EU(o,l)}catch(u){throw new Ue(`edit: write: ${hf(u,t)}`)}return`edited ${t} (${i?c:1} replacement(s))`}})}function Vje(e){return e.split(/[\\/{},]/).includes("..")}function Kie(e){return uu(e.unrestrictedPaths),ru({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:async({pattern:t,path:n})=>{if(!t)throw new Ue("glob: pattern is required");if(Ar.isAbsolute(t))throw new Ue("glob: absolute pattern not permitted; pass a relative pattern (and optionally path)");if(Vje(t))throw new Ue('glob: ".." is not permitted in the pattern');let r=n?await wf(e,n):Ar.resolve(e.workdir),i=n?r:await Ob(r),o=[],s=Zie;try{for await(let a of Uje(t,{cwd:r,withFileTypes:!0,exclude:c=>c.name===".git"||c.name==="node_modules"})){if(s--<=0)break;if(!a.isFile())continue;let c=Ar.join(a.parentPath,a.name),l;try{l=await Dn.realpath(c)}catch{continue}if(!AE(i,l))continue;let u=0;try{u=(await Dn.stat(c)).mtimeMs}catch{}o.push({path:c,mtime:u})}}catch(a){throw new Ue(`glob: ${a instanceof Error?a.message:String(a)}`)}return o.length===0?"no matches":(o.sort((a,c)=>c.mtime-a.mtime),o.slice(0,Lje).map(a=>a.path).join(` +`))}})}function Jie(e){return uu(e.unrestrictedPaths),ru({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:async({pattern:t,path:n},r)=>{if(!t)throw new Ue("grep: pattern is required");let i=Ar.resolve(e.workdir);n&&(i=await wf(e,n));let o=await Jje();return o?qje(o,t,i,r?.signal):Wje(t,i,r?.signal)}})}function qje(e,t,n,r){return new Promise((i,o)=>{let s=jU.spawn(e,["-n","--no-heading","-e",t,"--",n],{...r?{signal:r}:{}}),a="",c="",l=!1;s.stdout.on("data",u=>{l||(a+=u,a.length>zb&&(l=!0,a=a.slice(0,zb),s.kill("SIGKILL")))}),s.stderr.on("data",u=>c+=u),s.on("close",u=>{if(r?.aborted)return o(new Ue("grep: aborted"));if(l)return i(a+` +[output truncated at ${zb} bytes]`);if(u===0)return i(a);if(u===1)return i("no matches");o(new Ue(`grep: rg failed: ${c||`exit ${u}`}`))}),s.on("error",u=>{if(r?.aborted)return o(new Ue("grep: aborted"));o(new Ue(`grep: rg failed: ${u.message}`))})})}async function Wje(e,t,n){let r;try{r=new RegExp(e)}catch(c){throw new Ue(`grep: invalid regex: ${c instanceof Error?c.message:String(c)}`)}let i=[],o=zb,s=c=>(o-=c.length+1,o<0?(i.push(`[output truncated at ${zb} bytes]`),!1):(i.push(c),!0));if((await Dn.stat(t).catch(()=>null))?.isFile()?await Lie(t,r,s):await Kje(t,"",c=>Lie(Ar.join(t,c),r,s),n),n?.aborted)throw new Ue("grep: aborted");return i.length===0?"no matches":i.join(` +`)}async function Lie(e,t,n){let r=Gb.createReadStream(e,{encoding:"utf8"}),i=Uie.createInterface({input:r,crlfDelay:1/0}),o=0;try{for await(let s of i)if(o++,!(s.length>Mje)&&t.test(s)&&!n(`${e}:${o}:${s}`))return!1}catch{}finally{r.destroy()}return!0}async function Kje(e,t,n,r){let i=Zie;async function o(s,a){if(a>Hje)return!0;if(r?.aborted)return!1;let c;try{c=await Dn.readdir(Ar.join(e,s),{withFileTypes:!0})}catch{return!0}for(let l of c){if(l.name===".git"||l.name==="node_modules")continue;if(i--<=0||r?.aborted)return!1;let u=s?Ar.join(s,l.name):l.name;if(l.isDirectory()){if(!await o(u,a+1))return!1}else if(l.isFile()&&await n(u)===!1)return!1}return!0}await o(t,0)}async function Jje(){let e=(process.env.PATH??"").split(Ar.delimiter);for(let t of e){let n=Ar.join(t,"rg");try{return await Dn.access(n,Gb.constants.X_OK),n}catch{}}return null}var Dn,Gb,Ar,jU,Fie,Uie,ME,Tr,Zr,Fb,su,Wi,UU,LE,Ub,FE,UE,au,cu,_f,lu,jb,vc,Nie,Oie,Die,jie,Oje,Dje,Mie,zb,Mje,Lje,jE,Fje,Uje,Bie,Bje,Hje,Zie,Qie=P(()=>{sr();Dn=$t(require("node:fs/promises"),1),Gb=$t(require("node:fs"),1),Ar=$t(require("node:path"),1),jU=$t(require("node:child_process"),1),Fie=$t(require("node:crypto"),1),Uie=$t(require("node:readline"),1);at();lf();oie();SU();TU();uie();Cie();Die=100*1024,jie=12e4,Oje=256*1024,Dje=64*1024,Mie=Buffer.from(` +`),zb=100*1024,Mje=2e3,Lje=200,jE=class extends Q{constructor(t){super(`bash command timed out after ${t}ms`),this.name="BashTimeoutError",this.timeoutMs=t}},Fje=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,Uje=Dn.glob;Bie=(()=>{class e{constructor(n,r=zje()){ME.add(this),Tr.set(this,void 0),Zr.set(this,""),Fb.set(this,!1),su.set(this,!1),Wi.set(this,null),O(this,Tr,jU.spawn("/bin/bash",["--noprofile","--norc"],{cwd:n,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),y(this,Tr,"f").stdout.setEncoding("utf8"),y(this,Tr,"f").stderr.setEncoding("utf8"),y(this,Tr,"f").stdout.on("data",i=>y(this,ME,"m",UU).call(this,i)),y(this,Tr,"f").stderr.on("data",i=>y(this,ME,"m",UU).call(this,i)),y(this,Tr,"f").once("close",()=>{O(this,su,!0,"f");let i=y(this,Wi,"f");O(this,Wi,null,"f"),i?.resolve()})}get closed(){return y(this,su,"f")}async exec(n,r={}){if(y(this,su,"f"))throw new Q("bash session terminated");let i=r.timeoutMs??jie,o=r.signal;o?.throwIfAborted(),O(this,Zr,"","f"),O(this,Fb,!1,"f");let s=`__ANT_CMD_${Fie.randomUUID()}_DONE__`,a=`${s.slice(0,8)}''${s.slice(8)}`,c=`{ ${n} +} &1; printf '\\n${a}%d\\n' $? +`;if(y(this,Tr,"f").stdin.write(c),y(this,Zr,"f").indexOf(s)<0){let{promise:m,resolve:g}=gf();O(this,Wi,{sentinel:s,resolve:g},"f");let h,v;try{await Promise.race([m,new Promise((b,_)=>{h=setTimeout(()=>_(new jE(i)),i)}),new Promise((b,_)=>{o&&(v=()=>_(o.reason),o.addEventListener("abort",v,{once:!0}))})])}finally{h&&clearTimeout(h),v&&o&&o.removeEventListener("abort",v),O(this,Wi,null,"f")}}let l=y(this,Zr,"f").indexOf(s);if(l<0)throw new Q("bash session terminated");let d=y(this,Zr,"f").slice(l+s.length).match(/^(-?\d+)/),p=d?parseInt(d[1],10):-1,f=y(this,Zr,"f").slice(0,l).replace(Fje,"").replace(/\n+$/,"");return y(this,Fb,"f")&&(f=`[output truncated] +${f}`),{output:f,exitCode:p}}close(){if(y(this,su,"f"))return;O(this,su,!0,"f");let n=y(this,Wi,"f");O(this,Wi,null,"f"),n?.resolve(),y(this,Tr,"f").stdout.destroy(),y(this,Tr,"f").stderr.destroy(),y(this,Tr,"f").stdin.destroy();try{process.kill(-y(this,Tr,"f").pid,"SIGKILL")}catch{y(this,Tr,"f").kill("SIGKILL")}y(this,Tr,"f").unref()}}return Tr=new WeakMap,Zr=new WeakMap,Fb=new WeakMap,su=new WeakMap,Wi=new WeakMap,ME=new WeakSet,UU=function(n){if(O(this,Zr,y(this,Zr,"f")+n,"f"),y(this,Zr,"f").length>Die&&(O(this,Zr,y(this,Zr,"f").slice(y(this,Zr,"f").length-Die),"f"),O(this,Fb,!0,"f")),y(this,Wi,"f")&&y(this,Zr,"f").indexOf(y(this,Wi,"f").sentinel)>=0){let r=y(this,Wi,"f");O(this,Wi,null,"f"),r.resolve()}},e})();Bje=(()=>{class e{constructor(n,r,i,o){LE.add(this),Ub.set(this,void 0),FE.set(this,void 0),UE.set(this,void 0),au.set(this,void 0),cu.set(this,void 0),_f.set(this,void 0),lu.set(this,0),jb.set(this,[]),vc.set(this,0),O(this,Ub,n,"f"),O(this,FE,r,"f"),O(this,UE,i,"f"),O(this,au,Math.max(0,r-1),"f"),O(this,cu,i>0?i:1/0,"f"),O(this,_f,o,"f")}rangeIsEmpty(){return y(this,cu,"f")<=y(this,au,"f")}rangeIsCollected(){return y(this,lu,"f")>=y(this,cu,"f")}collectFrom(n){var r;let i=0;for(;i=y(this,au,"f")&&y(this,LE,"m",Nie).call(this,n.subarray(i,s),o>=0),o<0)break;O(this,lu,(r=y(this,lu,"f"),r++,r),"f"),i=o+1}}text(){return Buffer.concat(y(this,jb,"f"),y(this,vc,"f")).toString("utf8")}}return Ub=new WeakMap,FE=new WeakMap,UE=new WeakMap,au=new WeakMap,cu=new WeakMap,_f=new WeakMap,lu=new WeakMap,jb=new WeakMap,vc=new WeakMap,LE=new WeakSet,Nie=function(n,r){if(y(this,jb,"f").push(n),O(this,vc,y(this,vc,"f")+n.length,"f"),r&&y(this,lu,"f")+1y(this,_f,"f"))throw y(this,LE,"m",Oie).call(this)},Oie=function(){return y(this,cu,"f")-y(this,au,"f")===1?new Ue(`read: line ${y(this,au,"f")+1} of ${y(this,Ub,"f")} alone exceeds ${y(this,_f,"f")}-byte limit. The read tool cannot return part of a line, so view_range cannot narrow this further.`):new Ue(`read: view_range [${y(this,FE,"f")}, ${y(this,UE,"f")}] of ${y(this,Ub,"f")} exceeds ${y(this,_f,"f")}-byte limit. Narrow the view_range to read a smaller portion.`)},e})();Hje=40,Zie=5e4});function Qje(e){return e.resources.some(t=>t.type==="memory_store")}function Xje(e){if(!e)return null;let t;try{let r=e.replace(/-/g,"+").replace(/_/g,"/"),i=r.padEnd(Math.ceil(r.length/4)*4,"=");t=JSON.parse(ql(Xne(i)))}catch{return null}if(t===null||typeof t!="object"||Array.isArray(t))return null;let n=t.sessions_token;return typeof n=="string"&&n!==""?n:null}async function eoe(e,t){let n;try{return await Promise.race([e.then(()=>!1,()=>!1),new Promise(r=>{n=setTimeout(()=>r(!0),t)})])}finally{n!==void 0&&clearTimeout(n)}}async function eze(e,t,n,r){try{await e.beta.environments.work.stop(t.id,{environment_id:t.environment_id,force:!0},{...r,headers:T([r?.headers])})}catch(i){Wn(i,409)||n.error("force-stop on exit failed",{work_id:t.id,error:String(i)})}}function nze(e){let t=e instanceof _t?e.error:void 0;for(let n of["error","details","current_state"]){if(!DL(t))return{};t=t[n]}return DL(t)?t:{}}async function rze(e,t,n,r,i,o){let s=Xie,a=Zje,c=Date.now(),l=Yje,u=async()=>{let d=new AbortController,p=mc(n.signal,d),f=setTimeout(()=>d.abort(),s);try{let m=await e.beta.environments.work.heartbeat(t.id,{environment_id:t.environment_id,expected_last_heartbeat:l},{...i,headers:T([i?.headers]),signal:d.signal});c=Date.now(),l=m.last_heartbeat,m.ttl_seconds>0&&(a=m.ttl_seconds*1e3,s=Math.max(1e3,Math.min(a/2,Xie)),o?.(a)),(m.state==="stopping"||m.state==="stopped")&&(r.info("heartbeat signals shutdown",{work_id:t.id,state:m.state}),n.finish("control_plane_stop")),m.lease_extended||(r.warn("lease not extended, shutting down",{work_id:t.id}),n.finish("control_plane_stop"))}catch(m){if(n.signal.throwIfAborted(),Wn(m,412)){let g=nze(m);r.error("lease lost: heartbeat precondition failed",{work_id:t.id,server_state:g.state,server_ttl_seconds:g.ttl_seconds,server_last_heartbeat:g.last_heartbeat}),n.finish("lease_lost");return}if(tu(m))throw r.error("permanent heartbeat failure",{work_id:t.id,error:String(m)}),n.finish("heartbeat_rejected"),m;if(Date.now()-c>a){r.error("lease assumed lost: no successful heartbeat in ttl",{work_id:t.id,ttl_ms:a,error:String(m)}),n.finish("assumed_lost");return}r.warn("transient heartbeat failure",{work_id:t.id,error:String(m)})}finally{clearTimeout(f),p()}};for(await u();!n.signal.aborted;)await fo(s,n.signal),n.signal.throwIfAborted(),await u()}var zE,Bb,zU,Vb,du,Xie,Zje,Yje,GU,tze,toe=P(()=>{sr();at();qn();AF();Mp();Wl();Cp();wb();oE();Gi();$e();X();$U();yU();hU();Hr();TE();Xie=3e4,Zje=9e4,Yje="NO_HEARTBEAT";GU=(()=>{class e{constructor(n){if(zE.add(this),Bb.set(this,void 0),n.unrestrictedPaths!==void 0)throw new Q("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory.");this.client=n.client,this.environmentId=n.environmentId,this.environmentKey=n.environmentKey,this.tools=n.tools,this.workdir=n.workdir??process.cwd(),this.maxFileBytes=n.maxFileBytes,this.maxIdleMs=n.maxIdleMs,n.memorySyncIntervalMs!=null&&EE(n.memorySyncIntervalMs,"memorySyncIntervalMs"),this.memorySyncIntervalMs=n.memorySyncIntervalMs,this.memorySyncDeletions=n.memorySyncDeletions??"enabled",this.workerId=n.workerId,this.requestOptions=n.requestOptions,O(this,Bb,n.signal,"f")}async run(n){let{environmentId:r,environmentKey:i}=this;if(r===void 0||i===void 0)throw new Q("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let o=n??y(this,Bb,"f"),s=new xb({client:this.client,environmentId:r,environmentKey:i,...this.workerId!==void 0?{workerId:this.workerId}:{},...o?{signal:o}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let a of s){let c=s._workSpan;try{await xF(this.client,c,s.signal,()=>y(this,zE,"m",zU).call(this,a,i,s.signal,c))}catch(l){if(s.signal?.aborted)throw l;Te(this.client).error("work item failed",{work_id:a.id,error:String(l)})}}}async handleItem(n){let r=n?.workId??je("ANTHROPIC_WORK_ID"),i=n?.environmentId??je("ANTHROPIC_ENVIRONMENT_ID"),o=n?.sessionId??je("ANTHROPIC_SESSION_ID"),s=(n?.environmentKey??this.environmentKey??je("ANTHROPIC_ENVIRONMENT_KEY"))||void 0,a=n?.workSecret||je("ANTHROPIC_WORK_SECRET")||null;if(!r)throw new Q("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!i)throw new Q("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!o)throw new Q("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s&&!a)throw new Q("handleItem: environmentKey is required when there is no work secret \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let c={id:r,environment_id:i,secret:a,data:{type:"session",id:o}};await y(this,zE,"m",zU).call(this,c,s,n?.signal??y(this,Bb,"f"))}}return Bb=new WeakMap,zE=new WeakSet,zU=async function(n,r,i,o){let s=Te(this.client),a=Xje(n.secret),c=a??r;if(c===void 0)throw new Q("handleItem: the work item carried a secret payload but no sessions token could be extracted, and there is no environment key to fall back to; the poller must issue a secret whose payload carries `sessions_token`, or provide the environment key (pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY)");n.secret&&a===null&&s.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key",{work_id:n.id});let l=cE(this.client,{authToken:c,helper:"environments-worker"}),u=n.data.id,d=new AbortController,p=mc(i,d),f=new tze(d),m=await Promise.resolve().then(()=>(Qie(),Yie)),g,h,v=rze(l,n,f,s,this.requestOptions,k=>{g=k,h?._setSendRetryWindow(k)}).catch(k=>{d.signal.aborted||s.error("heartbeat loop failed",{work_id:n.id,error:String(k)}),d.abort()}),b=async()=>{},_,w=!1;try{if(n.data.type!=="session"){s.debug("skipping non-session work item",{work_id:n.id,type:n.data.type});return}let k=await l.beta.sessions.retrieve(u);if(a===null&&this.memorySyncIntervalMs!==null&&Qje(k))throw new m.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${n.id}, session_id=${u}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`);let x={workdir:this.workdir,client:l,session:k,...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}};try{b=await m.setupSkills(x)}catch(I){s.warn("skill setup failed",{session_id:u,work_id:n.id,error:String(I)})}a!==null&&this.memorySyncIntervalMs!==null?(_=new m.SessionMemoryStores(l,{workdir:this.workdir,...this.memorySyncIntervalMs!==void 0?{syncIntervalMs:this.memorySyncIntervalMs}:{},syncDeletions:this.memorySyncDeletions}),await _.download(k),x.allowedRoots=_.roots,x.readOnlyRoots=_.readOnlyRoots):s.debug("memory stores disabled for this item",{work_id:n.id});let A=typeof this.tools=="function"?this.tools(x):this.tools??m.betaAgentToolset20260401(x);h=new Pb(u,{client:l,tools:A,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:d.signal}),g!==void 0&&h._setSendRetryWindow(g);for await(let I of h)_&&await _.syncIfDue();w=!d.signal.aborted}finally{try{await b().catch(k=>{s.warn("skill cleanup failed",{session_id:u,work_id:n.id,error:String(k)})})}finally{if(_){let k=m.MEMORY_FLUSH_TIMEOUT_MS;w&&await eoe(_.finish(),k)&&s.warn(`final memory sync cut off after ${k}ms; the flush that follows still uploads changed files`,{session_id:u,work_id:n.id});let x=new AbortController;await eoe(_.flushWrites(x.signal),k)&&(x.abort(),s.warn(`memory flush cut off after ${k}ms; changed files it had not uploaded yet are not saved`,{session_id:u,work_id:n.id})),await _.dispose().catch(I=>{s.warn("memory store cleanup failed",{session_id:u,work_id:n.id,error:String(I)})})}}f.finish("runner_done"),p(),await v,f.lost?s.info("lease lost; released without stopping it",{session_id:u,work_id:n.id}):await eze(l,n,s,this.requestOptions),(f.lost||f.rejected)&&nt(this.client,()=>o?.end())}},e})();tze=(()=>{class e{constructor(n){Vb.set(this,void 0),du.set(this,void 0),O(this,Vb,n,"f")}get signal(){return y(this,Vb,"f").signal}finish(n){O(this,du,y(this,du,"f")??n,"f"),y(this,Vb,"f").abort()}get lost(){return y(this,du,"f")==="lease_lost"||y(this,du,"f")==="assumed_lost"}get rejected(){return y(this,du,"f")==="heartbeat_rejected"}}return Vb=new WeakMap,du=new WeakMap,e})()});var GE,BU=P(()=>{ne();oe();$e();X();me();yU();toe();GE=(()=>{class e extends N{retrieve(n,r,i){let{environment_id:o,betas:s,workspace_id:a}=r;return this._client.get(E`/v1/environments/${o}/work/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers]),__span:$(this._client,"anthropic.environments.work.retrieve",i,{route:"/v1/environments/{environment_id}/work/{work_id}",attributes:{"anthropic.environment.id":o,"anthropic.environment.work.id":n}})})}update(n,r,i){let{environment_id:o,betas:s,workspace_id:a,...c}=r;return this._client.post(E`/v1/environments/${o}/work/${n}?beta=true`,{body:c,...i,headers:T([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers]),__span:$(this._client,"anthropic.environments.work.update",i,{route:"/v1/environments/{environment_id}/work/{work_id}",attributes:{"anthropic.environment.id":o,"anthropic.environment.work.id":n}})})}list(n,r={},i){let{betas:o,...s}=r??{};return this._client.getAPIList(E`/v1/environments/${n}/work?beta=true`,G,{query:s,...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},i?.headers]),__span:$(this._client,"anthropic.environments.work.list",i,{route:"/v1/environments/{environment_id}/work",queryParams:["limit","page"],attributes:{"anthropic.environment.id":n}})})}ack(n,r,i){let{environment_id:o,betas:s}=r;return this._client.post(E`/v1/environments/${o}/work/${n}/ack?beta=true`,{...i,headers:T([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers]),__span:$(this._client,"anthropic.environments.work.ack",i,{route:"/v1/environments/{environment_id}/work/{work_id}/ack",attributes:{"anthropic.environment.id":o,"anthropic.environment.work.id":n}})})}heartbeat(n,r,i){let{environment_id:o,desired_ttl_seconds:s,expected_last_heartbeat:a,betas:c}=r;return this._client.post(E`/v1/environments/${o}/work/${n}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:a},...i,headers:T([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},i?.headers]),__span:$(this._client,"anthropic.environments.work.heartbeat",i,{route:"/v1/environments/{environment_id}/work/{work_id}/heartbeat",queryParams:["desired_ttl_seconds","expected_last_heartbeat"],attributes:{"anthropic.environment.id":o,"anthropic.environment.work.id":n}})})}poll(n,r={},i){let{betas:o,"Anthropic-Worker-ID":s,...a}=r??{};return this._client.get(E`/v1/environments/${n}/work/poll?beta=true`,{query:a,...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"Anthropic-Worker-ID":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.environments.work.poll",i,{route:"/v1/environments/{environment_id}/work/poll",queryParams:["block_ms","reclaim_older_than_ms"],attributes:{"anthropic.environment.id":n}})})}stats(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(E`/v1/environments/${n}/work/stats?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.environments.work.stats",i,{route:"/v1/environments/{environment_id}/work/stats",attributes:{"anthropic.environment.id":n}})})}stop(n,r,i){let{environment_id:o,betas:s,workspace_id:a,...c}=r;return this._client.post(E`/v1/environments/${o}/work/${n}/stop?beta=true`,{body:c,...i,headers:T([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers]),__span:$(this._client,"anthropic.environments.work.stop",i,{route:"/v1/environments/{environment_id}/work/{work_id}/stop",attributes:{"anthropic.environment.id":o,"anthropic.environment.work.id":n}})})}poller(n){return new xb({...n,client:this._client})}worker(n){return new GU({...n,client:this._client})}}return e.WorkPoller=xb,e.EnvironmentWorker=GU,e})()});var BE,VU=P(()=>{ne();BU();BU();oe();$e();X();me();BE=(()=>{class e extends N{constructor(){super(...arguments),this.work=new GE(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/environments?beta=true",{body:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.environments.create",r,{route:"/v1/environments",createdIDAttribute:"anthropic.environment.id"})})}retrieve(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(E`/v1/environments/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.environments.retrieve",i,{route:"/v1/environments/{environment_id}",attributes:{"anthropic.environment.id":n}})})}update(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(E`/v1/environments/${n}?beta=true`,{body:a,...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.environments.update",i,{route:"/v1/environments/{environment_id}",attributes:{"anthropic.environment.id":n}})})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/environments?beta=true",G,{query:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.environments.list",r,{route:"/v1/environments",queryParams:["include_archived","limit","page"]})})}delete(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.delete(E`/v1/environments/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.environments.delete",i,{route:"/v1/environments/{environment_id}",attributes:{"anthropic.environment.id":n}})})}archive(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(E`/v1/environments/${n}/archive?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.environments.archive",i,{route:"/v1/environments/{environment_id}/archive",attributes:{"anthropic.environment.id":n}})})}}return e.Work=GE,e})()});var kf,qU=P(()=>{ne();oe();$e();X();me();kf=class extends N{create(t,n,r){let{view:i,betas:o,workspace_id:s,...a}=n;return this._client.post(E`/v1/memory_stores/${t}/memories?beta=true`,{query:{view:i},body:a,...r,headers:T([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.memory_stores.memories.create",r,{route:"/v1/memory_stores/{memory_store_id}/memories",queryParams:["view"],attributes:{"gen_ai.memory.store.id":t},createdIDAttribute:"gen_ai.memory.record.id"})})}retrieve(t,n,r){let{memory_store_id:i,betas:o,workspace_id:s,...a}=n;return this._client.get(E`/v1/memory_stores/${i}/memories/${t}?beta=true`,{query:a,...r,headers:T([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.memory_stores.memories.retrieve",r,{route:"/v1/memory_stores/{memory_store_id}/memories/{memory_id}",queryParams:["view"],attributes:{"gen_ai.memory.store.id":i,"gen_ai.memory.record.id":t}})})}update(t,n,r){let{memory_store_id:i,view:o,betas:s,workspace_id:a,...c}=n;return this._client.post(E`/v1/memory_stores/${i}/memories/${t}?beta=true`,{query:{view:o},body:c,...r,headers:T([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},r?.headers]),__span:$(this._client,"anthropic.memory_stores.memories.update",r,{route:"/v1/memory_stores/{memory_store_id}/memories/{memory_id}",queryParams:["view"],attributes:{"gen_ai.memory.store.id":i,"gen_ai.memory.record.id":t}})})}list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(E`/v1/memory_stores/${t}/memories?beta=true`,G,{query:s,...r,headers:T([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.memory_stores.memories.list",r,{route:"/v1/memory_stores/{memory_store_id}/memories",queryParams:["depth","limit","page","path_prefix","view"],contentQueryParams:["page"],attributes:{"gen_ai.memory.store.id":t}})})}delete(t,n,r){let{memory_store_id:i,expected_content_sha256:o,betas:s,workspace_id:a}=n;return this._client.delete(E`/v1/memory_stores/${i}/memories/${t}?beta=true`,{query:{expected_content_sha256:o},...r,headers:T([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},r?.headers]),__span:$(this._client,"anthropic.memory_stores.memories.delete",r,{route:"/v1/memory_stores/{memory_store_id}/memories/{memory_id}",queryParams:["expected_content_sha256"],attributes:{"gen_ai.memory.store.id":i,"gen_ai.memory.record.id":t}})})}}});var $f,WU=P(()=>{ne();oe();$e();X();me();$f=class extends N{retrieve(t,n,r){let{memory_store_id:i,betas:o,workspace_id:s,...a}=n;return this._client.get(E`/v1/memory_stores/${i}/memory_versions/${t}?beta=true`,{query:a,...r,headers:T([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.memory_stores.memory_versions.retrieve",r,{route:"/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}",queryParams:["view"],attributes:{"gen_ai.memory.store.id":i,"anthropic.memory_store.memory_version.id":t}})})}list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(E`/v1/memory_stores/${t}/memory_versions?beta=true`,G,{query:s,...r,headers:T([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.memory_stores.memory_versions.list",r,{route:"/v1/memory_stores/{memory_store_id}/memory_versions",queryParams:["api_key_id","created_at[gte]","created_at[lte]","limit","memory_id","operation","page","service_account_id","session_id","view"],attributes:{"gen_ai.memory.store.id":t}})})}redact(t,n,r){let{memory_store_id:i,betas:o,workspace_id:s}=n;return this._client.post(E`/v1/memory_stores/${i}/memory_versions/${t}/redact?beta=true`,{...r,headers:T([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.memory_stores.memory_versions.redact",r,{route:"/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}/redact",attributes:{"gen_ai.memory.store.id":i,"anthropic.memory_store.memory_version.id":t}})})}}});var VE,HU=P(()=>{ne();qU();qU();WU();WU();oe();$e();X();me();VE=(()=>{class e extends N{constructor(){super(...arguments),this.memories=new kf(this._client),this.memoryVersions=new $f(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/memory_stores?beta=true",{body:s,...r,headers:T([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.memory_stores.create",r,{route:"/v1/memory_stores",createdIDAttribute:"gen_ai.memory.store.id"})})}retrieve(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(E`/v1/memory_stores/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.memory_stores.retrieve",i,{route:"/v1/memory_stores/{memory_store_id}",attributes:{"gen_ai.memory.store.id":n}})})}update(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(E`/v1/memory_stores/${n}?beta=true`,{body:a,...i,headers:T([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.memory_stores.update",i,{route:"/v1/memory_stores/{memory_store_id}",attributes:{"gen_ai.memory.store.id":n}})})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/memory_stores?beta=true",G,{query:s,...r,headers:T([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.memory_stores.list",r,{route:"/v1/memory_stores",queryParams:["created_at[gte]","created_at[lte]","include_archived","limit","page"]})})}delete(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.delete(E`/v1/memory_stores/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.memory_stores.delete",i,{route:"/v1/memory_stores/{memory_store_id}",attributes:{"gen_ai.memory.store.id":n}})})}archive(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(E`/v1/memory_stores/${n}/archive?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.memory_stores.archive",i,{route:"/v1/memory_stores/{memory_store_id}/archive",attributes:{"gen_ai.memory.store.id":n}})})}}return e.Memories=kf,e.MemoryVersions=$f,e})()});var Sf,KU=P(()=>{ne();oe();$e();X();eU();qp();me();Sf=class extends N{create(t,n){let{betas:r,user_profile_id:i,workspace_id:o,...s}=t;return this._client.post("/v1/messages/batches?beta=true",{body:s,...n,headers:T([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...i!=null?{"anthropic-user-profile-id":i}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},n?.headers]),__span:$(this._client,"anthropic.messages.batches.create",n,{route:"/v1/messages/batches",attributes:{"anthropic.message.batch.request_count":s.requests?.length},createdIDAttribute:"anthropic.message.batch.id"})})}retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(E`/v1/messages/batches/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.messages.batches.retrieve",r,{route:"/v1/messages/batches/{message_batch_id}",attributes:{"anthropic.message.batch.id":t}})})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/messages/batches?beta=true",gt,{query:o,...n,headers:T([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),__span:$(this._client,"anthropic.messages.batches.list",n,{route:"/v1/messages/batches",queryParams:["after_id","before_id","limit"]})})}delete(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.delete(E`/v1/messages/batches/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.messages.batches.delete",r,{route:"/v1/messages/batches/{message_batch_id}",attributes:{"anthropic.message.batch.id":t}})})}cancel(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(E`/v1/messages/batches/${t}/cancel?beta=true`,{...r,headers:T([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.messages.batches.cancel",r,{route:"/v1/messages/batches/{message_batch_id}/cancel",attributes:{"anthropic.message.batch.id":t}})})}async results(t,n={},r){let i=await this.retrieve(t,n,r);if(!i.results_url)throw new Q(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{betas:o,workspace_id:s}=n??{};return this._client.get(i.results_url,{...r,headers:T([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary",...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),stream:!0,__binaryResponse:!0,__span:$(this._client,"anthropic.messages.batches.results",r,{route:"/v1/messages/batches/{message_batch_id}/results",attributes:{"anthropic.message.batch.id":t}})})._thenUnwrap((a,c)=>eE.fromResponse(c.response,c.controller))}}});function noe(e){return e?.output_format??e?.output_config?.format}function JU(e,t,n){let r=noe(t);return!t||!("parse"in(r??{}))?{...e,content:e.content.map(i=>{if(i.type==="text"){let o=Object.defineProperty({...i},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return i}),parsed_output:null}:ZU(e,t,n)}function ZU(e,t,n){let r=null,i=e.content.map(o=>{if(o.type==="text"){let s=uze(t,o.text);r===null&&(r=s);let a=Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),s},enumerable:!1})}return o});return{...e,content:i,parsed_output:r}}function uze(e,t){let n=noe(e);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(t):JSON.parse(t)}catch(r){throw new Q(`Failed to parse structured output: ${r}`)}}var YU=P(()=>{at()});function QU(e,t){let{betas:n,user_profile_id:r,workspace_id:i,tools:o,messages:s}=e;return T([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0,...r!=null?{"anthropic-user-profile-id":r}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},Fx(o,s),t?.headers])}function roe(e,t,n){if(!e._tracer)return;let r=QU(t,n);return $(e,"anthropic.messages.create",n,Gs(e,{...qE(t),stream:!0},r))}function qE(e){if(!e.output_format)return e;if(e.output_config?.format)throw new Q("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:t,...n}=e;return{...n,output_config:{...e.output_config,format:t}}}var XU=P(()=>{qp();$e();gi();X();Hr()});function oj(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}var Yr,_c,rs,qb,WE,Wb,Hb,HE,Kb,is,Jb,KE,JE,pu,ZE,YE,QE,Zb,fu,Qr,ej,ioe,Yb,tj,nj,rj,ooe,ij,XE,sj=P(()=>{sr();gi();qp();Ds();BF();YU();XU();Hr();HF();XE=(()=>{class e{constructor(n,r){Yr.add(this),this.messages=[],this.receivedMessages=[],_c.set(this,void 0),rs.set(this,null),this.controller=new AbortController,qb.set(this,void 0),WE.set(this,()=>{}),Wb.set(this,()=>{}),Hb.set(this,void 0),HE.set(this,()=>{}),Kb.set(this,()=>{}),is.set(this,{}),Jb.set(this,!1),KE.set(this,!1),JE.set(this,!1),pu.set(this,!1),ZE.set(this,void 0),YE.set(this,void 0),QE.set(this,void 0),Zb.set(this,void 0),fu.set(this,void 0),Qr.set(this,void 0),Yb.set(this,i=>{if(O(this,KE,!0,"f"),y(this,Qr,"f")&&(y(this,Qr,"f").streamed=void 0),$r(i)&&(i=new Xt),i instanceof Xt)return O(this,JE,!0,"f"),this._emit("abort",i);if(i instanceof Q)return this._emit("error",i);if(i instanceof Error){let o=new Q(i.message);return o.cause=i,this._emit("error",o)}return this._emit("error",new Q(String(i)))}),O(this,qb,new Promise((i,o)=>{O(this,WE,i,"f"),O(this,Wb,o,"f")}),"f"),O(this,Hb,new Promise((i,o)=>{O(this,HE,i,"f"),O(this,Kb,o,"f")}),"f"),y(this,qb,"f").catch(()=>{}),y(this,Hb,"f").catch(()=>{}),O(this,rs,n,"f"),O(this,Zb,r?.logger??console,"f"),O(this,fu,r?.client,"f")}get response(){return y(this,ZE,"f")}get request_id(){return y(this,YE,"f")}get workspace_id(){return y(this,QE,"f")}async withResponse(){O(this,pu,!0,"f");let n=await y(this,qb,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id"),workspace_id:n.headers.get("anthropic-workspace-id")}}static fromReadableStream(n){let r=new e(null);return r._run(()=>r._fromReadableStream(n)),r}static createMessage(n,r,i,{logger:o,client:s}={}){let a=new e(r,{logger:o,client:s});for(let c of r.messages)a._addMessageParam(c);return O(a,rs,{...r,stream:!0},"f"),a._run(()=>a._createMessage(n,{...r,stream:!0},{...i,headers:{...i?.headers,[Bp]:"stream"}})),a}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},y(this,Yb,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,r=!0){this.receivedMessages.push(n),r&&this._emit("message",n)}async _createMessage(n,r,i){let o=i?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{y(this,Yr,"m",tj).call(this),O(this,Qr,i?.__span??(y(this,fu,"f")&&roe(y(this,fu,"f"),r,i)),"f");let{response:a,data:c}=await n.create({...r,stream:!0},{...i,__span:y(this,Qr,"f"),signal:this.controller.signal}).withResponse();try{this._connected(a)}catch(l){throw y(this,Qr,"f")&&(y(this,Qr,"f").failure=l),c.controller.abort(),l}for await(let l of c)try{y(this,Yr,"m",nj).call(this,l)}catch(u){throw y(this,Qr,"f")&&(y(this,Qr,"f").failure=u),u}if(c.controller.signal?.aborted)throw new Xt;y(this,Yr,"m",rj).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(n){this.ended||(O(this,ZE,n,"f"),O(this,YE,n?.headers.get("request-id"),"f"),O(this,QE,n?.headers.get("anthropic-workspace-id"),"f"),y(this,WE,"f").call(this,n),this._emit("connect"))}get ended(){return y(this,Jb,"f")}get errored(){return y(this,KE,"f")}get aborted(){return y(this,JE,"f")}abort(){this.controller.abort()}on(n,r){return(y(this,is,"f")[n]||(y(this,is,"f")[n]=[])).push({listener:r}),this}off(n,r){let i=y(this,is,"f")[n];if(!i)return this;let o=i.findIndex(s=>s.listener===r);return o>=0&&i.splice(o,1),this}once(n,r){return(y(this,is,"f")[n]||(y(this,is,"f")[n]=[])).push({listener:r,once:!0}),this}emitted(n){return new Promise((r,i)=>{O(this,pu,!0,"f"),n!=="error"&&this.once("error",i),this.once(n,r)})}async done(){O(this,pu,!0,"f"),await y(this,Hb,"f")}get currentMessage(){return y(this,_c,"f")}async finalMessage(){return await this.done(),y(this,Yr,"m",ej).call(this)}async finalText(){return await this.done(),y(this,Yr,"m",ioe).call(this)}_emit(n,...r){if(y(this,Jb,"f"))return;n==="end"&&(O(this,Jb,!0,"f"),y(this,HE,"f").call(this));let i=y(this,is,"f")[n];if(i&&(y(this,is,"f")[n]=i.filter(o=>!o.once),i.forEach(({listener:o})=>o(...r))),n==="abort"){let o=r[0];!y(this,pu,"f")&&!i?.length&&Promise.reject(o),y(this,Wb,"f").call(this,o),y(this,Kb,"f").call(this,o),this._emit("end");return}if(n==="error"){let o=r[0];!y(this,pu,"f")&&!i?.length&&Promise.reject(o),y(this,Wb,"f").call(this,o),y(this,Kb,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",y(this,Yr,"m",ej).call(this))}_deliverEvent(n,r){this._emit("_rawEvent",n),r&&this._emit("streamEvent",n,r)}async _fromReadableStream(n,r){let i=r?.signal,o;i&&(i.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),i.addEventListener("abort",o));try{y(this,Yr,"m",tj).call(this),this._connected(null);let s=Cn.fromReadableStream(n,this.controller);for await(let a of s)y(this,Yr,"m",nj).call(this,a);if(s.controller.signal?.aborted)throw new Xt;y(this,Yr,"m",rj).call(this)}finally{i&&o&&i.removeEventListener("abort",o)}}[(_c=new WeakMap,rs=new WeakMap,qb=new WeakMap,WE=new WeakMap,Wb=new WeakMap,Hb=new WeakMap,HE=new WeakMap,Kb=new WeakMap,is=new WeakMap,Jb=new WeakMap,KE=new WeakMap,JE=new WeakMap,pu=new WeakMap,ZE=new WeakMap,YE=new WeakMap,QE=new WeakMap,Zb=new WeakMap,fu=new WeakMap,Qr=new WeakMap,Yb=new WeakMap,Yr=new WeakSet,ej=function(){if(this.receivedMessages.length===0)throw new Q("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},ioe=function(){if(this.receivedMessages.length===0)throw new Q("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(r.length===0)throw new Q("stream ended without producing a content block with type=text");return r.join(" ")},tj=function(){this.ended||O(this,_c,void 0,"f")},nj=function(r){if(this.ended)return;let i=y(this,Yr,"m",ooe).call(this,r);if(this._deliverEvent(r,i),!!i)switch(r.type){case"content_block_delta":{let o=i.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{if(oj(o)&&y(this,is,"f").inputJson?.length){let s;try{s=o.input}catch(a){y(this,Yb,"f").call(this,y(this,Yr,"m",ij).call(this,o,a));break}this._emit("inputJson",r.delta.partial_json,s)}break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}case"compaction_delta":{o.type==="compaction"&&o.content&&this._emit("compaction",o.content);break}default:r.delta}break}case"message_stop":{y(this,fu,"f")&&y(this,Qr,"f")&&y(this,rs,"f")&&Gp(y(this,fu,"f"),y(this,Qr,"f"),y(this,rs,"f"),i),this._addMessageParam(i),this._addMessage(JU(i,y(this,rs,"f"),{logger:y(this,Zb,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{O(this,_c,i,"f"),y(this,Qr,"f")&&y(this,rs,"f")&&(y(this,Qr,"f").streamed={body:y(this,rs,"f"),message:i});break}case"content_block_start":case"message_delta":break}},rj=function(){if(this.ended)throw new Q("stream has ended, this shouldn't happen");let r=y(this,_c,"f");if(!r)throw new Q("request ended without sending any chunks");return O(this,_c,void 0,"f"),JU(r,y(this,rs,"f"),{logger:y(this,Zb,"f")})},ooe=function(r){let i=y(this,_c,"f");if(r.type==="message_start"){if(i)throw new Q(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(i)switch(r.type){case"message_stop":return i;case"message_delta":return i.stop_reason=r.delta.stop_reason,i.stop_sequence=r.delta.stop_sequence,i.stop_details=r.delta.stop_details,i.usage.output_tokens=r.usage.output_tokens,r.delta.container!=null&&(i.container=r.delta.container),r.context_management!=null&&(i.context_management=r.context_management),r.input_transformations!=null&&(i.input_transformations=r.input_transformations),r.usage.input_tokens!=null&&(i.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(i.usage.server_tool_use=r.usage.server_tool_use),r.usage.iterations!=null&&(i.usage.iterations=r.usage.iterations),r.usage.fallback_credit!=null&&(i.usage.fallback_credit=r.usage.fallback_credit),r.usage.output_tokens_details!=null&&(i.usage.output_tokens_details=r.usage.output_tokens_details),i;case"content_block_start":return i.content.push(r.content_block),r.content_block.type==="fallback"&&(i.model=r.content_block.to.model),i;case"content_block_delta":{let o=i.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(i.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(i.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&oj(o)){let s=(o[dc]||"")+r.delta.partial_json;i.content[r.index]=Wx(o,s)}break}case"thinking_delta":{o?.type==="thinking"&&(i.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(i.content[r.index]={...o,signature:r.delta.signature});break}case"compaction_delta":{if(o?.type==="compaction"){let s={...o,content:r.delta.content};"encrypted_content"in r.delta&&(s.encrypted_content=r.delta.encrypted_content),i.content[r.index]=s}break}default:r.delta}return i}case"content_block_stop":{let o=i.content.at(r.index);if(o&&oj(o)&&dc in o){let s;try{s=o.input}catch(a){s={},y(this,Yb,"f").call(this,y(this,Yr,"m",ij).call(this,o,a))}Object.defineProperty(o,"input",{value:s,enumerable:!0,configurable:!0,writable:!0})}return i}default:return i}},ij=function(r,i){let o=r[dc];return new Q(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${i}. JSON: ${o}`)},Symbol.asyncIterator)](){let n=[],r=[],i=!1;return this.on("_rawEvent",o=>{let s=r.shift();s?s.resolve(o):n.push(o)}),this.on("end",()=>{i=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{i=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{i=!0;for(let s of r)s.reject(o);r.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((s,a)=>r.push({resolve:s,reject:a})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Cn(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}return e})()});function wc(e){return soe[e.type]}function xf(e){return"run"in e&&e.type!=null&&Object.prototype.hasOwnProperty.call(soe,e.type)}var soe,aj=P(()=>{soe={browser_toolset_20260801:"browser",computer_toolset_20260801:"computer"}});var Qb,kc,cj=P(()=>{at();Qb=class extends Q{constructor(t,n){super(t),this.name="ToolsetUsageError",n&&"cause"in n&&(this.cause=n.cause)}},kc=class extends Qb{constructor(t,n){super(t,n),this.name="ToolsetContractError"}}});function loe(e){return Object.prototype.hasOwnProperty.call(aoe,e)?aoe[e]:coe}function Xb(e,t,n=!1){return n&&(t===""||Array.isArray(t)&&t.length===0)&&(t="The tool call failed with an empty error message."),{type:"tool_result",tool_use_id:e.id,toolset_name:e.toolset_name??null,content:t,...n?{is_error:!0}:{}}}function dze(e,t){if(e instanceof Qb)throw e;pze(t.signal)}function pze(e){if(e?.aborted)throw new Xt}async function uoe(e,t,n={}){let r=wc(e);if(t.toolset_name!==r)throw new kc(`tool_use ${JSON.stringify(t.id)} (toolset_name=${JSON.stringify(t.toolset_name??null)}, name=${JSON.stringify(t.name)}) is not a member call of the ${JSON.stringify(r)} toolset`);let i={...n,toolUse:t,toolUseBlock:t};try{return Xb(t,await e.run(i,t))}catch(o){return dze(o,i),Xb(t,Jre(o instanceof Ue?o.content:Hre(o)),!0)}}var coe,aoe,doe=P(()=>{at();lf();cj();gE();aj();coe="Not executed: an earlier action in this turn failed.",aoe={browser:coe,computer:"Not executed: an earlier computer action in this turn failed."}});var poe=P(()=>{tT()});var Tf,lj=P(()=>{ne();oe();X();me();Tf=class extends N{retrieve(t,n){return this._client.get(E`/v1/organizations/api_keys/${t}?beta=true`,{...n,__span:$(this._client,"anthropic.organization.api_keys.retrieve",n,{route:"/v1/organizations/api_keys/{api_key_id}",attributes:{"anthropic.organization.api_key.id":t}})})}update(t,n,r){return this._client.post(E`/v1/organizations/api_keys/${t}?beta=true`,{body:n,...r,__span:$(this._client,"anthropic.organization.api_keys.update",r,{route:"/v1/organizations/api_keys/{api_key_id}",attributes:{"anthropic.organization.api_key.id":t}})})}list(t={},n){return this._client.getAPIList("/v1/organizations/api_keys?beta=true",gt,{query:t,...n,__span:$(this._client,"anthropic.organization.api_keys.list",n,{route:"/v1/organizations/api_keys",queryParams:["after_id","before_id","created_by_user_id","limit","status","workspace_id"]})})}}});var Af,uj=P(()=>{ne();oe();X();Af=class extends N{list(t,n){return this._client.getAPIList("/v1/organizations/analytics/artifacts?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.analytics.artifacts.list",n,{route:"/v1/organizations/analytics/artifacts",queryParams:["date","filter","group_by","limit","page"]})})}}});var If,dj=P(()=>{ne();oe();X();If=class extends N{list(t={},n){return this._client.getAPIList("/v1/organizations/analytics/connectors?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.analytics.connectors.list",n,{route:"/v1/organizations/analytics/connectors",queryParams:["date","ending_date","filter","group_by","limit","order","order_by","page","starting_date"],contentQueryParams:["filter"]})})}}});var Rf,pj=P(()=>{ne();oe();X();Rf=class extends N{list(t,n){return this._client.getAPIList("/v1/organizations/analytics/cost_report?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.analytics.cost_report.list",n,{route:"/v1/organizations/analytics/cost_report",queryParams:["bucket_width","claude_tag_categories","claude_tag_user_ids","context_windows","ending_at","group_by","inference_geos","limit","models","page","products","rbac_group_ids","slack_channel_ids","speeds","starting_at","user_ids"]})})}}});var Pf,fj=P(()=>{ne();oe();X();Pf=class extends N{list(t={},n){return this._client.getAPIList("/v1/organizations/analytics/plugins?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.analytics.plugins.list",n,{route:"/v1/organizations/analytics/plugins",queryParams:["date","ending_date","filter","group_by","limit","order","order_by","page","starting_date"],contentQueryParams:["filter"]})})}}});var Cf,mj=P(()=>{ne();oe();X();Cf=class extends N{list(t={},n){return this._client.getAPIList("/v1/organizations/analytics/skills?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.analytics.skills.list",n,{route:"/v1/organizations/analytics/skills",queryParams:["date","ending_date","filter","group_by","limit","order","order_by","page","starting_date"],contentQueryParams:["filter"]})})}}});var Nf,gj=P(()=>{ne();oe();X();Nf=class extends N{list(t,n){return this._client.getAPIList("/v1/organizations/analytics/summaries?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.analytics.summaries.list",n,{route:"/v1/organizations/analytics/summaries",queryParams:["ending_date","filter","limit","page","starting_date"]})})}}});var Of,hj=P(()=>{ne();oe();X();Of=class extends N{list(t,n){return this._client.getAPIList("/v1/organizations/analytics/usage_report?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.analytics.usage_report.list",n,{route:"/v1/organizations/analytics/usage_report",queryParams:["bucket_width","claude_tag_categories","claude_tag_user_ids","context_windows","ending_at","group_by","inference_geos","limit","models","page","products","rbac_group_ids","slack_channel_ids","speeds","starting_at","user_ids"]})})}}});var Df,yj=P(()=>{ne();oe();X();Df=class extends N{list(t,n){return this._client.getAPIList("/v1/organizations/analytics/user_cost_report?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.analytics.user_cost_report.list",n,{route:"/v1/organizations/analytics/user_cost_report",queryParams:["bucket_width","claude_tag_categories","claude_tag_user_ids","context_windows","ending_at","exclude_deleted_users","group_by","inference_geos","limit","models","order","order_by","page","products","rbac_group_ids","slack_channel_ids","speeds","starting_at","user_ids"]})})}}});var Mf,bj=P(()=>{ne();oe();X();Mf=class extends N{list(t,n){return this._client.getAPIList("/v1/organizations/analytics/user_usage_report?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.analytics.user_usage_report.list",n,{route:"/v1/organizations/analytics/user_usage_report",queryParams:["bucket_width","claude_tag_categories","claude_tag_user_ids","context_windows","ending_at","exclude_deleted_users","group_by","inference_geos","limit","models","order","order_by","page","products","rbac_group_ids","slack_channel_ids","speeds","starting_at","user_ids"]})})}}});var Lf,vj=P(()=>{ne();oe();X();Lf=class extends N{list(t={},n){return this._client.getAPIList("/v1/organizations/analytics/users?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.analytics.users.list",n,{route:"/v1/organizations/analytics/users",queryParams:["date","ending_date","filter","group_by","limit","order","order_by","page","starting_date"],contentQueryParams:["page"]})})}}});var Ff,_j=P(()=>{ne();oe();X();Ff=class extends N{list(t={},n){return this._client.getAPIList("/v1/organizations/analytics/apps/chat/projects?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.analytics.apps.chat.projects.list",n,{route:"/v1/organizations/analytics/apps/chat/projects",queryParams:["date","ending_date","filter","group_by","limit","order","order_by","page","starting_date"]})})}}});var nT,wj=P(()=>{ne();_j();_j();nT=(()=>{class e extends N{constructor(){super(...arguments),this.projects=new Ff(this._client)}}return e.Projects=Ff,e})()});var rT,kj=P(()=>{ne();wj();wj();rT=(()=>{class e extends N{constructor(){super(...arguments),this.chat=new nT(this._client)}}return e.Chat=nT,e})()});var iT,$j=P(()=>{ne();uj();uj();dj();dj();pj();pj();fj();fj();mj();mj();gj();gj();hj();hj();yj();yj();bj();bj();vj();vj();kj();kj();iT=(()=>{class e extends N{constructor(){super(...arguments),this.summaries=new Nf(this._client),this.users=new Lf(this._client),this.apps=new rT(this._client),this.connectors=new If(this._client),this.plugins=new Pf(this._client),this.skills=new Cf(this._client),this.artifacts=new Af(this._client),this.usageReport=new Of(this._client),this.userUsageReport=new Mf(this._client),this.costReport=new Rf(this._client),this.userCostReport=new Df(this._client)}}return e.Summaries=Nf,e.Users=Lf,e.Apps=rT,e.Connectors=If,e.Plugins=Pf,e.Skills=Cf,e.Artifacts=Af,e.UsageReport=Of,e.UserUsageReport=Mf,e.CostReport=Rf,e.UserCostReport=Df,e})()});var Uf,Sj=P(()=>{ne();X();Uf=class extends N{retrieve(t){return this._client.get("/v1/organizations/compliance_settings?beta=true",{...t,__span:$(this._client,"anthropic.organization.compliance_settings.retrieve",t,{route:"/v1/organizations/compliance_settings"})})}update(t,n){return this._client.post("/v1/organizations/compliance_settings?beta=true",{body:t,...n,__span:$(this._client,"anthropic.organization.compliance_settings.update",n,{route:"/v1/organizations/compliance_settings"})})}}});var jf,xj=P(()=>{ne();oe();X();me();jf=class extends N{create(t,n){return this._client.post("/v1/organizations/external_keys?beta=true",{body:t,...n,__span:$(this._client,"anthropic.organization.external_keys.create",n,{route:"/v1/organizations/external_keys",createdIDAttribute:"anthropic.organization.external_key.id"})})}retrieve(t,n){return this._client.get(E`/v1/organizations/external_keys/${t}?beta=true`,{...n,__span:$(this._client,"anthropic.organization.external_keys.retrieve",n,{route:"/v1/organizations/external_keys/{external_key_id}",attributes:{"anthropic.organization.external_key.id":t}})})}update(t,n,r){return this._client.post(E`/v1/organizations/external_keys/${t}?beta=true`,{body:n,...r,__span:$(this._client,"anthropic.organization.external_keys.update",r,{route:"/v1/organizations/external_keys/{external_key_id}",attributes:{"anthropic.organization.external_key.id":t}})})}list(t={},n){return this._client.getAPIList("/v1/organizations/external_keys?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.external_keys.list",n,{route:"/v1/organizations/external_keys",queryParams:["limit","page"]})})}delete(t,n){return this._client.delete(E`/v1/organizations/external_keys/${t}?beta=true`,{...n,__span:$(this._client,"anthropic.organization.external_keys.delete",n,{route:"/v1/organizations/external_keys/{external_key_id}",attributes:{"anthropic.organization.external_key.id":t}})})}validate(t,n){return this._client.post(E`/v1/organizations/external_keys/${t}/validate?beta=true`,{...n,__span:$(this._client,"anthropic.organization.external_keys.validate",n,{route:"/v1/organizations/external_keys/{external_key_id}/validate",attributes:{"anthropic.organization.external_key.id":t}})})}}});var zf,Ej=P(()=>{ne();oe();$e();X();me();zf=class extends N{create(t,n){let{betas:r,...i}=t;return this._client.post("/v1/organizations/federation_issuers?beta=true",{body:i,...n,headers:T([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers]),__span:$(this._client,"anthropic.organization.federation.issuers.create",n,{route:"/v1/organizations/federation_issuers",createdIDAttribute:"anthropic.organization.federation_issuer.id"})})}retrieve(t,n={},r){let{betas:i}=n??{};return this._client.get(E`/v1/organizations/federation_issuers/${t}?beta=true`,{...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.federation.issuers.retrieve",r,{route:"/v1/organizations/federation_issuers/{federation_issuer_id}",attributes:{"anthropic.organization.federation_issuer.id":t}})})}update(t,n,r){let{betas:i,...o}=n;return this._client.post(E`/v1/organizations/federation_issuers/${t}?beta=true`,{body:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.federation.issuers.update",r,{route:"/v1/organizations/federation_issuers/{federation_issuer_id}",attributes:{"anthropic.organization.federation_issuer.id":t}})})}list(t={},n){let{betas:r,...i}=t??{};return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true",G,{query:i,...n,headers:T([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers]),__span:$(this._client,"anthropic.organization.federation.issuers.list",n,{route:"/v1/organizations/federation_issuers",queryParams:["include_archived","limit","page"]})})}archive(t,n={},r){let{betas:i}=n??{};return this._client.post(E`/v1/organizations/federation_issuers/${t}/archive?beta=true`,{...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.federation.issuers.archive",r,{route:"/v1/organizations/federation_issuers/{federation_issuer_id}/archive",attributes:{"anthropic.organization.federation_issuer.id":t}})})}}});var Gf,Tj=P(()=>{ne();oe();$e();X();me();Gf=class extends N{list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(E`/v1/organizations/federation_rules/${t}/workspaces?beta=true`,G,{query:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.federation.rules.workspaces.list",r,{route:"/v1/organizations/federation_rules/{federation_rule_id}/workspaces",queryParams:["limit","page"],attributes:{"anthropic.organization.federation_rule.id":t}})})}add(t,n,r){let{betas:i,...o}=n;return this._client.post(E`/v1/organizations/federation_rules/${t}/workspaces?beta=true`,{body:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.federation.rules.workspaces.add",r,{route:"/v1/organizations/federation_rules/{federation_rule_id}/workspaces",attributes:{"anthropic.organization.federation_rule.id":t},createdIDAttribute:"anthropic.organization.federation_rule.workspace.id",createdIDField:"workspace_id"})})}remove(t,n,r){let{federation_rule_id:i,betas:o}=n;return this._client.delete(E`/v1/organizations/federation_rules/${i}/workspaces/${t}?beta=true`,{...r,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.federation.rules.workspaces.remove",r,{route:"/v1/organizations/federation_rules/{federation_rule_id}/workspaces/{workspace_id}",attributes:{"anthropic.organization.federation_rule.id":i,"anthropic.organization.federation_rule.workspace.id":t}})})}}});var oT,Aj=P(()=>{ne();Tj();Tj();oe();$e();X();me();oT=(()=>{class e extends N{constructor(){super(...arguments),this.workspaces=new Gf(this._client)}create(n,r){let{betas:i,...o}=n;return this._client.post("/v1/organizations/federation_rules?beta=true",{body:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.federation.rules.create",r,{route:"/v1/organizations/federation_rules",createdIDAttribute:"anthropic.organization.federation_rule.id"})})}retrieve(n,r={},i){let{betas:o}=r??{};return this._client.get(E`/v1/organizations/federation_rules/${n}?beta=true`,{...i,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers]),__span:$(this._client,"anthropic.organization.federation.rules.retrieve",i,{route:"/v1/organizations/federation_rules/{federation_rule_id}",attributes:{"anthropic.organization.federation_rule.id":n}})})}update(n,r,i){let{betas:o,...s}=r;return this._client.post(E`/v1/organizations/federation_rules/${n}?beta=true`,{body:s,...i,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers]),__span:$(this._client,"anthropic.organization.federation.rules.update",i,{route:"/v1/organizations/federation_rules/{federation_rule_id}",attributes:{"anthropic.organization.federation_rule.id":n}})})}list(n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList("/v1/organizations/federation_rules?beta=true",G,{query:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.federation.rules.list",r,{route:"/v1/organizations/federation_rules",queryParams:["include_archived","issuer_id","limit","page"]})})}archive(n,r={},i){let{betas:o}=r??{};return this._client.post(E`/v1/organizations/federation_rules/${n}/archive?beta=true`,{...i,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers]),__span:$(this._client,"anthropic.organization.federation.rules.archive",i,{route:"/v1/organizations/federation_rules/{federation_rule_id}/archive",attributes:{"anthropic.organization.federation_rule.id":n}})})}}return e.Workspaces=Gf,e})()});var sT,Ij=P(()=>{ne();Ej();Ej();Aj();Aj();sT=(()=>{class e extends N{constructor(){super(...arguments),this.issuers=new zf(this._client),this.rules=new oT(this._client)}}return e.Issuers=zf,e.Rules=oT,e})()});var Bf,Rj=P(()=>{ne();oe();X();me();Bf=class extends N{create(t,n){return this._client.post("/v1/organizations/invites?beta=true",{body:t,...n,__span:$(this._client,"anthropic.organization.invites.create",n,{route:"/v1/organizations/invites",createdIDAttribute:"anthropic.organization.invite.id"})})}retrieve(t,n){return this._client.get(E`/v1/organizations/invites/${t}?beta=true`,{...n,__span:$(this._client,"anthropic.organization.invites.retrieve",n,{route:"/v1/organizations/invites/{invite_id}",attributes:{"anthropic.organization.invite.id":t}})})}list(t={},n){return this._client.getAPIList("/v1/organizations/invites?beta=true",gt,{query:t,...n,__span:$(this._client,"anthropic.organization.invites.list",n,{route:"/v1/organizations/invites",queryParams:["after_id","before_id","email","limit","roles","statuses"]})})}delete(t,n){return this._client.delete(E`/v1/organizations/invites/${t}?beta=true`,{...n,__span:$(this._client,"anthropic.organization.invites.delete",n,{route:"/v1/organizations/invites/{invite_id}",attributes:{"anthropic.organization.invite.id":t}})})}}});var Vf,Pj=P(()=>{ne();oe();$e();X();hi();me();Vf=class extends N{retrieve(t,n={},r){let{betas:i,...o}=n??{};return this._client.get(E`/v1/organizations/plugin_marketplaces/${t}?beta=true`,{query:o,...r,headers:T([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.plugin_marketplaces.retrieve",r,{route:"/v1/organizations/plugin_marketplaces/{marketplace_id}",queryParams:["organization_id"],attributes:{"anthropic.organization.plugin_marketplace.id":t}})})}update(t,n,r){let{betas:i,...o}=n;return this._client.post(E`/v1/organizations/plugin_marketplaces/${t}?beta=true`,{body:o,...r,headers:T([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.plugin_marketplaces.update",r,{route:"/v1/organizations/plugin_marketplaces/{marketplace_id}",attributes:{"anthropic.organization.plugin_marketplace.id":t}})})}list(t={},n){let{betas:r,...i}=t??{};return this._client.getAPIList("/v1/organizations/plugin_marketplaces?beta=true",G,{query:i,...n,headers:T([{"anthropic-beta":[...r??[],"ce-plugins-2026-09-01"].toString()},n?.headers]),__span:$(this._client,"anthropic.organization.plugin_marketplaces.list",n,{route:"/v1/organizations/plugin_marketplaces",queryParams:["limit","organization_id","owner_type","page","source"]})})}validateArchive(t,n){let{betas:r,...i}=t;return this._client.post("/v1/organizations/plugin_marketplaces/validate_archive?beta=true",Nn({body:i,...n,headers:T([{"anthropic-beta":[...r??[],"ce-plugins-2026-09-01"].toString()},n?.headers]),__span:$(this._client,"anthropic.organization.plugin_marketplaces.validate_archive",n,{route:"/v1/organizations/plugin_marketplaces/validate_archive"})},this._client))}validateRepository(t,n){let{betas:r,...i}=t;return this._client.post("/v1/organizations/plugin_marketplaces/validate_repository?beta=true",{body:i,...n,headers:T([{"anthropic-beta":[...r??[],"ce-plugins-2026-09-01"].toString()},n?.headers]),__span:$(this._client,"anthropic.organization.plugin_marketplaces.validate_repository",n,{route:"/v1/organizations/plugin_marketplaces/validate_repository"})})}}});var qf,Cj=P(()=>{ne();oe();X();qf=class extends N{list(t={},n){return this._client.getAPIList("/v1/organizations/rate_limits?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.rate_limits.list",n,{route:"/v1/organizations/rate_limits",queryParams:["group_type","limit","model","page"]})})}}});var Wf,Nj=P(()=>{ne();oe();X();me();Wf=class extends N{retrieve(t,n){return this._client.get(E`/v1/organizations/users/${t}?beta=true`,{...n,__span:$(this._client,"anthropic.organization.users.retrieve",n,{route:"/v1/organizations/users/{user_id}",attributes:{"anthropic.organization.user.id":t}})})}update(t,n,r){return this._client.post(E`/v1/organizations/users/${t}?beta=true`,{body:n,...r,__span:$(this._client,"anthropic.organization.users.update",r,{route:"/v1/organizations/users/{user_id}",attributes:{"anthropic.organization.user.id":t}})})}list(t={},n){return this._client.getAPIList("/v1/organizations/users?beta=true",gt,{query:t,...n,__span:$(this._client,"anthropic.organization.users.list",n,{route:"/v1/organizations/users",queryParams:["after_id","before_id","email","limit","roles"]})})}remove(t,n){return this._client.delete(E`/v1/organizations/users/${t}?beta=true`,{...n,__span:$(this._client,"anthropic.organization.users.remove",n,{route:"/v1/organizations/users/{user_id}",attributes:{"anthropic.organization.user.id":t}})})}}});var Hf,Oj=P(()=>{ne();oe();$e();X();me();Hf=class extends N{list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(E`/v1/organizations/plugins/${t}/installation_settings?beta=true`,G,{query:o,...r,headers:T([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.plugins.installation_settings.list",r,{route:"/v1/organizations/plugins/{plugin_id}/installation_settings",queryParams:["limit","organization_id","page","target_type"],attributes:{"anthropic.organization.plugin.id":t}})})}remove(t,n,r){let{plugin_id:i,betas:o}=n;return this._client.delete(E`/v1/organizations/plugins/${i}/installation_settings/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.plugins.installation_settings.remove",r,{route:"/v1/organizations/plugins/{plugin_id}/installation_settings/{target}",attributes:{"anthropic.organization.plugin.id":i,"anthropic.organization.plugin.installation_setting.id":t}})})}set(t,n,r){let{plugin_id:i,betas:o,...s}=n;return this._client.post(E`/v1/organizations/plugins/${i}/installation_settings/${t}?beta=true`,{body:s,...r,headers:T([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.plugins.installation_settings.set",r,{route:"/v1/organizations/plugins/{plugin_id}/installation_settings/{target}",attributes:{"anthropic.organization.plugin.id":i,"anthropic.organization.plugin.installation_setting.id":t}})})}}});var Kf,Dj=P(()=>{ne();oe();$e();X();me();Kf=class extends N{list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(E`/v1/organizations/plugins/${t}/shares?beta=true`,G,{query:o,...r,headers:T([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.plugins.shares.list",r,{route:"/v1/organizations/plugins/{plugin_id}/shares",queryParams:["limit","organization_id","page","target_type"],attributes:{"anthropic.organization.plugin.id":t}})})}}});var Jf,Mj=P(()=>{ne();oe();$e();X();hi();me();Jf=class extends N{create(t,n,r){let{betas:i,...o}=n;return this._client.post(E`/v1/organizations/plugins/${t}/versions?beta=true`,Nn({body:o,...r,headers:T([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.plugins.versions.create",r,{route:"/v1/organizations/plugins/{plugin_id}/versions",attributes:{"anthropic.organization.plugin.id":t},createdIDAttribute:"anthropic.organization.plugin.version.id"})},this._client))}retrieve(t,n,r){let{plugin_id:i,betas:o,...s}=n;return this._client.get(E`/v1/organizations/plugins/${i}/versions/${t}?beta=true`,{query:s,...r,headers:T([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.plugins.versions.retrieve",r,{route:"/v1/organizations/plugins/{plugin_id}/versions/{version}",queryParams:["organization_id"],attributes:{"anthropic.organization.plugin.id":i,"anthropic.organization.plugin.version.id":t}})})}list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(E`/v1/organizations/plugins/${t}/versions?beta=true`,G,{query:o,...r,headers:T([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.plugins.versions.list",r,{route:"/v1/organizations/plugins/{plugin_id}/versions",queryParams:["limit","organization_id","page"],attributes:{"anthropic.organization.plugin.id":t}})})}download(t,n,r){let{plugin_id:i,betas:o,...s}=n;return this._client.get(E`/v1/organizations/plugins/${i}/versions/${t}/content?beta=true`,{query:s,...r,headers:T([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString(),Accept:"application/binary"},r?.headers]),__binaryResponse:!0,__span:$(this._client,"anthropic.organization.plugins.versions.download",r,{route:"/v1/organizations/plugins/{plugin_id}/versions/{version}/content",queryParams:["organization_id"],attributes:{"anthropic.organization.plugin.id":i,"anthropic.organization.plugin.version.id":t}})})}}});var aT,Lj=P(()=>{ne();Oj();Oj();Dj();Dj();Mj();Mj();oe();$e();X();hi();me();aT=(()=>{class e extends N{constructor(){super(...arguments),this.versions=new Jf(this._client),this.installationSettings=new Hf(this._client),this.shares=new Kf(this._client)}create(n,r){let{betas:i,...o}=n;return this._client.post("/v1/organizations/plugins?beta=true",Nn({body:o,...r,headers:T([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.plugins.create",r,{route:"/v1/organizations/plugins",createdIDAttribute:"anthropic.organization.plugin.id"})},this._client))}retrieve(n,r={},i){let{betas:o,...s}=r??{};return this._client.get(E`/v1/organizations/plugins/${n}?beta=true`,{query:s,...i,headers:T([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString()},i?.headers]),__span:$(this._client,"anthropic.organization.plugins.retrieve",i,{route:"/v1/organizations/plugins/{plugin_id}",queryParams:["organization_id"],attributes:{"anthropic.organization.plugin.id":n}})})}update(n,r,i){let{betas:o,...s}=r;return this._client.post(E`/v1/organizations/plugins/${n}?beta=true`,{body:s,...i,headers:T([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString()},i?.headers]),__span:$(this._client,"anthropic.organization.plugins.update",i,{route:"/v1/organizations/plugins/{plugin_id}",attributes:{"anthropic.organization.plugin.id":n}})})}list(n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList("/v1/organizations/plugins?beta=true",G,{query:o,...r,headers:T([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.plugins.list",r,{route:"/v1/organizations/plugins",queryParams:["created_at[gt]","created_at[gte]","created_at[lt]","created_at[lte]","limit","marketplace_id","organization_id","owner_type","owner_user_id","page"]})})}delete(n,r={},i){let{betas:o}=r??{};return this._client.delete(E`/v1/organizations/plugins/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString()},i?.headers]),__span:$(this._client,"anthropic.organization.plugins.delete",i,{route:"/v1/organizations/plugins/{plugin_id}",attributes:{"anthropic.organization.plugin.id":n}})})}}return e.Versions=Jf,e.InstallationSettings=Hf,e.Shares=Kf,e})()});var Zf,Fj=P(()=>{ne();oe();X();me();Zf=class extends N{list(t,n={},r){return this._client.getAPIList(E`/v1/organizations/rbac_groups/${t}/members?beta=true`,G,{query:n,...r,__span:$(this._client,"anthropic.organization.rbac_groups.members.list",r,{route:"/v1/organizations/rbac_groups/{rbac_group_id}/members",queryParams:["limit","page"],attributes:{"anthropic.organization.rbac_group.id":t}})})}add(t,n,r){return this._client.post(E`/v1/organizations/rbac_groups/${t}/members?beta=true`,{body:n,...r,__span:$(this._client,"anthropic.organization.rbac_groups.members.add",r,{route:"/v1/organizations/rbac_groups/{rbac_group_id}/members",attributes:{"anthropic.organization.rbac_group.id":t},createdIDAttribute:"anthropic.organization.rbac_group.member.id",createdIDField:"user_id"})})}remove(t,n,r){let{rbac_group_id:i}=n;return this._client.delete(E`/v1/organizations/rbac_groups/${i}/members/${t}?beta=true`,{...r,__span:$(this._client,"anthropic.organization.rbac_groups.members.remove",r,{route:"/v1/organizations/rbac_groups/{rbac_group_id}/members/{user_id}",attributes:{"anthropic.organization.rbac_group.id":i,"anthropic.organization.rbac_group.member.id":t}})})}}});var cT,Uj=P(()=>{ne();Fj();Fj();oe();X();me();cT=(()=>{class e extends N{constructor(){super(...arguments),this.members=new Zf(this._client)}create(n,r){return this._client.post("/v1/organizations/rbac_groups?beta=true",{body:n,...r,__span:$(this._client,"anthropic.organization.rbac_groups.create",r,{route:"/v1/organizations/rbac_groups",createdIDAttribute:"anthropic.organization.rbac_group.id"})})}retrieve(n,r){return this._client.get(E`/v1/organizations/rbac_groups/${n}?beta=true`,{...r,__span:$(this._client,"anthropic.organization.rbac_groups.retrieve",r,{route:"/v1/organizations/rbac_groups/{rbac_group_id}",attributes:{"anthropic.organization.rbac_group.id":n}})})}update(n,r,i){return this._client.post(E`/v1/organizations/rbac_groups/${n}?beta=true`,{body:r,...i,__span:$(this._client,"anthropic.organization.rbac_groups.update",i,{route:"/v1/organizations/rbac_groups/{rbac_group_id}",attributes:{"anthropic.organization.rbac_group.id":n}})})}list(n={},r){return this._client.getAPIList("/v1/organizations/rbac_groups?beta=true",G,{query:n,...r,__span:$(this._client,"anthropic.organization.rbac_groups.list",r,{route:"/v1/organizations/rbac_groups",queryParams:["limit","page"]})})}delete(n,r){return this._client.delete(E`/v1/organizations/rbac_groups/${n}?beta=true`,{...r,__span:$(this._client,"anthropic.organization.rbac_groups.delete",r,{route:"/v1/organizations/rbac_groups/{rbac_group_id}",attributes:{"anthropic.organization.rbac_group.id":n}})})}}return e.Members=Zf,e})()});var Yf,jj=P(()=>{ne();oe();X();me();Yf=class extends N{list(t,n={},r){return this._client.getAPIList(E`/v1/organizations/rbac_roles/${t}/permissions?beta=true`,G,{query:n,...r,__span:$(this._client,"anthropic.organization.rbac_roles.permissions.list",r,{route:"/v1/organizations/rbac_roles/{rbac_role_id}/permissions",queryParams:["limit","page"],attributes:{"anthropic.organization.rbac_role.id":t}})})}}});var lT,zj=P(()=>{ne();jj();jj();oe();X();me();lT=(()=>{class e extends N{constructor(){super(...arguments),this.permissions=new Yf(this._client)}retrieve(n,r){return this._client.get(E`/v1/organizations/rbac_roles/${n}?beta=true`,{...r,__span:$(this._client,"anthropic.organization.rbac_roles.retrieve",r,{route:"/v1/organizations/rbac_roles/{rbac_role_id}",attributes:{"anthropic.organization.rbac_role.id":n}})})}list(n={},r){return this._client.getAPIList("/v1/organizations/rbac_roles?beta=true",G,{query:n,...r,__span:$(this._client,"anthropic.organization.rbac_roles.list",r,{route:"/v1/organizations/rbac_roles",queryParams:["limit","page"]})})}}return e.Permissions=Yf,e})()});var Qf,Gj=P(()=>{ne();oe();$e();X();me();Qf=class extends N{list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(E`/v1/organizations/service_accounts/${t}/workspaces?beta=true`,G,{query:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.service_accounts.workspaces.list",r,{route:"/v1/organizations/service_accounts/{service_account_id}/workspaces",queryParams:["limit","page"],attributes:{"anthropic.organization.service_account.id":t}})})}add(t,n,r){let{betas:i,...o}=n;return this._client.post(E`/v1/organizations/service_accounts/${t}/workspaces?beta=true`,{body:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.service_accounts.workspaces.add",r,{route:"/v1/organizations/service_accounts/{service_account_id}/workspaces",attributes:{"anthropic.organization.service_account.id":t},createdIDAttribute:"anthropic.organization.service_account.workspace.id",createdIDField:"workspace_id"})})}remove(t,n,r){let{service_account_id:i,betas:o}=n;return this._client.delete(E`/v1/organizations/service_accounts/${i}/workspaces/${t}?beta=true`,{...r,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.service_accounts.workspaces.remove",r,{route:"/v1/organizations/service_accounts/{service_account_id}/workspaces/{workspace_id}",attributes:{"anthropic.organization.service_account.id":i,"anthropic.organization.service_account.workspace.id":t}})})}}});var uT,Bj=P(()=>{ne();Gj();Gj();oe();$e();X();me();uT=(()=>{class e extends N{constructor(){super(...arguments),this.workspaces=new Qf(this._client)}create(n,r){let{betas:i,...o}=n;return this._client.post("/v1/organizations/service_accounts?beta=true",{body:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.service_accounts.create",r,{route:"/v1/organizations/service_accounts",createdIDAttribute:"anthropic.organization.service_account.id"})})}retrieve(n,r={},i){let{betas:o}=r??{};return this._client.get(E`/v1/organizations/service_accounts/${n}?beta=true`,{...i,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers]),__span:$(this._client,"anthropic.organization.service_accounts.retrieve",i,{route:"/v1/organizations/service_accounts/{service_account_id}",attributes:{"anthropic.organization.service_account.id":n}})})}update(n,r,i){let{betas:o,...s}=r;return this._client.post(E`/v1/organizations/service_accounts/${n}?beta=true`,{body:s,...i,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers]),__span:$(this._client,"anthropic.organization.service_accounts.update",i,{route:"/v1/organizations/service_accounts/{service_account_id}",attributes:{"anthropic.organization.service_account.id":n}})})}list(n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList("/v1/organizations/service_accounts?beta=true",G,{query:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.service_accounts.list",r,{route:"/v1/organizations/service_accounts",queryParams:["include_archived","limit","page"]})})}archive(n,r={},i){let{betas:o}=r??{};return this._client.post(E`/v1/organizations/service_accounts/${n}/archive?beta=true`,{...i,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers]),__span:$(this._client,"anthropic.organization.service_accounts.archive",i,{route:"/v1/organizations/service_accounts/{service_account_id}/archive",attributes:{"anthropic.organization.service_account.id":n}})})}}return e.Workspaces=Qf,e})()});var Xf,Vj=P(()=>{ne();oe();X();Xf=class extends N{list(t={},n){return this._client.getAPIList("/v1/organizations/spend_limits/effective?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.spend_limits.effective.list",n,{route:"/v1/organizations/spend_limits/effective",queryParams:["limit","page","period","user_ids"]})})}}});var em,qj=P(()=>{ne();oe();X();me();em=class extends N{retrieve(t,n){return this._client.get(E`/v1/organizations/spend_limit_increase_requests/${t}?beta=true`,{...n,__span:$(this._client,"anthropic.organization.spend_limits.increase_requests.retrieve",n,{route:"/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}",attributes:{"anthropic.organization.spend_limit_increase_request.id":t}})})}list(t={},n){return this._client.getAPIList("/v1/organizations/spend_limit_increase_requests?beta=true",G,{query:t,...n,__span:$(this._client,"anthropic.organization.spend_limits.increase_requests.list",n,{route:"/v1/organizations/spend_limit_increase_requests",queryParams:["actor_ids","limit","page","status"]})})}approve(t,n,r){return this._client.post(E`/v1/organizations/spend_limit_increase_requests/${t}/approve?beta=true`,{body:n,...r,__span:$(this._client,"anthropic.organization.spend_limits.increase_requests.approve",r,{route:"/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/approve",attributes:{"anthropic.organization.spend_limit_increase_request.id":t}})})}deny(t,n,r){return this._client.post(E`/v1/organizations/spend_limit_increase_requests/${t}/deny?beta=true`,{body:n,...r,__span:$(this._client,"anthropic.organization.spend_limits.increase_requests.deny",r,{route:"/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/deny",attributes:{"anthropic.organization.spend_limit_increase_request.id":t}})})}}});var dT,Wj=P(()=>{ne();Vj();Vj();qj();qj();oe();$e();X();me();dT=(()=>{class e extends N{constructor(){super(...arguments),this.effective=new Xf(this._client),this.increaseRequests=new em(this._client)}retrieve(n,r){return this._client.get(E`/v1/organizations/spend_limits/${n}?beta=true`,{...r,__span:$(this._client,"anthropic.organization.spend_limits.retrieve",r,{route:"/v1/organizations/spend_limits/{spend_limit_id}",attributes:{"anthropic.organization.spend_limit.id":n}})})}list(n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList("/v1/organizations/spend_limits?beta=true",G,{query:o,...r,headers:T([{"anthropic-beta":[...i??[],"spend-limit-reads-2026-09-26"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.spend_limits.list",r,{route:"/v1/organizations/spend_limits",queryParams:["limit","page","scope_type"]})})}delete(n,r){return this._client.delete(E`/v1/organizations/spend_limits/${n}?beta=true`,{...r,__span:$(this._client,"anthropic.organization.spend_limits.delete",r,{route:"/v1/organizations/spend_limits/{spend_limit_id}",attributes:{"anthropic.organization.spend_limit.id":n}})})}set(n,r){let{betas:i,...o}=n;return this._client.post("/v1/organizations/spend_limits?beta=true",{body:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.spend_limits.set",r,{route:"/v1/organizations/spend_limits",createdIDAttribute:"anthropic.organization.spend_limit.id"})})}}return e.Effective=Xf,e.IncreaseRequests=em,e})()});var tm,Hj=P(()=>{ne();oe();$e();X();me();tm=class extends N{list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(E`/v1/organizations/telemetry_destinations/${t}/workspaces?beta=true`,G,{query:o,...r,headers:T([{"anthropic-beta":[...i??[],"telemetry-destinations-2026-08-11"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.telemetry_destinations.workspaces.list",r,{route:"/v1/organizations/telemetry_destinations/{destination_id}/workspaces",queryParams:["limit","page"],attributes:{"anthropic.organization.telemetry_destination.id":t}})})}add(t,n,r){let{destination_id:i,betas:o}=n;return this._client.post(E`/v1/organizations/telemetry_destinations/${i}/workspaces/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...o??[],"telemetry-destinations-2026-08-11"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.telemetry_destinations.workspaces.add",r,{route:"/v1/organizations/telemetry_destinations/{destination_id}/workspaces/{workspace_id}",attributes:{"anthropic.organization.telemetry_destination.id":i,"anthropic.organization.telemetry_destination.workspace.id":t}})})}remove(t,n,r){let{destination_id:i,betas:o}=n;return this._client.delete(E`/v1/organizations/telemetry_destinations/${i}/workspaces/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...o??[],"telemetry-destinations-2026-08-11"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.telemetry_destinations.workspaces.remove",r,{route:"/v1/organizations/telemetry_destinations/{destination_id}/workspaces/{workspace_id}",attributes:{"anthropic.organization.telemetry_destination.id":i,"anthropic.organization.telemetry_destination.workspace.id":t}})})}}});var pT,Kj=P(()=>{ne();Hj();Hj();oe();$e();X();me();pT=(()=>{class e extends N{constructor(){super(...arguments),this.workspaces=new tm(this._client)}create(n,r){let{betas:i,...o}=n;return this._client.post("/v1/organizations/telemetry_destinations?beta=true",{body:o,...r,headers:T([{"anthropic-beta":[...i??[],"telemetry-destinations-2026-08-11"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.telemetry_destinations.create",r,{route:"/v1/organizations/telemetry_destinations",createdIDAttribute:"anthropic.organization.telemetry_destination.id"})})}retrieve(n,r={},i){let{betas:o}=r??{};return this._client.get(E`/v1/organizations/telemetry_destinations/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"telemetry-destinations-2026-08-11"].toString()},i?.headers]),__span:$(this._client,"anthropic.organization.telemetry_destinations.retrieve",i,{route:"/v1/organizations/telemetry_destinations/{destination_id}",attributes:{"anthropic.organization.telemetry_destination.id":n}})})}update(n,r,i){let{betas:o,...s}=r;return this._client.post(E`/v1/organizations/telemetry_destinations/${n}?beta=true`,{body:s,...i,headers:T([{"anthropic-beta":[...o??[],"telemetry-destinations-2026-08-11"].toString()},i?.headers]),__span:$(this._client,"anthropic.organization.telemetry_destinations.update",i,{route:"/v1/organizations/telemetry_destinations/{destination_id}",attributes:{"anthropic.organization.telemetry_destination.id":n}})})}list(n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList("/v1/organizations/telemetry_destinations?beta=true",G,{query:o,...r,headers:T([{"anthropic-beta":[...i??[],"telemetry-destinations-2026-08-11"].toString()},r?.headers]),__span:$(this._client,"anthropic.organization.telemetry_destinations.list",r,{route:"/v1/organizations/telemetry_destinations",queryParams:["limit","page","workspace_ids"]})})}delete(n,r={},i){let{betas:o}=r??{};return this._client.delete(E`/v1/organizations/telemetry_destinations/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"telemetry-destinations-2026-08-11"].toString()},i?.headers]),__span:$(this._client,"anthropic.organization.telemetry_destinations.delete",i,{route:"/v1/organizations/telemetry_destinations/{destination_id}",attributes:{"anthropic.organization.telemetry_destination.id":n}})})}test(n,r={},i){let{betas:o}=r??{};return this._client.post(E`/v1/organizations/telemetry_destinations/${n}/test?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"telemetry-destinations-2026-08-11"].toString()},i?.headers]),__span:$(this._client,"anthropic.organization.telemetry_destinations.test",i,{route:"/v1/organizations/telemetry_destinations/{destination_id}/test",attributes:{"anthropic.organization.telemetry_destination.id":n}})})}}return e.Workspaces=tm,e})()});var nm,Jj=P(()=>{ne();oe();X();me();nm=class extends N{retrieve(t,n,r){let{workspace_id:i}=n;return this._client.get(E`/v1/organizations/workspaces/${i}/members/${t}?beta=true`,{...r,__span:$(this._client,"anthropic.organization.workspaces.members.retrieve",r,{route:"/v1/organizations/workspaces/{workspace_id}/members/{user_id}",attributes:{"anthropic.organization.workspace.id":i,"anthropic.organization.workspace.member.id":t}})})}update(t,n,r){let{workspace_id:i,...o}=n;return this._client.post(E`/v1/organizations/workspaces/${i}/members/${t}?beta=true`,{body:o,...r,__span:$(this._client,"anthropic.organization.workspaces.members.update",r,{route:"/v1/organizations/workspaces/{workspace_id}/members/{user_id}",attributes:{"anthropic.organization.workspace.id":i,"anthropic.organization.workspace.member.id":t}})})}list(t,n={},r){return this._client.getAPIList(E`/v1/organizations/workspaces/${t}/members?beta=true`,gt,{query:n,...r,__span:$(this._client,"anthropic.organization.workspaces.members.list",r,{route:"/v1/organizations/workspaces/{workspace_id}/members",queryParams:["after_id","before_id","limit"],attributes:{"anthropic.organization.workspace.id":t}})})}add(t,n,r){return this._client.post(E`/v1/organizations/workspaces/${t}/members?beta=true`,{body:n,...r,__span:$(this._client,"anthropic.organization.workspaces.members.add",r,{route:"/v1/organizations/workspaces/{workspace_id}/members",attributes:{"anthropic.organization.workspace.id":t},createdIDAttribute:"anthropic.organization.workspace.member.id",createdIDField:"user_id"})})}remove(t,n,r){let{workspace_id:i}=n;return this._client.delete(E`/v1/organizations/workspaces/${i}/members/${t}?beta=true`,{...r,__span:$(this._client,"anthropic.organization.workspaces.members.remove",r,{route:"/v1/organizations/workspaces/{workspace_id}/members/{user_id}",attributes:{"anthropic.organization.workspace.id":i,"anthropic.organization.workspace.member.id":t}})})}}});var rm,Zj=P(()=>{ne();oe();X();me();rm=class extends N{list(t,n={},r){return this._client.getAPIList(E`/v1/organizations/workspaces/${t}/rate_limits?beta=true`,G,{query:n,...r,__span:$(this._client,"anthropic.organization.workspaces.rate_limits.list",r,{route:"/v1/organizations/workspaces/{workspace_id}/rate_limits",queryParams:["group_type","include_inherited","limit","page"],attributes:{"anthropic.organization.workspace.id":t}})})}}});var im,Yj=P(()=>{ne();oe();$e();X();me();im=class extends N{retrieve(t,n,r){let{workspace_id:i,betas:o}=n;return this._client.get(E`/v1/organizations/workspaces/${i}/service_accounts/${t}?beta=true`,{...r,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.workspaces.service_accounts.retrieve",r,{route:"/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}",attributes:{"anthropic.organization.workspace.id":i,"anthropic.organization.workspace.service_account.id":t}})})}update(t,n,r){let{workspace_id:i,betas:o,...s}=n;return this._client.post(E`/v1/organizations/workspaces/${i}/service_accounts/${t}?beta=true`,{body:s,...r,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.workspaces.service_accounts.update",r,{route:"/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}",attributes:{"anthropic.organization.workspace.id":i,"anthropic.organization.workspace.service_account.id":t}})})}list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(E`/v1/organizations/workspaces/${t}/service_accounts?beta=true`,G,{query:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.workspaces.service_accounts.list",r,{route:"/v1/organizations/workspaces/{workspace_id}/service_accounts",queryParams:["limit","page"],attributes:{"anthropic.organization.workspace.id":t}})})}add(t,n,r){let{betas:i,...o}=n;return this._client.post(E`/v1/organizations/workspaces/${t}/service_accounts?beta=true`,{body:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.workspaces.service_accounts.add",r,{route:"/v1/organizations/workspaces/{workspace_id}/service_accounts",attributes:{"anthropic.organization.workspace.id":t},createdIDAttribute:"anthropic.organization.workspace.service_account.id",createdIDField:"service_account_id"})})}remove(t,n,r){let{workspace_id:i,betas:o}=n;return this._client.delete(E`/v1/organizations/workspaces/${i}/service_accounts/${t}?beta=true`,{...r,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.workspaces.service_accounts.remove",r,{route:"/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}",attributes:{"anthropic.organization.workspace.id":i,"anthropic.organization.workspace.service_account.id":t}})})}}});var fT,Qj=P(()=>{ne();Jj();Jj();Zj();Zj();Yj();Yj();oe();$e();X();me();fT=(()=>{class e extends N{constructor(){super(...arguments),this.rateLimits=new rm(this._client),this.members=new nm(this._client),this.serviceAccounts=new im(this._client)}create(n,r){let{betas:i,...o}=n;return this._client.post("/v1/organizations/workspaces?beta=true",{body:o,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),__span:$(this._client,"anthropic.organization.workspaces.create",r,{route:"/v1/organizations/workspaces",createdIDAttribute:"anthropic.organization.workspace.id"})})}retrieve(n,r){return this._client.get(E`/v1/organizations/workspaces/${n}?beta=true`,{...r,__span:$(this._client,"anthropic.organization.workspaces.retrieve",r,{route:"/v1/organizations/workspaces/{workspace_id}",attributes:{"anthropic.organization.workspace.id":n}})})}update(n,r,i){return this._client.post(E`/v1/organizations/workspaces/${n}?beta=true`,{body:r,...i,__span:$(this._client,"anthropic.organization.workspaces.update",i,{route:"/v1/organizations/workspaces/{workspace_id}",attributes:{"anthropic.organization.workspace.id":n}})})}list(n={},r){return this._client.getAPIList("/v1/organizations/workspaces?beta=true",gt,{query:n,...r,__span:$(this._client,"anthropic.organization.workspaces.list",r,{route:"/v1/organizations/workspaces",queryParams:["after_id","before_id","include_archived","include_default","limit"]})})}archive(n,r){return this._client.post(E`/v1/organizations/workspaces/${n}/archive?beta=true`,{...r,__span:$(this._client,"anthropic.organization.workspaces.archive",r,{route:"/v1/organizations/workspaces/{workspace_id}/archive",attributes:{"anthropic.organization.workspace.id":n}})})}}return e.RateLimits=rm,e.Members=nm,e.ServiceAccounts=im,e})()});var mT,Xj=P(()=>{ne();lj();lj();Sj();Sj();xj();xj();Rj();Rj();Pj();Pj();Cj();Cj();Nj();Nj();$j();$j();Ij();Ij();Lj();Lj();Uj();Uj();zj();zj();Bj();Bj();Wj();Wj();Kj();Kj();Qj();Qj();X();mT=(()=>{class e extends N{constructor(){super(...arguments),this.apiKeys=new Tf(this._client),this.externalKeys=new jf(this._client),this.federation=new sT(this._client),this.invites=new Bf(this._client),this.serviceAccounts=new uT(this._client),this.users=new Wf(this._client),this.workspaces=new fT(this._client),this.rateLimits=new qf(this._client),this.complianceSettings=new Uf(this._client),this.analytics=new iT(this._client),this.spendLimits=new dT(this._client),this.rbacGroups=new cT(this._client),this.rbacRoles=new lT(this._client),this.plugins=new aT(this._client),this.pluginMarketplaces=new Vf(this._client),this.telemetryDestinations=new pT(this._client)}retrieve(n){return this._client.get("/v1/organizations/me?beta=true",{...n,__span:$(this._client,"anthropic.organization.retrieve",n,{route:"/v1/organizations/me"})})}}return e.APIKeys=Tf,e.ExternalKeys=jf,e.Federation=sT,e.Invites=Bf,e.ServiceAccounts=uT,e.Users=Wf,e.Workspaces=fT,e.RateLimits=qf,e.ComplianceSettings=Uf,e.Analytics=iT,e.SpendLimits=dT,e.RBACGroups=cT,e.RBACRoles=lT,e.Plugins=aT,e.PluginMarketplaces=Vf,e.TelemetryDestinations=pT,e})()});var gT,ez=P(()=>{ne();oe();$e();X();me();$U();gT=(()=>{class e extends N{list(n,r={},i){let{betas:o,workspace_id:s,...a}=r??{};return this._client.getAPIList(E`/v1/sessions/${n}/events?beta=true`,G,{query:a,...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.sessions.events.list",i,{route:"/v1/sessions/{session_id}/events",queryParams:["created_at[gt]","created_at[gte]","created_at[lt]","created_at[lte]","limit","order","page","types"],attributes:{"anthropic.session.id":n}})})}send(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(E`/v1/sessions/${n}/events?beta=true`,{body:a,...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.sessions.events.send",i,{route:"/v1/sessions/{session_id}/events",attributes:{"anthropic.session.id":n}})})}stream(n,r={},i){let{betas:o,workspace_id:s,...a}=r??{};return this._client.get(E`/v1/sessions/${n}/events/stream?beta=true`,{query:a,...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),stream:!0,__span:$(this._client,"anthropic.sessions.events.stream",i,{route:"/v1/sessions/{session_id}/events/stream",queryParams:["event_deltas"],attributes:{"anthropic.session.id":n}})})}toolRunner(n,r){return new Pb(n,{...r,client:this._client})}}return e.SessionToolRunner=Pb,e})()});var om,tz=P(()=>{ne();oe();$e();X();me();om=class extends N{retrieve(t,n,r){let{session_id:i,betas:o,workspace_id:s}=n;return this._client.get(E`/v1/sessions/${i}/resources/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.sessions.resources.retrieve",r,{route:"/v1/sessions/{session_id}/resources/{resource_id}",attributes:{"anthropic.session.id":i,"anthropic.session.resource.id":t}})})}update(t,n,r){let{session_id:i,betas:o,workspace_id:s,...a}=n;return this._client.post(E`/v1/sessions/${i}/resources/${t}?beta=true`,{body:a,...r,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.sessions.resources.update",r,{route:"/v1/sessions/{session_id}/resources/{resource_id}",attributes:{"anthropic.session.id":i,"anthropic.session.resource.id":t}})})}list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(E`/v1/sessions/${t}/resources?beta=true`,G,{query:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.sessions.resources.list",r,{route:"/v1/sessions/{session_id}/resources",queryParams:["limit","page"],attributes:{"anthropic.session.id":t}})})}delete(t,n,r){let{session_id:i,betas:o,workspace_id:s}=n;return this._client.delete(E`/v1/sessions/${i}/resources/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.sessions.resources.delete",r,{route:"/v1/sessions/{session_id}/resources/{resource_id}",attributes:{"anthropic.session.id":i,"anthropic.session.resource.id":t}})})}add(t,n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post(E`/v1/sessions/${t}/resources?beta=true`,{body:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.sessions.resources.add",r,{route:"/v1/sessions/{session_id}/resources",attributes:{"anthropic.session.id":t},createdIDAttribute:"anthropic.session.resource.id"})})}}});var sm,nz=P(()=>{ne();oe();$e();X();me();sm=class extends N{list(t,n,r){let{session_id:i,betas:o,workspace_id:s,...a}=n;return this._client.getAPIList(E`/v1/sessions/${i}/threads/${t}/events?beta=true`,G,{query:a,...r,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.sessions.threads.events.list",r,{route:"/v1/sessions/{session_id}/threads/{thread_id}/events",queryParams:["limit","page"],attributes:{"anthropic.session.id":i,"anthropic.session.thread.id":t}})})}stream(t,n,r){let{session_id:i,betas:o,workspace_id:s,...a}=n;return this._client.get(E`/v1/sessions/${i}/threads/${t}/stream?beta=true`,{query:a,...r,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),stream:!0,__span:$(this._client,"anthropic.sessions.threads.events.stream",r,{route:"/v1/sessions/{session_id}/threads/{thread_id}/stream",queryParams:["event_deltas"],attributes:{"anthropic.session.id":i,"anthropic.session.thread.id":t}})})}}});var hT,rz=P(()=>{ne();nz();nz();oe();$e();X();me();hT=(()=>{class e extends N{constructor(){super(...arguments),this.events=new sm(this._client)}retrieve(n,r,i){let{session_id:o,betas:s,workspace_id:a}=r;return this._client.get(E`/v1/sessions/${o}/threads/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers]),__span:$(this._client,"anthropic.sessions.threads.retrieve",i,{route:"/v1/sessions/{session_id}/threads/{thread_id}",attributes:{"anthropic.session.id":o,"anthropic.session.thread.id":n}})})}list(n,r={},i){let{betas:o,workspace_id:s,...a}=r??{};return this._client.getAPIList(E`/v1/sessions/${n}/threads?beta=true`,G,{query:a,...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.sessions.threads.list",i,{route:"/v1/sessions/{session_id}/threads",queryParams:["limit","page","statuses"],attributes:{"anthropic.session.id":n}})})}archive(n,r,i){let{session_id:o,betas:s,workspace_id:a}=r;return this._client.post(E`/v1/sessions/${o}/threads/${n}/archive?beta=true`,{...i,headers:T([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers]),__span:$(this._client,"anthropic.sessions.threads.archive",i,{route:"/v1/sessions/{session_id}/threads/{thread_id}/archive",attributes:{"anthropic.session.id":o,"anthropic.session.thread.id":n}})})}}return e.Events=sm,e})()});var yT,iz=P(()=>{ne();ez();ez();tz();tz();rz();rz();oe();$e();X();Hr();me();yT=(()=>{class e extends N{constructor(){super(...arguments),this.events=new gT(this._client),this.resources=new om(this._client),this.threads=new hT(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n,a=T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),c=$(this._client,"anthropic.sessions.create",r,{route:"/v1/sessions",attributes:{"gen_ai.agent.id":typeof s.agent=="object"?s.agent?.id:s.agent,"anthropic.session.environment.id":s.environment_id},createdIDAttribute:"anthropic.session.id"}),l=this._client.post("/v1/sessions?beta=true",{body:s,...r,headers:a,__span:c});return c?l._thenUnwrap(u=>(wF(this._client,c,u),u)):l}retrieve(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(E`/v1/sessions/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.sessions.retrieve",i,{route:"/v1/sessions/{session_id}",attributes:{"anthropic.session.id":n}})})}update(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(E`/v1/sessions/${n}?beta=true`,{body:a,...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.sessions.update",i,{route:"/v1/sessions/{session_id}",attributes:{"anthropic.session.id":n}})})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/sessions?beta=true",qx,{query:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.sessions.list",r,{route:"/v1/sessions",queryParams:["agent_id","agent_version","created_at[gt]","created_at[gte]","created_at[lt]","created_at[lte]","deployment_id","include_archived","limit","memory_store_id","order","page","statuses"]})})}delete(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.delete(E`/v1/sessions/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.sessions.delete",i,{route:"/v1/sessions/{session_id}",attributes:{"anthropic.session.id":n}})})}archive(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(E`/v1/sessions/${n}/archive?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.sessions.archive",i,{route:"/v1/sessions/{session_id}/archive",attributes:{"anthropic.session.id":n}})})}}return e.Events=gT,e.Resources=om,e.Threads=hT,e})()});var am,oz=P(()=>{ne();oe();$e();X();hi();me();am=class extends N{create(t,n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post(E`/v1/skills/${t}/versions?beta=true`,Nn({body:s,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.skills.versions.create",r,{route:"/v1/skills/{skill_id}/versions",attributes:{"anthropic.skill.id":t},createdIDAttribute:"anthropic.skill.version.id"})},this._client,!1))}retrieve(t,n,r){let{skill_id:i,betas:o,workspace_id:s}=n;return this._client.get(E`/v1/skills/${i}/versions/${t}?beta=true`,{...r,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.skills.versions.retrieve",r,{route:"/v1/skills/{skill_id}/versions/{version}",attributes:{"anthropic.skill.id":i,"anthropic.skill.version.id":t}})})}list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(E`/v1/skills/${t}/versions?beta=true`,G,{query:s,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.skills.versions.list",r,{route:"/v1/skills/{skill_id}/versions",queryParams:["limit","page"],attributes:{"anthropic.skill.id":t}})})}delete(t,n,r){let{skill_id:i,betas:o,workspace_id:s}=n;return this._client.delete(E`/v1/skills/${i}/versions/${t}?beta=true`,{...r,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.skills.versions.delete",r,{route:"/v1/skills/{skill_id}/versions/{version}",attributes:{"anthropic.skill.id":i,"anthropic.skill.version.id":t}})})}download(t,n,r){let{skill_id:i,betas:o,workspace_id:s}=n;return this._client.get(E`/v1/skills/${i}/versions/${t}/content?beta=true`,{...r,headers:T([{Accept:"application/binary",...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__binaryResponse:!0,__span:$(this._client,"anthropic.skills.versions.download",r,{route:"/v1/skills/{skill_id}/versions/{version}/content",attributes:{"anthropic.skill.id":i,"anthropic.skill.version.id":t}})})}}});var bT,sz=P(()=>{ne();oz();oz();oe();$e();X();hi();me();bT=(()=>{class e extends N{constructor(){super(...arguments),this.versions=new am(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/skills?beta=true",Nn({body:s,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.skills.create",r,{route:"/v1/skills",createdIDAttribute:"anthropic.skill.id"})},this._client,!1))}retrieve(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(E`/v1/skills/${n}?beta=true`,{...i,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.skills.retrieve",i,{route:"/v1/skills/{skill_id}",attributes:{"anthropic.skill.id":n}})})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/skills?beta=true",G,{query:s,...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.skills.list",r,{route:"/v1/skills",queryParams:["limit","page","source"]})})}delete(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.delete(E`/v1/skills/${n}?beta=true`,{...i,headers:T([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.skills.delete",i,{route:"/v1/skills/{skill_id}",attributes:{"anthropic.skill.id":n}})})}}return e.Versions=am,e})()});var cm,az=P(()=>{ne();oe();$e();X();me();cm=class extends N{create(t,n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post(E`/v1/tunnels/${t}/certificates?beta=true`,{body:s,...r,headers:T([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.tunnels.certificates.create",r,{route:"/v1/tunnels/{tunnel_id}/certificates",attributes:{"anthropic.tunnel.id":t},createdIDAttribute:"anthropic.tunnel.certificate.id"})})}retrieve(t,n,r){let{tunnel_id:i,betas:o,workspace_id:s}=n;return this._client.get(E`/v1/tunnels/${i}/certificates/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.tunnels.certificates.retrieve",r,{route:"/v1/tunnels/{tunnel_id}/certificates/{certificate_id}",attributes:{"anthropic.tunnel.id":i,"anthropic.tunnel.certificate.id":t}})})}list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(E`/v1/tunnels/${t}/certificates?beta=true`,G,{query:s,...r,headers:T([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.tunnels.certificates.list",r,{route:"/v1/tunnels/{tunnel_id}/certificates",queryParams:["include_archived","limit","page"],attributes:{"anthropic.tunnel.id":t}})})}archive(t,n,r){let{tunnel_id:i,betas:o,workspace_id:s}=n;return this._client.post(E`/v1/tunnels/${i}/certificates/${t}/archive?beta=true`,{...r,headers:T([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.tunnels.certificates.archive",r,{route:"/v1/tunnels/{tunnel_id}/certificates/{certificate_id}/archive",attributes:{"anthropic.tunnel.id":i,"anthropic.tunnel.certificate.id":t}})})}}});var vT,cz=P(()=>{ne();az();az();oe();$e();X();me();vT=(()=>{class e extends N{constructor(){super(...arguments),this.certificates=new cm(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/tunnels?beta=true",{body:s,...r,headers:T([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.tunnels.create",r,{route:"/v1/tunnels",createdIDAttribute:"anthropic.tunnel.id"})})}retrieve(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(E`/v1/tunnels/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.tunnels.retrieve",i,{route:"/v1/tunnels/{tunnel_id}",attributes:{"anthropic.tunnel.id":n}})})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/tunnels?beta=true",G,{query:s,...r,headers:T([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.tunnels.list",r,{route:"/v1/tunnels",queryParams:["include_archived","limit","page"]})})}archive(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(E`/v1/tunnels/${n}/archive?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.tunnels.archive",i,{route:"/v1/tunnels/{tunnel_id}/archive",attributes:{"anthropic.tunnel.id":n}})})}revealToken(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(E`/v1/tunnels/${n}/reveal_token?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.tunnels.reveal_token",i,{route:"/v1/tunnels/{tunnel_id}/reveal_token",attributes:{"anthropic.tunnel.id":n}})})}rotateToken(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(E`/v1/tunnels/${n}/rotate_token?beta=true`,{body:a,...i,headers:T([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.tunnels.rotate_token",i,{route:"/v1/tunnels/{tunnel_id}/rotate_token",attributes:{"anthropic.tunnel.id":n}})})}}return e.Certificates=cm,e})()});var lm,lz=P(()=>{ne();oe();$e();X();me();lm=class extends N{create(t,n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post(E`/v1/vaults/${t}/credentials?beta=true`,{body:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.vaults.credentials.create",r,{route:"/v1/vaults/{vault_id}/credentials",attributes:{"anthropic.vault.id":t},createdIDAttribute:"anthropic.vault.credential.id"})})}retrieve(t,n,r){let{vault_id:i,betas:o,workspace_id:s}=n;return this._client.get(E`/v1/vaults/${i}/credentials/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.vaults.credentials.retrieve",r,{route:"/v1/vaults/{vault_id}/credentials/{credential_id}",attributes:{"anthropic.vault.id":i,"anthropic.vault.credential.id":t}})})}update(t,n,r){let{vault_id:i,betas:o,workspace_id:s,...a}=n;return this._client.post(E`/v1/vaults/${i}/credentials/${t}?beta=true`,{body:a,...r,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.vaults.credentials.update",r,{route:"/v1/vaults/{vault_id}/credentials/{credential_id}",attributes:{"anthropic.vault.id":i,"anthropic.vault.credential.id":t}})})}list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(E`/v1/vaults/${t}/credentials?beta=true`,G,{query:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.vaults.credentials.list",r,{route:"/v1/vaults/{vault_id}/credentials",queryParams:["include_archived","limit","page"],attributes:{"anthropic.vault.id":t}})})}delete(t,n,r){let{vault_id:i,betas:o,workspace_id:s}=n;return this._client.delete(E`/v1/vaults/${i}/credentials/${t}?beta=true`,{...r,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.vaults.credentials.delete",r,{route:"/v1/vaults/{vault_id}/credentials/{credential_id}",attributes:{"anthropic.vault.id":i,"anthropic.vault.credential.id":t}})})}archive(t,n,r){let{vault_id:i,betas:o,workspace_id:s}=n;return this._client.post(E`/v1/vaults/${i}/credentials/${t}/archive?beta=true`,{...r,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.vaults.credentials.archive",r,{route:"/v1/vaults/{vault_id}/credentials/{credential_id}/archive",attributes:{"anthropic.vault.id":i,"anthropic.vault.credential.id":t}})})}mcpOAuthValidate(t,n,r){let{vault_id:i,betas:o,workspace_id:s}=n;return this._client.post(E`/v1/vaults/${i}/credentials/${t}/mcp_oauth_validate?beta=true`,{...r,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__span:$(this._client,"anthropic.vaults.credentials.mcp_oauth_validate",r,{route:"/v1/vaults/{vault_id}/credentials/{credential_id}/mcp_oauth_validate",attributes:{"anthropic.vault.id":i,"anthropic.vault.credential.id":t}})})}}});var _T,uz=P(()=>{ne();lz();lz();oe();$e();X();me();_T=(()=>{class e extends N{constructor(){super(...arguments),this.credentials=new lm(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/vaults?beta=true",{body:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.vaults.create",r,{route:"/v1/vaults",createdIDAttribute:"anthropic.vault.id"})})}retrieve(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(E`/v1/vaults/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.vaults.retrieve",i,{route:"/v1/vaults/{vault_id}",attributes:{"anthropic.vault.id":n}})})}update(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(E`/v1/vaults/${n}?beta=true`,{body:a,...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.vaults.update",i,{route:"/v1/vaults/{vault_id}",attributes:{"anthropic.vault.id":n}})})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/vaults?beta=true",G,{query:s,...r,headers:T([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.vaults.list",r,{route:"/v1/vaults",queryParams:["include_archived","limit","page"]})})}delete(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.delete(E`/v1/vaults/${n}?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.vaults.delete",i,{route:"/v1/vaults/{vault_id}",attributes:{"anthropic.vault.id":n}})})}archive(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(E`/v1/vaults/${n}/archive?beta=true`,{...i,headers:T([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__span:$(this._client,"anthropic.vaults.archive",i,{route:"/v1/vaults/{vault_id}/archive",attributes:{"anthropic.vault.id":n}})})}}return e.Credentials=lm,e})()});var foe=P(()=>{poe()});var moe=P(()=>{foe()});var Hs,wT,mu,um,kT,gu,dm,$T,goe,ST,xT,dz,hoe=P(()=>{sr();gi();sj();dz=(()=>{class e extends XE{constructor(n,r,i){super(n,{client:i}),Hs.add(this),wT.set(this,void 0),mu.set(this,0),um.set(this,[]),kT.set(this,[]),gu.set(this,void 0),dm.set(this,[]),$T.set(this,!1),O(this,wT,r,"f")}get toolCalls(){return y(this,kT,"f")}static start(n,r,i,o){let s=new e({...r,stream:!0},o,n);for(let a of r.messages)s._addMessageParam(a);return s._run(()=>s._createMessage(n.beta.messages,{...r,stream:!0},{...i,headers:{...i?.headers,[Bp]:"stream"}})),s}_deliverEvent(n,r){var i;O(this,mu,(i=y(this,mu,"f"),i++,i),"f");let o=n.type==="content_block_stop"?r?.content[n.index]:void 0,s=o?.type==="tool_use"?o:void 0;s&&y(this,kT,"f").push(s),super._deliverEvent(n,r),y(this,Hs,"m",goe).call(this,n,s),y(this,Hs,"m",ST).call(this)}[(wT=new WeakMap,mu=new WeakMap,um=new WeakMap,kT=new WeakMap,gu=new WeakMap,dm=new WeakMap,$T=new WeakMap,Hs=new WeakSet,Symbol.asyncIterator)](){let n=super[Symbol.asyncIterator](),r={handled:y(this,mu,"f")};y(this,um,"f").push(r);let i=!1;return{next:async()=>{i&&(i=!1,r.handled++,y(this,Hs,"m",ST).call(this));try{let o=await n.next();return i=!o.done,o.done&&y(this,Hs,"m",xT).call(this,r),o}catch(o){throw y(this,Hs,"m",xT).call(this,r),o}},return:async()=>{let o=n.return?.();return y(this,Hs,"m",xT).call(this,r),await o??{value:void 0,done:!0}}}}}return goe=function(n,r){if(y(this,$T,"f"))return;if(n.type==="content_block_start"&&n.content_block.type==="fallback"){O(this,$T,!0,"f"),O(this,gu,void 0,"f");return}let i=n.type==="content_block_start"||n.type==="message_delta"&&n.delta.stop_reason==="tool_use";y(this,gu,"f")&&i&&(y(this,dm,"f").push({toolUse:y(this,gu,"f"),event:y(this,mu,"f")}),O(this,gu,void 0,"f")),r&&O(this,gu,r,"f")},ST=function(){if(this.errored||this.controller.signal.aborted)return;let n=Math.min(y(this,mu,"f"),...y(this,um,"f").map(r=>r.handled));for(;y(this,dm,"f")[0]&&y(this,dm,"f")[0].event<=n;)y(this,wT,"f").call(this,y(this,dm,"f").shift().toolUse)},xT=function(n){let r=y(this,um,"f").indexOf(n);r>=0&&(y(this,um,"f").splice(r,1),y(this,Hs,"m",ST).call(this))},e})()});function koe(e){if("compaction"in e&&e.compaction!=null)throw new Q("`compaction` cannot be set on a tool runner: every request in the loop would compact again. Call `runner.compactBeforeNextTurn()` when the conversation should be compacted instead.")}function bGe(e){if("compactionControl"in e&&e.compactionControl!=null)throw new Q("`compactionControl` has been removed from the tool runner. Use server-side compaction instead: call `runner.compactBeforeNextTurn()` when the conversation should be compacted.")}function $oe(e){if(e.runToolsEagerly&&!e.stream)throw new TypeError("`runToolsEagerly: true` needs `stream: true` in the tool runner's params, because a reply that isn't streamed arrives whole.")}function yz(e){if(e.context_management?.edits?.some(t=>t.type.startsWith("compact_")))throw new Q("`compactBeforeNextTurn()` can't be used while `context_management` has a compaction edit, because the API doesn't accept a compaction block together with one. Remove the edit first.")}function vGe(e){let{context_management:t,stop_sequences:n,output_format:r,...i}=e,o=({format:s,...a})=>a;return(i.tool_choice?.type==="any"||i.tool_choice?.type==="tool")&&delete i.tool_choice,i.output_config&&(i.output_config=o(i.output_config)),Array.isArray(i.fallbacks)&&(i.fallbacks=i.fallbacks.map(s=>s.output_config?{...s,output_config:o(s.output_config)}:s)),i}function bz(e){if(!("run"in e))return e;let t=eT,n="toJSON"in e&&typeof e.toJSON=="function"?e.toJSON():e;return{...Object.fromEntries(Object.entries(n).filter(([r])=>t.includes(r))),...Bs(e)&&{[ho]:e[ho]}}}function Soe(e){return e.map(t=>{if(t.role!=="system"||typeof t.content=="string")return t;let n=t.content.map(r=>r.type==="tool_addition"&&r.tool.type==="tool_definition"?{...r,tool:{...r.tool,definition:bz(r.tool.definition)}}:r);return{...t,content:n}})}async function _Ge(e,t,n,r,i,o,s,a){if(!r||r.role!=="assistant"||!r.content||typeof r.content=="string")return null;let c=r.content.filter(d=>d.type==="tool_use");if(c.length===0)return null;let l=new Map;return{role:"user",content:await Promise.all(c.map(async d=>{let p=o?.get(d.id),f=p?.status==="started"?p.result:void 0;if(d.toolset_name){let h=d.toolset_name,v=l.get(h)??{tail:Promise.resolve(),failed:!1};l.set(h,v);let b=e.tools.some(w=>xf(w)&&wc(w)===h),_=f??v.tail.then(()=>v.failed?Xb(d,loe(h),!0):Toe(e,h,d,i,s,a));return v.tail=_.then(({is_error:w})=>{w&&b&&(v.failed=!0)},()=>{v.failed=!0}),o?.set(d.id,{status:"started",result:_}),_}if(f)return f;if(!(n.has(d.name)?t.get(d.name):void 0)&&e.tools.some(h=>xf(h)&&wc(h)===d.name)){let h=l.get(d.name)??{tail:Promise.resolve(),failed:!1};return l.set(d.name,h),h.tail=h.tail.then(()=>{h.failed=!0}),$Ge(d)}let g=Aoe(t,n,d,i,s,a);return o?.set(d.id,{status:"started",result:g}),g}))}}async function Toe(e,t,n,r,i,o){let s=e.tools.find(l=>xf(l)&&wc(l)===t);if(!s)return Xb(n,`Error: Toolset '${Vs(t)}' member '${Vs(n.name)}' not found`,!0);let a={signal:r?.signal,conversationId:r?.openTelemetry?.conversationId,parentContext:o};return(await Vp(i,s,n,a,async()=>{let l=await uoe(s,n,{signal:r?.signal});return{block:l,content:l.content??[],isError:l.is_error===!0}})).block}async function Aoe(e,t,n,r,i,o){let s=t.has(n.name)?e.get(n.name):void 0;if(!s)return kGe(n);let a={signal:r?.signal,conversationId:r?.openTelemetry?.conversationId,parentContext:o},c=await Vp(i,s,n,a,()=>hE(s,n.input,{toolUse:n,toolUseBlock:n,signal:r?.signal}));return{type:"tool_result",tool_use_id:n.id,content:c.content,...c.isError?{is_error:!0}:void 0}}function wGe(e){return(e.type??"custom").replace(/_\d{8}$/,"").replace(/_toolset$/,"")}function kGe(e){return{type:"tool_result",tool_use_id:e.id,content:`Error: Tool '${e.name}' not found`,is_error:!0}}function $Ge(e){return{type:"tool_result",tool_use_id:e.id,content:`Error: the '${Vs(e.name)}' toolset could not run this call${SGe(e.input)}; nothing in the batch was executed`,is_error:!0}}function SGe(e){let t=typeof e=="object"&&e!==null?e:{};if(!("actions"in t)){let o="action"in t?t.action:void 0;return typeof o=="string"?`: the call has no 'actions' list (action: '${Vs(o)}')`:": the call has no 'actions' list"}let{actions:n}=t;if(typeof n=="string")return": 'actions' is text, not a list of actions";if(!Array.isArray(n))return": 'actions' is not a list of actions";if(n.length===0)return": the 'actions' list is empty";let r=[];for(let[o,s]of n.entries()){let a=typeof s=="object"&&s!==null&&"action"in s?s.action:void 0;if(typeof a!="string")return`: action ${o} must be an object with a string 'action' field`;r.push(`'${Vs(a)}'`)}let i=r.length>10?`, and ${r.length-10} more`:"";return`: its actions could not be run as sent (actions: ${r.slice(0,10).join(", ")}${i})`}function xoe(e,t){switch(e.type){case"tool_removal":case"tool_addition":xGe(e,t);break}}function xGe(e,t){let n=EGe(e.tool);n!==void 0&&(e.type==="tool_removal"?t.delete(n):t.add(n))}function EGe(e){switch(e.type){case"tool_reference":return e.name;case"tool_definition":return"name"in e.definition?e.definition.name:void 0;default:return}}function Eoe(e){if(e===null)return"stop";switch(e){case"tool_use":return"run_tools";case"pause_turn":case"compaction":return"resume";case"end_turn":case"stop_sequence":case"max_tokens":case"model_context_window_exceeded":case"refusal":return"stop";default:return"stop"}}var ht,pm,hu,kt,cr,Xr,$c,os,Sc,ev,Ks,_i,ss,fm,mm,yu,tv,pz,yoe,fz,mz,nv,ET,boe,voe,gz,TT,_oe,hz,woe,yGe,vz,Ioe=P(()=>{sr();Zo();vU();aj();doe();gE();cj();at();moe();hoe();X();Hr();$e();SU();qn();gi();woe="a tool runner's toolsets come only from its tools param; change them with setMessagesParams(), or build a new runner",yGe="a tool runner's toolsets come only from its tools param; remove it there with setMessagesParams(), or build a new runner without it",vz=(()=>{class e{constructor(n,r,i){ht.add(this),this.client=n,pm.set(this,!1),hu.set(this,!1),kt.set(this,void 0),cr.set(this,void 0),Xr.set(this,void 0),$c.set(this,void 0),os.set(this,void 0),Sc.set(this,void 0),ev.set(this,0),Ks.set(this,void 0),_i.set(this,{status:"idle"}),ss.set(this,void 0),fm.set(this,null),mm.set(this,new Map),yu.set(this,[]),koe(r),bGe(r),$oe(r),O(this,kt,{params:{...r,messages:JSON.parse(JSON.stringify(Soe(r.messages)))}},"f");let o=EF(r.tools,r.messages);O(this,cr,{...i,headers:T([Lx("BetaToolRunner"),o.length?{[es]:o.join(", ")}:void 0,i?.headers])},"f"),O(this,Sc,gf(),"f")}async*[(pm=new WeakMap,hu=new WeakMap,kt=new WeakMap,cr=new WeakMap,Xr=new WeakMap,$c=new WeakMap,os=new WeakMap,Sc=new WeakMap,ev=new WeakMap,Ks=new WeakMap,_i=new WeakMap,ss=new WeakMap,fm=new WeakMap,mm=new WeakMap,yu=new WeakMap,ht=new WeakSet,tv=function(r){return y(this,Ks,"f")?ln.with(y(this,Ks,"f"),r):r()},Symbol.asyncIterator)](){var n;if(y(this,pm,"f"))throw new Q("Cannot iterate over a consumed stream");O(this,pm,!0,"f"),O(this,hu,!0,"f"),O(this,os,void 0,"f");let r=nt(this.client,()=>TF(this.client,y(this,kt,"f").params,y(this,cr,"f").openTelemetry?.conversationId));O(this,Ks,r&&pi.setSpan(ln.active(),r),"f");try{for(;;)try{if(y(this,kt,"f").params.max_iterations&&y(this,ev,"f")>=y(this,kt,"f").params.max_iterations)break;if(y(this,ht,"m",_oe).call(this),y(this,_i,"f").status==="scheduled"&&Eoe(y(this,fm,"f"))!=="resume"){yield*y(this,ht,"m",mz).call(this,y(this,_i,"f").config);continue}O(this,hu,!1,"f"),O(this,os,void 0,"f"),O(this,ev,(n=y(this,ev,"f"),n++,n),"f"),O(this,Xr,void 0,"f");let{max_iterations:i,runToolsEagerly:o,...s}=y(this,kt,"f").params;if(yield*y(this,ht,"m",pz).call(this,s),await y(this,ht,"m",tv).call(this,async()=>{if(y(this,hu,"f"))O(this,fm,null,"f");else{let l=await y(this,Xr,"f"),u=Eoe(l.stop_reason);O(this,fm,l.stop_reason,"f"),y(this,kt,"f").params.messages.push({role:l.role,content:l.content});let{container:d}=y(this,kt,"f").params;if(l.container&&(d==null?y(this,kt,"f").params.container=l.container.id:typeof d=="object"&&d.id==null&&(y(this,kt,"f").params.container={...d,id:l.container.id})),u==="stop")return"stop";if(u==="resume")return"continue"}let c=await y(this,ht,"m",gz).call(this,y(this,kt,"f").params.messages.at(-1),y(this,cr,"f").signal,y(this,Ks,"f"));if(c)y(this,kt,"f").params.messages.push(c);else if(!y(this,hu,"f"))return"stop";return"continue"})==="stop"){yield*y(this,ht,"m",voe).call(this);break}}finally{y(this,$c,"f")?.abort(),O(this,$c,void 0,"f")}if(await y(this,ht,"m",fz).call(this),!y(this,Xr,"f"))throw new Q("ToolRunner concluded without a message from the server");y(this,Sc,"f").resolve(await y(this,Xr,"f")),nt(this.client,()=>r?.setStatus({code:xr.OK}))}catch(i){throw r&&nt(this.client,()=>Bi(r,i)),O(this,pm,!1,"f"),y(this,Sc,"f").promise.catch(()=>{}),y(this,Sc,"f").reject(i),O(this,Sc,gf(),"f"),i}finally{nt(this.client,()=>r?.end()),O(this,Ks,void 0,"f")}}setMessagesParams(n){let r=typeof n=="function"?n(y(this,kt,"f").params):n;if(koe(r),$oe(r),y(this,_i,"f").status!=="idle"&&yz(r),y(this,_i,"f").status==="in_flight"&&r.messages!==y(this,kt,"f").params.messages)throw new Q("Message params can't be changed while the conversation is being compacted, because the compaction response is about to replace them. Change them after this iteration instead.");y(this,kt,"f").params=r,O(this,hu,!0,"f"),O(this,os,void 0,"f")}setRequestOptions(n){typeof n=="function"?O(this,cr,n(y(this,cr,"f")),"f"):O(this,cr,{...y(this,cr,"f"),...n},"f")}async generateToolResponse(n=y(this,cr,"f").signal){let r=this.client._tracer?ln.active():void 0,i=await y(this,Xr,"f")??this.params.messages.at(-1);return i?y(this,ht,"m",gz).call(this,i,n,r):null}deferToolCall(n){let r=typeof n=="string"?n:n.id;y(this,ss,"f")&&!y(this,ss,"f").has(r)&&y(this,ss,"f").set(r,{status:"held"})}get deferredToolCalls(){let n=y(this,$c,"f"),r=y(this,ss,"f");return!(n instanceof dz)||!r?[]:n.toolCalls.filter(i=>r.get(i.id)?.status==="held")}done(){return y(this,Sc,"f").promise}async runUntilDone(){if(!y(this,pm,"f"))for await(let n of this);return this.done()}get params(){return y(this,kt,"f").params}pushMessages(...n){this.setMessagesParams(r=>({...r,messages:[...r.messages,...n]}))}compactBeforeNextTurn(n){y(this,_i,"f").status!=="in_flight"&&(yz(y(this,kt,"f").params),O(this,_i,{status:"scheduled",config:n??{type:"summarize"}},"f"))}addTools(...n){let r=y(this,ht,"m",TT).call(this);for(let i of n){if(xf(i))throw new kc(`addTools() can't add the '${Vs(wc(i))}' toolset: ${woe}`);let o=wGe(i);if(r.has(o))throw new kc(`addTools() can't replace the '${Vs(o)}' toolset: ${woe}`)}for(let i of n)"name"in i&&y(this,mm,"f").set(i.name,"run"in i?i:null),y(this,yu,"f").push({type:"addition",tool:i})}removeTools(...n){let r=y(this,ht,"m",TT).call(this);for(let i of n){let o=typeof i=="string"?i:i.name;if(r.has(o))throw new kc(`removeTools() can't remove the '${Vs(o)}' toolset: ${yGe}`)}for(let i of n){let o=typeof i=="string"?i:i.name;y(this,mm,"f").set(o,null),y(this,yu,"f").push({type:"removal",name:o})}}then(n,r){return this.runUntilDone().then(n,r)}}return pz=async function*(n){await y(this,ht,"m",fz).call(this),O(this,ss,void 0,"f"),n=y(this,ht,"m",tv).call(this,()=>({...n,...n.tools&&{tools:n.tools.map(bz)},messages:Soe(n.messages)})),n.stream?(O(this,$c,y(this,ht,"m",tv).call(this,()=>y(this,kt,"f").params.runToolsEagerly?y(this,ht,"m",yoe).call(this,n):this.client.beta.messages.stream({...n},y(this,cr,"f"))),"f"),O(this,Xr,y(this,$c,"f").finalMessage(),"f"),y(this,Xr,"f").catch(()=>{}),yield y(this,$c,"f")):(O(this,Xr,y(this,ht,"m",tv).call(this,()=>this.client.beta.messages.create({...n,stream:!1},y(this,cr,"f"))),"f"),yield y(this,Xr,"f"))},yoe=function(n){let r=new Map;O(this,ss,r,"f");let i=new Map;return dz.start(this.client,n,y(this,cr,"f"),o=>{let s=r.has(o.id),a=!o.toolset_name&&y(this,ht,"m",TT).call(this).has(o.name),c=a?o.name:o.toolset_name;if(c){if(s||a||i.has(c)){i.set(c,"waiting");return}i.set(c,"running");let u=Toe(y(this,kt,"f").params,c,o,y(this,cr,"f"),this.client,y(this,Ks,"f"));r.set(o.id,{status:"started",result:u}),u.then(({is_error:d})=>{d||i.get(c)==="waiting"?i.set(c,"waiting"):i.delete(c)},()=>i.set(c,"waiting"));return}if(s)return;let l=Aoe(y(this,ht,"m",nv).call(this),y(this,ht,"m",ET).call(this),o,y(this,cr,"f"),this.client,y(this,Ks,"f"));l.catch(()=>{}),r.set(o.id,{status:"started",result:l})})},fz=async function(){let n=[...y(this,ss,"f")?.values()??[]].filter(r=>r.status==="started");await Promise.allSettled(n.map(r=>r.result))},mz=async function*(n){yz(y(this,kt,"f").params);let{max_iterations:r,runToolsEagerly:i,...o}=y(this,kt,"f").params,s=vGe(o);O(this,_i,{status:"in_flight"},"f"),O(this,os,void 0,"f");let a=y(this,Xr,"f");try{yield*y(this,ht,"m",pz).call(this,{...s,compaction:n});let c=await y(this,Xr,"f");c.content.some(l=>l.type==="compaction"&&l.content)?(y(this,ht,"m",boe).call(this),y(this,kt,"f").params.messages=[{role:c.role,content:c.content}]):(Te(this.client).warn("Compaction produced no summary; keeping the conversation as it is."),O(this,Xr,a,"f"))}finally{O(this,_i,{status:"idle"},"f")}},nv=function(){let n=new Map;for(let r of y(this,kt,"f").params.tools)"run"in r&&"name"in r&&n.set(r.name,r);for(let[r,i]of y(this,mm,"f"))i?n.set(r,i):n.delete(r);return n},ET=function(){let n=new Set(y(this,ht,"m",nv).call(this).keys());for(let r of[...y(this,kt,"f").params.messages,y(this,ht,"m",hz).call(this)])if(typeof r.content!="string"){for(let i of r.content)if(r.role==="system")xoe(i,n);else if(r.role==="assistant"&&i.type==="compaction")for(let o of i.tool_changes??[])xoe(o,n)}return n},boe=function(){let n=y(this,ht,"m",ET).call(this);for(let r of y(this,ht,"m",nv).call(this).keys())n.has(r)||y(this,mm,"f").set(r,null)},voe=async function*(){if(y(this,_i,"f").status!=="scheduled")return;let n=y(this,kt,"f").params.messages.at(-1)?.content;if(Array.isArray(n)&&n.some(r=>r.type==="tool_use")){Te(this.client).warn("The pending compaction was skipped because the last turn ended with tool calls that were not run. Call `compactBeforeNextTurn()` again if you continue the conversation."),O(this,_i,{status:"idle"},"f");return}yield*y(this,ht,"m",mz).call(this,y(this,_i,"f").config)},gz=async function(n,r,i){return y(this,os,"f")!==void 0?y(this,os,"f"):(O(this,os,_Ge(y(this,kt,"f").params,y(this,ht,"m",nv).call(this),y(this,ht,"m",ET).call(this),n,{...y(this,cr,"f"),signal:r},y(this,ss,"f"),this.client,i),"f"),y(this,os,"f"))},TT=function(){return new Set(y(this,kt,"f").params.tools.filter(xf).map(wc))},_oe=function(){y(this,fm,"f")==="pause_turn"||y(this,yu,"f").length===0||(y(this,kt,"f").params.messages.push(y(this,ht,"m",hz).call(this)),O(this,yu,[],"f"))},hz=function(){let n=[];for(let r of y(this,yu,"f")){if(r.type==="removal"){n.push({type:"tool_removal",tool:{type:"tool_reference",name:r.name}});continue}let i=bz(r.tool);n.push({type:"tool_addition",tool:{type:"tool_definition",definition:i}})}return{role:"system",content:n}},e})()});var Roe,TGe,Ef,eT,tT=P(()=>{KU();ne();nU();$e();X();Hr();zs();YU();sj();XU();Ioe();lf();KU();Roe={"claude-sonnet-4-5":"November 30th, 2026","claude-sonnet-4-5-20250929":"November 30th, 2026"},TGe=["claude-mythos-preview","claude-opus-4-6"],Ef=(()=>{class e extends N{constructor(){super(...arguments),this.batches=new Sf(this._client)}create(n,r){let i=qE(n),{betas:o,user_profile_id:s,workspace_id:a,...c}=i;c.model in Roe&&console.warn(`The model '${c.model}' is deprecated and will reach end-of-life on ${Roe[c.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),TGe.includes(c.model)&&c.thinking&&c.thinking.type==="enabled"&&console.warn(`Using Claude with ${c.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let l=r?.timeout??this._client._options.timeout;if(!c.stream&&l==null){let f=tE[c.model]??void 0;l=this._client.calculateNonstreamingTimeout(c.max_tokens,f)}let u=QU(i,r),d=this._client._tracer&&$(this._client,"anthropic.messages.create",r,Gs(this._client,c,u));ib(this._client,d,c);let p=this._client.post("/v1/messages?beta=true",{body:c,timeout:l??6e5,...r,__span:d,headers:u,stream:i.stream??!1});return d?p._thenUnwrap(f=>(ob(this._client,d,c,f),f)):p}parse(n,r){return r={...r,headers:T([{"anthropic-beta":[...n.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(n,r).then(i=>ZU(i,n,{logger:this._client.logger??console}))}stream(n,r){return XE.createMessage(this,n,r,{client:this._client})}countTokens(n,r){let i=qE(n),{betas:o,user_profile_id:s,workspace_id:a,...c}=i,l=T([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString(),...s!=null?{"anthropic-user-profile-id":s}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},r?.headers]),u=$(this._client,"anthropic.messages.count_tokens",r,{route:"/v1/messages/count_tokens",attributes:{[js]:c.model}}),d=this._client.post("/v1/messages/count_tokens?beta=true",{body:c,...r,__span:u,headers:l});return u?d._thenUnwrap(p=>(sb(this._client,u,p),p)):d}toolRunner(n,r){return new vz(this._client,n,r)}}return e.Batches=Sf,e.BetaToolRunner=vz,e.ToolError=Ue,e})(),eT=["input_schema","name","allowed_callers","cache_control","defer_loading","description","eager_input_streaming","input_examples","strict","type","configs","display_height_px","display_width_px","display_number","enable_zoom","max_characters"]});var rv,_z=P(()=>{ne();iU();iU();oU();oU();sU();sU();aU();aU();cU();cU();lU();lU();fU();fU();gU();gU();VU();VU();HU();HU();tT();tT();Xj();Xj();iz();iz();sz();sz();cz();cz();uz();uz();rv=(()=>{class e extends N{constructor(){super(...arguments),this.models=new Yp(this._client),this.messages=new Ef(this._client),this.agents=new iE(this._client),this.environments=new BE(this._client),this.sessions=new yT(this._client),this.deployments=new Kp(this._client),this.deploymentRuns=new Hp(this._client),this.vaults=new _T(this._client),this.memoryStores=new VE(this._client),this.files=new Zp(this._client),this.skills=new bT(this._client),this.webhooks=new ef(this._client),this.userProfiles=new Qp(this._client),this.dreams=new Jp(this._client),this.tunnels=new vT(this._client),this.organization=new mT(this._client)}}return e.Models=Yp,e.Messages=Ef,e.Agents=iE,e.Environments=BE,e.Sessions=yT,e.Deployments=Kp,e.DeploymentRuns=Hp,e.Vaults=_T,e.MemoryStores=VE,e.Files=Zp,e.Skills=bT,e.Webhooks=ef,e.UserProfiles=Qp,e.Dreams=Jp,e.Tunnels=vT,e.Organization=mT,e})()});var bu,wz=P(()=>{ne();$e();X();bu=class extends N{create(t,n){let{betas:r,workspace_id:i,...o}=t;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...n,headers:T([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),stream:t.stream??!1,__span:$(this._client,"anthropic.completions.create",n,{route:"/v1/complete"})})}}});var vu,kz=P(()=>{ne();oe();$e();X();gi();hi();me();vu=class extends N{list(t={},n){let{workspace_id:r,...i}=t??{};return this._client.getAPIList("/v1/files",G,{query:i,...n,headers:T([{...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers]),__span:$(this._client,"anthropic.files.list",n,{route:"/v1/files",queryParams:["ids","limit","page"]})})}delete(t,n={},r){let{workspace_id:i}=n??{};return this._client.delete(E`/v1/files/${t}`,{...r,headers:T([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),__span:$(this._client,"anthropic.files.delete",r,{route:"/v1/files/{file_id}",attributes:{"anthropic.file.id":t}})})}download(t,n={},r){let{workspace_id:i}=n??{};return this._client.get(E`/v1/files/${t}/content`,{...r,headers:T([{Accept:"application/binary",...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),__binaryResponse:!0,__span:$(this._client,"anthropic.files.download",r,{route:"/v1/files/{file_id}/content",attributes:{"anthropic.file.id":t}})})}retrieveMetadata(t,n={},r){let{workspace_id:i}=n??{};return this._client.get(E`/v1/files/${t}`,{...r,headers:T([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),__span:$(this._client,"anthropic.files.retrieve_metadata",r,{route:"/v1/files/{file_id}",attributes:{"anthropic.file.id":t}})})}upload(t,n){let{workspace_id:r,...i}=t;return this._client.post("/v1/files",Nn({body:i,...n,headers:T([{...r!=null?{"anthropic-workspace-id":r}:void 0},Ux(i.file),n?.headers]),__span:$(this._client,"anthropic.files.upload",n,{route:"/v1/files",createdIDAttribute:"anthropic.file.id"})},this._client))}}});var _u,$z=P(()=>{ne();oe();$e();X();me();_u=class extends N{retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(E`/v1/models/${t}`,{...r,headers:T([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.models.retrieve",r,{route:"/v1/models/{model_id}",attributes:{"anthropic.model.id":t}})})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/models",gt,{query:o,...n,headers:T([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),__span:$(this._client,"anthropic.models.list",n,{route:"/v1/models",queryParams:["after_id","before_id","lifecycle","limit"]})})}}});var gm,Sz=P(()=>{ne();oe();X();me();gm=class extends N{retrieve(t,n){return this._client.get(E`/v1/organizations/api_keys/${t}`,{...n,__span:$(this._client,"anthropic.organization.api_keys.retrieve",n,{route:"/v1/organizations/api_keys/{api_key_id}",attributes:{"anthropic.organization.api_key.id":t}})})}update(t,n,r){return this._client.post(E`/v1/organizations/api_keys/${t}`,{body:n,...r,__span:$(this._client,"anthropic.organization.api_keys.update",r,{route:"/v1/organizations/api_keys/{api_key_id}",attributes:{"anthropic.organization.api_key.id":t}})})}list(t={},n){return this._client.getAPIList("/v1/organizations/api_keys",gt,{query:t,...n,__span:$(this._client,"anthropic.organization.api_keys.list",n,{route:"/v1/organizations/api_keys",queryParams:["after_id","before_id","created_by_user_id","limit","status","workspace_id"]})})}}});var hm,xz=P(()=>{ne();X();hm=class extends N{retrieve(t){return this._client.get("/v1/organizations/compliance_settings",{...t,__span:$(this._client,"anthropic.organization.compliance_settings.retrieve",t,{route:"/v1/organizations/compliance_settings"})})}update(t,n){return this._client.post("/v1/organizations/compliance_settings",{body:t,...n,__span:$(this._client,"anthropic.organization.compliance_settings.update",n,{route:"/v1/organizations/compliance_settings"})})}}});var ym,Ez=P(()=>{ne();oe();X();me();ym=class extends N{create(t,n){return this._client.post("/v1/organizations/external_keys",{body:t,...n,__span:$(this._client,"anthropic.organization.external_keys.create",n,{route:"/v1/organizations/external_keys",createdIDAttribute:"anthropic.organization.external_key.id"})})}retrieve(t,n){return this._client.get(E`/v1/organizations/external_keys/${t}`,{...n,__span:$(this._client,"anthropic.organization.external_keys.retrieve",n,{route:"/v1/organizations/external_keys/{external_key_id}",attributes:{"anthropic.organization.external_key.id":t}})})}update(t,n,r){return this._client.post(E`/v1/organizations/external_keys/${t}`,{body:n,...r,__span:$(this._client,"anthropic.organization.external_keys.update",r,{route:"/v1/organizations/external_keys/{external_key_id}",attributes:{"anthropic.organization.external_key.id":t}})})}list(t={},n){return this._client.getAPIList("/v1/organizations/external_keys",G,{query:t,...n,__span:$(this._client,"anthropic.organization.external_keys.list",n,{route:"/v1/organizations/external_keys",queryParams:["limit","page"]})})}delete(t,n){return this._client.delete(E`/v1/organizations/external_keys/${t}`,{...n,__span:$(this._client,"anthropic.organization.external_keys.delete",n,{route:"/v1/organizations/external_keys/{external_key_id}",attributes:{"anthropic.organization.external_key.id":t}})})}validate(t,n){return this._client.post(E`/v1/organizations/external_keys/${t}/validate`,{...n,__span:$(this._client,"anthropic.organization.external_keys.validate",n,{route:"/v1/organizations/external_keys/{external_key_id}/validate",attributes:{"anthropic.organization.external_key.id":t}})})}}});var bm,Tz=P(()=>{ne();oe();X();me();bm=class extends N{create(t,n){return this._client.post("/v1/organizations/invites",{body:t,...n,__span:$(this._client,"anthropic.organization.invites.create",n,{route:"/v1/organizations/invites",createdIDAttribute:"anthropic.organization.invite.id"})})}retrieve(t,n){return this._client.get(E`/v1/organizations/invites/${t}`,{...n,__span:$(this._client,"anthropic.organization.invites.retrieve",n,{route:"/v1/organizations/invites/{invite_id}",attributes:{"anthropic.organization.invite.id":t}})})}list(t={},n){return this._client.getAPIList("/v1/organizations/invites",gt,{query:t,...n,__span:$(this._client,"anthropic.organization.invites.list",n,{route:"/v1/organizations/invites",queryParams:["after_id","before_id","email","limit","roles","statuses"]})})}delete(t,n){return this._client.delete(E`/v1/organizations/invites/${t}`,{...n,__span:$(this._client,"anthropic.organization.invites.delete",n,{route:"/v1/organizations/invites/{invite_id}",attributes:{"anthropic.organization.invite.id":t}})})}}});var vm,Az=P(()=>{ne();oe();X();vm=class extends N{list(t={},n){return this._client.getAPIList("/v1/organizations/rate_limits",G,{query:t,...n,__span:$(this._client,"anthropic.organization.rate_limits.list",n,{route:"/v1/organizations/rate_limits",queryParams:["group_type","limit","model","page"]})})}}});var _m,Iz=P(()=>{ne();oe();X();me();_m=class extends N{retrieve(t,n){return this._client.get(E`/v1/organizations/users/${t}`,{...n,__span:$(this._client,"anthropic.organization.users.retrieve",n,{route:"/v1/organizations/users/{user_id}",attributes:{"anthropic.organization.user.id":t}})})}update(t,n,r){return this._client.post(E`/v1/organizations/users/${t}`,{body:n,...r,__span:$(this._client,"anthropic.organization.users.update",r,{route:"/v1/organizations/users/{user_id}",attributes:{"anthropic.organization.user.id":t}})})}list(t={},n){return this._client.getAPIList("/v1/organizations/users",gt,{query:t,...n,__span:$(this._client,"anthropic.organization.users.list",n,{route:"/v1/organizations/users",queryParams:["after_id","before_id","email","limit","roles"]})})}remove(t,n){return this._client.delete(E`/v1/organizations/users/${t}`,{...n,__span:$(this._client,"anthropic.organization.users.remove",n,{route:"/v1/organizations/users/{user_id}",attributes:{"anthropic.organization.user.id":t}})})}}});var wm,Rz=P(()=>{ne();oe();X();me();wm=class extends N{create(t,n){return this._client.post("/v1/organizations/federation_issuers",{body:t,...n,__span:$(this._client,"anthropic.organization.federation.issuers.create",n,{route:"/v1/organizations/federation_issuers",createdIDAttribute:"anthropic.organization.federation_issuer.id"})})}retrieve(t,n){return this._client.get(E`/v1/organizations/federation_issuers/${t}`,{...n,__span:$(this._client,"anthropic.organization.federation.issuers.retrieve",n,{route:"/v1/organizations/federation_issuers/{federation_issuer_id}",attributes:{"anthropic.organization.federation_issuer.id":t}})})}update(t,n,r){return this._client.post(E`/v1/organizations/federation_issuers/${t}`,{body:n,...r,__span:$(this._client,"anthropic.organization.federation.issuers.update",r,{route:"/v1/organizations/federation_issuers/{federation_issuer_id}",attributes:{"anthropic.organization.federation_issuer.id":t}})})}list(t={},n){return this._client.getAPIList("/v1/organizations/federation_issuers",G,{query:t,...n,__span:$(this._client,"anthropic.organization.federation.issuers.list",n,{route:"/v1/organizations/federation_issuers",queryParams:["include_archived","limit","page"]})})}archive(t,n){return this._client.post(E`/v1/organizations/federation_issuers/${t}/archive`,{...n,__span:$(this._client,"anthropic.organization.federation.issuers.archive",n,{route:"/v1/organizations/federation_issuers/{federation_issuer_id}/archive",attributes:{"anthropic.organization.federation_issuer.id":t}})})}}});var km,Pz=P(()=>{ne();oe();X();me();km=class extends N{list(t,n={},r){return this._client.getAPIList(E`/v1/organizations/federation_rules/${t}/workspaces`,G,{query:n,...r,__span:$(this._client,"anthropic.organization.federation.rules.workspaces.list",r,{route:"/v1/organizations/federation_rules/{federation_rule_id}/workspaces",queryParams:["limit","page"],attributes:{"anthropic.organization.federation_rule.id":t}})})}add(t,n,r){return this._client.post(E`/v1/organizations/federation_rules/${t}/workspaces`,{body:n,...r,__span:$(this._client,"anthropic.organization.federation.rules.workspaces.add",r,{route:"/v1/organizations/federation_rules/{federation_rule_id}/workspaces",attributes:{"anthropic.organization.federation_rule.id":t},createdIDAttribute:"anthropic.organization.federation_rule.workspace.id",createdIDField:"workspace_id"})})}remove(t,n,r){let{federation_rule_id:i}=n;return this._client.delete(E`/v1/organizations/federation_rules/${i}/workspaces/${t}`,{...r,__span:$(this._client,"anthropic.organization.federation.rules.workspaces.remove",r,{route:"/v1/organizations/federation_rules/{federation_rule_id}/workspaces/{workspace_id}",attributes:{"anthropic.organization.federation_rule.id":i,"anthropic.organization.federation_rule.workspace.id":t}})})}}});var AT,Cz=P(()=>{ne();Pz();Pz();oe();X();me();AT=(()=>{class e extends N{constructor(){super(...arguments),this.workspaces=new km(this._client)}create(n,r){return this._client.post("/v1/organizations/federation_rules",{body:n,...r,__span:$(this._client,"anthropic.organization.federation.rules.create",r,{route:"/v1/organizations/federation_rules",createdIDAttribute:"anthropic.organization.federation_rule.id"})})}retrieve(n,r){return this._client.get(E`/v1/organizations/federation_rules/${n}`,{...r,__span:$(this._client,"anthropic.organization.federation.rules.retrieve",r,{route:"/v1/organizations/federation_rules/{federation_rule_id}",attributes:{"anthropic.organization.federation_rule.id":n}})})}update(n,r,i){return this._client.post(E`/v1/organizations/federation_rules/${n}`,{body:r,...i,__span:$(this._client,"anthropic.organization.federation.rules.update",i,{route:"/v1/organizations/federation_rules/{federation_rule_id}",attributes:{"anthropic.organization.federation_rule.id":n}})})}list(n={},r){return this._client.getAPIList("/v1/organizations/federation_rules",G,{query:n,...r,__span:$(this._client,"anthropic.organization.federation.rules.list",r,{route:"/v1/organizations/federation_rules",queryParams:["include_archived","issuer_id","limit","page"]})})}archive(n,r){return this._client.post(E`/v1/organizations/federation_rules/${n}/archive`,{...r,__span:$(this._client,"anthropic.organization.federation.rules.archive",r,{route:"/v1/organizations/federation_rules/{federation_rule_id}/archive",attributes:{"anthropic.organization.federation_rule.id":n}})})}}return e.Workspaces=km,e})()});var IT,Nz=P(()=>{ne();Rz();Rz();Cz();Cz();IT=(()=>{class e extends N{constructor(){super(...arguments),this.issuers=new wm(this._client),this.rules=new AT(this._client)}}return e.Issuers=wm,e.Rules=AT,e})()});var $m,Oz=P(()=>{ne();oe();X();me();$m=class extends N{list(t,n={},r){return this._client.getAPIList(E`/v1/organizations/service_accounts/${t}/workspaces`,G,{query:n,...r,__span:$(this._client,"anthropic.organization.service_accounts.workspaces.list",r,{route:"/v1/organizations/service_accounts/{service_account_id}/workspaces",queryParams:["limit","page"],attributes:{"anthropic.organization.service_account.id":t}})})}add(t,n,r){return this._client.post(E`/v1/organizations/service_accounts/${t}/workspaces`,{body:n,...r,__span:$(this._client,"anthropic.organization.service_accounts.workspaces.add",r,{route:"/v1/organizations/service_accounts/{service_account_id}/workspaces",attributes:{"anthropic.organization.service_account.id":t},createdIDAttribute:"anthropic.organization.service_account.workspace.id",createdIDField:"workspace_id"})})}remove(t,n,r){let{service_account_id:i}=n;return this._client.delete(E`/v1/organizations/service_accounts/${i}/workspaces/${t}`,{...r,__span:$(this._client,"anthropic.organization.service_accounts.workspaces.remove",r,{route:"/v1/organizations/service_accounts/{service_account_id}/workspaces/{workspace_id}",attributes:{"anthropic.organization.service_account.id":i,"anthropic.organization.service_account.workspace.id":t}})})}}});var RT,Dz=P(()=>{ne();Oz();Oz();oe();X();me();RT=(()=>{class e extends N{constructor(){super(...arguments),this.workspaces=new $m(this._client)}create(n,r){return this._client.post("/v1/organizations/service_accounts",{body:n,...r,__span:$(this._client,"anthropic.organization.service_accounts.create",r,{route:"/v1/organizations/service_accounts",createdIDAttribute:"anthropic.organization.service_account.id"})})}retrieve(n,r){return this._client.get(E`/v1/organizations/service_accounts/${n}`,{...r,__span:$(this._client,"anthropic.organization.service_accounts.retrieve",r,{route:"/v1/organizations/service_accounts/{service_account_id}",attributes:{"anthropic.organization.service_account.id":n}})})}update(n,r,i){return this._client.post(E`/v1/organizations/service_accounts/${n}`,{body:r,...i,__span:$(this._client,"anthropic.organization.service_accounts.update",i,{route:"/v1/organizations/service_accounts/{service_account_id}",attributes:{"anthropic.organization.service_account.id":n}})})}list(n={},r){return this._client.getAPIList("/v1/organizations/service_accounts",G,{query:n,...r,__span:$(this._client,"anthropic.organization.service_accounts.list",r,{route:"/v1/organizations/service_accounts",queryParams:["include_archived","limit","page"]})})}archive(n,r){return this._client.post(E`/v1/organizations/service_accounts/${n}/archive`,{...r,__span:$(this._client,"anthropic.organization.service_accounts.archive",r,{route:"/v1/organizations/service_accounts/{service_account_id}/archive",attributes:{"anthropic.organization.service_account.id":n}})})}}return e.Workspaces=$m,e})()});var Sm,Mz=P(()=>{ne();oe();X();me();Sm=class extends N{retrieve(t,n,r){let{workspace_id:i}=n;return this._client.get(E`/v1/organizations/workspaces/${i}/members/${t}`,{...r,__span:$(this._client,"anthropic.organization.workspaces.members.retrieve",r,{route:"/v1/organizations/workspaces/{workspace_id}/members/{user_id}",attributes:{"anthropic.organization.workspace.id":i,"anthropic.organization.workspace.member.id":t}})})}update(t,n,r){let{workspace_id:i,...o}=n;return this._client.post(E`/v1/organizations/workspaces/${i}/members/${t}`,{body:o,...r,__span:$(this._client,"anthropic.organization.workspaces.members.update",r,{route:"/v1/organizations/workspaces/{workspace_id}/members/{user_id}",attributes:{"anthropic.organization.workspace.id":i,"anthropic.organization.workspace.member.id":t}})})}list(t,n={},r){return this._client.getAPIList(E`/v1/organizations/workspaces/${t}/members`,gt,{query:n,...r,__span:$(this._client,"anthropic.organization.workspaces.members.list",r,{route:"/v1/organizations/workspaces/{workspace_id}/members",queryParams:["after_id","before_id","limit"],attributes:{"anthropic.organization.workspace.id":t}})})}add(t,n,r){return this._client.post(E`/v1/organizations/workspaces/${t}/members`,{body:n,...r,__span:$(this._client,"anthropic.organization.workspaces.members.add",r,{route:"/v1/organizations/workspaces/{workspace_id}/members",attributes:{"anthropic.organization.workspace.id":t},createdIDAttribute:"anthropic.organization.workspace.member.id",createdIDField:"user_id"})})}remove(t,n,r){let{workspace_id:i}=n;return this._client.delete(E`/v1/organizations/workspaces/${i}/members/${t}`,{...r,__span:$(this._client,"anthropic.organization.workspaces.members.remove",r,{route:"/v1/organizations/workspaces/{workspace_id}/members/{user_id}",attributes:{"anthropic.organization.workspace.id":i,"anthropic.organization.workspace.member.id":t}})})}}});var xm,Lz=P(()=>{ne();oe();X();me();xm=class extends N{list(t,n={},r){return this._client.getAPIList(E`/v1/organizations/workspaces/${t}/rate_limits`,G,{query:n,...r,__span:$(this._client,"anthropic.organization.workspaces.rate_limits.list",r,{route:"/v1/organizations/workspaces/{workspace_id}/rate_limits",queryParams:["group_type","include_inherited","limit","page"],attributes:{"anthropic.organization.workspace.id":t}})})}}});var Em,Fz=P(()=>{ne();oe();X();me();Em=class extends N{retrieve(t,n,r){let{workspace_id:i}=n;return this._client.get(E`/v1/organizations/workspaces/${i}/service_accounts/${t}`,{...r,__span:$(this._client,"anthropic.organization.workspaces.service_accounts.retrieve",r,{route:"/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}",attributes:{"anthropic.organization.workspace.id":i,"anthropic.organization.workspace.service_account.id":t}})})}update(t,n,r){let{workspace_id:i,...o}=n;return this._client.post(E`/v1/organizations/workspaces/${i}/service_accounts/${t}`,{body:o,...r,__span:$(this._client,"anthropic.organization.workspaces.service_accounts.update",r,{route:"/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}",attributes:{"anthropic.organization.workspace.id":i,"anthropic.organization.workspace.service_account.id":t}})})}list(t,n={},r){return this._client.getAPIList(E`/v1/organizations/workspaces/${t}/service_accounts`,G,{query:n,...r,__span:$(this._client,"anthropic.organization.workspaces.service_accounts.list",r,{route:"/v1/organizations/workspaces/{workspace_id}/service_accounts",queryParams:["limit","page"],attributes:{"anthropic.organization.workspace.id":t}})})}add(t,n,r){return this._client.post(E`/v1/organizations/workspaces/${t}/service_accounts`,{body:n,...r,__span:$(this._client,"anthropic.organization.workspaces.service_accounts.add",r,{route:"/v1/organizations/workspaces/{workspace_id}/service_accounts",attributes:{"anthropic.organization.workspace.id":t},createdIDAttribute:"anthropic.organization.workspace.service_account.id",createdIDField:"service_account_id"})})}remove(t,n,r){let{workspace_id:i}=n;return this._client.delete(E`/v1/organizations/workspaces/${i}/service_accounts/${t}`,{...r,__span:$(this._client,"anthropic.organization.workspaces.service_accounts.remove",r,{route:"/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}",attributes:{"anthropic.organization.workspace.id":i,"anthropic.organization.workspace.service_account.id":t}})})}}});var PT,Uz=P(()=>{ne();Mz();Mz();Lz();Lz();Fz();Fz();oe();X();me();PT=(()=>{class e extends N{constructor(){super(...arguments),this.rateLimits=new xm(this._client),this.members=new Sm(this._client),this.serviceAccounts=new Em(this._client)}create(n,r){return this._client.post("/v1/organizations/workspaces",{body:n,...r,__span:$(this._client,"anthropic.organization.workspaces.create",r,{route:"/v1/organizations/workspaces",createdIDAttribute:"anthropic.organization.workspace.id"})})}retrieve(n,r){return this._client.get(E`/v1/organizations/workspaces/${n}`,{...r,__span:$(this._client,"anthropic.organization.workspaces.retrieve",r,{route:"/v1/organizations/workspaces/{workspace_id}",attributes:{"anthropic.organization.workspace.id":n}})})}update(n,r,i){return this._client.post(E`/v1/organizations/workspaces/${n}`,{body:r,...i,__span:$(this._client,"anthropic.organization.workspaces.update",i,{route:"/v1/organizations/workspaces/{workspace_id}",attributes:{"anthropic.organization.workspace.id":n}})})}list(n={},r){return this._client.getAPIList("/v1/organizations/workspaces",gt,{query:n,...r,__span:$(this._client,"anthropic.organization.workspaces.list",r,{route:"/v1/organizations/workspaces",queryParams:["after_id","before_id","include_archived","include_default","limit"]})})}archive(n,r){return this._client.post(E`/v1/organizations/workspaces/${n}/archive`,{...r,__span:$(this._client,"anthropic.organization.workspaces.archive",r,{route:"/v1/organizations/workspaces/{workspace_id}/archive",attributes:{"anthropic.organization.workspace.id":n}})})}}return e.RateLimits=xm,e.Members=Sm,e.ServiceAccounts=Em,e})()});var iv,jz=P(()=>{ne();Sz();Sz();xz();xz();Ez();Ez();Tz();Tz();Az();Az();Iz();Iz();Nz();Nz();Dz();Dz();Uz();Uz();X();iv=(()=>{class e extends N{constructor(){super(...arguments),this.apiKeys=new gm(this._client),this.externalKeys=new ym(this._client),this.federation=new IT(this._client),this.invites=new bm(this._client),this.serviceAccounts=new RT(this._client),this.users=new _m(this._client),this.workspaces=new PT(this._client),this.rateLimits=new vm(this._client),this.complianceSettings=new hm(this._client)}retrieve(n){return this._client.get("/v1/organizations/me",{...n,__span:$(this._client,"anthropic.organization.retrieve",n,{route:"/v1/organizations/me"})})}}return e.APIKeys=gm,e.ExternalKeys=ym,e.Federation=IT,e.Invites=bm,e.ServiceAccounts=RT,e.Users=_m,e.Workspaces=PT,e.RateLimits=vm,e.ComplianceSettings=hm,e})()});var Tm,zz=P(()=>{ne();oe();$e();X();hi();me();Tm=class extends N{create(t,n,r){let{workspace_id:i,...o}=n;return this._client.post(E`/v1/skills/${t}/versions`,Nn({body:o,...r,headers:T([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),__span:$(this._client,"anthropic.skills.versions.create",r,{route:"/v1/skills/{skill_id}/versions",attributes:{"anthropic.skill.id":t},createdIDAttribute:"anthropic.skill.version.id"})},this._client,!1))}retrieve(t,n,r){let{skill_id:i,workspace_id:o}=n;return this._client.get(E`/v1/skills/${i}/versions/${t}`,{...r,headers:T([{...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.skills.versions.retrieve",r,{route:"/v1/skills/{skill_id}/versions/{version}",attributes:{"anthropic.skill.id":i,"anthropic.skill.version.id":t}})})}list(t,n={},r){let{workspace_id:i,...o}=n??{};return this._client.getAPIList(E`/v1/skills/${t}/versions`,G,{query:o,...r,headers:T([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),__span:$(this._client,"anthropic.skills.versions.list",r,{route:"/v1/skills/{skill_id}/versions",queryParams:["limit","page"],attributes:{"anthropic.skill.id":t}})})}delete(t,n,r){let{skill_id:i,workspace_id:o}=n;return this._client.delete(E`/v1/skills/${i}/versions/${t}`,{...r,headers:T([{...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__span:$(this._client,"anthropic.skills.versions.delete",r,{route:"/v1/skills/{skill_id}/versions/{version}",attributes:{"anthropic.skill.id":i,"anthropic.skill.version.id":t}})})}}});var ov,Gz=P(()=>{ne();zz();zz();oe();$e();X();hi();me();ov=(()=>{class e extends N{constructor(){super(...arguments),this.versions=new Tm(this._client)}create(n,r){let{workspace_id:i,...o}=n;return this._client.post("/v1/skills",Nn({body:o,...r,headers:T([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),__span:$(this._client,"anthropic.skills.create",r,{route:"/v1/skills",createdIDAttribute:"anthropic.skill.id"})},this._client,!1))}retrieve(n,r={},i){let{workspace_id:o}=r??{};return this._client.get(E`/v1/skills/${n}`,{...i,headers:T([{...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),__span:$(this._client,"anthropic.skills.retrieve",i,{route:"/v1/skills/{skill_id}",attributes:{"anthropic.skill.id":n}})})}list(n={},r){let{workspace_id:i,...o}=n??{};return this._client.getAPIList("/v1/skills",G,{query:o,...r,headers:T([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),__span:$(this._client,"anthropic.skills.list",r,{route:"/v1/skills",queryParams:["limit","page","source"]})})}delete(n,r={},i){let{workspace_id:o}=r??{};return this._client.delete(E`/v1/skills/${n}`,{...i,headers:T([{...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),__span:$(this._client,"anthropic.skills.delete",i,{route:"/v1/skills/{skill_id}",attributes:{"anthropic.skill.id":n}})})}}return e.Versions=Tm,e})()});var Poe=P(()=>{_re();rU();_z();wz();kz();$z();jz();Gz()});var Bz,Vz,CT,wu,Coe,qz,Wz,Hz,Kz,NT=P(()=>{sr();Gi();Cp();Ds();WS();KS();Vl();LL();X();fF();Zo();Ly();at();Up();ane();Hr();pre();hre();oe();jF();Poe();Vx();wz();kz();$z();_z();rU();jz();Gz();WS();$e();Wl();qn();Gi();qz="\\n\\nHuman:",Wz="\\n\\nAssistant:",Hz=(()=>{class e{get credentials(){return this._authState.provider}get openTelemetry(){return y(this,wu,"f")}_instrumentationScope(){return{version:ui}}constructor({baseURL:n=je("ANTHROPIC_BASE_URL"),apiKey:r,authToken:i,webhookKey:o=je("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(Bz.add(this),this._requestAuthFlags=new WeakMap,CT.set(this,void 0),wu.set(this,void 0),this._genAIProviderName="anthropic",r===void 0&&(r=s.profile!=null?null:je("ANTHROPIC_API_KEY")??null),i===void 0&&(i=s.profile!=null?null:je("ANTHROPIC_AUTH_TOKEN")??null),s.profile!=null&&(s.credentials!=null||s.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let a={apiKey:r,authToken:i,webhookKey:o,...s,baseURL:n||"https://api.anthropic.com"};if(!a.dangerouslyAllowBrowser&&jee())throw new Q(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); -`);this.baseURL=s.baseURL,this._baseURLIsExplicit=o.__baseURLIsExplicit??!!t,this.timeout=s.timeout??_F.DEFAULT_TIMEOUT,this.logger=s.logger??console,this.logLevel=Oh,this.logLevel=E_(s.logLevel,"ClientOptions.logLevel",qe(this))??E_(ze("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",qe(this))??Oh,this.fetchOptions=s.fetchOptions,this.maxRetries=d_("maxRetries",s.maxRetries??2),this.fetch=s.fetch??$5(),M(this,VS,S5,"f"),this.middleware=[...s.middleware??[]];let a=ze("ANTHROPIC_CUSTOM_HEADERS");if(a){let l={};for(let u of a.split(` -`)){let d=u.indexOf(":");d>=0&&(l[u.substring(0,d).trim()]=u.substring(d+1).trim())}s.defaultHeaders={...l,...s.defaultHeaders}}let c=o.__auth;if(delete s.__auth,delete s.__baseURLIsExplicit,this._options=s,this.apiKey=typeof n=="string"?n:null,this.authToken=i,this.webhookKey=r,c)this._authState=c,!this._baseURLIsExplicit&&c.baseURL&&(this.baseURL=c.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let l=s.credentials??null;if(l)this._authState.provider=l,this._authState.tokenCache=this._makeTokenCache(l);else if(s.config!=null){let u=pM(s.config,this._credentialResolverOptions());this._authState.provider=u.provider,this._authState.tokenCache=this._makeTokenCache(u.provider),this._authState.extraHeaders=u.extraHeaders,this._applyCredentialBaseURL(u.baseURL)}else s.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(s.profile):this._shouldResolveDefaultCredentials()&&(this._authState.resolution=this._resolveDefaultCredentials())}}_shouldResolveDefaultCredentials(){return!0}_applyCredentialBaseURL(t){if(!t)return;let n=t.replace(/\/+$/,"");this._authState.baseURL=n,this._baseURLIsExplicit||(this.baseURL=n)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:t=>{qe(this).debug("credential cache write failed (best-effort)",t)},onSafetyWarning:t=>{qe(this).warn(t)}}}_credentialsFetch(){return hM(this.fetch,this.middleware,void 0,this)}_makeTokenCache(t){return new __(t,n=>{qe(this).debug("advisory token refresh failed; serving cached token",n)})}withOptions(t){let n="credentials"in t||"config"in t||"profile"in t,i="apiKey"in t||"authToken"in t||n,r={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,middleware:this.middleware,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...n?{credentials:void 0,config:void 0,profile:void 0}:{},...t,__auth:i?void 0:this._authState,__baseURLIsExplicit:"baseURL"in t?!0:this._baseURLIsExplicit};return new this.constructor(r)}async _resolveDefaultCredentials(t){try{let n=await sQ(this._credentialResolverOptions(),t);if(n)this._authState.provider=n.provider,this._authState.tokenCache=this._makeTokenCache(n.provider),this._authState.extraHeaders=n.extraHeaders,this._applyCredentialBaseURL(n.baseURL);else if(t!=null)throw new J(`Profile "${t}" could not be resolved (no /configs/${t}.json found).`)}catch(n){this._authState.error=n}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:n}){if(!(t.get("x-api-key")||t.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&t.get("x-api-key"))&&!n.has("x-api-key")&&!(this.authToken&&t.get("authorization"))&&!n.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(t){let n=this._requestAuthFlags.get(t);return n||(n={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(t,n)),n}async authHeaders(t){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let n=await this._authState.tokenCache.getToken();return this._authFlags(t).usedTokenCache=!0,I([{Authorization:`Bearer ${n}`}])}return I([await this.apiKeyAuth(t),await this.bearerAuth(t)])}}async apiKeyAuth(t){if(this.apiKey!=null)return I([{"X-Api-Key":this.apiKey}])}async bearerAuth(t){if(this.authToken!=null)return I([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(t){return O5(t)}getUserAgent(){return`Anthropic/JS ${Si}`}makeStatusError(t,n,i,r){return Dt.generate(t,n,i,r)}buildURL(t,n,i){let r=!v(this,$F,"m",i7).call(this)&&i||this.baseURL,o=f5(t)?new URL(t):new URL(r+(r.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),s=this.defaultQuery(),a=Object.fromEntries(o.searchParams);return(!VO(s)||!VO(a))&&(n={...a,...s,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(o.search=this.stringifyQuery(n)),o.toString()}_calculateNonstreamingTimeout(t){if(3600*t/128e3>600)throw new J("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(t){}async prepareRequest(t,{url:n,options:i}){if(this._authState.tokenCache&&this.apiKey==null){let r=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(let[s,a]of Object.entries(this._authState.extraHeaders))r.has(s)||r.set(s,a);r.get("anthropic-beta")?.split(",").map(s=>s.trim())?.includes(_l)||r.append("anthropic-beta",_l),t.headers=r}}backendMiddleware(){return[]}get(t,n){return this.methodRequest("get",t,n)}post(t,n){return this.methodRequest("post",t,n)}patch(t,n){return this.methodRequest("patch",t,n)}put(t,n){return this.methodRequest("put",t,n)}delete(t,n){return this.methodRequest("delete",t,n)}methodRequest(t,n,i){return this.request(Promise.resolve(i).then(r=>({method:t,path:n,...r})))}request(t,n=null){return new La(this,this.makeRequest(t,n,void 0))}async makeRequest(t,n,i){let r=await t,o=d_("maxRetries",r.maxRetries??this.maxRetries);n==null&&(n=o,this._requestAuthFlags.delete(r)),await this.prepareOptions(r);let{req:s,url:a,timeout:c}=await this.buildRequest(r,{retryCount:o-n}),l="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),u=i===void 0?"":`, retryOf: ${i}`,d=Date.now();if(r.signal?.aborted)throw new In;let p=new AbortController,f=await this.fetchWithTimeout(a,s,c,p,r,{requestLogID:l,retryOfRequestLogID:i}).catch(pl),m=Date.now();if(f instanceof globalThis.Error){Co(p);let b=`retrying, ${n} attempts remaining`;if(r.signal?.aborted)throw new In;let y=Yr(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):"")),w=this.middleware.length>0||!!r.middleware?.length||this.backendMiddleware().length>0;if(w&&!y&&!pQ(f))throw qe(this).info(`[${l}] middleware error (not retryable)`),qe(this).debug(`[${l}] middleware error (not retryable)`,Oo({retryOfRequestLogID:i,url:a,durationMs:m-d,message:f.message})),f;if(n)return qe(this).info(`[${l}] connection ${y?"timed out":"failed"} - ${b}`),qe(this).debug(`[${l}] connection ${y?"timed out":"failed"} (${b})`,Oo({retryOfRequestLogID:i,url:a,durationMs:m-d,message:f.message})),this.retryRequest(r,n,i??l);throw qe(this).info(`[${l}] connection ${y?"timed out":"failed"} - error; no more retries left`),qe(this).debug(`[${l}] connection ${y?"timed out":"failed"} (error; no more retries left)`,Oo({retryOfRequestLogID:i,url:a,durationMs:m-d,message:f.message})),y?new fl:w&&!gM(f)?f:new Zi({cause:f})}let g=[...f.headers.entries()].filter(([b])=>b==="request-id"||b==="anthropic-workspace-id").map(([b,y])=>", "+b+": "+JSON.stringify(y)).join(""),h=`[${l}${u}${g}] ${s.method} ${a} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${m-d}ms`;if(!f.ok){let b=await this.shouldRetry(f,r);if(n&&b){let x=`retrying, ${n} attempts remaining`;return await _5(f.body),Co(p),qe(this).info(`${h} - ${x}`),qe(this).debug(`[${l}] response error (${x})`,Oo({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,durationMs:m-d})),this.retryRequest(r,n,i??l,f.headers)}let y=b?"error; no more retries left":"error; not retryable";qe(this).info(`${h} - ${y}`);let w=await f.text().catch(x=>pl(x).message),k=$l(w),_=k?void 0:w;throw qe(this).debug(`[${l}] response error (${y})`,Oo({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,message:_,durationMs:Date.now()-d})),Co(p),this.makeStatusError(f.status,k,_,f.headers)}return qe(this).info(h),qe(this).debug(`[${l}] response start`,Oo({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,durationMs:m-d})),k5(f.body??f,p),{response:f,options:r,controller:p,requestLogID:l,retryOfRequestLogID:i,startTime:d}}getAPIList(t,n,i){return this.requestAPIList(n,i&&"then"in i?i.then(r=>({method:"get",path:t,...r})):{method:"get",path:t,...i})}requestAPIList(t,n){let i=this.makeRequest(n,null,void 0);return new fp(this,i,t)}async fetchWithTimeout(t,n,i,r,o,s){let{signal:a,method:c,...l}=n||{},u=this._makeAbort(r);a&&(a.addEventListener("abort",u,{once:!0}),w5(r,a,u));let d=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,p={signal:r.signal,...d?{duplex:"half"}:{},method:"GET",...l};c&&(p.method=c.toUpperCase());let f=this.fetch,m=async(w,k)=>{let _=setTimeout(u,i);try{return await f.call(void 0,w,k)}finally{clearTimeout(_)}},g=o===void 0?m:(async(w,k={})=>{let _=typeof w=="string"?w:w instanceof URL?w.href:w.url;return k.headers=k.headers instanceof Headers?k.headers:new Headers(k.headers),await this.prepareRequest(k,{url:_,options:o}),s&&qe(this).debug(`[${s.requestLogID}] sending request`,Oo({retryOfRequestLogID:s.retryOfRequestLogID,method:k.method,url:_,options:o,headers:k.headers})),m(w,k)}),h=o?.middleware,b=this.backendMiddleware(),y=h?.length||b.length?[...this.middleware,...h??[],...b]:this.middleware;return await hM(g,y,o,this)(t,p)}async shouldRetry(t,n){let i=this._authFlags(n);if(t.status===401&&this._authState.tokenCache&&i.usedTokenCache&&!i.didRefreshFor401)return i.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let r=t.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,n,i,r){let o,s=r?.get("retry-after-ms");if(s){let c=parseFloat(s);Number.isNaN(c)||(o=c)}let a=r?.get("retry-after");if(a&&!o){let c=parseFloat(a);Number.isNaN(c)?o=Date.parse(a)-Date.now():o=c*1e3}if(o===void 0||!(o>0&&o<=2**31-1)){let c=t.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(n,c)}return await Yi(o),this.makeRequest(t,n-1,i)}calculateDefaultRetryTimeoutMillis(t,n){let o=n-t,s=Math.min(.5*Math.pow(2,o),8),a=1-Math.random()*.25;return s*a*1e3}calculateNonstreamingTimeout(t,n){if(36e5*t/128e3>6e5||n!=null&&t>n)throw new J("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(t,{retryCount:n=0}={}){let i={...t},{method:r,path:o,query:s,defaultBaseURL:a}=i;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let c=this.buildURL(o,s,a);"timeout"in i&&d_("timeout",i.timeout),i.timeout=i.timeout??this.timeout;let{bodyHeaders:l,body:u}=this.buildBody({options:i}),d=await this.buildHeaders({options:t,method:r,bodyHeaders:l,retryCount:n});return{req:{method:r,headers:d,...i.signal&&{signal:i.signal},...globalThis.ReadableStream&&u instanceof globalThis.ReadableStream&&{duplex:"half"},...u&&{body:u},...this.fetchOptions??{},...i.fetchOptions??{}},url:c,timeout:i.timeout}}async buildHeaders({options:t,method:n,bodyHeaders:i,retryCount:r}){let o=I([{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{},...Rh(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(t),this._options.defaultHeaders,i,t.headers]);return this.validateHeaders(o),o.values}_makeAbort(t){return()=>t.abort()}buildBody({options:{body:t,headers:n}}){if(!t)return{bodyHeaders:void 0,body:void 0};let i=I([n]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&i.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:g_(t)}:typeof t=="object"&&i.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(t)}:v(this,VS,"f").call(this,{body:t,headers:i})}};_F=Ot,VS=new WeakMap,$F=new WeakSet,i7=function(){return this.baseURL!=="https://api.anthropic.com"};Ot.Anthropic=_F;Ot.HUMAN_PROMPT=SF;Ot.AI_PROMPT=xF;Ot.DEFAULT_TIMEOUT=6e5;Ot.AnthropicError=J;Ot.APIError=Dt;Ot.APIConnectionError=Zi;Ot.APIConnectionTimeoutError=fl;Ot.APIUserAbortError=In;Ot.NotFoundError=yl;Ot.ConflictError=bl;Ot.RateLimitError=wl;Ot.BadRequestError=ml;Ot.AuthenticationError=gl;Ot.InternalServerError=kl;Ot.PermissionDeniedError=hl;Ot.UnprocessableEntityError=vl;Ot.toFile=Gh;no=class extends Ot{constructor(){super(...arguments),this.completions=new Kl(this),this.messages=new tc(this),this.models=new Yl(this),this.files=new Jl(this),this.skills=new nc(this),this.beta=new jt(this)}};no.Completions=Kl;no.Messages=tc;no.Models=Yl;no.Files=Jl;no.Skills=nc;no.Beta=jt});function TOe(e){let t=e.messages.flatMap(n=>{if(!Array.isArray(n.content))return[n];let i=n.content.filter(r=>r.type!=="fallback");return i.length===n.content.length?[n]:i.length>0?[{...n,content:i}]:[]});return{...e,messages:t}}function o7(e,t){let n={...e};for(let[i,r]of Object.entries(t))if(i==="output_config"&&r!=null){let o={...n[i]??{}};for(let[s,a]of Object.entries(r))TF(o,s,a);TF(n,i,Object.keys(o).length?o:null)}else TF(n,i,r);return n}function TF(e,t,n){n!==void 0&&(n===null?delete e[t]:e[t]=n)}function u7(e,t={}){let n=!1;return async(i,r,o)=>{let[s,a]=(o.options?.path??"").split("?");if(e.length===0||o.options?.method!=="post"||s!=="/v1/messages"||new URLSearchParams(a).get("beta")!=="true"||typeof o.options.body!="object"||o.options.body==null)return r(i);if(o.options.body.fallbacks!=null)throw new J("Sending the `fallbacks:` request param is not supported when using the `betaRefusalFallbackMiddleware`. You should either remove the middleware and send `fallbacks:` with the `server-side-fallback-2026-07-01` beta header to let the API handle refusal fallbacks, or omit the `fallbacks:` param if you'd like `betaRefusalFallbackMiddleware` to handle fallbacks on the client side.");let c=t.onError??(S=>o.logger.error(`anthropic-sdk: betaRefusalFallbackMiddleware: ${S.message}`));i=COe(i,t.betas??EOe);let l=TOe(o.options.body),u=o.options.fallbackState,d=u?.index??-1;if(!Number.isInteger(d)||d<-1||d>=e.length)throw new J(`fallbackState.index ${d} is out of bounds for a chain of ${e.length} fallback(s); was the state shared with a different middleware?`);let p=S=>{u?u.index=S:n||(n=!0,o.logger.warn("anthropic-sdk: betaRefusalFallbackMiddleware fell back without a `fallbackState` request option; follow-up requests will retry models that already refused. Pass a shared `{ fallbackState: new BetaFallbackState() }` to pin them to the accepted model."))},f=d===-1?l:o7(l,e[d]),m=typeof i.body!="string"?i:{...i,body:JSON.stringify(f)},g=await r(m);if(!g.ok)return g;if(o.options.stream===!0){let S=d+1;return S>=e.length||typeof m.body!="string"?g:IOe({request:m,response:g,next:r,ctx:o,fallbacks:e,firstHop:S,onError:c,pin:p})}let h=d,b=g,y=f.model,w=[];for(;hnull);if(L===0&&E.status===400&&f.length){i.logger.warn(`anthropic-sdk: betaRefusalFallbackMiddleware: fallback request with the partial output appended was rejected (HTTP 400: ${JSON.stringify(K)}); retrying without it`),x=p,E=null;continue}T={kind:"request_failed",message:`fallback request failed: HTTP ${E.status}: ${JSON.stringify(K)}`,model:k,status:E.status,detail:K};break}if(T){if(s(T),_)continue;let L={...h,recommended_model:k};yield $s("message_delta",{type:"message_delta",context_management:null,delta:{stop_reason:"refusal",stop_sequence:null,container:null,stop_details:L},usage:g??{},...b!==void 0&&{input_transformations:b}}),yield $s("message_stop",{type:"message_stop"});return}let A=yield*s7({response:E,controller:c,indexBase:u,hasNext:_,onError:s,splice:{iterations:y,model:k}});if(!A.refused)return;d=A.refused.token,h=A.refused.stopDetails,b=A.refused.inputTransformations,p=x,f=A.refused.hasPrefillClaim?a7(A.blocks):[],y.push(AF("message",k,A.refused.usage)),g=A.refused.usage,m=k,u=A.nextIndex}}async function*s7(e){let{response:t,controller:n,indexBase:i,hasNext:r,onError:o,splice:s}=e,a=new IF(i),c,l=null,u;for await(let d of Fr.rawEvents(t,n)){let p=$l(d.data);switch(p?.type){case"message_start":{if(c=p.message.model,l=p.message.usage,"input_transformations"in p.message&&(u=p.message.input_transformations),s)continue;break}case"content_block_start":{if(a.start(p),s){yield $s(p.type,p);continue}break}case"content_block_delta":{if(a.delta(p),s){yield $s(p.type,p);continue}break}case"content_block_stop":{if(a.stop(p),s){yield $s(p.type,p);continue}break}case"message_delta":{if(p.delta.stop_reason==="refusal"){let f=p.delta.stop_details?.type==="refusal"?p.delta.stop_details:null;if(f?.fallback_credit_token&&r){let m=c7(p.usage,l);return yield*a.closeOpenBlocks(),{refused:{token:f.fallback_credit_token,hasPrefillClaim:f.fallback_has_prefill_claim===!0,usage:m,stopDetails:f,inputTransformations:s?u:void 0},model:c,blocks:a.contentBlocks(),nextIndex:a.nextIndex}}f?.fallback_credit_token?o({kind:"chain_exhausted",message:"refusal but no fallback entries remain",event:p}):o({kind:"no_credit_token",message:"refusal stop_details has no fallback_credit_token",event:p})}if(s){let f=c7(p.usage,l);f.iterations=[...s.iterations,AF("fallback_message",s.model,f)],p.usage=f,!("input_transformations"in p)&&u!==void 0&&(p.input_transformations=u),yield $s("message_delta",p);continue}break}}yield POe(d)}return{refused:null,model:c,blocks:a.contentBlocks(),nextIndex:a.nextIndex}}function d7(e){return{token:e,mode:"best_effort"}}function ROe(e,{model:t,creditToken:n,continuation:i}){let r=JSON.parse(e.body);return r.model=t,r.fallback_credit_token=d7(n),i.length&&(r.messages=[...r.messages,{role:"assistant",content:i}]),{...e,headers:new Headers(e.headers),body:JSON.stringify(r)}}function NOe(e,t,n){let i=e.find(r=>r.index===t)?.block;if(i)switch(n.type){case"text_delta":{i.text=(i.text??"")+n.text;break}case"input_json_delta":{i._partial_json=(i._partial_json??"")+n.partial_json;break}case"citations_delta":(i.citations??(i.citations=[])).push(n.citation);break;case"thinking_delta":{i.thinking=(i.thinking??"")+n.thinking;break}case"signature_delta":{i.signature=n.signature;break}case"compaction_delta":break;default:}}function a7(e){return e.map(t=>{if(typeof t?._partial_json!="string")return t;let{_partial_json:n,...i}=t;return{...i,input:$l(n)??i.input}})}function COe(e,t){let n=new Headers(e.headers),i=new Set(n.get("anthropic-beta")?.split(",").map(r=>r.trim()));for(let r of t)i.has(r)||(n.append("anthropic-beta",r),i.add(r));return n.set(Mo,$M(n.get(Mo),"fallback-refusal-middleware")),{...e,headers:n}}function $s(e,t){let n={event:e,data:JSON.stringify(t),raw:[]};return l7.encode(p7(n))}function POe(e){return l7.encode(e.raw.length?e.raw.join(` +`);this.baseURL=a.baseURL,this._baseURLIsExplicit=s.__baseURLIsExplicit??!!n,this.timeout=a.timeout??Vz.DEFAULT_TIMEOUT,this.logger=a.logger??console,this.logLevel=Zy,this.logLevel=gx(a.logLevel,"ClientOptions.logLevel",Te(this))??gx(je("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",Te(this))??Zy,this.fetchOptions=a.fetchOptions,this.maxRetries=qS("maxRetries",a.maxRetries??2);let c=this._instrumentationScope();O(this,wu,Lte(a.openTelemetry),"f"),a.openTelemetry=y(this,wu,"f"),this._tracer=nt(this,()=>Fte(y(this,wu,"f"),c.version,c.platform)),this.fetch=a.fetch??qee(),O(this,CT,Wee,"f"),this.middleware=[...a.middleware??[]];let l=je("ANTHROPIC_CUSTOM_HEADERS");if(l){let d={};for(let p of l.split(` +`)){let f=p.indexOf(":");f>=0&&(d[p.substring(0,f).trim()]=p.substring(f+1).trim())}a.defaultHeaders={...d,...a.defaultHeaders}}let u=s.__auth;if(delete a.__auth,delete a.__baseURLIsExplicit,this._options=a,this.apiKey=typeof r=="string"?r:null,this.authToken=i,this.webhookKey=o,u)this._authState=u,!this._baseURLIsExplicit&&u.baseURL&&(this.baseURL=u.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let d=a.credentials??null;if(d)this._authState.provider=d,this._authState.tokenCache=this._makeTokenCache(d);else if(a.config!=null){let p=NF(a.config,this._credentialResolverOptions());this._authState.provider=p.provider,this._authState.tokenCache=this._makeTokenCache(p.provider),this._authState.extraHeaders=p.extraHeaders,this._applyCredentialBaseURL(p.baseURL)}else a.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(a.profile):this._shouldResolveDefaultCredentials()&&(this._authState.resolution=this._resolveDefaultCredentials())}}_shouldResolveDefaultCredentials(){return!0}_applyCredentialBaseURL(n){if(!n)return;let r=n.replace(/\/+$/,"");this._authState.baseURL=r,this._baseURLIsExplicit||(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:n=>{Te(this).debug("credential cache write failed (best-effort)",n)},onSafetyWarning:n=>{Te(this).warn(n)}}}_credentialsFetch(){return DF(this.fetch,this.middleware,void 0,this)}_makeTokenCache(n){return new Ex(n,r=>{Te(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(n){let r="credentials"in n||"config"in n||"profile"in n,i="apiKey"in n||"authToken"in n||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,middleware:this.middleware,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...n,openTelemetry:n.openTelemetry??y(this,wu,"f"),__auth:i?void 0:this._authState,__baseURLIsExplicit:"baseURL"in n?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(n){try{let r=await dre(this._credentialResolverOptions(),n);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(n!=null)throw new Q(`Profile "${n}" could not be resolved (no /configs/${n}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:n,nulls:r}){if(!(n.get("x-api-key")||n.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&n.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&n.get("authorization"))&&!r.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(n){let r=this._requestAuthFlags.get(n);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(n,r)),r}async authHeaders(n){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(n).usedTokenCache=!0,T([{Authorization:`Bearer ${r}`}])}return T([await this.apiKeyAuth(n),await this.bearerAuth(n)])}}async apiKeyAuth(n){if(this.apiKey!=null)return T([{"X-Api-Key":this.apiKey}])}async bearerAuth(n){if(this.authToken!=null)return T([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(n){return ene(n)}getUserAgent(){return`Anthropic/JS ${ui}`}makeStatusError(n,r,i,o){return _t.generate(n,r,i,o)}buildURL(n,r,i){let o=!y(this,Bz,"m",Coe).call(this)&&i||this.baseURL,s=Dee(n)?new URL(n):new URL(o+(o.endsWith("/")&&n.startsWith("/")?n.slice(1):n)),a=this.defaultQuery(),c=Object.fromEntries(s.searchParams);return(!OL(a)||!OL(c))&&(r={...c,...a,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(n){if(3600*n/128e3>600)throw new Q("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(n){}async prepareRequest(n,{url:r,options:i}){if(this._authState.tokenCache&&this.apiKey==null){let o=n.headers instanceof Headers?n.headers:new Headers(n.headers);for(let[a,c]of Object.entries(this._authState.extraHeaders))o.has(a)||o.set(a,c);let s=o.get("anthropic-beta")?.split(",").map(a=>a.trim());s?.includes(Kl)||o.set("anthropic-beta",[...s??[],Kl].join(",")),n.headers=o}}backendMiddleware(){return[]}get(n,r){return this.methodRequest("get",n,r)}post(n,r){return this.methodRequest("post",n,r)}patch(n,r){return this.methodRequest("patch",n,r)}put(n,r){return this.methodRequest("put",n,r)}delete(n,r){return this.methodRequest("delete",n,r)}methodRequest(n,r,i){return this.request(Promise.resolve(i).then(o=>({method:n,path:r,...o})))}request(n,r=null){return this._tracer?new Ql(this,this.makeTracedRequest(n,r)):new Ql(this,this.makeRequest(n,r,void 0))}async makeTracedRequest(n,r){let i=await n,o=i.__span?.span;if(!o)return this.makeRequest(i,r,void 0);try{return await ln.with(pi.setSpan(ln.active(),o),()=>this.makeRequest(i,r,void 0,o))}catch(s){let a={status:"error",options:i,error:s};throw Zl(this,o,a),nt(this,()=>uc(o,a)),s}}async makeRequest(n,r,i,o){let s=await n,a=qS("maxRetries",s.maxRetries??this.maxRetries);this.isStreamBody(s.body)&&(a=0),r==null&&(r=a,this._requestAuthFlags.delete(s)),await this.prepareOptions(s);let{req:c,url:l,timeout:u}=await this.buildRequest(s,{retryCount:a-r}),d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),p=i===void 0?"":`, retryOf: ${i}`;o&&this.openTelemetry.propagation&&(c.headers=nt(this,()=>zte(o,c.headers))??c.headers);let f=Date.now();if(s.signal?.aborted)throw new Xt;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m,s,{requestLogID:d,retryOfRequestLogID:i}).catch(Ol),h=Date.now();if(g instanceof globalThis.Error){Wo(m);let _=`retrying, ${r} attempts remaining`;if(s.signal?.aborted)throw new Xt;let w=$r(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):"")),k=this.middleware.length>0||!!s.middleware?.length||this.backendMiddleware().length>0;if(k&&!w&&!gre(g))throw Te(this).info(`[${d}] middleware error (not retryable)`),Yo(Te(this),`[${d}] middleware error (not retryable)`,{retryOfRequestLogID:i,url:l,durationMs:h-f,message:g.message}),g;if(r)return Te(this).info(`[${d}] connection ${w?"timed out":"failed"} - ${_}`),Yo(Te(this),`[${d}] connection ${w?"timed out":"failed"} (${_})`,{retryOfRequestLogID:i,url:l,durationMs:h-f,message:g.message}),this.retryRequest(s,r,i??d,o);throw Te(this).info(`[${d}] connection ${w?"timed out":"failed"} - error; no more retries left`),Yo(Te(this),`[${d}] connection ${w?"timed out":"failed"} (error; no more retries left)`,{retryOfRequestLogID:i,url:l,durationMs:h-f,message:g.message}),w?new Ms:k&&!OF(g)?g:new li({cause:g})}let v=[...g.headers.entries()].filter(([_])=>_==="request-id"||_==="anthropic-workspace-id").map(([_,w])=>", "+_+": "+JSON.stringify(w)).join(""),b=`[${d}${p}${v}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${h-f}ms`;if(!g.ok){let _=await this.shouldRetry(g,s);if(r&&_){let R=`retrying, ${r} attempts remaining`;return await ZS(g.body),Wo(m),Te(this).info(`${b} - ${R}`),Yo(Te(this),`[${d}] response error (${R})`,{retryOfRequestLogID:i,url:g.url,status:g.status,headers:g.headers,durationMs:h-f}),this.retryRequest(s,r,i??d,o,g.headers)}let w=_?"error; no more retries left":"error; not retryable";Te(this).info(`${b} - ${w}`);let k=await g.text().catch(R=>Ol(R).message),x=Bl(k),A=x?void 0:k;throw Yo(Te(this),`[${d}] response error (${w})`,{retryOfRequestLogID:i,url:g.url,status:g.status,headers:g.headers,message:A,durationMs:Date.now()-f}),Wo(m),this.makeStatusError(g.status,x,A,g.headers)}return Te(this).info(b),Yo(Te(this),`[${d}] response start`,{retryOfRequestLogID:i,url:g.url,status:g.status,headers:g.headers,durationMs:h-f}),Bee(g.body??g,m),{response:g,options:s,controller:m,requestLogID:d,retryOfRequestLogID:i,startTime:f}}getAPIList(n,r,i){return this.requestAPIList(r,i&&"then"in i?i.then(o=>({method:"get",path:n,...o})):{method:"get",path:n,...i})}requestAPIList(n,r){if(!this._tracer){let o=this.makeRequest(r,null,void 0);return new db(this,o,n)}let i=this.makeTracedRequest(r,null);return new db(this,i,n)}async fetchWithTimeout(n,r,i,o,s,a){let{signal:c,method:l,...u}=r||{},d=this._makeAbort(o);c&&(c.addEventListener("abort",d,{once:!0}),Gee(o,c,d));let p=globalThis.ReadableStream&&u.body instanceof globalThis.ReadableStream||typeof u.body=="object"&&u.body!==null&&Symbol.asyncIterator in u.body,f={signal:o.signal,...p?{duplex:"half"}:{},method:"GET",...u};l&&(f.method=l.toUpperCase());let m=this.fetch,g=async(w,k)=>{let x=setTimeout(d,i);try{return await m.call(void 0,w,k)}finally{clearTimeout(x)}},h=s===void 0?g:(async(w,k={})=>{let x=typeof w=="string"?w:w instanceof URL?w.href:w.url;k.headers=k.headers instanceof Headers?k.headers:new Headers(k.headers);let A=[];s.__span&&(k.headers=new Headers(k.headers),A=Ox(k.headers)),await this.prepareRequest(k,{url:x,options:s}),A.length&&(k.headers=T([k.headers,A]).values);let I=s.__span;return I&&nt(this,()=>jte(I,k.method??"GET",x,this.openTelemetry.traces.contentMode==="content")),a&&Yo(Te(this),`[${a.requestLogID}] sending request`,{retryOfRequestLogID:a.retryOfRequestLogID,method:k.method,url:x,options:s,headers:k.headers}),g(w,k)}),v=s?.middleware,b=s?.__span?this.backendMiddleware().map(kF):this.backendMiddleware(),_=v?.length||b.length?[...this.middleware,...v??[],...b]:this.middleware;return await DF(h,_,s,this)(n,f)}async shouldRetry(n,r){let i=this._authFlags(r);if(n.status===401&&this._authState.tokenCache&&i.usedTokenCache&&!i.didRefreshFor401)return i.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=n.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:n.status===408||n.status===409||n.status===429||n.status>=500}async retryRequest(n,r,i,o,s){let a,c=s?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(a=u)}let l=s?.get("retry-after");if(l&&!a){let u=parseFloat(l);Number.isNaN(u)?a=Date.parse(l)-Date.now():a=u*1e3}if(a===void 0||!(a>0&&a<=2**31-1)){let u=n.maxRetries??this.maxRetries;a=this.calculateDefaultRetryTimeoutMillis(r,u)}return await fo(a,n.signal??void 0),this.makeRequest(n,r-1,i,o)}calculateDefaultRetryTimeoutMillis(n,r){let s=r-n,a=Math.min(.5*Math.pow(2,s),8),c=1-Math.random()*.25;return a*c*1e3}calculateNonstreamingTimeout(n,r){if(36e5*n/128e3>6e5||r!=null&&n>r)throw new Q("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(n,{retryCount:r=0}={}){let i={...n},{method:o,path:s,query:a,defaultBaseURL:c}=i;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let l=this.buildURL(s,a,c);"timeout"in i&&qS("timeout",i.timeout),i.timeout=i.timeout??this.timeout;let{bodyHeaders:u,body:d}=this.buildBody({options:i}),p=await this.buildHeaders({options:n,method:o,bodyHeaders:u,retryCount:r,timeout:i.timeout});return{req:{method:o,headers:p,...i.signal&&{signal:i.signal},...globalThis.ReadableStream&&d instanceof globalThis.ReadableStream&&{duplex:"half"},...d&&{body:d},...this.fetchOptions??{},...i.fetchOptions??{}},url:l,timeout:i.timeout}}async buildHeaders({options:n,method:r,bodyHeaders:i,retryCount:o,timeout:s}){let a=T([{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),"X-Stainless-Timeout":String(Math.trunc(s/1e3)),...Fy(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(n),this._options.defaultHeaders,i,n.headers]);return this.validateHeaders(a),a.values}_makeAbort(n){return()=>n.abort()}buildBody({options:{body:n,headers:r}}){if(!n)return{bodyHeaders:void 0,body:void 0};let i=T([r]);return ArrayBuffer.isView(n)||n instanceof ArrayBuffer||n instanceof DataView||typeof n=="string"&&i.values.has("content-type")||globalThis.Blob&&n instanceof globalThis.Blob||n instanceof FormData||n instanceof URLSearchParams||globalThis.ReadableStream&&n instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:n}:this.isStreamBody(n)?{bodyHeaders:void 0,body:JS(n)}:typeof n=="object"&&i.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(n)}:y(this,CT,"f").call(this,{body:n,headers:i})}isStreamBody(n){return globalThis.ReadableStream&&n instanceof globalThis.ReadableStream?!0:typeof n=="object"&&n!==null&&(Symbol.asyncIterator in n||Symbol.iterator in n&&"next"in n&&typeof n.next=="function")}}return Vz=e,CT=new WeakMap,wu=new WeakMap,Bz=new WeakSet,Coe=function(){return this.baseURL!=="https://api.anthropic.com"},e.Anthropic=Vz,e.DEFAULT_TIMEOUT=6e5,e.AnthropicError=Q,e.APIError=_t,e.APIConnectionError=li,e.APIConnectionTimeoutError=Ms,e.APIUserAbortError=Xt,e.NotFoundError=Fl,e.ConflictError=Ul,e.RateLimitError=zl,e.BadRequestError=Dl,e.AuthenticationError=Ml,e.InternalServerError=Gl,e.PermissionDeniedError=Ll,e.UnprocessableEntityError=jl,e.toFile=pb,e.HUMAN_PROMPT=qz,e.AI_PROMPT=Wz,e})(),Kz=(()=>{class e extends Hz{constructor(){super(...arguments),this.completions=new bu(this),this.messages=new vb(this),this.models=new _u(this),this.files=new vu(this),this.skills=new ov(this),this.organization=new iv(this),this.beta=new rv(this)}}return e.Completions=bu,e.Messages=vb,e.Models=_u,e.Files=vu,e.Skills=ov,e.Organization=iv,e.Beta=rv,e})()});function KGe(e){let t=e.messages.flatMap(n=>{if(!Array.isArray(n.content))return[n];let r=n.content.filter(i=>i.type!=="fallback");return r.length===n.content.length?[n]:r.length>0?[{...n,content:r}]:[]});return{...e,messages:t}}function Noe(e,t){let n={...e};for(let[r,i]of Object.entries(t))if(r==="output_config"&&i!=null){let o={...n[r]??{}};for(let[s,a]of Object.entries(i))OT(o,s,a);OT(n,r,Object.keys(o).length?o:null)}else OT(n,r,i);return t.thinking===void 0&&e.thinking?.type==="between_tools"&&(n.thinking={type:"disabled"}),n}function OT(e,t,n){n!==void 0&&(n===null?delete e[t]:e[t]=n)}function Foe(e,t={}){let n=!1;return async(r,i,o)=>{let[s,a]=(o.options?.path??"").split("?");if(e.length===0||o.options?.method!=="post"||s!=="/v1/messages"||new URLSearchParams(a).get("beta")!=="true"||typeof o.options.body!="object"||o.options.body==null)return i(r);if(o.options.body.fallbacks!=null)throw new Q("Sending the `fallbacks:` request param is not supported when using the `betaRefusalFallbackMiddleware`. You should either remove the middleware and send `fallbacks:` with the `server-side-fallback-2026-07-01` beta header to let the API handle refusal fallbacks, or omit the `fallbacks:` param if you'd like `betaRefusalFallbackMiddleware` to handle fallbacks on the client side.");let c=t.onError??(x=>o.logger.error(`anthropic-sdk: betaRefusalFallbackMiddleware: ${x.message}`));r=XGe(r,t.betas??HGe);let l=KGe(o.options.body),u=o.options.fallbackState,d=u?.index??-1;if(!Number.isInteger(d)||d<-1||d>=e.length)throw new Q(`fallbackState.index ${d} is out of bounds for a chain of ${e.length} fallback(s); was the state shared with a different middleware?`);let p=x=>{u?u.index=x:n||(n=!0,o.logger.warn("anthropic-sdk: betaRefusalFallbackMiddleware fell back without a `fallbackState` request option; follow-up requests will retry models that already refused. Pass a shared `{ fallbackState: new BetaFallbackState() }` to pin them to the accepted model."))},f=d===-1?l:Noe(l,e[d]),m=typeof r.body!="string"?r:{...r,body:JSON.stringify(f)},g=d===-1?await i(m):(await Zz(i,o,e[d],m)).response;if(!g.ok)return g;if(o.options.stream===!0){let x=d+1;return x>=e.length||typeof m.body!="string"?g:JGe({request:m,response:g,next:i,ctx:o,fallbacks:e,firstHop:x,onError:c,pin:p})}let h=d,v=g,b=f.model,_=[];for(;hnull);if(Y===0&&C.status===400&&f.length){r.logger.warn(`anthropic-sdk: betaRefusalFallbackMiddleware: fallback request with the partial output appended was rejected (HTTP 400: ${JSON.stringify(L)}); retrying without it`),R=p,C=null;continue}j={kind:"request_failed",message:`fallback request failed: HTTP ${C.status}: ${JSON.stringify(L)}`,model:k,status:C.status,detail:L};break}if(j){if(s(j),A)continue;let Y={...h,recommended_model:k};yield Js("message_delta",{type:"message_delta",context_management:null,delta:{stop_reason:"refusal",stop_sequence:null,container:null,stop_details:Y},usage:g??{},...v!==void 0&&{input_transformations:v}}),yield Js("message_stop",{type:"message_stop"});return}let z=yield*Ooe({response:C,controller:c,indexBase:u,hasNext:A,onError:s,splice:{iterations:b,model:k}});if(!z.refused)return;d=z.refused.token,h=z.refused.stopDetails,v=z.refused.inputTransformations,p=R,f=z.refused.hasPrefillClaim?Doe(z.blocks):[],b.push(Yz("message",k,z.refused.usage)),g=z.refused.usage,m=k,u=z.nextIndex}}async function*Ooe(e){let{response:t,controller:n,indexBase:r,hasNext:i,onError:o,splice:s}=e,a=new Jz(r),c,l=null,u;for await(let d of Cn.rawEvents(t,n)){let p=Bl(d.data);switch(p?.type){case"message_start":{if(c=p.message.model,l=p.message.usage,"input_transformations"in p.message&&(u=p.message.input_transformations),s)continue;break}case"content_block_start":{if(a.start(p),s){yield Js(p.type,p);continue}break}case"content_block_delta":{if(a.delta(p),s){yield Js(p.type,p);continue}break}case"content_block_stop":{if(a.stop(p),s){yield Js(p.type,p);continue}break}case"message_delta":{if(p.delta.stop_reason==="refusal"){let f=p.delta.stop_details?.type==="refusal"?p.delta.stop_details:null;if(f?.fallback_credit_token&&i){let m=Moe(p.usage,l);return yield*a.closeOpenBlocks(),{refused:{token:f.fallback_credit_token,hasPrefillClaim:f.fallback_has_prefill_claim===!0,usage:m,stopDetails:f,inputTransformations:s?u:void 0},model:c,blocks:a.contentBlocks(),nextIndex:a.nextIndex}}f?.fallback_credit_token?o({kind:"chain_exhausted",message:"refusal but no fallback entries remain",event:p}):o({kind:"no_credit_token",message:"refusal stop_details has no fallback_credit_token",event:p})}if(s){let f=Moe(p.usage,l);f.iterations=[...s.iterations,Yz("fallback_message",s.model,f)],p.usage=f,!("input_transformations"in p)&&u!==void 0&&(p.input_transformations=u),yield Js("message_delta",p);continue}break}}yield eBe(d)}return{refused:null,model:c,blocks:a.contentBlocks(),nextIndex:a.nextIndex}}function Uoe(e){return{token:e,mode:"best_effort"}}function YGe(e,{model:t,speed:n,creditToken:r,continuation:i}){let o=JSON.parse(e.body);return o.model=t,OT(o,"speed",n),o.fallback_credit_token=Uoe(r),o.thinking?.type==="between_tools"&&(o.thinking={type:"disabled"}),i.length&&(o.messages=[...o.messages,{role:"assistant",content:i}]),{...e,headers:new Headers(e.headers),body:JSON.stringify(o)}}async function Zz(e,t,n,r){let i=await e(r);if(i.status!==429&&i.status!==529||n.speed!==void 0||typeof r.body!="string")return{response:i,droppedSpeed:!1};let{speed:o,...s}=JSON.parse(r.body);return o!=="fast"?{response:i,droppedSpeed:!1}:(t.logger.info(`anthropic-sdk: betaRefusalFallbackMiddleware: fast fallback request to ${n.model} was rejected (HTTP ${i.status}); retrying without \`speed\``),await ZS(i.body),{response:await e({...r,body:JSON.stringify(s)}),droppedSpeed:!0})}function QGe(e,t,n){let r=e.find(i=>i.index===t)?.block;if(r)switch(n.type){case"text_delta":{r.text=(r.text??"")+n.text;break}case"input_json_delta":{r._partial_json=(r._partial_json??"")+n.partial_json;break}case"citations_delta":(r.citations??(r.citations=[])).push(n.citation);break;case"thinking_delta":{r.thinking=(r.thinking??"")+n.thinking;break}case"signature_delta":{r.signature=n.signature;break}case"compaction_delta":{r.content=n.content,"encrypted_content"in n&&(r.encrypted_content=n.encrypted_content);break}default:}}function Doe(e){return e.map(t=>{if(typeof t?._partial_json!="string")return t;let{_partial_json:n,...r}=t;return{...r,input:Bl(n)??r.input}})}function XGe(e,t){let n=new Headers(e.headers),r=new Set(n.get("anthropic-beta")?.split(",").map(i=>i.trim()));for(let i of t)r.has(i)||(r.add(i),n.set("anthropic-beta",[...r].join(",")));return n.set(es,iF(n.get(es),"fallback-refusal-middleware")),{...e,headers:n}}function Js(e,t){let n={event:e,data:JSON.stringify(t),raw:[]};return Loe.encode(joe(n))}function eBe(e){return Loe.encode(e.raw.length?e.raw.join(` `)+` -`:p7(e))}function AF(e,t,n){return{type:e,model:t,input_tokens:n?.input_tokens??0,output_tokens:n?.output_tokens??0,cache_read_input_tokens:n?.cache_read_input_tokens??0,cache_creation_input_tokens:n?.cache_creation_input_tokens??0,cache_creation:n?.cache_creation??null}}function c7(e,t){let n={...t??{},...e??{}};for(let i of Object.keys(n))n[i]==null&&t?.[i]!=null&&(n[i]=t[i]);return n}function p7(e){let t="";e.event!==null&&(t+=`event: ${e.event} +`:joe(e))}function Yz(e,t,n){return{type:e,model:t,input_tokens:n?.input_tokens??0,output_tokens:n?.output_tokens??0,cache_read_input_tokens:n?.cache_read_input_tokens??0,cache_creation_input_tokens:n?.cache_creation_input_tokens??0,cache_creation:n?.cache_creation??null}}function Moe(e,t){let n={...t??{},...e??{}};for(let r of Object.keys(n))n[r]==null&&t?.[r]!=null&&(n[r]=t[r]);return n}function joe(e){let t="";e.event!==null&&(t+=`event: ${e.event} `);for(let n of e.data.split(` `))t+=`data: ${n} `;return t+` -`}function DOe(e,t){return()=>e.abort(t.reason)}var l7,EOe,IF,f7=j(()=>{kt();Lh();Da();Ne();eo();hr();WO();l7=new TextEncoder,EOe=["fallback-credit-2026-07-01"];IF=class{constructor(t=0){this.indexBase=t,this.blocks=[],this.open=[],this.nextIndex=t}contentBlocks(){return this.blocks.map(t=>t.block)}start(t){this.blocks.push({index:t.index,block:{...t.content_block}}),t.index+=this.indexBase,this.open.push(t.index),this.nextIndex=Math.max(this.nextIndex,t.index+1)}delta(t){NOe(this.blocks,t.index,t.delta),t.index+=this.indexBase}stop(t){t.index+=this.indexBase;let n=this.open.indexOf(t.index);n!==-1&&this.open.splice(n,1),this.nextIndex=Math.max(this.nextIndex,t.index+1)}*closeOpenBlocks(){for(let t of this.open)yield $s("content_block_stop",{type:"content_block_stop",index:t});this.open.length=0}}});var m7={};_r(m7,{AI_PROMPT:()=>xF,APIConnectionError:()=>Zi,APIConnectionTimeoutError:()=>fl,APIError:()=>Dt,APIPromise:()=>La,APIUserAbortError:()=>In,Anthropic:()=>no,AnthropicError:()=>J,AuthenticationError:()=>gl,BadRequestError:()=>ml,BaseAnthropic:()=>Ot,BetaFallbackState:()=>Ch,ConflictError:()=>bl,HUMAN_PROMPT:()=>SF,InternalServerError:()=>kl,NotFoundError:()=>yl,PagePromise:()=>fp,PermissionDeniedError:()=>hl,RateLimitError:()=>wl,RetryableError:()=>ap,UnprocessableEntityError:()=>vl,betaRefusalFallbackMiddleware:()=>u7,default:()=>no,toFile:()=>Gh});var VM=j(()=>{EF();kM();N_();f7();EF();De();kt()});var OU=require("node:fs/promises"),MU=require("node:fs/promises");var C2=gt(gc(),1);var U={};_r(U,{$brand:()=>nI,$input:()=>SA,$output:()=>_A,INVALID:()=>sr,NEVER:()=>tI,TimePrecision:()=>OA,ZodAny:()=>_N,ZodArray:()=>TN,ZodBase64:()=>Yw,ZodBase64URL:()=>Qw,ZodBigInt:()=>ud,ZodBigIntFormat:()=>tk,ZodBoolean:()=>ld,ZodCIDRv4:()=>Jw,ZodCIDRv6:()=>Zw,ZodCUID:()=>Gw,ZodCUID2:()=>Vw,ZodCatch:()=>KN,ZodCodec:()=>pg,ZodCompileAsyncError:()=>Ui,ZodCompileUnsupportedError:()=>Ve,ZodCreditCard:()=>gN,ZodCustom:()=>fg,ZodCustomStringFormat:()=>ad,ZodDate:()=>sg,ZodDefault:()=>GN,ZodDiscriminatedUnion:()=>AN,ZodE164:()=>Xw,ZodEmail:()=>Fw,ZodEmoji:()=>jw,ZodEnum:()=>od,ZodError:()=>Cfe,ZodExactOptional:()=>ok,ZodFile:()=>FN,ZodFirstPartyTypeKind:()=>uC,ZodFunction:()=>iC,ZodGUID:()=>Uw,ZodIBAN:()=>hN,ZodIPv4:()=>Hw,ZodIPv6:()=>Kw,ZodISODate:()=>Ks,ZodISODateTime:()=>Hs,ZodISODuration:()=>Zs,ZodISOTime:()=>Js,ZodInstanceOf:()=>lC,ZodIntersection:()=>RN,ZodIssueCode:()=>Ofe,ZodJWT:()=>ek,ZodKSUID:()=>Ww,ZodLazy:()=>tC,ZodLiteral:()=>LN,ZodMAC:()=>mN,ZodMap:()=>ON,ZodNaN:()=>ZN,ZodNanoID:()=>zw,ZodNever:()=>xN,ZodNonOptional:()=>sk,ZodNull:()=>kN,ZodNullable:()=>zN,ZodNumber:()=>cd,ZodNumberFormat:()=>Nc,ZodObject:()=>cg,ZodOptional:()=>ug,ZodPipe:()=>dg,ZodPrefault:()=>BN,ZodPreprocess:()=>YN,ZodPromise:()=>rC,ZodProperties:()=>oC,ZodReadonly:()=>QN,ZodRealError:()=>Ar,ZodRecord:()=>id,ZodSet:()=>MN,ZodString:()=>sd,ZodStringFormat:()=>mt,ZodSuccess:()=>HN,ZodSymbol:()=>vN,ZodTemplateLiteral:()=>eC,ZodTransform:()=>UN,ZodTuple:()=>CN,ZodType:()=>Le,ZodULID:()=>Bw,ZodURL:()=>og,ZodUUID:()=>go,ZodUndefined:()=>wN,ZodUnion:()=>lg,ZodUnknown:()=>SN,ZodVoid:()=>EN,ZodXID:()=>qw,ZodXor:()=>IN,_ZodString:()=>Lw,_default:()=>VN,_function:()=>u2,any:()=>zq,array:()=>ag,base64:()=>$q,base64url:()=>_q,bigint:()=>Mq,boolean:()=>bN,catch:()=>JN,check:()=>d2,cidrv4:()=>wq,cidrv6:()=>kq,clone:()=>ot,codec:()=>s2,coerce:()=>pC,compile:()=>IA,config:()=>zt,core:()=>Zo,creditCard:()=>xq,cuid:()=>pq,cuid2:()=>fq,custom:()=>p2,date:()=>Vq,decode:()=>aN,decodeAsync:()=>lN,deepPartial:()=>x2,describe:()=>f2,discriminatedUnion:()=>Jq,e164:()=>Sq,email:()=>nq,emoji:()=>uq,encode:()=>sN,encodeAsync:()=>cN,endsWith:()=>Wu,enum:()=>rk,exactOptional:()=>jN,file:()=>n2,flattenError:()=>Cm,float32:()=>Cq,float64:()=>Pq,formatError:()=>Pm,fromJSONSchema:()=>_2,function:()=>u2,getDiscriminatedOption:()=>Z0,getErrorMap:()=>Lfe,globalRegistry:()=>Dn,gt:()=>fo,gte:()=>Vr,guid:()=>rq,hash:()=>Nq,hex:()=>Rq,hostname:()=>Aq,httpUrl:()=>lq,iban:()=>Eq,includes:()=>Bu,input:()=>T2,instanceof:()=>g2,int:()=>Ow,int32:()=>Dq,int64:()=>Lq,intersection:()=>NN,invertCodec:()=>a2,ipv4:()=>yq,ipv6:()=>vq,iso:()=>mg,json:()=>y2,jwt:()=>Tq,keyof:()=>Bq,ksuid:()=>hq,lazy:()=>nC,length:()=>Ic,literal:()=>t2,locales:()=>Zm,looseObject:()=>Hq,looseRecord:()=>Yq,lowercase:()=>Gu,lt:()=>po,lte:()=>Gr,mac:()=>bq,map:()=>Qq,maxLength:()=>Tc,maxSize:()=>Gs,memoizer:()=>Km,meta:()=>m2,mime:()=>Hu,minLength:()=>Jo,minSize:()=>mo,multipleOf:()=>zs,nan:()=>o2,nanoid:()=>dq,nativeEnum:()=>e2,negative:()=>Sw,never:()=>nk,nonnegative:()=>Ew,nonoptional:()=>WN,nonpositive:()=>xw,normalize:()=>Ku,null:()=>$N,nullable:()=>ig,nullish:()=>r2,number:()=>yN,object:()=>qq,optional:()=>Rc,output:()=>I2,overwrite:()=>ji,parse:()=>nN,parseAsync:()=>rN,partialRecord:()=>Zq,pipe:()=>Mw,positive:()=>_w,prefault:()=>qN,preprocess:()=>b2,prettifyError:()=>aI,promise:()=>l2,properties:()=>sC,property:()=>Tw,readonly:()=>XN,record:()=>DN,refine:()=>aC,regex:()=>zu,regexes:()=>or,registry:()=>Xv,safeDecode:()=>dN,safeDecodeAsync:()=>fN,safeEncode:()=>uN,safeEncodeAsync:()=>pN,safeParse:()=>iN,safeParseAsync:()=>oN,set:()=>Xq,setErrorMap:()=>Mfe,size:()=>Ec,slugify:()=>Qu,startsWith:()=>qu,strictObject:()=>Wq,string:()=>rg,stringFormat:()=>Iq,stringbool:()=>h2,success:()=>i2,superRefine:()=>cC,symbol:()=>Uq,templateLiteral:()=>c2,toJSONSchema:()=>Nw,toLowerCase:()=>Zu,toUpperCase:()=>Yu,toZod:()=>Sm,transform:()=>ik,treeifyError:()=>sI,trim:()=>Ju,tuple:()=>PN,uint32:()=>Oq,uint64:()=>Fq,ulid:()=>mq,undefined:()=>jq,union:()=>dd,unknown:()=>Ac,uppercase:()=>Vu,url:()=>cq,util:()=>G,uuid:()=>iq,uuidv4:()=>oq,uuidv6:()=>sq,uuidv7:()=>aq,validate:()=>Dm,validateAsync:()=>Om,void:()=>Gq,withParser:()=>ew,xid:()=>gq,xor:()=>Kq});var Zo={};_r(Zo,{$ZodAny:()=>G0,$ZodArray:()=>H0,$ZodAsyncError:()=>Tr,$ZodBase64:()=>R0,$ZodBase64URL:()=>N0,$ZodBigInt:()=>Uv,$ZodBigIntFormat:()=>F0,$ZodBoolean:()=>Gm,$ZodCIDRv4:()=>I0,$ZodCIDRv6:()=>A0,$ZodCUID:()=>h0,$ZodCUID2:()=>y0,$ZodCatch:()=>pA,$ZodCheck:()=>ht,$ZodCheckBigIntFormat:()=>BI,$ZodCheckEndsWith:()=>n0,$ZodCheckGreaterThan:()=>$v,$ZodCheckIncludes:()=>e0,$ZodCheckLengthEquals:()=>ZI,$ZodCheckLessThan:()=>kv,$ZodCheckLowerCase:()=>QI,$ZodCheckMaxLength:()=>KI,$ZodCheckMaxSize:()=>qI,$ZodCheckMimeType:()=>i0,$ZodCheckMinLength:()=>JI,$ZodCheckMinSize:()=>WI,$ZodCheckMultipleOf:()=>GI,$ZodCheckNumberFormat:()=>VI,$ZodCheckOverwrite:()=>o0,$ZodCheckProperty:()=>r0,$ZodCheckRegex:()=>YI,$ZodCheckSizeEquals:()=>HI,$ZodCheckStartsWith:()=>t0,$ZodCheckStringFormat:()=>Mu,$ZodCheckUpperCase:()=>XI,$ZodCodec:()=>Bm,$ZodCreditCard:()=>P0,$ZodCustom:()=>vA,$ZodCustomStringFormat:()=>M0,$ZodCyclicError:()=>Wv,$ZodDate:()=>W0,$ZodDefault:()=>cA,$ZodDiscriminatedUnion:()=>Y0,$ZodE164:()=>C0,$ZodEmail:()=>u0,$ZodEmoji:()=>m0,$ZodEncodeError:()=>js,$ZodEnum:()=>nA,$ZodError:()=>oI,$ZodExactOptional:()=>sA,$ZodFile:()=>iA,$ZodFunction:()=>yA,$ZodGUID:()=>c0,$ZodIBAN:()=>D0,$ZodIPv4:()=>x0,$ZodIPv6:()=>E0,$ZodISODate:()=>$0,$ZodISODateTime:()=>k0,$ZodISODuration:()=>S0,$ZodISOTime:()=>_0,$ZodIntersection:()=>Q0,$ZodJWT:()=>O0,$ZodKSUID:()=>w0,$ZodLazy:()=>qm,$ZodLiteral:()=>rA,$ZodMAC:()=>T0,$ZodMap:()=>eA,$ZodNaN:()=>fA,$ZodNanoID:()=>g0,$ZodNever:()=>B0,$ZodNonOptional:()=>uA,$ZodNull:()=>z0,$ZodNullable:()=>aA,$ZodNumber:()=>Fv,$ZodNumberFormat:()=>L0,$ZodObject:()=>dV,$ZodObjectJIT:()=>K0,$ZodOptional:()=>zv,$ZodPipe:()=>Gv,$ZodPrefault:()=>lA,$ZodPreprocess:()=>mA,$ZodPromise:()=>bA,$ZodProperties:()=>wA,$ZodReadonly:()=>gA,$ZodRealError:()=>Ir,$ZodRecord:()=>X0,$ZodRegistry:()=>Qv,$ZodSet:()=>tA,$ZodString:()=>kc,$ZodStringFormat:()=>ut,$ZodSuccess:()=>dA,$ZodSymbol:()=>U0,$ZodTemplateLiteral:()=>hA,$ZodTransform:()=>oA,$ZodTuple:()=>jv,$ZodType:()=>Ce,$ZodULID:()=>b0,$ZodURL:()=>f0,$ZodUUID:()=>l0,$ZodUndefined:()=>j0,$ZodUnion:()=>Vm,$ZodUnknown:()=>V0,$ZodVoid:()=>q0,$ZodXID:()=>v0,$ZodXor:()=>J0,$brand:()=>nI,$constructor:()=>R,$input:()=>SA,$output:()=>_A,Doc:()=>wc,INVALID:()=>sr,JSONSchema:()=>XB,JSONSchemaGenerator:()=>Cw,NEVER:()=>tI,TimePrecision:()=>OA,URL_BAD_FORMAT:()=>d0,URL_UNPARSEABLE:()=>p0,ZodCompileAsyncError:()=>Ui,ZodCompileUnsupportedError:()=>Ve,_any:()=>QA,_array:()=>sR,_base64:()=>vw,_base64url:()=>ww,_bigint:()=>qA,_boolean:()=>VA,_catch:()=>vfe,_check:()=>LB,_cidrv4:()=>yw,_cidrv6:()=>bw,_coercedBigint:()=>WA,_coercedBoolean:()=>BA,_coercedDate:()=>rR,_coercedNumber:()=>LA,_coercedString:()=>NA,_creditCard:()=>PA,_cuid:()=>uw,_cuid2:()=>dw,_custom:()=>cR,_date:()=>nR,_decode:()=>dv,_decodeAsync:()=>fv,_default:()=>hfe,_discriminatedUnion:()=>ife,_e164:()=>kw,_email:()=>nw,_emoji:()=>cw,_encode:()=>uv,_encodeAsync:()=>pv,_endsWith:()=>Wu,_enum:()=>ufe,_file:()=>aR,_float32:()=>UA,_float64:()=>jA,_gt:()=>fo,_gte:()=>Vr,_guid:()=>rw,_iban:()=>DA,_includes:()=>Bu,_int:()=>FA,_int32:()=>zA,_int64:()=>HA,_intersection:()=>ofe,_ipv4:()=>gw,_ipv6:()=>hw,_isoDate:()=>Xm,_isoDateTime:()=>Qm,_isoDuration:()=>tg,_isoTime:()=>eg,_jwt:()=>$w,_ksuid:()=>mw,_lazy:()=>_fe,_length:()=>Ic,_literal:()=>pfe,_lowercase:()=>Gu,_lt:()=>po,_lte:()=>Gr,_mac:()=>CA,_map:()=>cfe,_max:()=>Gr,_maxLength:()=>Tc,_maxSize:()=>Gs,_mime:()=>Hu,_min:()=>Vr,_minLength:()=>Jo,_minSize:()=>mo,_multipleOf:()=>zs,_nan:()=>iR,_nanoid:()=>lw,_nativeEnum:()=>dfe,_negative:()=>Sw,_never:()=>eR,_nonnegative:()=>Ew,_nonoptional:()=>yfe,_nonpositive:()=>xw,_normalize:()=>Ku,_null:()=>YA,_nullable:()=>gfe,_number:()=>MA,_optional:()=>mfe,_overwrite:()=>ji,_parse:()=>Cu,_parseAsync:()=>Pu,_pipe:()=>wfe,_positive:()=>_w,_promise:()=>Sfe,_properties:()=>oR,_property:()=>Tw,_readonly:()=>kfe,_record:()=>afe,_refine:()=>lR,_regex:()=>zu,_safeDecode:()=>gv,_safeDecodeAsync:()=>yv,_safeEncode:()=>mv,_safeEncodeAsync:()=>hv,_safeParse:()=>Du,_safeParseAsync:()=>Ou,_set:()=>lfe,_size:()=>Ec,_slugify:()=>Qu,_startsWith:()=>qu,_string:()=>RA,_stringFormat:()=>Xu,_stringbool:()=>fR,_success:()=>bfe,_superRefine:()=>uR,_symbol:()=>JA,_templateLiteral:()=>$fe,_toLowerCase:()=>Zu,_toUpperCase:()=>Yu,_transform:()=>ffe,_trim:()=>Ju,_tuple:()=>sfe,_uint32:()=>GA,_uint64:()=>KA,_ulid:()=>pw,_undefined:()=>ZA,_union:()=>nfe,_unknown:()=>XA,_uppercase:()=>Vu,_url:()=>Ym,_uuid:()=>iw,_uuidv4:()=>ow,_uuidv6:()=>sw,_uuidv7:()=>aw,_void:()=>tR,_xid:()=>fw,_xor:()=>rfe,base64Charset:()=>Pv,base64urlCharset:()=>zm,clone:()=>ot,compile:()=>IA,compileFn:()=>tw,config:()=>zt,createStandardJSONSchemaMethod:()=>ed,createToJSONSchemaMethod:()=>gR,decode:()=>iue,decodeAsync:()=>sue,describe:()=>dR,encode:()=>rue,encodeAsync:()=>oue,extractDefs:()=>Bs,finalize:()=>qs,flattenError:()=>Cm,formatError:()=>Pm,getDiscriminatedOption:()=>Z0,globalConfig:()=>hn,globalRegistry:()=>Dn,handleUnrepresentable:()=>Zt,initializeContext:()=>Vs,isBackEdge:()=>Kv,isRecursiveSchema:()=>Hv,isTransforming:()=>xn,isValidBase64:()=>jm,isValidBase64URL:()=>Dv,isValidCIDRv6:()=>Cv,isValidCreditCard:()=>Ov,isValidIBAN:()=>Mv,isValidIPv6:()=>Um,isValidJWT:()=>Lv,locales:()=>Zm,memoizer:()=>Km,mergeValues:()=>Lu,meta:()=>pR,parse:()=>cv,parseAsync:()=>lv,parseURLObject:()=>Iv,prettifyError:()=>aI,process:()=>st,processSchema:()=>st,regexes:()=>or,registry:()=>Xv,safeDecode:()=>cue,safeDecodeAsync:()=>uue,safeEncode:()=>aue,safeEncodeAsync:()=>lue,safeParse:()=>Qle,safeParseAsync:()=>Xle,standardProps:()=>Tv,stripTabAndNewline:()=>Av,toDotPath:()=>jG,toJSONSchema:()=>Nw,toZod:()=>Sm,treeifyError:()=>sI,urlHostnameOk:()=>Rv,urlProtocolOk:()=>Nv,util:()=>G,validate:()=>Dm,validateAsync:()=>Om,version:()=>s0,withParser:()=>ew});var G={};_r(G,{BIGINT_FORMAT_RANGES:()=>Am,CONSTANT_CATCH:()=>sv,Class:()=>BT,NUMBER_FORMAT_RANGES:()=>Im,aborted:()=>rr,allowsEval:()=>HT,assert:()=>vle,assertEqual:()=>gle,assertIs:()=>yle,assertNever:()=>ble,assertNotEqual:()=>hle,assignProp:()=>Sn,attachSchema:()=>ov,base64ToUint8Array:()=>DG,base64urlToUint8Array:()=>Fle,cached:()=>Au,captureStackTrace:()=>rv,cleanEnum:()=>Lle,cleanRegex:()=>Ho,clone:()=>ot,cloneDef:()=>$le,codePointLength:()=>bc,constantCatch:()=>XT,createTransparentProxy:()=>Ile,defineLazy:()=>qT,defineLazyInternal:()=>Ue,derived:()=>Gle,esc:()=>nr,escapeRegex:()=>li,explicitlyAborted:()=>ZT,extend:()=>Nle,finalizeIssue:()=>Er,floatSafeRemainder:()=>xm,getElementAtPath:()=>_le,getEnumValues:()=>Tu,getLengthableOrigin:()=>Nm,getParsedType:()=>Tle,getSizableOrigin:()=>Rm,hexToUint8Array:()=>jle,hide:()=>QT,installLazyProp:()=>qle,isObject:()=>yc,isPlainObject:()=>ci,issue:()=>Nu,joinValues:()=>C,jsonStringifyReplacer:()=>Iu,members:()=>YT,merge:()=>Ple,mergeDefs:()=>Fi,normalizeParams:()=>Q,nullish:()=>nv,numKeys:()=>Ele,objectClone:()=>wle,omit:()=>Rle,optionalKeys:()=>JT,own:()=>Us,parsedType:()=>H,partial:()=>Dle,pick:()=>Ale,prefixIssues:()=>ir,primitiveTypes:()=>KT,promiseAllObject:()=>Sle,propertyKeyTypes:()=>Tm,randomString:()=>xle,rawShape:()=>Ru,required:()=>Ole,safeExtend:()=>Cle,shallowClone:()=>Em,slugify:()=>WT,stringifyPrimitive:()=>V,toZod:()=>Sm,uint8ArrayToBase64:()=>OG,uint8ArrayToBase64url:()=>Ule,uint8ArrayToHex:()=>zle,unwrapMessage:()=>Eu});function gle(e){return e}function hle(e){return e}function Sm(){return e=>e}function yle(e){}function ble(e){throw new Error("Unexpected value in exhaustive check")}function vle(e){}function Tu(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function C(e,t="|"){return e.map(n=>V(n)).join(t)}function Iu(e,t){return typeof t=="bigint"?t.toString():t}var VT=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Au(e){return new VT(e)}function nv(e){return e==null}function Ho(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function xm(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i){let a=t._zod.def.shape[o];return i?i(a,o):a}):CG(e,o,i?i(s.value,o):s.value))}}function kle(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?NG(e,n,()=>t[n]):CG(e,n,i.value))}}function Fi(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function $le(e){return Fi(e._zod.def)}function _le(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function Sle(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o{};function yc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var HT=Au(()=>{if(hn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ci(e){if(yc(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(yc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Em(e){return ci(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Ele(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Tle=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Tm=new Set(["string","number","symbol"]),KT=new Set(["string","number","bigint","boolean","symbol","undefined"]);function li(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ot(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function Q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ile(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function V(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function JT(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Im={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Am={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ale(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return hc(o,e,iv(e,t)),ot(e,Fi(n,{shape:o,checks:[]}))}function iv(e,t){let n=Wo(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}function Rle(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(iv(e,t)),s={};return hc(s,e,Reflect.ownKeys(Wo(e)).filter(a=>!o.has(a))),ot(e,Fi(n,{shape:s,checks:[]}))}function Nle(e,t){if(!ci(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=Wo(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ot(e,Fi(e._zod.def,{shape:PG(e,t)}))}function PG(e,t){let n={};return hc(n,e,Reflect.ownKeys(Wo(e))),kle(n,t),n}function Cle(e,t){if(!ci(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ot(e,Fi(e._zod.def,{shape:PG(e,t)}))}function Ple(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};hc(n,e,Reflect.ownKeys(Wo(e))),hc(n,t,Reflect.ownKeys(Wo(t)));let i=Fi(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ot(e,i)}function Dle(e,t,n,i="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let a=n?new Set(iv(t,n)):void 0,c={};return hc(c,t,Reflect.ownKeys(Wo(t)),e&&((l,u)=>a&&!a.has(u)?l:new e({type:"optional",innerType:l}))),ot(t,Fi(t._zod.def,{shape:c,checks:[]}))}function Ole(e,t,n){let i=n?new Set(iv(t,n)):void 0,r={};return hc(r,t,Reflect.ownKeys(Wo(t)),(o,s)=>i&&!i.has(s)?o:new e({type:"nonoptional",innerType:o})),ot(t,Fi(t._zod.def,{shape:r}))}function rr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Eu(e){return typeof e=="string"?e:e?.message}function ov(e,t,n){var i;for(let r=t;rNumber.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function DG(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;it.toString(16).padStart(2,"0")).join("")}var BT=class{constructor(...t){}};function YT(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):RG(e,n,i.value)}for(let n of Object.getOwnPropertySymbols(t))RG(e,n,t[n])}function Us(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function QT(e,t,n){return Us(e,t,n,!1)}function Gle(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Us(this,n,i(this))},set(r){Us(this,n,r)}})}return t}function RG(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Us(this,t,n.bind(this))},set(i){Us(this,t,i)}})}function Vle(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var GT,Fs=!1,Ble={configurable:!0,get(){Fs=!0}};function Ue(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&>!==e._zod){GT=void 0;return}GT=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,Ble);let r=Fs;Fs=!1;try{let o=n(this);return Fs?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),Fs=Fs||r,o}catch(o){throw delete this[t],Fs=Fs||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function qle(e,t,n,i){let r=Vle(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var sv="~constantCatch";function XT(e){let t=()=>e;return t[sv]=!0,t}var MG,tI=Object.freeze({status:"aborted"}),eI={value:void 0,enumerable:!1},LG="captureStackTrace"in Error?Error:null;function Wle(e){let t=LG;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return LG=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function R(e,t,n,i){let r={};function o(p){this.def=p,this.constr=d,this.traits=new Set}o.prototype=r;let s=n,a=s&&new WeakSet;function c(p,f){if(!p._zod){eI.value=new o(f);try{Object.defineProperty(p,"_zod",eI)}finally{eI.value=void 0}}if(p._zod.traits.has(e))return;if(p._zod.traits.add(e),t(p,f),a){let g=Object.getPrototypeOf(p),h=p._zod.constr.prototype,b=g;for(;b&&b!==h;)b=Object.getPrototypeOf(b);let y=b??g;a.has(y)||(a.add(y),YT(y,s))}let m=d.prototype;for(let g in m)Object.prototype.hasOwnProperty.call(m,g)&&(g in p||(p[g]=m[g].bind(p)))}let l=i?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(p){let f=i?.Parent?Wle(u):this;c(f,p);let m=f._zod.deferred;if(m){for(let h of m)h();f._zod.deferred=void 0}let g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(f),f}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:p=>i?.Parent&&p instanceof i.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var nI=Symbol("zod_brand"),Tr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},js=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(MG=globalThis).__zod_globalConfig??(MG.__zod_globalConfig={});var hn=globalThis.__zod_globalConfig;function zt(e){return e&&Object.assign(hn,e),hn}function Hle(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Iu,2)),e.message}function Kle(e){this._zod.message=e}var Jle={get:Hle,set:Kle,enumerable:!0,configurable:!0},iI={value:void 0,enumerable:!1},FG=new WeakSet([Object.prototype,Error.prototype]),UG=(e,t)=>{e.name="$ZodError",iI.value=t,Object.defineProperty(e,"issues",iI),iI.value=void 0,Object.defineProperty(e,"message",Jle);let n=Object.getPrototypeOf(e);FG.has(n)||(FG.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},oI=R("$ZodError",UG),Ir=R("$ZodError",UG,void 0,{Parent:Error});function Zle(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Cm(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?Zle(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function Pm(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,l=0;for(;ln.message){let n={errors:[]},i=(r,o=[])=>{var s;for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let c=[...o,...a.path];if(c.length===0){n.errors.push(t(a));continue}let l=n,u=0;for(;utypeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function aI(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${jG(i.path)}`);return t.join(` -`)}function av(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Cu=e=>{let t=(n,i,r,o)=>{let s=r?{...r,async:!1}:{async:!1},a=n._zod.run({value:i,issues:[]},s);if(a instanceof Promise)throw new Tr;if(a.issues.length){let c=new(o?.Err??e)(a.issues.map(l=>Er(l,s,zt())));throw rv(c,o?.callee??t),c}return a.value};return t},cv=Cu(Ir),Pu=e=>{let t=async(n,i,r,o)=>{let s=r?{...r,async:!0}:{async:!0},a=n._zod.run({value:i,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(o?.Err??e)(a.issues.map(l=>Er(l,s,zt())));throw rv(c,o?.callee??t),c}return a.value};return t},lv=Pu(Ir),Du=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new Tr;return o.issues.length?zG(e,o.issues,r):{success:!0,data:o.value}},Qle=Du(Ir);function zG(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>Er(r,n,zt()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}var Ou=e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?zG(e,o.issues,r):{success:!0,data:o.value}},Xle=Ou(Ir),eue=Symbol.for("zod.compile.invalid"),tue=Symbol.for("zod.compile.fallback"),Dm=((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==eue)return!0;if(i.definite===!0&&n===void 0)return!1}return nue(e,t,n)});function nue(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,o;if(r?(i[tue]=!0,o=r({value:t,issues:[]},i)):o=e._zod.run({value:t,issues:[]},i),o instanceof Promise)throw new Tr;return o.issues.length===0}var Om=async(e,t,n)=>{let i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},r=e._zod.run({value:t,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},uv=e=>{let t=Cu(e),n=(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return t(i,r,a,av(n,s))};return n},rue=uv(Ir),dv=e=>{let t=Cu(e),n=(i,r,o,s)=>t(i,r,o,av(n,s));return n},iue=dv(Ir),pv=e=>{let t=Pu(e),n=async(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return await t(i,r,a,av(n,s))};return n},oue=pv(Ir),fv=e=>{let t=Pu(e),n=async(i,r,o,s)=>await t(i,r,o,av(n,s));return n},sue=fv(Ir),mv=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Du(e)(t,n,r)},aue=mv(Ir),gv=e=>(t,n,i)=>Du(e)(t,n,i),cue=gv(Ir),hv=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Ou(e)(t,n,r)},lue=hv(Ir),yv=e=>async(t,n,i)=>Ou(e)(t,n,i),uue=yv(Ir);var or={};_r(or,{anyString:()=>CI,base64:()=>xI,base64url:()=>EI,bigint:()=>DI,boolean:()=>OI,browserEmail:()=>bue,cidrv4:()=>_I,cidrv6:()=>SI,creditCard:()=>bv,cuid:()=>lI,cuid2:()=>uI,date:()=>AI,datetime:()=>NI,domain:()=>kue,duration:()=>hI,e164:()=>II,email:()=>bI,emoji:()=>vI,extendedDuration:()=>due,guid:()=>yI,hex:()=>_ue,hostname:()=>wue,html5Email:()=>gue,httpProtocol:()=>TI,iban:()=>vv,idnEmail:()=>yue,integer:()=>Mm,ipv4:()=>wI,ipv6:()=>kI,ksuid:()=>fI,lowercase:()=>FI,mac:()=>$I,md5_base64:()=>xue,md5_base64url:()=>Eue,md5_hex:()=>Sue,nanoid:()=>mI,nanoidOfLength:()=>gI,null:()=>MI,number:()=>Ko,rfc5322Email:()=>hue,sha1_base64:()=>Iue,sha1_base64url:()=>Aue,sha1_hex:()=>Tue,sha256_base64:()=>Nue,sha256_base64url:()=>Cue,sha256_hex:()=>Rue,sha384_base64:()=>Due,sha384_base64url:()=>Oue,sha384_hex:()=>Pue,sha512_base64:()=>Lue,sha512_base64url:()=>Fue,sha512_hex:()=>Mue,string:()=>PI,time:()=>RI,ulid:()=>dI,undefined:()=>LI,unicodeEmail:()=>GG,uppercase:()=>UI,uuid:()=>vc,uuid4:()=>pue,uuid6:()=>fue,uuid7:()=>mue,xid:()=>pI});var lI=/^[cC][0-9a-z]{6,}$/,uI=/^[0-9a-z]+$/,dI=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,pI=/^[0-9a-vA-V]{20}$/,fI=/^[A-Za-z0-9]{27}$/,mI=/^[a-zA-Z0-9_-]{21}$/;function gI(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var hI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,due=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,yI=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,pue=vc(4),fue=vc(6),mue=vc(7),bI=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,gue=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,hue=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,GG=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,yue=GG,bue=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,vue="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function vI(){return new RegExp(vue,"u")}var wI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,kI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,$I=e=>{let t=li(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},_I=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,SI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,EI=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,wue=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,kue=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,TI=/^https?$/,II=/^\+[1-9]\d{6,14}$/,bv=/^\d(?:[ -]?\d){11,18}$/,vv=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,VG="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function $ue(e){return new RegExp(`^${e}$`)}var AI=$ue(VG);function cI(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function RI(e){return new RegExp(`^${cI(e)}$`)}function NI(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${cI({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${cI({precision:e.precision})}`:n;return new RegExp(`^${VG}T(?:${i})$`)}var CI=/^[\s\S]{0,}$/,PI=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},DI=/^-?\d+n?$/,Mm=/^-?\d+$/,Ko=/^-?\d+(?:\.\d+)?$/,OI=/^(?:true|false)$/i,MI=/^null$/i;var LI=/^undefined$/i;var FI=/^[^A-Z]*$/,UI=/^[^a-z]*$/,_ue=/^[0-9a-fA-F]*$/;function Lm(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Fm(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Sue=/^[0-9a-fA-F]{32}$/,xue=Lm(22,"=="),Eue=Fm(22),Tue=/^[0-9a-fA-F]{40}$/,Iue=Lm(27,"="),Aue=Fm(27),Rue=/^[0-9a-fA-F]{64}$/,Nue=Lm(43,"="),Cue=Fm(43),Pue=/^[0-9a-fA-F]{96}$/,Due=Lm(64,""),Oue=Fm(64),Mue=/^[0-9a-fA-F]{128}$/,Lue=Lm(86,"=="),Fue=Fm(86);var ht=R("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),jI=e=>{let t=e.value;return!nv(t)&&t.size!==void 0},zI=e=>{let t=e.value;return!nv(t)&&t.length!==void 0},wv={number:"number",bigint:"bigint",object:"date"},kv=R("$ZodCheckLessThan",(e,t)=>{ht.init(e,t);let n=wv[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value{ht.init(e,t);let n=wv[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:wv[typeof i.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),GI=R("$ZodCheckMultipleOf",(e,t)=>{ht.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):xm(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),VI=R("$ZodCheckNumberFormat",(e,t)=>{ht.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=Im[t.format];e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}ao&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),BI=R("$ZodCheckBigIntFormat",(e,t)=>{ht.init(e,t);let[n,i]=Am[t.format];e._zod.check=r=>{let o=r.value;oi&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),qI=R("$ZodCheckMaxSize",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=jI),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Rm(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),WI=R("$ZodCheckMinSize",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=jI),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Rm(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),HI=R("$ZodCheckSizeEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=jI),e._zod.check=i=>{let r=i.value,o=r.size;if(o===t.size)return;let s=o>t.size;i.issues.push({origin:Rm(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),KI=R("$ZodCheckMaxLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=zI),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>t.maximum?bc(r):o)<=t.maximum)return;let a=Nm(r);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),JI=R("$ZodCheckMinLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=zI),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>=t.minimum&&o=t.minimum)return;let a=Nm(r);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ZI=R("$ZodCheckLengthEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=zI),e._zod.check=i=>{let r=i.value,o=r.length,s=typeof r=="string"&&o>=t.length&&o<=t.length*2?bc(r):o;if(s===t.length)return;let a=Nm(r),c=s>t.length;i.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Mu=R("$ZodCheckStringFormat",(e,t)=>{var n,i;ht.init(e,t),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),YI=R("$ZodCheckRegex",(e,t)=>{Mu.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),QI=R("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=FI),Mu.init(e,t)}),XI=R("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=UI),Mu.init(e,t)}),e0=R("$ZodCheckIncludes",(e,t)=>{ht.init(e,t);let n=li(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=i,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),t0=R("$ZodCheckStartsWith",(e,t)=>{ht.init(e,t);let n=new RegExp(`^${li(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),n0=R("$ZodCheckEndsWith",(e,t)=>{ht.init(e,t);let n=new RegExp(`.*${li(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function BG(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues))}var r0=R("$ZodCheckProperty",(e,t)=>{ht.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>BG(r,n,t.property));BG(i,n,t.property)}}),i0=R("$ZodCheckMimeType",(e,t)=>{ht.init(e,t);let n=new Set(t.mime);e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),o0=R("$ZodCheckOverwrite",(e,t)=>{ht.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var wc=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(` -`).filter(s=>s),r=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { +`}function tBe(e,t){return()=>e.abort(t.reason)}var Loe,HGe,Jz,zoe=P(()=>{at();lc();Ds();$e();Vl();gi();Gi();LL();Loe=new TextEncoder,HGe=["fallback-credit-2026-07-01"];Jz=class{constructor(t=0){this.indexBase=t,this.blocks=[],this.open=[],this.nextIndex=t}contentBlocks(){return this.blocks.map(t=>t.block)}start(t){this.blocks.push({index:t.index,block:{...t.content_block}}),t.index+=this.indexBase,this.open.push(t.index),this.nextIndex=Math.max(this.nextIndex,t.index+1)}delta(t){QGe(this.blocks,t.index,t.delta),t.index+=this.indexBase}stop(t){t.index+=this.indexBase;let n=this.open.indexOf(t.index);n!==-1&&this.open.splice(n,1),this.nextIndex=Math.max(this.nextIndex,t.index+1)}*closeOpenBlocks(){for(let t of this.open)yield Js("content_block_stop",{type:"content_block_stop",index:t});this.open.length=0}}});var Goe={};Cr(Goe,{AI_PROMPT:()=>Wz,APIConnectionError:()=>li,APIConnectionTimeoutError:()=>Ms,APIError:()=>_t,APIPromise:()=>Ql,APIUserAbortError:()=>Xt,Anthropic:()=>Kz,AnthropicError:()=>Q,AuthenticationError:()=>Ml,BadRequestError:()=>Dl,BaseAnthropic:()=>Hz,BetaFallbackState:()=>jy,ConflictError:()=>Ul,HUMAN_PROMPT:()=>qz,InternalServerError:()=>Gl,NotFoundError:()=>Fl,PagePromise:()=>db,PermissionDeniedError:()=>Ll,RateLimitError:()=>zl,RetryableError:()=>Pp,UnprocessableEntityError:()=>jl,betaRefusalFallbackMiddleware:()=>Foe,default:()=>Kz,toFile:()=>pb});var Boe=P(()=>{NT();jF();Vx();NT();oe();at();NT();zoe()});var rV=require("node:fs/promises"),iV=require("node:fs/promises");var eK=$t(Lc(),1);var B={};Cr(B,{$brand:()=>HR,$input:()=>gC,$output:()=>mC,INVALID:()=>mr,NEVER:()=>WR,TimePrecision:()=>EC,ZodAny:()=>mO,ZodArray:()=>bO,ZodBase64:()=>Pk,ZodBase64URL:()=>Ck,ZodBigInt:()=>Od,ZodBigIntFormat:()=>Dk,ZodBoolean:()=>Nd,ZodCIDRv4:()=>Ik,ZodCIDRv6:()=>Rk,ZodCUID:()=>kk,ZodCUID2:()=>$k,ZodCatch:()=>UO,ZodCodec:()=>_h,ZodCompileAsyncError:()=>to,ZodCompileUnsupportedError:()=>We,ZodCreditCard:()=>sO,ZodCustom:()=>wh,ZodCustomStringFormat:()=>Pd,ZodDate:()=>mh,ZodDefault:()=>NO,ZodDiscriminatedUnion:()=>_O,ZodE164:()=>Nk,ZodEmail:()=>bk,ZodEmoji:()=>_k,ZodEnum:()=>Id,ZodError:()=>a_e,ZodExactOptional:()=>Uk,ZodFile:()=>IO,ZodFirstPartyTypeKind:()=>tD,ZodFunction:()=>JO,ZodGUID:()=>vk,ZodIBAN:()=>aO,ZodIPv4:()=>Tk,ZodIPv6:()=>Ak,ZodISODate:()=>wa,ZodISODateTime:()=>_a,ZodISODuration:()=>$a,ZodISOTime:()=>ka,ZodInstanceOf:()=>eD,ZodIntersection:()=>wO,ZodIssueCode:()=>u_e,ZodJWT:()=>Ok,ZodKSUID:()=>Ek,ZodLazy:()=>WO,ZodLiteral:()=>AO,ZodMAC:()=>oO,ZodMap:()=>EO,ZodNaN:()=>zO,ZodNanoID:()=>wk,ZodNever:()=>hO,ZodNonOptional:()=>jk,ZodNull:()=>pO,ZodNullable:()=>CO,ZodNumber:()=>Cd,ZodNumberFormat:()=>Xc,ZodObject:()=>hh,ZodOptional:()=>bh,ZodPipe:()=>vh,ZodPrefault:()=>DO,ZodPreprocess:()=>GO,ZodPromise:()=>KO,ZodProperties:()=>ZO,ZodReadonly:()=>BO,ZodRealError:()=>Fr,ZodRecord:()=>Ad,ZodSet:()=>TO,ZodString:()=>Rd,ZodStringFormat:()=>vt,ZodSuccess:()=>FO,ZodSymbol:()=>uO,ZodTemplateLiteral:()=>qO,ZodTransform:()=>RO,ZodTuple:()=>$O,ZodType:()=>ze,ZodULID:()=>Sk,ZodURL:()=>fh,ZodUUID:()=>Io,ZodUndefined:()=>dO,ZodUnion:()=>yh,ZodUnknown:()=>gO,ZodVoid:()=>yO,ZodXID:()=>xk,ZodXor:()=>vO,_ZodString:()=>yk,_default:()=>OO,_function:()=>CH,any:()=>lH,array:()=>gh,base64:()=>VW,base64url:()=>qW,bigint:()=>iH,boolean:()=>lO,catch:()=>jO,check:()=>NH,cidrv4:()=>GW,cidrv6:()=>BW,clone:()=>ct,codec:()=>AH,coerce:()=>rD,compile:()=>vC,config:()=>Wt,core:()=>bs,creditCard:()=>HW,cuid:()=>OW,cuid2:()=>DW,custom:()=>OH,date:()=>dH,decode:()=>QN,decodeAsync:()=>eO,deepPartial:()=>HH,describe:()=>DH,discriminatedUnion:()=>yH,e164:()=>WW,email:()=>SW,emoji:()=>CW,encode:()=>YN,encodeAsync:()=>XN,endsWith:()=>hd,enum:()=>Lk,exactOptional:()=>PO,file:()=>SH,flattenError:()=>jg,float32:()=>eH,float64:()=>tH,formatError:()=>zg,fromJSONSchema:()=>qH,function:()=>CH,getDiscriminatedOption:()=>zP,getErrorMap:()=>p_e,globalRegistry:()=>Un,gt:()=>To,gte:()=>ti,guid:()=>xW,hash:()=>XW,hex:()=>QW,hostname:()=>YW,httpUrl:()=>PW,iban:()=>KW,includes:()=>md,input:()=>JH,instanceof:()=>LH,int:()=>gk,int32:()=>nH,int64:()=>oH,intersection:()=>kO,invertCodec:()=>IH,ipv4:()=>UW,ipv6:()=>zW,iso:()=>kh,json:()=>UH,jwt:()=>JW,keyof:()=>pH,ksuid:()=>FW,lazy:()=>HO,length:()=>Zc,literal:()=>$H,locales:()=>ih,looseObject:()=>gH,looseRecord:()=>vH,lowercase:()=>pd,lt:()=>Eo,lte:()=>ei,mac:()=>jW,map:()=>_H,maxLength:()=>Jc,maxSize:()=>ga,memoizer:()=>nh,meta:()=>MH,mime:()=>yd,minLength:()=>ys,minSize:()=>Ao,multipleOf:()=>ma,nan:()=>TH,nanoid:()=>NW,nativeEnum:()=>kH,negative:()=>ik,never:()=>Mk,nonnegative:()=>sk,nonoptional:()=>LO,nonpositive:()=>ok,normalize:()=>bd,null:()=>fO,nullable:()=>ph,nullish:()=>xH,number:()=>cO,object:()=>fH,optional:()=>Qc,output:()=>ZH,overwrite:()=>no,parse:()=>HN,parseAsync:()=>KN,partialRecord:()=>bH,pipe:()=>hk,positive:()=>rk,prefault:()=>MO,preprocess:()=>jH,prettifyError:()=>QR,promise:()=>PH,properties:()=>YO,property:()=>ak,readonly:()=>VO,record:()=>xO,refine:()=>QO,regex:()=>dd,regexes:()=>fr,registry:()=>Nw,safeDecode:()=>nO,safeDecodeAsync:()=>iO,safeEncode:()=>tO,safeEncodeAsync:()=>rO,safeParse:()=>JN,safeParseAsync:()=>ZN,set:()=>wH,setErrorMap:()=>d_e,size:()=>Kc,slugify:()=>kd,startsWith:()=>gd,strictObject:()=>mH,string:()=>dh,stringFormat:()=>ZW,stringbool:()=>FH,success:()=>EH,superRefine:()=>XO,symbol:()=>aH,templateLiteral:()=>RH,toJSONSchema:()=>dk,toLowerCase:()=>_d,toUpperCase:()=>wd,toZod:()=>Cg,transform:()=>Fk,treeifyError:()=>YR,trim:()=>vd,tuple:()=>SO,uint32:()=>rH,uint64:()=>sH,ulid:()=>MW,undefined:()=>cH,union:()=>Dd,unknown:()=>Yc,uppercase:()=>fd,url:()=>RW,util:()=>q,uuid:()=>EW,uuidv4:()=>TW,uuidv6:()=>AW,uuidv7:()=>IW,validate:()=>Gg,validateAsync:()=>Bg,void:()=>uH,withParser:()=>Ow,xid:()=>LW,xor:()=>hH});var bs={};Cr(bs,{$ZodAny:()=>NP,$ZodArray:()=>FP,$ZodAsyncError:()=>Mr,$ZodBase64:()=>wP,$ZodBase64URL:()=>kP,$ZodBigInt:()=>vw,$ZodBigIntFormat:()=>IP,$ZodBoolean:()=>Zg,$ZodCIDRv4:()=>vP,$ZodCIDRv6:()=>_P,$ZodCUID:()=>aP,$ZodCUID2:()=>cP,$ZodCatch:()=>rC,$ZodCheck:()=>St,$ZodCheckBigIntFormat:()=>D0,$ZodCheckEndsWith:()=>H0,$ZodCheckGreaterThan:()=>nw,$ZodCheckIncludes:()=>q0,$ZodCheckLengthEquals:()=>z0,$ZodCheckLessThan:()=>tw,$ZodCheckLowerCase:()=>B0,$ZodCheckMaxLength:()=>U0,$ZodCheckMaxSize:()=>M0,$ZodCheckMimeType:()=>J0,$ZodCheckMinLength:()=>j0,$ZodCheckMinSize:()=>L0,$ZodCheckMultipleOf:()=>N0,$ZodCheckNumberFormat:()=>O0,$ZodCheckOverwrite:()=>Z0,$ZodCheckProperty:()=>K0,$ZodCheckRegex:()=>G0,$ZodCheckSizeEquals:()=>F0,$ZodCheckStartsWith:()=>W0,$ZodCheckStringFormat:()=>sd,$ZodCheckUpperCase:()=>V0,$ZodCodec:()=>Qg,$ZodCreditCard:()=>SP,$ZodCustom:()=>uC,$ZodCustomStringFormat:()=>TP,$ZodCyclicError:()=>Ew,$ZodDate:()=>LP,$ZodDefault:()=>XP,$ZodDiscriminatedUnion:()=>GP,$ZodE164:()=>$P,$ZodEmail:()=>tP,$ZodEmoji:()=>oP,$ZodEncodeError:()=>fa,$ZodEnum:()=>HP,$ZodError:()=>ZR,$ZodExactOptional:()=>YP,$ZodFile:()=>JP,$ZodFunction:()=>cC,$ZodGUID:()=>X0,$ZodIBAN:()=>xP,$ZodIPv4:()=>hP,$ZodIPv6:()=>yP,$ZodISODate:()=>fP,$ZodISODateTime:()=>pP,$ZodISODuration:()=>gP,$ZodISOTime:()=>mP,$ZodIntersection:()=>BP,$ZodJWT:()=>EP,$ZodKSUID:()=>dP,$ZodLazy:()=>Xg,$ZodLiteral:()=>KP,$ZodMAC:()=>bP,$ZodMap:()=>qP,$ZodNaN:()=>iC,$ZodNanoID:()=>sP,$ZodNever:()=>DP,$ZodNonOptional:()=>tC,$ZodNull:()=>CP,$ZodNullable:()=>QP,$ZodNumber:()=>bw,$ZodNumberFormat:()=>AP,$ZodObject:()=>N4,$ZodObjectJIT:()=>UP,$ZodOptional:()=>ww,$ZodPipe:()=>kw,$ZodPrefault:()=>eC,$ZodPreprocess:()=>oC,$ZodPromise:()=>lC,$ZodProperties:()=>dC,$ZodReadonly:()=>sC,$ZodRealError:()=>Lr,$ZodRecord:()=>VP,$ZodRegistry:()=>Cw,$ZodSet:()=>WP,$ZodString:()=>Bc,$ZodStringFormat:()=>ft,$ZodSuccess:()=>nC,$ZodSymbol:()=>RP,$ZodTemplateLiteral:()=>aC,$ZodTransform:()=>ZP,$ZodTuple:()=>_w,$ZodType:()=>Me,$ZodULID:()=>lP,$ZodURL:()=>iP,$ZodUUID:()=>eP,$ZodUndefined:()=>PP,$ZodUnion:()=>Yg,$ZodUnknown:()=>OP,$ZodVoid:()=>MP,$ZodXID:()=>uP,$ZodXor:()=>jP,$brand:()=>HR,$constructor:()=>D,$input:()=>gC,$output:()=>mC,Doc:()=>Gc,INVALID:()=>mr,JSONSchema:()=>wW,JSONSchemaGenerator:()=>pk,NEVER:()=>WR,TimePrecision:()=>EC,URL_BAD_FORMAT:()=>nP,URL_UNPARSEABLE:()=>rP,ZodCompileAsyncError:()=>to,ZodCompileUnsupportedError:()=>We,_any:()=>BC,_array:()=>YC,_base64:()=>Xw,_base64url:()=>ek,_bigint:()=>MC,_boolean:()=>OC,_catch:()=>Kve,_check:()=>oW,_cidrv4:()=>Yw,_cidrv6:()=>Qw,_coercedBigint:()=>LC,_coercedBoolean:()=>DC,_coercedDate:()=>KC,_coercedNumber:()=>AC,_coercedString:()=>kC,_creditCard:()=>SC,_cuid:()=>Vw,_cuid2:()=>qw,_custom:()=>XC,_date:()=>HC,_decode:()=>q_,_decodeAsync:()=>H_,_default:()=>qve,_discriminatedUnion:()=>Nve,_e164:()=>tk,_email:()=>Mw,_emoji:()=>Gw,_encode:()=>V_,_encodeAsync:()=>W_,_endsWith:()=>hd,_enum:()=>Uve,_file:()=>QC,_float32:()=>RC,_float64:()=>PC,_gt:()=>To,_gte:()=>ti,_guid:()=>Lw,_iban:()=>xC,_includes:()=>md,_int:()=>IC,_int32:()=>CC,_int64:()=>FC,_intersection:()=>Ove,_ipv4:()=>Jw,_ipv6:()=>Zw,_isoDate:()=>ah,_isoDateTime:()=>sh,_isoDuration:()=>lh,_isoTime:()=>ch,_jwt:()=>nk,_ksuid:()=>Kw,_lazy:()=>Qve,_length:()=>Zc,_literal:()=>zve,_lowercase:()=>pd,_lt:()=>Eo,_lte:()=>ei,_mac:()=>$C,_map:()=>Lve,_max:()=>ei,_maxLength:()=>Jc,_maxSize:()=>ga,_mime:()=>yd,_min:()=>ti,_minLength:()=>ys,_minSize:()=>Ao,_multipleOf:()=>ma,_nan:()=>JC,_nanoid:()=>Bw,_nativeEnum:()=>jve,_negative:()=>ik,_never:()=>qC,_nonnegative:()=>sk,_nonoptional:()=>Wve,_nonpositive:()=>ok,_normalize:()=>bd,_null:()=>GC,_nullable:()=>Vve,_number:()=>TC,_optional:()=>Bve,_overwrite:()=>no,_parse:()=>nd,_parseAsync:()=>rd,_pipe:()=>Jve,_positive:()=>rk,_promise:()=>Xve,_properties:()=>ZC,_property:()=>ak,_readonly:()=>Zve,_record:()=>Mve,_refine:()=>eN,_regex:()=>dd,_safeDecode:()=>J_,_safeDecodeAsync:()=>Y_,_safeEncode:()=>K_,_safeEncodeAsync:()=>Z_,_safeParse:()=>id,_safeParseAsync:()=>od,_set:()=>Fve,_size:()=>Kc,_slugify:()=>kd,_startsWith:()=>gd,_string:()=>wC,_stringFormat:()=>$d,_stringbool:()=>iN,_success:()=>Hve,_superRefine:()=>tN,_symbol:()=>jC,_templateLiteral:()=>Yve,_toLowerCase:()=>_d,_toUpperCase:()=>wd,_transform:()=>Gve,_trim:()=>vd,_tuple:()=>Dve,_uint32:()=>NC,_uint64:()=>UC,_ulid:()=>Ww,_undefined:()=>zC,_union:()=>Pve,_unknown:()=>VC,_uppercase:()=>fd,_url:()=>oh,_uuid:()=>Fw,_uuidv4:()=>Uw,_uuidv6:()=>jw,_uuidv7:()=>zw,_void:()=>WC,_xid:()=>Hw,_xor:()=>Cve,base64Charset:()=>fw,base64urlCharset:()=>Jg,clone:()=>ct,compile:()=>vC,compileFn:()=>Dw,config:()=>Wt,createStandardJSONSchemaMethod:()=>Sd,createToJSONSchemaMethod:()=>sN,decode:()=>Nhe,decodeAsync:()=>Dhe,describe:()=>nN,encode:()=>Che,encodeAsync:()=>Ohe,extractDefs:()=>ya,finalize:()=>ba,flattenError:()=>jg,formatError:()=>zg,getDiscriminatedOption:()=>zP,globalConfig:()=>_n,globalRegistry:()=>Un,handleUnrepresentable:()=>en,initializeContext:()=>ha,isBackEdge:()=>Aw,isRecursiveSchema:()=>Tw,isTransforming:()=>In,isValidBase64:()=>Kg,isValidBase64URL:()=>mw,isValidCIDRv6:()=>pw,isValidCreditCard:()=>gw,isValidIBAN:()=>hw,isValidIPv6:()=>Hg,isValidJWT:()=>yw,locales:()=>ih,memoizer:()=>nh,mergeValues:()=>ad,meta:()=>rN,parse:()=>G_,parseAsync:()=>B_,parseURLObject:()=>cw,prettifyError:()=>QR,process:()=>lt,processSchema:()=>lt,regexes:()=>fr,registry:()=>Nw,safeDecode:()=>Lhe,safeDecodeAsync:()=>Uhe,safeEncode:()=>Mhe,safeEncodeAsync:()=>Fhe,safeParse:()=>The,safeParseAsync:()=>Ahe,standardProps:()=>aw,stripTabAndNewline:()=>lw,toDotPath:()=>c4,toJSONSchema:()=>dk,toZod:()=>Cg,treeifyError:()=>YR,urlHostnameOk:()=>uw,urlProtocolOk:()=>dw,util:()=>q,validate:()=>Gg,validateAsync:()=>Bg,version:()=>Y0,withParser:()=>Ow});var q={};Cr(q,{BIGINT_FORMAT_RANGES:()=>Lg,CONSTANT_CATCH:()=>j_,Class:()=>DR,NUMBER_FORMAT_RANGES:()=>Mg,aborted:()=>dr,allowsEval:()=>FR,assert:()=>Kge,assertEqual:()=>Vge,assertIs:()=>Wge,assertNever:()=>Hge,assertNotEqual:()=>qge,assignProp:()=>An,attachSchema:()=>U_,base64ToUint8Array:()=>n4,base64urlToUint8Array:()=>fhe,cached:()=>Xu,captureStackTrace:()=>L_,cleanEnum:()=>phe,cleanRegex:()=>gs,clone:()=>ct,cloneDef:()=>Yge,codePointLength:()=>jc,constantCatch:()=>VR,createTransparentProxy:()=>rhe,defineLazy:()=>MR,defineLazyInternal:()=>Be,derived:()=>yhe,esc:()=>ur,escapeRegex:()=>Ti,explicitlyAborted:()=>zR,extend:()=>she,finalizeIssue:()=>Dr,floatSafeRemainder:()=>Ng,getElementAtPath:()=>Qge,getEnumValues:()=>Yu,getLengthableOrigin:()=>Ug,getParsedType:()=>nhe,getSizableOrigin:()=>Fg,hexToUint8Array:()=>ghe,hide:()=>BR,installLazyProp:()=>_he,isObject:()=>Uc,isPlainObject:()=>Ei,issue:()=>td,joinValues:()=>M,jsonStringifyReplacer:()=>Qu,members:()=>GR,merge:()=>che,mergeDefs:()=>eo,normalizeParams:()=>re,nullish:()=>M_,numKeys:()=>the,objectClone:()=>Jge,omit:()=>ohe,optionalKeys:()=>jR,own:()=>pa,parsedType:()=>Z,partial:()=>lhe,pick:()=>ihe,prefixIssues:()=>pr,primitiveTypes:()=>UR,promiseAllObject:()=>Xge,propertyKeyTypes:()=>Dg,randomString:()=>ehe,rawShape:()=>ed,required:()=>uhe,safeExtend:()=>ahe,shallowClone:()=>Og,slugify:()=>LR,stringifyPrimitive:()=>W,toZod:()=>Cg,uint8ArrayToBase64:()=>r4,uint8ArrayToBase64url:()=>mhe,uint8ArrayToHex:()=>hhe,unwrapMessage:()=>Zu});function Vge(e){return e}function qge(e){return e}function Cg(){return e=>e}function Wge(e){}function Hge(e){throw new Error("Unexpected value in exhaustive check")}function Kge(e){}function Yu(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function M(e,t="|"){return e.map(n=>W(n)).join(t)}function Qu(e,t){return typeof t=="bigint"?t.toString():t}var OR=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Xu(e){return new OR(e)}function M_(e){return e==null}function gs(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Ng(e,t){let n=e/t,r=Math.round(n),i=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r){let a=t._zod.def.shape[o];return r?r(a,o):a}):e4(e,o,r?r(s.value,o):s.value))}}function Zge(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?X2(e,n,()=>t[n]):e4(e,n,r.value))}}function eo(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Yge(e){return eo(e._zod.def)}function Qge(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function Xge(e){let t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{let i={};for(let o=0;o{};function Uc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var FR=Xu(()=>{if(_n.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ei(e){if(Uc(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Uc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Og(e){return Ei(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function the(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var nhe=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Dg=new Set(["string","number","symbol"]),UR=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ti(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ct(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function re(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function rhe(e){let t;return new Proxy({},{get(n,r,i){return t??(t=e()),Reflect.get(t,r,i)},set(n,r,i,o){return t??(t=e()),Reflect.set(t,r,i,o)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??(t=e()),Reflect.defineProperty(t,r,i)}})}function W(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function jR(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Mg={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Lg={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ihe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return Fc(o,e,F_(e,t)),ct(e,eo(n,{shape:o,checks:[]}))}function F_(e,t){let n=ms(e),r=[];for(let i of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,i)?.enumerable)throw new Error(`Unrecognized key: "${String(i)}"`);t[i]&&r.push(i)}return r}function ohe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(F_(e,t)),s={};return Fc(s,e,Reflect.ownKeys(ms(e)).filter(a=>!o.has(a))),ct(e,eo(n,{shape:s,checks:[]}))}function she(e,t){if(!Ei(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let i=ms(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(i,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ct(e,eo(e._zod.def,{shape:t4(e,t)}))}function t4(e,t){let n={};return Fc(n,e,Reflect.ownKeys(ms(e))),Zge(n,t),n}function ahe(e,t){if(!Ei(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ct(e,eo(e._zod.def,{shape:t4(e,t)}))}function che(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Fc(n,e,Reflect.ownKeys(ms(e))),Fc(n,t,Reflect.ownKeys(ms(t)));let r=eo(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ct(e,r)}function lhe(e,t,n,r="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(F_(t,n)):void 0,c={};return Fc(c,t,Reflect.ownKeys(ms(t)),e&&((l,u)=>a&&!a.has(u)?l:new e({type:"optional",innerType:l}))),ct(t,eo(t._zod.def,{shape:c,checks:[]}))}function uhe(e,t,n){let r=n?new Set(F_(t,n)):void 0,i={};return Fc(i,t,Reflect.ownKeys(ms(t)),(o,s)=>r&&!r.has(s)?o:new e({type:"nonoptional",innerType:o})),ct(t,eo(t._zod.def,{shape:i}))}function dr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Zu(e){return typeof e=="string"?e:e?.message}function U_(e,t,n){var r;for(let i=t;iNumber.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function n4(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;rt.toString(16).padStart(2,"0")).join("")}var DR=class{constructor(...t){}};function GR(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Q2(e,n,r.value)}for(let n of Object.getOwnPropertySymbols(t))Q2(e,n,t[n])}function pa(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function BR(e,t,n){return pa(e,t,n,!1)}function yhe(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return pa(this,n,r(this))},set(i){pa(this,n,i)}})}return t}function Q2(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:pa(this,t,n.bind(this))},set(r){pa(this,t,r)}})}function bhe(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var NR,da=!1,vhe={configurable:!0,get(){da=!0}};function Be(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&NR!==e._zod){NR=void 0;return}NR=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,vhe);let i=da;da=!1;try{let o=n(this);return da?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),da=da||i,o}catch(o){throw delete this[t],da=da||i,o}},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i})}})}function _he(e,t,n,r){let i=bhe(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:o})}})}var j_="~constantCatch";function VR(e){let t=()=>e;return t[j_]=!0,t}var i4,WR=Object.freeze({status:"aborted"}),qR={value:void 0,enumerable:!1},o4="captureStackTrace"in Error?Error:null;function whe(e){let t=o4;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return o4=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function D(e,t,n,r){let i={};function o(p){this.def=p,this.constr=d,this.traits=new Set}o.prototype=i;let s=n,a=s&&new WeakSet;function c(p,f){if(!p._zod){qR.value=new o(f);try{Object.defineProperty(p,"_zod",qR)}finally{qR.value=void 0}}if(p._zod.traits.has(e))return;if(p._zod.traits.add(e),t(p,f),a){let g=Object.getPrototypeOf(p),h=p._zod.constr.prototype,v=g;for(;v&&v!==h;)v=Object.getPrototypeOf(v);let b=v??g;a.has(b)||(a.add(b),GR(b,s))}let m=d.prototype;for(let g in m)Object.prototype.hasOwnProperty.call(m,g)&&(g in p||(p[g]=m[g].bind(p)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(p){let f=r?.Parent?whe(u):this;c(f,p);let m=f._zod.deferred;if(m){for(let h of m)h();f._zod.deferred=void 0}let g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(f),f}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var HR=Symbol("zod_brand"),Mr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},fa=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(i4=globalThis).__zod_globalConfig??(i4.__zod_globalConfig={});var _n=globalThis.__zod_globalConfig;function Wt(e){return e&&Object.assign(_n,e),_n}function khe(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Qu,2)),e.message}function $he(e){this._zod.message=e}var She={get:khe,set:$he,enumerable:!0,configurable:!0},JR={value:void 0,enumerable:!1},s4=new WeakSet([Object.prototype,Error.prototype]),a4=(e,t)=>{e.name="$ZodError",JR.value=t,Object.defineProperty(e,"issues",JR),JR.value=void 0,Object.defineProperty(e,"message",She);let n=Object.getPrototypeOf(e);s4.has(n)||(s4.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},ZR=D("$ZodError",a4),Lr=D("$ZodError",a4,void 0,{Parent:Error});function xhe(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function jg(e,t=n=>n.message){let n={},r=[];for(let i of e.issues)i.path.length>0?xhe(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function zg(e,t=n=>n.message){let n={_errors:[]},r=(i,o=[])=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,l=0;for(;ln.message){let n={errors:[]},r=(i,o=[])=>{var s;for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>r({issues:c},[...o,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...o,...a.path]);else{let c=[...o,...a.path];if(c.length===0){n.errors.push(t(a));continue}let l=n,u=0;for(;utypeof r=="object"?r.key:r);for(let r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function QR(e){let t=[],n=[...e.issues].sort((r,i)=>(r.path??[]).length-(i.path??[]).length);for(let r of n)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${c4(r.path)}`);return t.join(` +`)}function z_(e,t){return{callee:t?.callee??e,Err:t?.Err}}var nd=e=>{let t=(n,r,i,o)=>{let s=i?{...i,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new Mr;if(a.issues.length){let c=new(o?.Err??e)(a.issues.map(l=>Dr(l,s,Wt())));throw L_(c,o?.callee??t),c}return a.value};return t},G_=nd(Lr),rd=e=>{let t=async(n,r,i,o)=>{let s=i?{...i,async:!0}:{async:!0},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(o?.Err??e)(a.issues.map(l=>Dr(l,s,Wt())));throw L_(c,o?.callee??t),c}return a.value};return t},B_=rd(Lr),id=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Mr;return o.issues.length?l4(e,o.issues,i):{success:!0,data:o.value}},The=id(Lr);function l4(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(i=>Dr(i,n,Wt()))),t=void 0,n=void 0),r},set error(i){r=i,t=void 0,n=void 0}}}var od=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?l4(e,o.issues,i):{success:!0,data:o.value}},Ahe=od(Lr),Ihe=Symbol.for("zod.compile.invalid"),Rhe=Symbol.for("zod.compile.fallback"),Gg=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Ihe)return!0;if(r.definite===!0&&n===void 0)return!1}return Phe(e,t,n)});function Phe(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,o;if(i?(r[Rhe]=!0,o=i({value:t,issues:[]},r)):o=e._zod.run({value:t,issues:[]},r),o instanceof Promise)throw new Mr;return o.issues.length===0}var Bg=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},V_=e=>{let t=nd(e),n=(r,i,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return t(r,i,a,z_(n,s))};return n},Che=V_(Lr),q_=e=>{let t=nd(e),n=(r,i,o,s)=>t(r,i,o,z_(n,s));return n},Nhe=q_(Lr),W_=e=>{let t=rd(e),n=async(r,i,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return await t(r,i,a,z_(n,s))};return n},Ohe=W_(Lr),H_=e=>{let t=rd(e),n=async(r,i,o,s)=>await t(r,i,o,z_(n,s));return n},Dhe=H_(Lr),K_=e=>(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return id(e)(t,n,i)},Mhe=K_(Lr),J_=e=>(t,n,r)=>id(e)(t,n,r),Lhe=J_(Lr),Z_=e=>async(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return od(e)(t,n,i)},Fhe=Z_(Lr),Y_=e=>async(t,n,r)=>od(e)(t,n,r),Uhe=Y_(Lr);var fr={};Cr(fr,{anyString:()=>$0,base64:()=>h0,base64url:()=>y0,bigint:()=>x0,boolean:()=>E0,browserEmail:()=>Hhe,cidrv4:()=>m0,cidrv6:()=>g0,creditCard:()=>Q_,cuid:()=>e0,cuid2:()=>t0,date:()=>_0,datetime:()=>k0,domain:()=>Zhe,duration:()=>a0,e164:()=>v0,email:()=>l0,emoji:()=>u0,extendedDuration:()=>jhe,guid:()=>c0,hex:()=>Qhe,hostname:()=>Jhe,html5Email:()=>Vhe,httpProtocol:()=>b0,iban:()=>X_,idnEmail:()=>Whe,integer:()=>Vg,ipv4:()=>d0,ipv6:()=>p0,ksuid:()=>i0,lowercase:()=>I0,mac:()=>f0,md5_base64:()=>eye,md5_base64url:()=>tye,md5_hex:()=>Xhe,nanoid:()=>o0,nanoidOfLength:()=>s0,null:()=>T0,number:()=>hs,rfc5322Email:()=>qhe,sha1_base64:()=>rye,sha1_base64url:()=>iye,sha1_hex:()=>nye,sha256_base64:()=>sye,sha256_base64url:()=>aye,sha256_hex:()=>oye,sha384_base64:()=>lye,sha384_base64url:()=>uye,sha384_hex:()=>cye,sha512_base64:()=>pye,sha512_base64url:()=>fye,sha512_hex:()=>dye,string:()=>S0,time:()=>w0,ulid:()=>n0,undefined:()=>A0,unicodeEmail:()=>u4,uppercase:()=>R0,uuid:()=>zc,uuid4:()=>zhe,uuid6:()=>Ghe,uuid7:()=>Bhe,xid:()=>r0});var e0=/^[cC][0-9a-z]{6,}$/,t0=/^[0-9a-z]+$/,n0=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,r0=/^[0-9a-vA-V]{20}$/,i0=/^[A-Za-z0-9]{27}$/,o0=/^[a-zA-Z0-9_-]{21}$/;function s0(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var a0=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jhe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,c0=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,zc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,zhe=zc(4),Ghe=zc(6),Bhe=zc(7),l0=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vhe=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,qhe=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,u4=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Whe=u4,Hhe=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Khe="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function u0(){return new RegExp(Khe,"u")}var d0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,p0=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,f0=e=>{let t=Ti(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},m0=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,g0=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,h0=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,y0=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Jhe=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Zhe=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,b0=/^https?$/,v0=/^\+[1-9]\d{6,14}$/,Q_=/^\d(?:[ -]?\d){11,18}$/,X_=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,d4="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Yhe(e){return new RegExp(`^${e}$`)}var _0=Yhe(d4);function XR(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function w0(e){return new RegExp(`^${XR(e)}$`)}function k0(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${XR({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${XR({precision:e.precision})}`:n;return new RegExp(`^${d4}T(?:${r})$`)}var $0=/^[\s\S]{0,}$/,S0=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},x0=/^-?\d+n?$/,Vg=/^-?\d+$/,hs=/^-?\d+(?:\.\d+)?$/,E0=/^(?:true|false)$/i,T0=/^null$/i;var A0=/^undefined$/i;var I0=/^[^A-Z]*$/,R0=/^[^a-z]*$/,Qhe=/^[0-9a-fA-F]*$/;function qg(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Wg(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Xhe=/^[0-9a-fA-F]{32}$/,eye=qg(22,"=="),tye=Wg(22),nye=/^[0-9a-fA-F]{40}$/,rye=qg(27,"="),iye=Wg(27),oye=/^[0-9a-fA-F]{64}$/,sye=qg(43,"="),aye=Wg(43),cye=/^[0-9a-fA-F]{96}$/,lye=qg(64,""),uye=Wg(64),dye=/^[0-9a-fA-F]{128}$/,pye=qg(86,"=="),fye=Wg(86);var St=D("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),P0=e=>{let t=e.value;return!M_(t)&&t.size!==void 0},C0=e=>{let t=e.value;return!M_(t)&&t.length!==void 0},ew={number:"number",bigint:"bigint",object:"date"},tw=D("$ZodCheckLessThan",(e,t)=>{St.init(e,t);let n=ew[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value{St.init(e,t);let n=ew[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:ew[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),N0=D("$ZodCheckMultipleOf",(e,t)=>{St.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Ng(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),O0=D("$ZodCheckNumberFormat",(e,t)=>{St.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[i,o]=Mg[t.format];e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}ao&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),D0=D("$ZodCheckBigIntFormat",(e,t)=>{St.init(e,t);let[n,r]=Lg[t.format];e._zod.check=i=>{let o=i.value;or&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),M0=D("$ZodCheckMaxSize",(e,t)=>{var n;St.init(e,t),(n=e._zod.def).when??(n.when=P0),e._zod.check=r=>{let i=r.value;i.size<=t.maximum||r.issues.push({origin:Fg(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),L0=D("$ZodCheckMinSize",(e,t)=>{var n;St.init(e,t),(n=e._zod.def).when??(n.when=P0),e._zod.check=r=>{let i=r.value;i.size>=t.minimum||r.issues.push({origin:Fg(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),F0=D("$ZodCheckSizeEquals",(e,t)=>{var n;St.init(e,t),(n=e._zod.def).when??(n.when=P0),e._zod.check=r=>{let i=r.value,o=i.size;if(o===t.size)return;let s=o>t.size;r.issues.push({origin:Fg(i),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),U0=D("$ZodCheckMaxLength",(e,t)=>{var n;St.init(e,t),(n=e._zod.def).when??(n.when=C0),e._zod.check=r=>{let i=r.value,o=i.length;if((typeof i=="string"&&o>t.maximum?jc(i):o)<=t.maximum)return;let a=Ug(i);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),j0=D("$ZodCheckMinLength",(e,t)=>{var n;St.init(e,t),(n=e._zod.def).when??(n.when=C0),e._zod.check=r=>{let i=r.value,o=i.length;if((typeof i=="string"&&o>=t.minimum&&o=t.minimum)return;let a=Ug(i);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),z0=D("$ZodCheckLengthEquals",(e,t)=>{var n;St.init(e,t),(n=e._zod.def).when??(n.when=C0),e._zod.check=r=>{let i=r.value,o=i.length,s=typeof i=="string"&&o>=t.length&&o<=t.length*2?jc(i):o;if(s===t.length)return;let a=Ug(i),c=s>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),sd=D("$ZodCheckStringFormat",(e,t)=>{var n,r;St.init(e,t),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),G0=D("$ZodCheckRegex",(e,t)=>{sd.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),B0=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=I0),sd.init(e,t)}),V0=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=R0),sd.init(e,t)}),q0=D("$ZodCheckIncludes",(e,t)=>{St.init(e,t);let n=Ti(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),W0=D("$ZodCheckStartsWith",(e,t)=>{St.init(e,t);let n=new RegExp(`^${Ti(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),H0=D("$ZodCheckEndsWith",(e,t)=>{St.init(e,t);let n=new RegExp(`.*${Ti(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function p4(e,t,n){e.issues.length&&t.issues.push(...pr(n,e.issues))}var K0=D("$ZodCheckProperty",(e,t)=>{St.init(e,t),e._zod.check=n=>{let r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(i=>p4(i,n,t.property));p4(r,n,t.property)}}),J0=D("$ZodCheckMimeType",(e,t)=>{St.init(e,t);let n=new Set(t.mime);e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Z0=D("$ZodCheckOverwrite",(e,t)=>{St.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var Gc=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(` +`).filter(s=>s),i=Math.min(...r.map(s=>s.length-s.trimStart().length)),o=r.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { ${n.join(` `)} -};`)(...Object.values(this.closed))}};var s0={major:4,minor:6,patch:2};var Ce=R("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=s0;let i=e._zod.def.checks,r=e._zod.traits.has("$ZodCheck")?[e,...i??[]]:i?.length?[...i]:[];for(let o of r)for(let s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(a,c,l)=>{if(a.memo)return a;let u=rr(a),d;for(let p of c){if(p._zod.def.when){if(ZT(a)||!p._zod.def.when(a))continue}else if(u)continue;let f=a.issues.length,m=p._zod.check(a);if(m instanceof Promise&&l?.async===!1)throw new Tr;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,a.issues.length!==f&&(ov(a.issues,f,e),u||(u=rr(a,f)))});else{if(a.issues.length===f)continue;ov(a.issues,f,e),u||(u=rr(a,f))}}return d?d.then(()=>a):a},s=(a,c,l)=>{if(rr(a))return a.aborted=!0,a;let u=o(c,r,l);if(u instanceof Promise){if(l.async===!1)throw new Tr;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,a,c)):s(u,a,c)}let l=e._zod.parse(a,c);if(l instanceof Promise){if(c.async===!1)throw new Tr;return l.then(u=>o(u,r,c))}return o(l,r,c)}}},{get"~standard"(){return QT(this,"~standard",Tv(this))},set"~standard"(e){Us(this,"~standard",e)}}),cV=(e,t)=>e.issues.length?{issues:e.issues.map(n=>Er(n,t,zt()))}:{value:e.value};async function Uue(e,t){let n={async:!0};return cV(await e._zod.run({value:t,issues:[]},n),n)}function Tv(e){return{validate:t=>{let n={async:!1};try{let i=e._zod.run({value:t,issues:[]},n);if(!(i instanceof Promise))return cV(i,n)}catch{}return Uue(e,t)},vendor:"zod",version:1}}var kc=R("$ZodString",(e,t)=>{Ce.init(e,t),e._zod.pattern=t.pattern??CI,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ut=R("$ZodStringFormat",(e,t)=>{Mu.init(e,t),kc.init(e,t)}),c0=R("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=yI),ut.init(e,t)}),l0=R("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=vc(i))}else t.pattern??(t.pattern=vc());ut.init(e,t)}),u0=R("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=bI),ut.init(e,t)}),d0=1,p0=2;function Iv(e,t){if(!t.normalize&&t.protocol?.source===TI.source&&!/^https?:\/\//i.test(e))return d0;try{return new URL(e)}catch{return p0}}var jue=/[\t\n\r]/g;function Av(e){return e.replace(jue,"")}function Rv(e,t){return t.lastIndex=0,t.test(e.hostname)}function Nv(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var f0=R("$ZodURL",(e,t)=>{ut.init(e,t),e._zod.check=n=>{try{let i=n.value.trim(),r=Iv(i,t);if(r===d0){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(r===p0){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!Rv(r,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Nv(r,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?r.href:Av(i);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),m0=R("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=vI()),ut.init(e,t)}),g0=R("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?mI:gI(t.length)),ut.init(e,t)}),h0=R("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lI),ut.init(e,t)}),y0=R("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=uI),ut.init(e,t)}),b0=R("$ZodULID",(e,t)=>{t.pattern??(t.pattern=dI),ut.init(e,t)}),v0=R("$ZodXID",(e,t)=>{t.pattern??(t.pattern=pI),ut.init(e,t)}),w0=R("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fI),ut.init(e,t)}),k0=R("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=NI(t)),ut.init(e,t)}),$0=R("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=AI),ut.init(e,t)}),_0=R("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RI(t)),ut.init(e,t)}),S0=R("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=hI),ut.init(e,t)}),x0=R("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=wI),ut.init(e,t)}),zue=/^[0-9a-fA-F:.]+$/;function Um(e){if(!zue.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var E0=R("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=kI),ut.init(e,t),e._zod.check=n=>{Um(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),T0=R("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=$I(t.delimiter)),ut.init(e,t)}),I0=R("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=_I),ut.init(e,t)});function Cv(e){let t=e.split("/");if(t.length!==2)return!1;let[n,i]=t;if(!i)return!1;let r=Number(i);return`${r}`!==i||r<0||r>128?!1:Um(n)}var A0=R("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=SI),ut.init(e,t),e._zod.check=n=>{Cv(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function jm(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Pv=/^[0-9a-zA-Z+/]*={0,2}$/,R0=R("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Pv),ut.init(e,t),e._zod.check=n=>{jm(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),zm=/^[A-Za-z0-9_-]*$/;function Dv(e){if(!zm.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return jm(n)}var N0=R("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=zm),ut.init(e,t),e._zod.check=n=>{Dv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),C0=R("$ZodE164",(e,t)=>{t.pattern??(t.pattern=II),ut.init(e,t)}),Gue=/[- ]/g;function Vue(e){let t=e.length,n=1,i=0;for(;t;){let r=e.charCodeAt(--t)-48;n^=1,i+=n?[0,2,4,6,8,1,3,5,7,9][r]:r}return i%10===0}function Ov(e){return bv.test(e)?Vue(e.replace(Gue,"")):!1}var P0=R("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=bv),ut.init(e,t),e._zod.check=n=>{Ov(n.value)||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}});function Bue(e){let t=0,n=e.length;for(let i=4;i=65?t*100+(r-55):t*10+(r-48))%97}for(let i=0;i<4;i++){let r=e.charCodeAt(i);t=(r>=65?t*100+(r-55):t*10+(r-48))%97}return t===1}function Mv(e){return vv.test(e)?Bue(e):!1}var D0=R("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=vv),ut.init(e,t),e._zod.check=n=>{Mv(n.value)||n.issues.push({code:"invalid_format",format:"iban",input:n.value,inst:e,continue:!t.abort})}});function Lv(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var O0=R("$ZodJWT",(e,t)=>{ut.init(e,t),e._zod.check=n=>{Lv(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),M0=R("$ZodCustomStringFormat",(e,t)=>{ut.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Fv=R("$ZodNumber",(e,t)=>{Ce.init(e,t),e._zod.pattern=Ko,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:String(r):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...o?{received:o}:{}}),n}}),L0=R("$ZodNumberFormat",(e,t)=>{VI.init(e,t),Fv.init(e,t)}),Gm=R("$ZodBoolean",(e,t)=>{Ce.init(e,t),e._zod.pattern=OI,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),Uv=R("$ZodBigInt",(e,t)=>{Ce.init(e,t),e._zod.pattern=DI,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),F0=R("$ZodBigIntFormat",(e,t)=>{BI.init(e,t),Uv.init(e,t)}),U0=R("$ZodSymbol",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),j0=R("$ZodUndefined",(e,t)=>{Ce.init(e,t),e._zod.pattern=LI,e._zod.values=new Set([void 0]),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),z0=R("$ZodNull",(e,t)=>{Ce.init(e,t),e._zod.pattern=MI,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),G0=R("$ZodAny",(e,t)=>{Ce.init(e,t),e._zod.parse=n=>n}),V0=R("$ZodUnknown",(e,t)=>{Ce.init(e,t),e._zod.parse=n=>n}),B0=R("$ZodNever",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),q0=R("$ZodVoid",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),W0=R("$ZodDate",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:e}),n}});function WG(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues)),t.value[n]=e.value}var H0=R("$ZodArray",(e,t)=>{Ce.init(e,t);let n=hn.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),i;i.value=n?n.alloc(e,i,Array(o.length),r):Array(o.length);let s=[],a=r?.abortEarly;for(let c=0;cWG(d,i,c)));else if(WG(u,i,c),a&&u.issues.length!==0&&rr(u))break}return s.length?Promise.all(s).then(()=>i):i}});function Ev(e,t,n,i,r,o){let s=n in i,a=o==="optional";if(!(!s&&a&&r==="optional")){if(e.issues.length){if(r!==void 0&&a&&!s)return;t.issues.push(...ir(n,e.issues))}if(!s&&r===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(s||r==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}var que=[];function lV(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),i=n.length?n:que,r=i.length?[...t,...i]:t;for(let s of r)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let o=JT(e.shape);return{...e,allKeys:r,symbolKeys:i,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function uV(e,t,n,i,r,o,s){let a=[],c=r.keySet,l=r.catchall._zod,u=l.def.type,d=l.optin,p=l.optout,f=0;for(let m in t){if(s&&n.issues.length!==f){if(rr(n,f))break;f=n.issues.length}if(c.has(m))continue;if(m==="__proto__"){u==="never"&&a.push(m);continue}if(u==="never"){a.push(m);continue}let g=l.run({value:t[m],issues:[]},i);g instanceof Promise?e.push(g.then(h=>Ev(h,n,m,t,d,p))):Ev(g,n,m,t,d,p)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var dV=R("$ZodObject",(e,t)=>{Ce.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),i=n?.get?n.get.raw:t.shape??{};if(i){let l=()=>{let u={...i};return Object.defineProperty(t,"shape",{value:u}),l.raw=u,u};l.raw=i,Object.defineProperty(t,"shape",{get:l})}let r=Au(()=>lV(t));Ue(e,"propValues",l=>{let u=l.def.shape,d={};for(let p in u){let f=u[p]._zod;if(f.values){Object.prototype.hasOwnProperty.call(d,p)||Sn(d,p,new Set);for(let m of f.values)d[p].add(m);f.optin!==void 0&&d[p].add(void 0)}}return d});let o=yc,s=t.catchall,a,c=hn.memoizer;c?.attach(e),e._zod.parse=(l,u)=>{a??(a=r.value);let d=l.value;if(!o(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;l.value=c?c.alloc(e,l,{},u):{};let p=[],f=a.shape,m=u?.abortEarly,g=l.issues.length;for(let h of a.allKeys){if(m&&l.issues.length!==g){if(rr(l,g))break;g=l.issues.length}if(h==="__proto__")continue;let b=f[h],y=b._zod.optin,w=b._zod.optout,k=b._zod.run({value:d[h],issues:[]},u);k instanceof Promise?p.push(k.then(_=>Ev(_,l,h,d,y,w))):Ev(k,l,h,d,y,w)}return s?uV(p,d,l,u,r.value,e,m===!0):p.length?Promise.all(p).then(()=>l):l}}),K0=R("$ZodObjectJIT",(e,t)=>{dV.init(e,t);let n=e._zod.parse,i=Au(()=>lV(t)),r=hn.memoizer,o=f=>{let m=i.value,g=m.symbolKeys,h=new wc(["payload","ctx"],{shape:f,inst:e,memo:r,syms:g}),b=_=>`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`,y=(_,S)=>` - let ${_}_ab = false; - for (let i = 0; i < ${_}.issues.length; i++) { - const iss = ${_}.issues[i]; - iss.path = iss.path ? [${S}, ...iss.path] : [${S}]; +};`)(...Object.values(this.closed))}};var Y0={major:4,minor:6,patch:2};var Me=D("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Y0;let r=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let o of i)for(let s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(a,c,l)=>{if(a.memo)return a;let u=dr(a),d;for(let p of c){if(p._zod.def.when){if(zR(a)||!p._zod.def.when(a))continue}else if(u)continue;let f=a.issues.length,m=p._zod.check(a);if(m instanceof Promise&&l?.async===!1)throw new Mr;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,a.issues.length!==f&&(U_(a.issues,f,e),u||(u=dr(a,f)))});else{if(a.issues.length===f)continue;U_(a.issues,f,e),u||(u=dr(a,f))}}return d?d.then(()=>a):a},s=(a,c,l)=>{if(dr(a))return a.aborted=!0,a;let u=o(c,i,l);if(u instanceof Promise){if(l.async===!1)throw new Mr;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,a,c)):s(u,a,c)}let l=e._zod.parse(a,c);if(l instanceof Promise){if(c.async===!1)throw new Mr;return l.then(u=>o(u,i,c))}return o(l,i,c)}}},{get"~standard"(){return BR(this,"~standard",aw(this))},set"~standard"(e){pa(this,"~standard",e)}}),R4=(e,t)=>e.issues.length?{issues:e.issues.map(n=>Dr(n,t,Wt()))}:{value:e.value};async function mye(e,t){let n={async:!0};return R4(await e._zod.run({value:t,issues:[]},n),n)}function aw(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return R4(r,n)}catch{}return mye(e,t)},vendor:"zod",version:1}}var Bc=D("$ZodString",(e,t)=>{Me.init(e,t),e._zod.pattern=t.pattern??$0,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ft=D("$ZodStringFormat",(e,t)=>{sd.init(e,t),Bc.init(e,t)}),X0=D("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=c0),ft.init(e,t)}),eP=D("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=zc(r))}else t.pattern??(t.pattern=zc());ft.init(e,t)}),tP=D("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=l0),ft.init(e,t)}),nP=1,rP=2;function cw(e,t){if(!t.normalize&&t.protocol?.source===b0.source&&!/^https?:\/\//i.test(e))return nP;try{return new URL(e)}catch{return rP}}var gye=/[\t\n\r]/g;function lw(e){return e.replace(gye,"")}function uw(e,t){return t.lastIndex=0,t.test(e.hostname)}function dw(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var iP=D("$ZodURL",(e,t)=>{ft.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=cw(r,t);if(i===nP){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(i===rP){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!uw(i,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!dw(i,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:lw(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),oP=D("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=u0()),ft.init(e,t)}),sP=D("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?o0:s0(t.length)),ft.init(e,t)}),aP=D("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=e0),ft.init(e,t)}),cP=D("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=t0),ft.init(e,t)}),lP=D("$ZodULID",(e,t)=>{t.pattern??(t.pattern=n0),ft.init(e,t)}),uP=D("$ZodXID",(e,t)=>{t.pattern??(t.pattern=r0),ft.init(e,t)}),dP=D("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=i0),ft.init(e,t)}),pP=D("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=k0(t)),ft.init(e,t)}),fP=D("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=_0),ft.init(e,t)}),mP=D("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=w0(t)),ft.init(e,t)}),gP=D("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=a0),ft.init(e,t)}),hP=D("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=d0),ft.init(e,t)}),hye=/^[0-9a-fA-F:.]+$/;function Hg(e){if(!hye.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var yP=D("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=p0),ft.init(e,t),e._zod.check=n=>{Hg(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),bP=D("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=f0(t.delimiter)),ft.init(e,t)}),vP=D("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=m0),ft.init(e,t)});function pw(e){let t=e.split("/");if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Hg(n)}var _P=D("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=g0),ft.init(e,t),e._zod.check=n=>{pw(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function Kg(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var fw=/^[0-9a-zA-Z+/]*={0,2}$/,wP=D("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=fw),ft.init(e,t),e._zod.check=n=>{Kg(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Jg=/^[A-Za-z0-9_-]*$/;function mw(e){if(!Jg.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Kg(n)}var kP=D("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Jg),ft.init(e,t),e._zod.check=n=>{mw(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),$P=D("$ZodE164",(e,t)=>{t.pattern??(t.pattern=v0),ft.init(e,t)}),yye=/[- ]/g;function bye(e){let t=e.length,n=1,r=0;for(;t;){let i=e.charCodeAt(--t)-48;n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][i]:i}return r%10===0}function gw(e){return Q_.test(e)?bye(e.replace(yye,"")):!1}var SP=D("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=Q_),ft.init(e,t),e._zod.check=n=>{gw(n.value)||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}});function vye(e){let t=0,n=e.length;for(let r=4;r=65?t*100+(i-55):t*10+(i-48))%97}for(let r=0;r<4;r++){let i=e.charCodeAt(r);t=(i>=65?t*100+(i-55):t*10+(i-48))%97}return t===1}function hw(e){return X_.test(e)?vye(e):!1}var xP=D("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=X_),ft.init(e,t),e._zod.check=n=>{hw(n.value)||n.issues.push({code:"invalid_format",format:"iban",input:n.value,inst:e,continue:!t.abort})}});function yw(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}var EP=D("$ZodJWT",(e,t)=>{ft.init(e,t),e._zod.check=n=>{yw(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),TP=D("$ZodCustomStringFormat",(e,t)=>{ft.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),bw=D("$ZodNumber",(e,t)=>{Me.init(e,t),e._zod.pattern=hs,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),AP=D("$ZodNumberFormat",(e,t)=>{O0.init(e,t),bw.init(e,t)}),Zg=D("$ZodBoolean",(e,t)=>{Me.init(e,t),e._zod.pattern=E0,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),vw=D("$ZodBigInt",(e,t)=>{Me.init(e,t),e._zod.pattern=x0,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),IP=D("$ZodBigIntFormat",(e,t)=>{D0.init(e,t),vw.init(e,t)}),RP=D("$ZodSymbol",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;return typeof i=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),n}}),PP=D("$ZodUndefined",(e,t)=>{Me.init(e,t),e._zod.pattern=A0,e._zod.values=new Set([void 0]),e._zod.parse=(n,r)=>{let i=n.value;return typeof i>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),n}}),CP=D("$ZodNull",(e,t)=>{Me.init(e,t),e._zod.pattern=T0,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{let i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),NP=D("$ZodAny",(e,t)=>{Me.init(e,t),e._zod.parse=n=>n}),OP=D("$ZodUnknown",(e,t)=>{Me.init(e,t),e._zod.parse=n=>n}),DP=D("$ZodNever",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),MP=D("$ZodVoid",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;return typeof i>"u"||n.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),n}}),LP=D("$ZodDate",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),n}});function m4(e,t,n){e.issues.length&&t.issues.push(...pr(n,e.issues)),t.value[n]=e.value}var FP=D("$ZodArray",(e,t)=>{Me.init(e,t);let n=_n.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=n?n.alloc(e,r,Array(o.length),i):Array(o.length);let s=[],a=i?.abortEarly;for(let c=0;cm4(d,r,c)));else if(m4(u,r,c),a&&u.issues.length!==0&&dr(u))break}return s.length?Promise.all(s).then(()=>r):r}});function sw(e,t,n,r,i,o){let s=n in r,a=o==="optional";if(!(!s&&a&&i==="optional")){if(e.issues.length){if(i!==void 0&&a&&!s)return;t.issues.push(...pr(n,e.issues))}if(!s&&i===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(s||i==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}var _ye=[];function P4(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:_ye,i=r.length?[...t,...r]:t;for(let s of i)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let o=jR(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function C4(e,t,n,r,i,o,s){let a=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,p=l.optout,f=0;for(let m in t){if(s&&n.issues.length!==f){if(dr(n,f))break;f=n.issues.length}if(c.has(m))continue;if(m==="__proto__"){u==="never"&&a.push(m);continue}if(u==="never"){a.push(m);continue}let g=l.run({value:t[m],issues:[]},r);g instanceof Promise?e.push(g.then(h=>sw(h,n,m,t,d,p))):sw(g,n,m,t,d,p)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var N4=D("$ZodObject",(e,t)=>{Me.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){let l=()=>{let u={...r};return Object.defineProperty(t,"shape",{value:u}),l.raw=u,u};l.raw=r,Object.defineProperty(t,"shape",{get:l})}let i=Xu(()=>P4(t));Be(e,"propValues",l=>{let u=l.def.shape,d={};for(let p in u){let f=u[p]._zod;if(f.values){Object.prototype.hasOwnProperty.call(d,p)||An(d,p,new Set);for(let m of f.values)d[p].add(m);f.optin!==void 0&&d[p].add(void 0)}}return d});let o=Uc,s=t.catchall,a,c=_n.memoizer;c?.attach(e),e._zod.parse=(l,u)=>{a??(a=i.value);let d=l.value;if(!o(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;l.value=c?c.alloc(e,l,{},u):{};let p=[],f=a.shape,m=u?.abortEarly,g=l.issues.length;for(let h of a.allKeys){if(m&&l.issues.length!==g){if(dr(l,g))break;g=l.issues.length}if(h==="__proto__")continue;let v=f[h],b=v._zod.optin,_=v._zod.optout,w=v._zod.run({value:d[h],issues:[]},u);w instanceof Promise?p.push(w.then(k=>sw(k,l,h,d,b,_))):sw(w,l,h,d,b,_)}return s?C4(p,d,l,u,i.value,e,m===!0):p.length?Promise.all(p).then(()=>l):l}}),UP=D("$ZodObjectJIT",(e,t)=>{N4.init(e,t);let n=e._zod.parse,r=Xu(()=>P4(t)),i=_n.memoizer,o=f=>{let m=r.value,g=m.symbolKeys,h=new Gc(["payload","ctx"],{shape:f,inst:e,memo:i,syms:g}),v=k=>`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`,b=(k,x)=>` + let ${k}_ab = false; + for (let i = 0; i < ${k}.issues.length; i++) { + const iss = ${k}.issues[i]; + iss.path = iss.path ? [${x}, ...iss.path] : [${x}]; payload.issues.push(iss); - if (iss.continue !== true) ${_}_ab = true; + if (iss.continue !== true) ${k}_ab = true; } - if (${_}_ab && ctx && ctx.abortEarly) { + if (${k}_ab && ctx && ctx.abortEarly) { payload.value = newResult; return payload; - }`;h.write("const input = payload.value;");let w=Object.create(null),k=0;for(let _ of m.allKeys)w[_]=`key_${k++}`;h.write(r?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let _ of m.allKeys){if(_==="__proto__")continue;let S=w[_],x=typeof _=="symbol"?`syms[${g.indexOf(_)}]`:nr(_),E=`${x} in input`,T=f[_],A=T?._zod?.optin,L=A!==void 0,F=T?._zod?.optout==="optional";if(h.write(`const ${S} = ${b(x)};`),L&&F){let K=A==="optional"?`${S}_present`:`${S}.value !== undefined || ${S}_present`;h.write(` - const ${S}_present = ${E}; - if (!${S}.issues.length || ${S}_present) { - if (${S}.issues.length) {${y(S,x)} + }`;h.write("const input = payload.value;");let _=Object.create(null),w=0;for(let k of m.allKeys)_[k]=`key_${w++}`;h.write(i?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let k of m.allKeys){if(k==="__proto__")continue;let x=_[k],A=typeof k=="symbol"?`syms[${g.indexOf(k)}]`:ur(k),I=`${A} in input`,R=f[k],C=R?._zod?.optin,j=C!==void 0,z=R?._zod?.optout==="optional";if(h.write(`const ${x} = ${v(A)};`),j&&z){let Y=C==="optional"?`${x}_present`:`${x}.value !== undefined || ${x}_present`;h.write(` + const ${x}_present = ${I}; + if (!${x}.issues.length || ${x}_present) { + if (${x}.issues.length) {${b(x,A)} } - if (${K}) { - newResult[${x}] = ${S}.value; + if (${Y}) { + newResult[${A}] = ${x}.value; } } - `)}else L?(h.write(` - if (${S}.issues.length) {${y(S,x)} + `)}else j?(h.write(` + if (${x}.issues.length) {${b(x,A)} } - `),A==="defaulted"?h.write(`newResult[${x}] = ${S}.value;`):h.write(` - if (${S}.value !== undefined || ${E}) { - newResult[${x}] = ${S}.value; + `),C==="defaulted"?h.write(`newResult[${A}] = ${x}.value;`):h.write(` + if (${x}.value !== undefined || ${I}) { + newResult[${A}] = ${x}.value; } `)):h.write(` - const ${S}_present = ${E}; - if (${S}.issues.length) {${y(S,x)} + const ${x}_present = ${I}; + if (${x}.issues.length) {${b(x,A)} } - if (!${S}_present && !${S}.issues.length) { + if (!${x}_present && !${x}.issues.length) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", input: undefined, - path: [${x}] + path: [${A}] }); if (ctx && ctx.abortEarly) { payload.value = newResult; @@ -249,127 +227,127 @@ ${n.join(` } } - if (${S}_present) { - newResult[${x}] = ${S}.value; + if (${x}_present) { + newResult[${A}] = ${x}.value; } - `)}return h.write("payload.value = newResult;"),h.write("return payload;"),h.compile()},s,a=yc,c=!hn.jitless,u=c&&HT.value,d=t.catchall,p;e._zod.parse=(f,m)=>{p??(p=i.value);let g=f.value;return a(g)?c&&u&&m?.async===!1&&m.jitless!==!0?(s||(s=o(t.shape)),f=s(f,m),d?uV([],g,f,m,p,e,m?.abortEarly===!0):f):n(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),f)}});function HG(e,t,n,i){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let r=e.filter(o=>!rr(o));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(s=>Er(s,i,zt())))}),t)}var Vm=R("$ZodUnion",(e,t)=>{Ce.init(e,t),Ue(e,"optin",i=>i.def.options.some(r=>r._zod.optin==="defaulted")?"defaulted":i.def.options.some(r=>r._zod.optin!==void 0)?"optional":void 0),Ue(e,"optout",i=>i.def.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Ue(e,"values",i=>{if(i.def.options.every(r=>r._zod.values))return new Set(i.def.options.flatMap(r=>Array.from(r._zod.values)))}),Ue(e,"pattern",i=>{if(i.def.options.every(r=>r._zod.pattern)){let r=i.def.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>Ho(o.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:i.value,issues:[]},r);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>HG(a,i,e,r)):HG(s,i,e,r)}});function KG(e,t,n,i){let r=[];for(let o=0;oo.issues.map(s=>Er(s,i,zt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:r}),t)}var J0=R("$ZodXor",(e,t)=>{Vm.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:i.value,issues:[]},r);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>KG(a,i,e,r)):KG(s,i,e,r)}});function Z0(e,t){let n=e._zod,i=n.bag.optionsMap;i||(i=pV(n.def),n.bag.optionsMap=i);let r=i.get(t);if(r===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return r}function pV(e){let t=new Map;for(let n of e.options){let i=n._zod.propValues?.[e.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let r of i)if(t.has(r)){if(r!==void 0)throw new Error(`Duplicate discriminator value "${String(r)}"`);t.set(r,null)}else t.set(r,n)}return t}var Y0=R("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Vm.init(e,t);let n=e._zod.parse;Ue(e,"propValues",r=>{let o={},s=0;for(let a of r.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${r.def.options.indexOf(a)}"`);c[r.def.discriminator]?.has(void 0)&&s++;for(let[l,u]of Object.entries(c)){Object.prototype.hasOwnProperty.call(o,l)||Sn(o,l,new Set);for(let d of u)o[l].add(d)}}return!r.def.unionFallback&&s>1&&o[r.def.discriminator]?.delete(void 0),o}),t.options.forEach((r,o)=>{let s=Ru(r._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${o}"`)});let i=Au(()=>pV(t));e._zod.parse=(r,o)=>{let s=r.value;if(!yc(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;let a=s?.[t.discriminator],c=i.value.get(a);return c&&(a!==void 0||o.direction!=="backward")?c._zod.run(r,o):t.unionFallback||o.direction==="backward"?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()).filter(l=>i.value.get(l)!==null),input:s,path:[t.discriminator],inst:e}),r)}}),Q0=R("$ZodIntersection",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{let r=n.value,o=t.left._zod.run({value:r,issues:[]},i),s=t.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>JG(n,c,l)):JG(n,o,s)}});function Lu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ci(e)&&ci(t)){let n=Object.keys(t),i=Object.keys(e).filter(o=>n.indexOf(o)!==-1),r={...e,...t};Object.prototype.hasOwnProperty.call(r,"__proto__")&&delete r.__proto__;for(let o of i){if(o==="__proto__")continue;let s=Lu(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r[o]=s.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i{let d;if(l.code==="unrecognized_keys"&&!l.path?.length)r??(r=l),d=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let p=String(l.path[0]);o.has(p)||o.set(p,l),d=[p]}else return!1;for(let p of d)i.has(p)||i.set(p,{}),i.get(p)[u]=!0;return!0};for(let l of t.issues)s(l,"l")||e.issues.push(l);for(let l of n.issues)s(l,"r")||e.issues.push(l);let a=[...i].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(a.length){let l=r?a.filter(u=>r.keys.includes(u)):[];l.length&&e.issues.push({...r,keys:l});for(let u of a)!l.includes(u)&&o.has(u)&&e.issues.push(o.get(u))}let c=Lu(t.value,n.value);if(!c.valid){if(rr(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var jv=R("$ZodTuple",(e,t)=>{Ce.init(e,t);let n=t.items,i=hn.memoizer;i?.attach(e),e._zod.parse=(r,o)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=i?i.alloc(e,r,[],o):[];let a=[],c=ZG(n,"optin"),l=ZG(n,"optout");if(!t.rest){if(s.lengthn.length&&r.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:s,inst:e,origin:"array"})}let u=new Array(n.length),d=t.rest?o?.abortEarly:void 0,p=!1;for(let f=0;f{u[f]=g})):(u[f]=m,d&&!p&&m.issues.length&&(p=rr(m)))}if(t.rest&&!p){let f=n.length-1,m=s.slice(n.length),g=r.issues.length;for(let h of m){if(d&&r.issues.length!==g){if(rr(r,g))break;g=r.issues.length}f++;let b=t.rest._zod.run({value:h,issues:[]},o);b instanceof Promise?a.push(b.then(y=>YG(y,r,f))):YG(b,r,f)}}return a.length?Promise.all(a).then(()=>QG(u,r,n,s,l)):QG(u,r,n,s,l)}});function ZG(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function YG(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues)),t.value[n]=e.value}function QG(e,t,n,i,r){for(let o=0;o=r&&n[o]._zod.optin==="optional"){t.value.length=o;break}if(s.issues.length){if(!a&&o>=r){t.value.length=o;break}t.issues.push(...ir(o,s.issues))}t.value[o]=s.value}for(let o=t.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&t.value[o]===void 0);o--)t.value.length=o;return t}var X0=R("$ZodRecord",(e,t)=>{Ce.init(e,t);let n=hn.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!ci(o))return i.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),i;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){i.value=n?n.alloc(e,i,{},r):{};let c=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){if(c.add(typeof u=="number"?u.toString():u),u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Er(m,r,zt())),input:u,path:[u],inst:e});continue}let p=d.value;if(p==="__proto__")continue;let f=t.valueType._zod.run({value:o[u],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&i.issues.push(...ir(u,m.issues)),i.value[p]=m.value})):(f.issues.length&&i.issues.push(...ir(u,f.issues)),i.value[p]=f.value)}let l;for(let u in o)if(!c.has(u))if(t.mode==="loose"){if(u==="__proto__")continue;i.value[u]=o[u]}else l=l??[],l.push(u);l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}else{i.value=n?n.alloc(e,i,{},r):{};let c;for(let l of Reflect.ownKeys(o)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,l))continue;let u=t.keyType._zod.run({value:l,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Ko.test(l)&&u.issues.length){let m=t.keyType._zod.run({value:Number(l),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(u=m)}if(u.issues.length){t.mode==="loose"?i.value[l]=o[l]:a?(c=c??[],c.push(l)):i.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(m=>Er(m,r,zt())),input:l,path:[l],inst:e});continue}let p=u.value;if(p==="__proto__")continue;let f=t.valueType._zod.run({value:o[l],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&i.issues.push(...ir(l,m.issues)),i.value[p]=m.value})):(f.issues.length&&i.issues.push(...ir(l,f.issues)),i.value[p]=f.value)}c&&c.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c,continue:!0})}return s.length?Promise.all(s).then(()=>i):i}}),eA=R("$ZodMap",(e,t)=>{Ce.init(e,t);let n=hn.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!(o instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:o,inst:e}),i;let s=[];i.value=n?n.alloc(e,i,new Map,r):new Map;let a=r?.abortEarly,c=i.issues.length;for(let[l,u]of o){if(a&&i.issues.length!==c){if(rr(i,c))break;c=i.issues.length}let d=t.keyType._zod.run({value:l,issues:[]},r),p=t.valueType._zod.run({value:u,issues:[]},r);d instanceof Promise||p instanceof Promise?s.push(Promise.all([d,p]).then(([f,m])=>{XG(f,m,i,l,o,e,r)})):XG(d,p,i,l,o,e,r)}return s.length?Promise.all(s).then(()=>i):i}});function XG(e,t,n,i,r,o,s){e.issues.length&&(Tm.has(typeof i)?n.issues.push(...ir(i,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:e.issues.map(a=>Er(a,s,zt()))})),t.issues.length&&(Tm.has(typeof i)?n.issues.push(...ir(i,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:t.issues.map(a=>Er(a,s,zt()))})),n.value.set(e.value,t.value)}var tA=R("$ZodSet",(e,t)=>{Ce.init(e,t);let n=hn.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!(o instanceof Set))return i.issues.push({input:o,inst:e,expected:"set",code:"invalid_type"}),i;let s=[];i.value=n?n.alloc(e,i,new Set,r):new Set;let a=r?.abortEarly,c=i.issues.length;for(let l of o){if(a&&i.issues.length!==c){if(rr(i,c))break;c=i.issues.length}let u=t.valueType._zod.run({value:l,issues:[]},r);u instanceof Promise?s.push(u.then(d=>eV(d,i))):eV(u,i)}return s.length?Promise.all(s).then(()=>i):i}});function eV(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var nA=R("$ZodEnum",(e,t)=>{Ce.init(e,t);let n=Tu(t.entries),i=new Set(n);e._zod.values=i,Ue(e,"pattern",r=>{let o=Tu(r.def.entries).filter(s=>Tm.has(typeof s));return new RegExp(o.length?`^(${o.map(s=>li(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,o)=>{let s=r.value;return i.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:e}),r}}),rA=R("$ZodLiteral",(e,t)=>{Ce.init(e,t);let n=new Set(t.values);e._zod.values=n,Ue(e,"pattern",i=>{let r=i.def.values;return new RegExp(r.length?`^(${r.map(o=>typeof o=="string"?li(o):o?li(o.toString()):String(o)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),iA=R("$ZodFile",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),oA=R("$ZodTransform",(e,t)=>{Ce.init(e,t),e._zod.optin="optional",hn.memoizer?.guard(e),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new js(e.constructor.name);let r=t.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n));if(r instanceof Promise)throw new Tr;return n.value=r,n}});function tV(e,t){return e.value=t.issues.length?void 0:t.value,e}var zv=R("$ZodOptional",(e,t)=>{Ce.init(e,t),Ue(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Ue(e,"values",n=>{let i=n.def.innerType._zod.values;return i?new Set([...i,void 0]):void 0}),Ue(e,"pattern",n=>{let i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${Ho(i.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let r=t.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>tV(n,o)):tV(n,r)}return t.innerType._zod.run(n,i)}}),sA=R("$ZodExactOptional",(e,t)=>{zv.init(e,t),Ue(e,"values",n=>n.def.innerType._zod.values),Ue(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),aA=R("$ZodNullable",(e,t)=>{Ce.init(e,t),Ue(e,"optin",n=>n.def.innerType._zod.optin),Ue(e,"optout",n=>n.def.innerType._zod.optout),Ue(e,"pattern",n=>{let i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${Ho(i.source)}|null)$`):void 0}),Ue(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),cA=R("$ZodDefault",(e,t)=>{Ce.init(e,t),e._zod.optin="defaulted",Ue(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>nV(o,t)):nV(r,t)}});function nV(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var lA=R("$ZodPrefault",(e,t)=>{Ce.init(e,t),e._zod.optin="defaulted",Ue(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),uA=R("$ZodNonOptional",(e,t)=>{Ce.init(e,t),Ue(e,"values",n=>{let i=n.def.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,i)=>{let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>rV(o,e)):rV(r,e)}});function rV(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var dA=R("$ZodSuccess",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new js("ZodSuccess");let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.issues.length===0,n)):(n.value=r.issues.length===0,n)}});function iV(e,t,n,i){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(r=>Er(r,i,zt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var pA=R("$ZodCatch",(e,t)=>{Ce.init(e,t),Ue(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Ue(e,"optout",n=>n.def.innerType._zod.optout),Ue(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);let r=t.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>iV(n,o,t,i)):iV(n,r,t,i)}}),fA=R("$ZodNaN",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),Gv=R("$ZodPipe",(e,t)=>{Ce.init(e,t),Ue(e,"values",n=>n.def.in._zod.values),Ue(e,"optin",n=>n.def.in._zod.optin),Ue(e,"optout",n=>n.def.out._zod.optout),Ue(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){let o=t.out._zod.run(n,i);return o instanceof Promise?o.then(s=>_v(s,t.in,i)):_v(o,t.in,i)}let r=t.in._zod.run(n,i);return r instanceof Promise?r.then(o=>_v(o,t.out,i)):_v(r,t.out,i)}});function _v(e,t,n){return e.issues.some(i=>i.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Bm=R("$ZodCodec",(e,t)=>{Ce.init(e,t),Ue(e,"values",n=>n.def.in._zod.values),Ue(e,"optin",n=>n.def.in._zod.optin),Ue(e,"optout",n=>n.def.out._zod.optout),Ue(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){let o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Sv(s,t,i)):Sv(o,t,i)}else{let o=t.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Sv(s,t,i)):Sv(o,t,i)}}});function Sv(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(o=>xv(e,o,t.out,n)):xv(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(o=>xv(e,o,t.in,n)):xv(e,r,t.in,n)}}function xv(e,t,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},i)}var mA=R("$ZodPreprocess",(e,t)=>{Gv.init(e,t)}),gA=R("$ZodReadonly",(e,t)=>{Ce.init(e,t),Ue(e,"propValues",n=>n.def.innerType._zod.propValues),Ue(e,"values",n=>n.def.innerType._zod.values),Ue(e,"optin",n=>n.def.innerType?._zod?.optin),Ue(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(oV):oV(r)}});function oV(e){return e.memo||(e.value=Object.freeze(e.value)),e}function Wue(e){let t=e._zod.def,n=t.pattern,i=!!t.format?.includes("int"),r,o;for(let a of t.checks??[]){let c=a._zod.def;c.pattern&&(n=c.pattern),i||(i=!!c.format?.includes("int"));let l=c.minimum??c.length,u=c.maximum??c.length;l!==void 0&&(r===void 0||l>r)&&(r=l),u!==void 0&&(o===void 0||uo)return"(?!)";if(r!==void 0||o!==void 0)return PI({minimum:r,maximum:o}).source;let s=e._zod.pattern;return(i&&s===Ko?Mm:s)?.source}function a0(e){let t=e._zod.def,n=e._zod.pattern?.source,i=t.innerType??e._zod.innerType;if(i){let r=i._zod.pattern?.source,o=a0(i);return n&&r&&o&&o!==r?n.replace(Ho(r),()=>Ho(o)):n}if(t.options){let r=t.options.map(a0);if(r.every(Boolean))return`^(${r.map(o=>Ho(o)).join("|")})$`}return Wue(e)}var hA=R("$ZodTemplateLiteral",(e,t)=>{Ce.init(e,t);let n=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){let r=a0(i);if(!r)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);n.push(Ho(r))}else if(i===null||KT.has(typeof i))n.push(li(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(i,r)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),yA=R("$ZodFunction",(e,t)=>(Ce.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...i){let r=e._def.input?cv(e._def.input,i):i,o=Reflect.apply(n,this,r);return e._def.output?cv(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...i){let r=e._def.input?await lv(e._def.input,i):i,o=await Reflect.apply(n,this,r);return e._def.output?await lv(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let i=e.constructor;return Array.isArray(n[0])?new i({type:"function",input:new jv({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new i({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:n})},e)),bA=R("$ZodPromise",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},i))}),qm=R("$ZodLazy",(e,t)=>{Ce.init(e,t),qT(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),Ue(e,"pattern",n=>n.innerType?._zod?.pattern),Ue(e,"propValues",n=>n.innerType?._zod?.propValues),Ue(e,"optin",n=>n.innerType?._zod?.optin??void 0),Ue(e,"optout",n=>n.innerType?._zod?.optout??void 0),e._zod.parse=(n,i)=>e._zod.innerType._zod.run(n,i)}),vA=R("$ZodCustom",(e,t)=>{ht.init(e,t),Ce.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{let i=n.value,r=t.fn(i);if(r instanceof Promise)return r.then(o=>sV(o,n,i,e));sV(r,n,i,e)}});function sV(e,t,n,i){if(!e){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),t.issues.push(Nu(r))}}function aV(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues))}var wA=R("$ZodProperties",(e,t)=>{Ce.init(e,t),ht.init(e,t);let n=hn.memoizer;n?.attach(e);let i,r=(o,s)=>{i??(i=Reflect.ownKeys(t.shape).map(l=>[l,t.shape[l]]));let a=o.value,c;for(let[l,u]of i){let d=u._zod.run({value:a[l],issues:[]},s);d instanceof Promise?(c??(c=[]),c.push(d.then(p=>aV(p,o,l)))):aV(d,o,l)}if(c)return Promise.all(c).then(()=>{})};e._zod.parse=(o,s)=>{let a=o.value;if(a===null||typeof a!="object"&&typeof a!="function")return o.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),o;s.direction==="backward"&&(s={...s,direction:"forward"}),n&&n.alloc(e,o,a,s);let c=r(o,s);return c instanceof Promise?c.then(()=>o):o},e._zod.check=o=>{if(o.value==null){o.issues.push({expected:"object",code:"invalid_type",input:o.value,inst:e});return}return r(o,{})}},{*[Symbol.iterator](){yield this}});var Wv=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},$A="~memo",mV=[];function gV(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function kA(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var hV=new WeakMap,Fu=0,qv=1,Wm=2;function Hm(e,t,n){let i=hV.get(e);if(i!==void 0)return i?Wm:Fu;if(t.has(e))return Wm;t.add(e);let r=Fu,o=u=>{if(r!==Wm&&u?._zod){let d=Hm(u,t,n);d>r&&(r=d)}},s=(u,d)=>{let p=Fu;for(let f of Reflect.ownKeys(u)){let m=Object.getOwnPropertyDescriptor(u,f);if(d&&!m.enumerable)continue;let g=m.get?qv:m.value?._zod?Hm(m.value,t,n):Fu;g>p&&(p=g)}return p},a=u=>{u>r&&(r=u)},c=e._zod.def,l=c.type;switch(l){case"object":{let u=Ru(c);a(u?s(u,!0):qv),o(c.catchall);break}case"properties":a(s(c.shape,!1));break;case"array":o(c.element);break;case"tuple":for(let u of c.items)o(u);o(c.rest);break;case"record":case"map":o(c.keyType),o(c.valueType);break;case"set":o(c.valueType);break;case"union":for(let u of c.options)o(u);break;case"intersection":o(c.left),o(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(c.innerType);break;case"pipe":o(c.in),o(c.out);break;case"function":o(c.input),o(c.output);break;case"lazy":{let u=c._cachedInner??(n?e._zod.innerType:void 0);a(u?Hm(u,t,!1):qv);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let u in c){let d=Object.getOwnPropertyDescriptor(c,u);if(!d||d.get)continue;let p=d.value;if(!(!p||typeof p!="object")){if(p._zod)o(p);else if(Array.isArray(p))for(let f of p)o(f)}}}return t.delete(e),Hue(e,r)}function Hue(e,t){return t!==qv&&hV.set(e,t===Wm),t}function Hv(e){return Hm(e,new Set,!0)!==Fu}function Kue(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Vv,Bv=[],Jue={alloc(e,t,n){let i=Vv;if(!i)return n;Vv=void 0;let r={value:n,issues:null};return i.set(t.value,r),Bv.push(r),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let n=e._zod.parse,i=(r,o)=>{if(o.direction!=="backward"&&Kv(o,r.value))throw new Wv;return n(r,o)};e._zod.parse=i,e._zod.run===n&&(e._zod.run=i)})},attach(e){var t;let n,i=!1,r,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,l)=>{if(n===void 0){let b=Hm(e,new Set,!1);if(b===Fu)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,l);b===Wm||i?n=!0:i=!0}let u=c.value;if(!gV(u))return s(c,l);let d=l[$A];d||(d={buckets:new WeakMap,backEdges:void 0},l[$A]=d);let p;r===l?p=o:(p=Kue(d,e),r=l,o=p);let f=p.get(u);if(f)return c.value=f.value,f.issues?f.issues.length&&c.issues.push(...kA(f.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(f.value)),c;Vv=p;let m=Bv.length,g=s(c,l);Vv=void 0;let h=Bv.length>m?Bv.pop():void 0;return g instanceof Promise?g.then(b=>(h&&(h.issues=b.issues.length?kA(b.issues):mV),b)):(h&&(h.issues=g.issues.length?kA(g.issues):mV),g)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a)})}};function Km(){return Jue}function Kv(e,t){let n=e[$A]?.backEdges;return n!==void 0&&gV(t)&&n.has(t)}var Zm={};_r(Zm,{ar:()=>yV,az:()=>bV,be:()=>wV,bg:()=>kV,bn:()=>$V,ca:()=>_V,ckb:()=>SV,cs:()=>xV,da:()=>EV,de:()=>TV,el:()=>IV,en:()=>Jv,eo:()=>AV,es:()=>RV,fa:()=>NV,fi:()=>CV,fr:()=>PV,frCA:()=>DV,gu:()=>OV,he:()=>MV,hi:()=>LV,hr:()=>FV,hu:()=>UV,hy:()=>zV,id:()=>GV,is:()=>VV,it:()=>BV,ja:()=>qV,ka:()=>WV,kh:()=>HV,km:()=>Zv,kn:()=>KV,ko:()=>JV,lt:()=>YV,mk:()=>QV,ms:()=>XV,ne:()=>eB,nl:()=>tB,nn:()=>nB,no:()=>rB,ota:()=>iB,pl:()=>sB,ps:()=>oB,pt:()=>aB,ptBR:()=>cB,ro:()=>lB,ru:()=>dB,sk:()=>pB,sl:()=>fB,sv:()=>mB,ta:()=>gB,tg:()=>hB,th:()=>yB,tk:()=>bB,tr:()=>vB,ua:()=>wB,uk:()=>Yv,ur:()=>kB,uz:()=>$B,vi:()=>_B,yo:()=>EB,zhCN:()=>SB,zhTW:()=>xB});var Zue=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},map:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",mac:"\u0639\u0646\u0648\u0627\u0646 MAC",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",credit_card:"\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",iban:"IBAN",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${V(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${n[o.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${C(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function yV(){return{localeError:Zue()}}var Yue=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"},map:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"kredit kart\u0131 n\xF6mr\u0259si",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${V(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[o.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function bV(){return{localeError:Yue()}}function vV(e,t,n,i){let r=Math.abs(e),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?n:i}var Que=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},map:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(r){return e[r]??null}let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",mac:"MAC \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",credit_card:"\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${V(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=vV(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=vV(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function wV(){return{localeError:Que()}}var Xue=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",mac:"MAC \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${V(r.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function kV(){return{localeError:Xue()}}var ede=()=>{let e={string:{unit:"\u0985\u0995\u09CD\u09B7\u09B0",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},file:{unit:"\u09AC\u09BE\u0987\u099F",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},array:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},set:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},map:{unit:"\u098F\u09A8\u09CD\u099F\u09CD\u09B0\u09BF",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"}};function t(r){return e[r]??null}let n={regex:"\u0987\u09A8\u09AA\u09C1\u099F",email:"\u0987\u09AE\u09C7\u0987\u09B2 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",url:"URL",emoji:"\u0987\u09AE\u09CB\u099C\u09BF",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u09A4\u09BE\u09B0\u09BF\u0996 \u0993 \u09B8\u09AE\u09AF\u09BC",date:"ISO \u09A4\u09BE\u09B0\u09BF\u0996",time:"ISO \u09B8\u09AE\u09AF\u09BC",duration:"ISO \u09B8\u09AE\u09AF\u09BC\u0995\u09BE\u09B2",ipv4:"IPv4 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",ipv6:"IPv6 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",mac:"MAC \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",cidrv4:"IPv4 \u09B0\u09C7\u099E\u09CD\u099C",cidrv6:"IPv6 \u09B0\u09C7\u099E\u09CD\u099C",base64:"base64-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",base64url:"base64url-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",json_string:"JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",e164:"E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",credit_card:"\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",iban:"IBAN",jwt:"JWT",template_literal:"\u0987\u09A8\u09AA\u09C1\u099F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${o}, \u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4 ${a}`}case"invalid_value":return r.values.length===1?`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${V(r.values[0])}`:`\u0985\u09AC\u09C8\u09A7 \u0985\u09AA\u09B6\u09A8: ${C(r.values," | ")} \u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7 \u098F\u0995\u099F\u09BF \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${r.origin??"\u09AE\u09BE\u09A8"} ${o}${r.maximum.toString()} ${s.unit??"\u098F\u09B2\u09BF\u09AE\u09C7\u09A8\u09CD\u099F"} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${r.origin??"\u09AE\u09BE\u09A8"} ${o}${r.maximum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${r.origin} ${o}${r.minimum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.prefix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C1\u09B0\u09C1 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="ends_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.suffix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C7\u09B7 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="includes"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.includes}" \u0985\u09A8\u09CD\u09A4\u09B0\u09CD\u09AD\u09C1\u0995\u09CD\u09A4 \u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="regex"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: ${o.pattern} \u09AA\u09CD\u09AF\u09BE\u099F\u09BE\u09B0\u09CD\u09A8 \u09AE\u09BF\u09B2\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09AC\u09C8\u09A7 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0985\u09AC\u09C8\u09A7 \u09A8\u09AE\u09CD\u09AC\u09B0: ${r.divisor} \u098F\u09B0 \u0997\u09C1\u09A3\u09BF\u09A4\u0995 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`;case"unrecognized_keys":return`\u0985\u099A\u09C7\u09A8\u09BE \u0995\u09C0${r.keys.length>1?"\u0997\u09C1\u09B2\u09CB":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u0995\u09C0`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0985\u09AC\u09C8\u09A7 \u09A1\u09BF\u09B8\u0995\u09CD\u09B0\u09BF\u09AE\u09BF\u09A8\u09C7\u099F\u09B0 \u09AE\u09BE\u09A8\u0964 \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F";case"invalid_element":return`${r.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u09AE\u09BE\u09A8`;default:return"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F"}}};function $V(){return{localeError:ede()}}var tde=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",mac:"adre\xE7a MAC",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",credit_card:"n\xFAmero de targeta de cr\xE8dit",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${V(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${C(r.values," o ")}`;case"too_big":{let o=r.inclusive?"com a m\xE0xim":"menys de",s=t(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${o} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${o} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function _V(){return{localeError:tde()}}var nde=()=>{let e={string:{unit:"\u067E\u06CC\u062A",verb:"\u0628\u06CE\u062A"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u0628\u06CE\u062A"},array:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},set:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},map:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"}};function t(r){return e[r]??null}let n={regex:"regex",email:"\u0626\u06CC\u0645\u06D5\u06CC\u06B5",url:"\u0628\u06D5\u0633\u062A\u06D5\u0631 (URL)",emoji:"\u0626\u06CC\u0645\u06C6\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0695\u06CE\u06A9\u06D5\u0648\u062A \u0648 \u06A9\u0627\u062A",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",time:"\u06A9\u0627\u062A",duration:"\u0645\u0627\u0648\u06D5",ipv4:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv4",ipv6:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv6",mac:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC MAC",cidrv4:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv4",cidrv6:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv6",base64:"\u062F\u06D5\u0642\u06CC base64",base64url:"\u062F\u06D5\u0642\u06CC base64url",json_string:"\u062F\u06D5\u0642\u06CC JSON",e164:"\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",credit_card:"\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",iban:"IBAN",jwt:"JWT",template_literal:"\u062A\u06CE\u06A9\u0631\u062F\u06D5"},i={nan:"NaN",string:"\u0646\u0648\u0648\u0633\u06CC\u0646",number:"\u0698\u0645\u0627\u0631\u06D5",boolean:"boolean",array:"array",object:"object",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",integer:"\u0698\u0645\u0627\u0631\u06D5",float:"\u0698\u0645\u0627\u0631\u06D5",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s,c=["\u0627","\u0648","\u06C6","\u0648\u0648","\u06D5","\u06CC","\u06CE"].some(u=>a.endsWith(u))?"\u06CC\u06D5":"\u06D5",l=/^[a-zA-Z]+$/.test(a);return s==="null"||s==="undefined"?"\u062F\u0627\u0648\u0627\u06A9\u0631\u0627\u0648\u06D5":`\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${o} \u0628\u06CE\u062A\u060C \u0628\u06D5\u06B5\u0627\u0645 ${a}${l?"":c}`}case"invalid_value":return r.values.length===1?`\u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0648\u0633\u062A\u06D5: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${V(r.values[0])} \u0628\u06CE\u062A`:`\u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 \u06CC\u06D5\u06A9\u06CE\u06A9 \u0628\u06CE\u062A \u0644\u06D5 ${C(r.values,"|")}`;case"too_big":{let o=t(r.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${r.maximum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${r.maximum.toString()} \u0628\u06CE\u062A`}case"too_small":{let o=t(r.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${r.minimum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${r.minimum.toString()} \u0628\u06CE\u062A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u062F\u06D5\u0633\u062A\u067E\u06CE\u0628\u06A9\u0627\u062A \u0628\u06D5 "${o.prefix}"`:o.format==="ends_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u06A9\u06C6\u062A\u0627\u06CC\u06CC\u0628\u06CE\u062A \u0628\u06D5 "${o.suffix}"`:o.format==="includes"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 "${o.includes}" \u0644\u06D5\u062E\u06C6\u0628\u06AF\u0631\u06CE\u062A`:o.format==="regex"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0644\u06D5\u06AF\u06D5\u06B5 \u067E\u0627\u062A\u06CE\u0631\u0646\u06CC ${o.pattern} \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A`:`\u0628\u06D5\u0647\u0627\u06CC ${n[o.format]??r.format} \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`}case"not_multiple_of":return`\u0698\u0645\u0627\u0631\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u062F\u06D5\u0628\u06CE\u062A \u0686\u06D5\u0646\u062F \u0647\u06CE\u0646\u062F\u06D5 \u0628\u06CE\u062A \u0628\u06C6 ${r.divisor}`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648: ${C(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A \u0644\u06D5 ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0628\u06D5\u0647\u0627\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648 \u0647\u06D5\u06CC\u06D5. \u0628\u06D5\u0647\u0627\u06CC \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648: ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u06CC\u06D5\u06A9\u06AF\u0631\u062A\u0646\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A";case"invalid_element":return`${r.origin} \u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`;default:return"\u062A\u06CE\u06A9\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A"}}};function SV(){return{localeError:nde()}}var rde=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"},map:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditn\xED karty",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${V(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${C(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function xV(){return{localeError:rde()}}var ide=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${V(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=i[r.origin]??r.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=i[r.origin]??r.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${r.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}};function EV(){return{localeError:ide()}}var ode=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"},map:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",iban:"IBAN",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${V(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ist`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ist`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function TV(){return{localeError:ode()}}var sde=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(r){return e[r]??null}let n={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",credit_card:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",iban:"IBAN",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return typeof r.expected=="string"&&/^[A-Z]/.test(r.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${r.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return r.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${V(r.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${o.prefix}"`:o.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${o.suffix}"`:o.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${o.includes}"`:o.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[o.format]??r.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function IV(){return{localeError:sde()}}var ade=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};function r(o,s){return o==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):i[o]??o}return o=>{switch(o.code){case"invalid_type":{let s=r(o.expected),a=H(o.input),c=r(a,o.input);return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${V(o.values[0])}`:`Invalid option: expected one of ${C(o.values,"|")}`;case"too_big":{let s=o.exact?"exactly ":o.inclusive?"<=":"<",a=t(o.origin);return a?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.exact?"exactly ":o.inclusive?">=":">",a=t(o.origin);return a?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${a.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${C(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(a=>`'${a}'`).join(" | ")}`:o.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function Jv(){return{localeError:ade()}}var cde=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",mac:"MAC-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",credit_card:"kreditkarta numero",iban:"IBAN",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${V(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${o}${r.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function AV(){return{localeError:cde()}}var lde=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",mac:"direcci\xF3n MAC",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",credit_card:"n\xFAmero de tarjeta de cr\xE9dito",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${V(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}};function RV(){return{localeError:lde()}}var ude=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},map:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",mac:"MAC \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",credit_card:"\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${V(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${C(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[o.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${C(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function NV(){return{localeError:ude()}}var dde=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",iban:"IBAN",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${V(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${C(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function CV(){return{localeError:dde()}}var pde=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"expression r\xE9guli\xE8re",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne de caract\xE8res encod\xE9e en base64",base64url:"cha\xEEne de caract\xE8res encod\xE9e en base64url",json_string:"cha\xEEne de caract\xE8res JSON",e164:"num\xE9ro au format E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne de caract\xE8res",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"record",map:"map",set:"ensemble",file:"fichier",nonoptional:"non optionnel",nan:"NaN",function:"fonction"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instance de ${r.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${V(r.values[0])} attendu`:`Option invalide : une valeur parmi ${C(r.values,"|")} attendue`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Trop grand : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Trop petit : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne de caract\xE8res invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne de caract\xE8res invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne de caract\xE8res invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne de caract\xE8res invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${C(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function PV(){return{localeError:pde()}}var fde=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"},map:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${V(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u2264":"<",s=t(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${o}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u2265":">",s=t(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${C(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function DV(){return{localeError:fde()}}var mde=()=>{let e={string:{unit:"\u0A85\u0A95\u0ACD\u0AB7\u0AB0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},file:{unit:"\u0AAC\u0ABE\u0AAF\u0A9F",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},array:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},set:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},map:{unit:"\u0A8F\u0AA8\u0ACD\u0A9F\u0ACD\u0AB0\u0AC0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"}};function t(r){return e[r]??null}let n={regex:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F",email:"\u0A88\u0AAE\u0AC7\u0A87\u0AB2 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",url:"URL",emoji:"\u0A87\u0AAE\u0ACB\u0A9C\u0AC0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96 \u0A85\u0AA8\u0AC7 \u0AB8\u0AAE\u0AAF",date:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96",time:"ISO \u0AB8\u0AAE\u0AAF",duration:"ISO \u0A85\u0AB5\u0AA7\u0ABF",ipv4:"IPv4 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",ipv6:"IPv6 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",mac:"MAC \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",cidrv4:"IPv4 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",cidrv6:"IPv6 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",base64:"base64-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",base64url:"base64url-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",json_string:"JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",e164:"E.164 \u0AA8\u0A82\u0AAC\u0AB0",credit_card:"\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",iban:"IBAN",jwt:"JWT",template_literal:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${o}, \u0AAA\u0ACD\u0AB0\u0ABE\u0AAA\u0ACD\u0AA4 ${a}`}case"invalid_value":return r.values.length===1?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${V(r.values[0])}`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB5\u0ABF\u0A95\u0AB2\u0ACD\u0AAA: ${C(r.values," | ")} \u0AAE\u0ABE\u0AA7\u0ACD\u0AAF\u0AAE\u0AA5\u0AC0 \u0A8F\u0A95 \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${r.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${r.maximum.toString()} ${s.unit??"\u0A8F\u0AB2\u0ABF\u0AAE\u0AC7\u0AA8\u0ACD\u0A9F"} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${r.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${r.maximum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${r.origin} ${o}${r.minimum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.prefix}" \u0AA5\u0AC0 \u0AB6\u0AB0\u0AC2 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="ends_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.suffix}" \u0AAA\u0AB0 \u0AB8\u0AAE\u0ABE\u0AAA\u0ACD\u0AA4 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="includes"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.includes}" \u0AB6\u0ABE\u0AAE\u0AC7\u0AB2 \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="regex"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: \u0AAA\u0AC7\u0A9F\u0AB0\u0ACD\u0AA8 ${o.pattern} \u0AB8\u0ABE\u0AA5\u0AC7 \u0AAE\u0AC7\u0AB3 \u0A96\u0ABE\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA8\u0A82\u0AAC\u0AB0: ${r.divisor} \u0AA8\u0ACB \u0A97\u0AC1\u0AA3\u0ABE\u0A82\u0A95 \u0AB9\u0ACB\u0AB5\u0ACB \u0A9C\u0ACB\u0A88\u0A8F`;case"unrecognized_keys":return`\u0A93\u0AB3\u0A96\u0AC0 \u0AB6\u0A95\u0ABE\u0AA4\u0ABE \u0AA8\u0AB9\u0AC0\u0A82 \u0AA4\u0AC7 \u0A95\u0AC0${r.keys.length>1?"\u0A93":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A95\u0AC0`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA1\u0ABF\u0AB8\u0ACD\u0A95\u0ACD\u0AB0\u0ABF\u0AAE\u0ABF\u0AA8\u0AC7\u0A9F\u0AB0 \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF. \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F";case"invalid_element":return`${r.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF`;default:return"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F"}}};function OV(){return{localeError:mde()}}var gde=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=l=>l?e[l]:void 0,i=l=>{let u=n(l);return u?u.label:l??e.unknown.label},r=l=>`\u05D4${i(l)}`,o=l=>(n(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?t[l]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},mac:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA MAC",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},credit_card:{label:"\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9",gender:"m"},iban:{label:"IBAN",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"\u05E7\u05DC\u05D8",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,d=c[u??""]??i(u),p=H(l.input),f=c[p]??e[p]?.label??p;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${V(l.values[0])}`;let u=l.values.map(f=>V(f));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=s(l.origin),d=r(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",g=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let p=l.inclusive?"<=":"<",f=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),d=r(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let h=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`}let g=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let p=l.inclusive?">=":">",f=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let d=a[u.format],p=d?.label??u.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${m}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${C(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function MV(){return{localeError:gde()}}var hde=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},file:{unit:"\u092C\u093E\u0907\u091F\u094D\u0938",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F\u092F\u093E\u0901",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"}};function t(r){return e[r]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0924\u093F\u0925\u093F \u0914\u0930 \u0938\u092E\u092F",date:"ISO \u0924\u093F\u0925\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u092A\u0924\u093E",ipv6:"IPv6 \u092A\u0924\u093E",mac:"MAC \u092A\u0924\u093E",cidrv4:"IPv4 \u0936\u094D\u0930\u0947\u0923\u0940",cidrv6:"IPv6 \u0936\u094D\u0930\u0947\u0923\u0940",base64:"Base64-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",base64url:"Base64URL-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",e164:"E.164 \u0938\u0902\u0916\u094D\u092F\u093E",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return r.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${V(r.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u094B\u0902 \u092E\u0947\u0902 \u0938\u0947 \u090F\u0915 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin??"\u092E\u093E\u0928"} \u092E\u0947\u0902 ${o}${r.maximum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin??"\u092E\u093E\u0928"} ${o}${r.maximum} \u0939\u094B`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin} \u092E\u0947\u0902 ${o}${r.minimum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin} ${o}${r.minimum} \u0939\u094B`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.prefix}" \u0938\u0947 \u0936\u0941\u0930\u0942 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.suffix}" \u092A\u0930 \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u0907\u0938\u092E\u0947\u0902 "${o.includes}" \u0936\u093E\u092E\u093F\u0932 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u092A\u0948\u091F\u0930\u094D\u0928 ${o.pattern} \u0938\u0947 \u092E\u0947\u0932 \u0916\u093E\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: \u092F\u0939 ${r.divisor} \u0915\u093E \u0917\u0941\u0923\u091C \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u0902\u091C\u0940${r.keys.length>1?"\u092F\u093E\u0901":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u0902\u091C\u0940: ${r.origin} \u092E\u0947\u0902`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${r.origin} \u092E\u0947\u0902`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function LV(){return{localeError:hde()}}var yde=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(r){return e[r]??null}let n={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",iban:"IBAN",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${V(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${r.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${r.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${n[o.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${C(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[r.origin]??r.origin}`;default:return"Neispravan unos"}}};function FV(){return{localeError:yde()}}var bde=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",mac:"MAC c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",credit_card:"hitelk\xE1rtyasz\xE1m",iban:"IBAN",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${V(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${o}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[o.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function UV(){return{localeError:bde()}}function jV(e,t,n){return Math.abs(e)===1?t:n}function Uu(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=e[e.length-1];return e+(t.includes(n)?"\u0576":"\u0568")}var vde=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},map:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(r){return e[r]??null}let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",mac:"MAC \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",credit_card:"\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",iban:"IBAN",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return r.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${V(r.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=jV(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Uu(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Uu(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=jV(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Uu(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Uu(r.origin)} \u056C\u056B\u0576\u056B ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[o.format]??r.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${C(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Uu(r.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Uu(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function zV(){return{localeError:vde()}}var wde=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",credit_card:"nomor kartu kredit",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${V(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function GV(){return{localeError:wde()}}var kde=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"},map:{unit:"hluti",verb:"a\xF0 hafa"}};function t(r){return e[r]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",credit_card:"kreditkortan\xFAmer",iban:"IBAN",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${V(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${o}${r.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${o}${r.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${C(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}};function VV(){return{localeError:kde()}}var $de=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${V(r.values[0])}`:`Opzione non valida: atteso uno tra ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${o}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${o}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${n[o.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${C(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function BV(){return{localeError:$de()}}var _de=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},map:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",mac:"MAC\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",credit_card:"\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",iban:"IBAN",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${V(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${C(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${C(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function qV(){return{localeError:_de()}}var Sde=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},map:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(r){return e[r]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",mac:"MAC \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",credit_card:"\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",iban:"IBAN",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return r.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${V(r.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${C(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${r.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function WV(){return{localeError:Sde()}}var xde=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},map:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",mac:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 MAC",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",credit_card:"\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",iban:"IBAN",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${V(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${C(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Zv(){return{localeError:xde()}}function HV(){return Zv()}var Ede=()=>{let e={string:{unit:"\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},file:{unit:"\u0CAC\u0CC8\u0C9F\u0CCD\u200C\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},array:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},set:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},map:{unit:"entries",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"}};function t(r){return e[r]??null}let n={regex:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD",email:"email \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95\u0CA6 \u0CB8\u0CAE\u0CAF",date:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95",time:"ISO \u0CB8\u0CAE\u0CAF",duration:"ISO \u0C85\u0CB5\u0CA7\u0CBF",ipv4:"IPv4 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",ipv6:"IPv6 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",mac:"MAC \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",cidrv4:"IPv4 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",cidrv6:"IPv6 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",base64:"base64-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",base64url:"base64url-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",json_string:"JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",e164:"E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",credit_card:"\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",iban:"IBAN",jwt:"JWT",template_literal:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${o}, \u0CB8\u0CCD\u0CB5\u0CC0\u0C95\u0CB0\u0CBF\u0CB8\u0CBF\u0CA6\u0CA8\u0CC1 ${a}`}case"invalid_value":return r.values.length===1?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${V(r.values[0])}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C86\u0CAF\u0CCD\u0C95\u0CC6: \u0C87\u0CB5\u0CC1\u0C97\u0CB3\u0CB2\u0CCD\u0CB2\u0CBF \u0C92\u0C82\u0CA6\u0CA8\u0CCD\u0CA8\u0CC1 \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin??"value"} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${r.maximum.toString()} ${s.unit??"\u0C85\u0C82\u0CB6\u0C97\u0CB3\u0CC1"}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin??"value"} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${r.minimum.toString()} ${s.unit}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0CAA\u0CCD\u0CB0\u0CBE\u0CB0\u0C82\u0CAD\u0CBF\u0CB8\u0CAC\u0CC7\u0C95\u0CC1 "${o.prefix}"`:o.format==="ends_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0C95\u0CCA\u0CA8\u0CC6\u0C97\u0CCA\u0CB3\u0CCD\u0CB3\u0CAC\u0CC7\u0C95\u0CC1 "${o.suffix}"`:o.format==="includes"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C92\u0CB3\u0C97\u0CCA\u0C82\u0CA1\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 "${o.includes}"`:o.format==="regex"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0CAE\u0CBE\u0CA6\u0CB0\u0CBF\u0C97\u0CC6 \u0CB9\u0CCA\u0C82\u0CA6\u0CBF\u0C95\u0CC6\u0CAF\u0CBE\u0C97\u0CAC\u0CC7\u0C95\u0CC1 ${o.pattern}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6: \u0CAC\u0CB9\u0CC1\u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6\u0CAF\u0CBE\u0C97\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 ${r.divisor}`;case"unrecognized_keys":return`\u0C97\u0CC1\u0CB0\u0CC1\u0CA4\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CA6 \u0C95\u0CC0 ${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0C95\u0CC0 \u0C87\u0CA8\u0CCD ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CA4\u0CBE\u0CB0\u0CA4\u0CAE\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF. \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD";case"invalid_element":return`\u0CB0\u0CB2\u0CCD\u0CB2\u0CBF \u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF ${r.origin}`;default:return"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD"}}};function KV(){return{localeError:Ede()}}var Tde=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"},map:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",mac:"MAC \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",credit_card:"\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",iban:"IBAN",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${V(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${C(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(r.origin),c=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${c} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${o}${s}`}case"too_small":{let o=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(r.origin),c=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${c} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[o.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${C(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function JV(){return{localeError:Tde()}}var Jm=e=>e.charAt(0).toUpperCase()+e.slice(1);function ZV(e){let t=Math.abs(e),n=t%10,i=t%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}var Ide=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(r,o,s,a){let c=e[r]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",mac:"MAC adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",credit_card:"kredito kortel\u0117s numeris",iban:"IBAN",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${V(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${C(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,s=t(r.origin,ZV(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${Jm(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.maximum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Jm(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[r.origin]??r.origin,s=t(r.origin,ZV(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${Jm(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.minimum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Jm(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${C(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[r.origin]??r.origin;return`${Jm(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function YV(){return{localeError:Ide()}}var Ade=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},map:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",mac:"MAC \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",credit_card:"\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${V(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function QV(){return{localeError:Ade()}}var Rde=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${V(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${C(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function XV(){return{localeError:Rde()}}var Nde=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},file:{unit:"\u092C\u093E\u0907\u091F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"}};function t(r){return e[r]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0907\u092E\u0947\u0932 \u0920\u0947\u0917\u093E\u0928\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u092E\u093F\u0924\u093F \u0930 \u0938\u092E\u092F",date:"ISO \u092E\u093F\u0924\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u0920\u0947\u0917\u093E\u0928\u093E",ipv6:"IPv6 \u0920\u0947\u0917\u093E\u0928\u093E",mac:"MAC \u0920\u0947\u0917\u093E\u0928\u093E",cidrv4:"IPv4 \u0926\u093E\u092F\u0930\u093E",cidrv6:"IPv6 \u0926\u093E\u092F\u0930\u093E",base64:"base64-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",base64url:"base64url-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",e164:"E.164 \u0928\u092E\u094D\u092C\u0930",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return r.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${V(r.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u0939\u0930\u0942 \u092E\u0927\u094D\u092F\u0947 \u090F\u0915 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${r.origin??"\u092E\u093E\u0928"} \u092E\u093E ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${r.origin??"\u092E\u093E\u0928"} ${o}${r.maximum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${r.origin} \u092E\u093E ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${r.origin} ${o}${r.minimum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.prefix}" \u092C\u093E\u091F \u0938\u0941\u0930\u0941 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.suffix}" \u092E\u093E \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.includes}" \u0938\u092E\u093E\u0935\u0947\u0936 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: \u0922\u093E\u0901\u091A\u093E ${o.pattern} \u0938\u0901\u0917 \u092E\u0947\u0932 \u0916\u093E\u0928\u0941\u092A\u0930\u094D\u091B`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: ${r.divisor} \u0915\u094B \u0917\u0941\u0923\u091C \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u091E\u094D\u091C\u0940${r.keys.length>1?"\u0939\u0930\u0942":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u091E\u094D\u091C\u0940: ${r.origin} \u092E\u093E`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${r.origin} \u092E\u093E`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function eB(){return{localeError:Nde()}}var Cde=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function t(r){return e[r]??null}let n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",iban:"IBAN",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${V(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} is`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} is`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function tB(){return{localeError:Cde()}}var Pde=()=>{let e={string:{unit:"teikn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"element",verb:"\xE5 innehalde"},set:{unit:"element",verb:"\xE5 innehalde"},map:{unit:"element",verb:"\xE5 innehalde"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tal",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventa instanceof ${r.expected}, fekk ${a}`:`Ugyldig input: forventa ${o}, fekk ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventa ${V(r.values[0])}`:`Ugyldig val: forventa eitt av ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventa ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`For stor(t): forventa ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventa ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventa ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 slutte med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 innehalde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tal: m\xE5 vere eit multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjende n\xF8klar":"Ukjend n\xF8kkel"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function nB(){return{localeError:Pde()}}var Dde=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"},map:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${V(r.values[0])}`:`Ugyldig valg: forventet en av ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function rB(){return{localeError:Dde()}}var Ode=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"},map:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",mac:"MAC ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",credit_card:"i'tib\xE2r kart\u0131 numaras\u0131",iban:"IBAN",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${V(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=r;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[o.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function iB(){return{localeError:Ode()}}var Mde=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},map:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",mac:"\u062F MAC \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",credit_card:"\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${V(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${C(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[o.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function oB(){return{localeError:Mde()}}var Lde=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"},map:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",mac:"adres MAC",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",credit_card:"numer karty kredytowej",iban:"IBAN",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${V(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[o.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function sB(){return{localeError:Lde()}}var Fde=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(s){return e[s]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"o intervalo de endere\xE7os IPv4",cidrv6:"o intervalo de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},r={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tuplo",articles:i.masculine},record:{name:"registo",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"ficheiro",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(s,a){let c=r[s]??{name:`valor "${s}"`,articles:i.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=H(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${V(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${C(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=t(s.origin);return c?`Demasiado grande: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=t(s.origin);return c?`Demasiado pequeno: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Demasiado pequeno: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar por "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar em "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${n[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${C(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function aB(){return{localeError:Fde()}}var Ude=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(s){return e[s]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"a faixa de endere\xE7os IPv4",cidrv6:"a faixa de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},r={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tupla",articles:i.feminine},record:{name:"registro",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"arquivo",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(s,a){let c=r[s]??{name:`valor "${s}"`,articles:i.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=H(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${V(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${C(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=t(s.origin);return c?`Grande demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Grande demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=t(s.origin);return c?`Pequeno demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Pequeno demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${n[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${C(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function cB(){return{localeError:Ude()}}var jde=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(r){return e[r]??null}let n={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",credit_card:"num\u0103r de card de credit",iban:"IBAN",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${V(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Prea mic: a\u0219teptat ca ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${n[o.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${C(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}};function lB(){return{localeError:jde()}}function uB(e,t,n,i){let r=Math.abs(e),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?n:i}var zde=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},map:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",mac:"MAC \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${V(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=uB(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=uB(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function dB(){return{localeError:zde()}}var Gde=()=>{let e={string:{unit:"znakov",verb:"ma\u0165"},file:{unit:"bajtov",verb:"ma\u0165"},array:{unit:"prvkov",verb:"ma\u0165"},set:{unit:"prvkov",verb:"ma\u0165"},map:{unit:"polo\u017Eiek",verb:"ma\u0165"}};function t(r){return e[r]??null}let n={regex:"regul\xE1rny v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"d\xE1tum a \u010Das vo form\xE1te ISO",date:"d\xE1tum vo form\xE1te ISO",time:"\u010Das vo form\xE1te ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64",base64url:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64url",json_string:"re\u0165azec vo form\xE1te JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditnej karty",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"re\u0165azec",function:"funkcia",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 instanceof ${r.expected}, obdr\u017Ean\xE9 ${a}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${o}, obdr\u017Ean\xE9 ${a}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${V(r.values[0])}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE1 jedna z hodn\xF4t ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${r.origin??"hodnota"} mus\xED ma\u0165 ${o}${r.maximum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${r.origin??"hodnota"} mus\xED by\u0165 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je pr\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED ma\u0165 ${o}${r.minimum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED by\u0165 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD re\u0165azec: mus\xED za\u010D\xEDna\u0165 na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD re\u0165azec: mus\xED kon\u010Di\u0165 na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD re\u0165azec: mus\xED obsahova\u0165 "${o.includes}"`:o.format==="regex"?`Neplatn\xFD re\u0165azec: mus\xED zodpoveda\u0165 vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED by\u0165 n\xE1sobkom ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1me kl\xFA\u010De: ${C(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xFA\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function pB(){return{localeError:Gde()}}var Vde=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",credit_card:"\u0161tevilka kreditne kartice",iban:"IBAN",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${V(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${o}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${o}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${C(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function fB(){return{localeError:Vde()}}var Bde=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"},map:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-adress",ipv6:"IPv6-adress",mac:"MAC-adress",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",credit_card:"kreditkortsnummer",iban:"IBAN",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${V(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function mB(){return{localeError:Bde()}}var qde=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},map:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(r){return e[r]??null}let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",mac:"MAC \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",credit_card:"\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${V(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${C(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${o}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function gB(){return{localeError:qde()}}var Wde=()=>{let e={string:{unit:"\u0430\u043B\u043E\u043C\u0430\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},file:{unit:"\u0431\u0430\u0439\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},array:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},set:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},map:{unit:"\u0441\u0430\u0431\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0443\u0440\u0443\u0434",email:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",url:"URL",emoji:"\u044D\u043C\u043E\u04B7\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",date:"\u0441\u0430\u043D\u0430\u0438 ISO",time:"\u0432\u0430\u049B\u0442\u0438 ISO",duration:"\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",ipv4:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",ipv6:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",mac:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",cidrv4:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",cidrv6:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",base64:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",base64url:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",json_string:"\u0441\u0430\u0442\u0440\u0438 JSON",e164:"\u0440\u0430\u049B\u0430\u043C\u0438 E.164",credit_card:"\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0443\u0440\u0443\u0434"},i={nan:"NaN",number:"\u0440\u0430\u049B\u0430\u043C",string:"\u0441\u0430\u0442\u0440",array:"\u043C\u0430\u0441\u0441\u0438\u0432",object:"\u043E\u0431\u044A\u0435\u043A\u0442",date:"\u0441\u0430\u043D\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${o} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${a} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`}case"invalid_value":return r.values.length===1?`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${V(r.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:`\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${C(r.values,"|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${r.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${r.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${r.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${r.origin} \u0431\u043E\u044F\u0434 ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${r.origin} \u0431\u043E\u044F\u0434 ${o}${r.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`:o.format==="ends_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`:o.format==="includes"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${o.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`:o.format==="regex"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${o.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`:`${n[o.format]??r.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`}case"not_multiple_of":return`\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${r.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;case"unrecognized_keys":return`\u041A\u0430\u043B\u0438\u0434${r.keys.length>1?"\u04B3\u043E\u0438":"\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${C(r.keys,", ")}`;case"invalid_key":return`\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${r.options.map(s=>`'${s}'`).join(" | ")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";case"invalid_element":return`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${r.origin}`;default:return"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442"}}};function hB(){return{localeError:Wde()}}var Hde=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},map:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",mac:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",credit_card:"\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",iban:"IBAN",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${V(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${C(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function yB(){return{localeError:Hde()}}var Kde=()=>{let e={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"ba\xFDt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function t(r){return e[r]??null}let n={regex:"giri\u015F",email:"e-po\xE7ta salgysy",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen \u015Fifrlenen setir",base64url:"base64url bilen \u015Fifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartyny\u0148 nomeri",iban:"IBAN",jwt:"JWT",template_literal:"\u015Fablon"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`N\xE4dogry baha: gara\u015Fylan ${o} \xFDerine ${a} alyndy`}case"invalid_value":return r.values.length===1?`N\xE4dogry baha: ${V(r.values[0])} bolmaly`:`N\xE4dogry sa\xFDlaw: a\u015Fakdakylardan biri bolmaly: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Has uly: gara\u015Fyl\xFDan ${r.origin??"baha"} ${o} ${r.maximum.toString()} ${s.unit??"element"}`:`Has uly: gara\u015Fyl\xFDan ${r.origin??"baha"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Has ki\xE7i: gara\u015Fyl\xFDan ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`Has ki\xE7i: gara\u015Fyl\xFDan ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`N\xE4dogry setir: "${o.prefix}" bilen ba\u015Flamaly`:o.format==="ends_with"?`N\xE4dogry setir: "${o.suffix}" bilen gutarmaly`:o.format==="includes"?`N\xE4dogry setir: "${o.includes}" saklamaly`:o.format==="regex"?`N\xE4dogry setir: ${o.pattern} nusga la\xFDyk bolmaly`:`N\xE4dogry ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xE4dogry san: ${r.divisor} bilen galyndysyz b\xF6l\xFCnmeli`;case"unrecognized_keys":return`Tanalma\xFDan a\xE7ar${r.keys.length>1?"lar":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde n\xE4dogry a\xE7ar`;case"invalid_union":return"N\xE4dogry baha";case"invalid_element":return`${r.origin} i\xE7inde n\xE4dogry baha`;default:return"N\xE4dogry baha"}}};function bB(){return{localeError:Kde()}}var Jde=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},map:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(r){return e[r]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",mac:"MAC adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",credit_card:"kredi kart\u0131 numaras\u0131",iban:"IBAN",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${V(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[o.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function vB(){return{localeError:Jde()}}var Zde=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",mac:"\u0430\u0434\u0440\u0435\u0441\u0430 MAC",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${V(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Yv(){return{localeError:Zde()}}function wB(){return Yv()}var Yde=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},map:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",mac:"\u0627\u06CC\u0645 \u0627\u06D2 \u0633\u06CC \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",credit_card:"\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",iban:"IBAN",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${V(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${C(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${o}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${o}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${C(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function kB(){return{localeError:Yde()}}var Qde=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(r){return e[r]??null}let n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",credit_card:"kredit karta raqami",iban:"IBAN",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${V(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[o.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function $B(){return{localeError:Qde()}}var Xde=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},map:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",mac:"\u0111\u1ECBa ch\u1EC9 MAC",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",credit_card:"s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",iban:"IBAN",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${V(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${n[o.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${C(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function _B(){return{localeError:Xde()}}var epe=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"},map:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",mac:"MAC\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",credit_card:"\u4FE1\u7528\u5361\u53F7",iban:"IBAN",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${V(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${n[o.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function SB(){return{localeError:epe()}}var tpe=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},map:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",mac:"MAC \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",credit_card:"\u4FE1\u7528\u5361\u865F",iban:"IBAN",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${V(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${C(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function xB(){return{localeError:tpe()}}var npe=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"},map:{unit:"nkan",verb:"n\xED"}};function t(r){return e[r]??null}let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",mac:"\xE0d\xEDr\u1EB9\u0301s\xEC MAC",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",credit_card:"n\u1ECDmba kaadi gbese",iban:"IBAN",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${V(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${s.verb} ${o}${r.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.maximum}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${s.verb} ${o}${r.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.minimum}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${n[o.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${C(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function EB(){return{localeError:npe()}}var TB,_A=Symbol("ZodOutput"),SA=Symbol("ZodInput"),Qv=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Xv(){return new Qv}(TB=globalThis).__zod_globalRegistry??(TB.__zod_globalRegistry=Xv());var Dn=globalThis.__zod_globalRegistry;var sr=Symbol.for("zod.compile.invalid"),IB=Symbol.for("zod.compile.fallback"),Ui=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},Ve=class extends Error{constructor(t,n=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=n}};function ipe(e,t){try{return tw(e,{assertOnly:!0})}catch{return t}}function IA(e,t){try{let n=tw(e),i=ew(e,n);return i._zod.bag.validator=ipe(e,n),i}catch(n){if(t?.strict)throw n;return e}}function ew(e,t){if(Hv(e))throw new Ve("a schema whose subtree contains a reference cycle");let n=ot(e),i=e._zod.run,r=i.__originalRun??i,o=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[IB]||a&&Kv(a,s.value))return r(s,a);let c=t(s.value);return c!==sr?(s.value=c,s):(a&&(a[IB]=!0),r(s,a))};return o.__originalRun=r,n._zod.bag.fallbackRun=r,n._zod.bag.validator=t,n._zod.run=o,i.__originalRun||ope(n,e,t),n}function ope(e,t,n){let i=e,r=t;if(typeof r.safeParse=="function"){let o=r.safeParse;i.safeParse=(s,a)=>{let c=n(s);return c!==sr?{success:!0,data:c}:o(s,a)}}if(typeof r.parse=="function"){let o=r.parse;i.parse=(s,a)=>{let c=n(s);return c!==sr?c:o(s,a)}}}function tw(e,t){let n=!0;try{n=Hv(e)}catch{}if(n)throw new Ve("a schema whose subtree contains a reference cycle");let i={constants:new Map,constantCounter:0,varCounter:0,definite:!0},r=new wc(["input"]),o=Rt(r,i,e,"input",!t?.assertOnly);r.write(o===null?"return true;":`return ${o};`);let s=["INVALID",...i.constants.keys()],a=[sr,...i.constants.values()],c=r.content.join(` + `)}return h.write("payload.value = newResult;"),h.write("return payload;"),h.compile()},s,a=Uc,c=!_n.jitless,u=c&&FR.value,d=t.catchall,p;e._zod.parse=(f,m)=>{p??(p=r.value);let g=f.value;return a(g)?c&&u&&m?.async===!1&&m.jitless!==!0?(s||(s=o(t.shape)),f=s(f,m),d?C4([],g,f,m,p,e,m?.abortEarly===!0):f):n(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),f)}});function g4(e,t,n,r){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let i=e.filter(o=>!dr(o));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(s=>Dr(s,r,Wt())))}),t)}var Yg=D("$ZodUnion",(e,t)=>{Me.init(e,t),Be(e,"optin",r=>r.def.options.some(i=>i._zod.optin==="defaulted")?"defaulted":r.def.options.some(i=>i._zod.optin!==void 0)?"optional":void 0),Be(e,"optout",r=>r.def.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Be(e,"values",r=>{if(r.def.options.every(i=>i._zod.values))return new Set(r.def.options.flatMap(i=>Array.from(i._zod.values)))}),Be(e,"pattern",r=>{if(r.def.options.every(i=>i._zod.pattern)){let i=r.def.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>gs(o.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:r.value,issues:[]},i);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>g4(a,r,e,i)):g4(s,r,e,i)}});function h4(e,t,n,r){let i=[];for(let o=0;oo.issues.map(s=>Dr(s,r,Wt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:i}),t)}var jP=D("$ZodXor",(e,t)=>{Yg.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:r.value,issues:[]},i);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>h4(a,r,e,i)):h4(s,r,e,i)}});function zP(e,t){let n=e._zod,r=n.bag.optionsMap;r||(r=O4(n.def),n.bag.optionsMap=r);let i=r.get(t);if(i===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return i}function O4(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let i of r)if(t.has(i)){if(i!==void 0)throw new Error(`Duplicate discriminator value "${String(i)}"`);t.set(i,null)}else t.set(i,n)}return t}var GP=D("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Yg.init(e,t);let n=e._zod.parse;Be(e,"propValues",i=>{let o={},s=0;for(let a of i.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${i.def.options.indexOf(a)}"`);c[i.def.discriminator]?.has(void 0)&&s++;for(let[l,u]of Object.entries(c)){Object.prototype.hasOwnProperty.call(o,l)||An(o,l,new Set);for(let d of u)o[l].add(d)}}return!i.def.unionFallback&&s>1&&o[i.def.discriminator]?.delete(void 0),o}),t.options.forEach((i,o)=>{let s=ed(i._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${o}"`)});let r=Xu(()=>O4(t));e._zod.parse=(i,o)=>{let s=i.value;if(!Uc(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;let a=s?.[t.discriminator],c=r.value.get(a);return c&&(a!==void 0||o.direction!=="backward")?c._zod.run(i,o):t.unionFallback||o.direction==="backward"?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(l=>r.value.get(l)!==null),input:s,path:[t.discriminator],inst:e}),i)}}),BP=D("$ZodIntersection",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{let i=n.value,o=t.left._zod.run({value:i,issues:[]},r),s=t.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>y4(n,c,l)):y4(n,o,s)}});function ad(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ei(e)&&Ei(t)){let n=Object.keys(t),r=Object.keys(e).filter(o=>n.indexOf(o)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__;for(let o of r){if(o==="__proto__")continue;let s=ad(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};i[o]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{let d;if(l.code==="unrecognized_keys"&&!l.path?.length)i??(i=l),d=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let p=String(l.path[0]);o.has(p)||o.set(p,l),d=[p]}else return!1;for(let p of d)r.has(p)||r.set(p,{}),r.get(p)[u]=!0;return!0};for(let l of t.issues)s(l,"l")||e.issues.push(l);for(let l of n.issues)s(l,"r")||e.issues.push(l);let a=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(a.length){let l=i?a.filter(u=>i.keys.includes(u)):[];l.length&&e.issues.push({...i,keys:l});for(let u of a)!l.includes(u)&&o.has(u)&&e.issues.push(o.get(u))}let c=ad(t.value,n.value);if(!c.valid){if(dr(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var _w=D("$ZodTuple",(e,t)=>{Me.init(e,t);let n=t.items,r=_n.memoizer;r?.attach(e),e._zod.parse=(i,o)=>{let s=i.value;if(!Array.isArray(s))return i.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=r?r.alloc(e,i,[],o):[];let a=[],c=b4(n,"optin"),l=b4(n,"optout");if(!t.rest){if(s.lengthn.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:s,inst:e,origin:"array"})}let u=new Array(n.length),d=t.rest?o?.abortEarly:void 0,p=!1;for(let f=0;f{u[f]=g})):(u[f]=m,d&&!p&&m.issues.length&&(p=dr(m)))}if(t.rest&&!p){let f=n.length-1,m=s.slice(n.length),g=i.issues.length;for(let h of m){if(d&&i.issues.length!==g){if(dr(i,g))break;g=i.issues.length}f++;let v=t.rest._zod.run({value:h,issues:[]},o);v instanceof Promise?a.push(v.then(b=>v4(b,i,f))):v4(v,i,f)}}return a.length?Promise.all(a).then(()=>_4(u,i,n,s,l)):_4(u,i,n,s,l)}});function b4(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function v4(e,t,n){e.issues.length&&t.issues.push(...pr(n,e.issues)),t.value[n]=e.value}function _4(e,t,n,r,i){for(let o=0;o=i&&n[o]._zod.optin==="optional"){t.value.length=o;break}if(s.issues.length){if(!a&&o>=i){t.value.length=o;break}t.issues.push(...pr(o,s.issues))}t.value[o]=s.value}for(let o=t.value.length-1;o>=r.length&&(n[o]._zod.optout==="optional"&&t.value[o]===void 0);o--)t.value.length=o;return t}var VP=D("$ZodRecord",(e,t)=>{Me.init(e,t);let n=_n.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!Ei(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){if(c.add(typeof u=="number"?u.toString():u),u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Dr(m,i,Wt())),input:u,path:[u],inst:e});continue}let p=d.value;if(p==="__proto__")continue;let f=t.valueType._zod.run({value:o[u],issues:[]},i);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&r.issues.push(...pr(u,m.issues)),r.value[p]=m.value})):(f.issues.length&&r.issues.push(...pr(u,f.issues)),r.value[p]=f.value)}let l;for(let u in o)if(!c.has(u))if(t.mode==="loose"){if(u==="__proto__")continue;r.value[u]=o[u]}else l=l??[],l.push(u);l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let l of Reflect.ownKeys(o)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,l))continue;let u=t.keyType._zod.run({value:l,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&hs.test(l)&&u.issues.length){let m=t.keyType._zod.run({value:Number(l),issues:[]},i);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(u=m)}if(u.issues.length){t.mode==="loose"?r.value[l]=o[l]:a?(c=c??[],c.push(l)):r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(m=>Dr(m,i,Wt())),input:l,path:[l],inst:e});continue}let p=u.value;if(p==="__proto__")continue;let f=t.valueType._zod.run({value:o[l],issues:[]},i);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&r.issues.push(...pr(l,m.issues)),r.value[p]=m.value})):(f.issues.length&&r.issues.push(...pr(l,f.issues)),r.value[p]=f.value)}c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c,continue:!0})}return s.length?Promise.all(s).then(()=>r):r}}),qP=D("$ZodMap",(e,t)=>{Me.init(e,t);let n=_n.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:e}),r;let s=[];r.value=n?n.alloc(e,r,new Map,i):new Map;let a=i?.abortEarly,c=r.issues.length;for(let[l,u]of o){if(a&&r.issues.length!==c){if(dr(r,c))break;c=r.issues.length}let d=t.keyType._zod.run({value:l,issues:[]},i),p=t.valueType._zod.run({value:u,issues:[]},i);d instanceof Promise||p instanceof Promise?s.push(Promise.all([d,p]).then(([f,m])=>{w4(f,m,r,l,o,e,i)})):w4(d,p,r,l,o,e,i)}return s.length?Promise.all(s).then(()=>r):r}});function w4(e,t,n,r,i,o,s){e.issues.length&&(Dg.has(typeof r)?n.issues.push(...pr(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(a=>Dr(a,s,Wt()))})),t.issues.length&&(Dg.has(typeof r)?n.issues.push(...pr(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:r,issues:t.issues.map(a=>Dr(a,s,Wt()))})),n.value.set(e.value,t.value)}var WP=D("$ZodSet",(e,t)=>{Me.init(e,t);let n=_n.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:e,expected:"set",code:"invalid_type"}),r;let s=[];r.value=n?n.alloc(e,r,new Set,i):new Set;let a=i?.abortEarly,c=r.issues.length;for(let l of o){if(a&&r.issues.length!==c){if(dr(r,c))break;c=r.issues.length}let u=t.valueType._zod.run({value:l,issues:[]},i);u instanceof Promise?s.push(u.then(d=>k4(d,r))):k4(u,r)}return s.length?Promise.all(s).then(()=>r):r}});function k4(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var HP=D("$ZodEnum",(e,t)=>{Me.init(e,t);let n=Yu(t.entries),r=new Set(n);e._zod.values=r,Be(e,"pattern",i=>{let o=Yu(i.def.entries).filter(s=>Dg.has(typeof s));return new RegExp(o.length?`^(${o.map(s=>Ti(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(i,o)=>{let s=i.value;return r.has(s)||i.issues.push({code:"invalid_value",values:n,input:s,inst:e}),i}}),KP=D("$ZodLiteral",(e,t)=>{Me.init(e,t);let n=new Set(t.values);e._zod.values=n,Be(e,"pattern",r=>{let i=r.def.values;return new RegExp(i.length?`^(${i.map(o=>typeof o=="string"?Ti(o):o?Ti(o.toString()):String(o)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,i)=>{let o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),JP=D("$ZodFile",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;return i instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),n}}),ZP=D("$ZodTransform",(e,t)=>{Me.init(e,t),e._zod.optin="optional",_n.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new fa(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(n.value=s,n));if(i instanceof Promise)throw new Mr;return n.value=i,n}});function $4(e,t){return e.value=t.issues.length?void 0:t.value,e}var ww=D("$ZodOptional",(e,t)=>{Me.init(e,t),Be(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Be(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),Be(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${gs(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let i=t.innerType._zod.run({value:n.value,issues:[]},r);return i instanceof Promise?i.then(o=>$4(n,o)):$4(n,i)}return t.innerType._zod.run(n,r)}}),YP=D("$ZodExactOptional",(e,t)=>{ww.init(e,t),Be(e,"values",n=>n.def.innerType._zod.values),Be(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),QP=D("$ZodNullable",(e,t)=>{Me.init(e,t),Be(e,"optin",n=>n.def.innerType._zod.optin),Be(e,"optout",n=>n.def.innerType._zod.optout),Be(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${gs(r.source)}|null)$`):void 0}),Be(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),XP=D("$ZodDefault",(e,t)=>{Me.init(e,t),e._zod.optin="defaulted",Be(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>S4(o,t)):S4(i,t)}});function S4(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var eC=D("$ZodPrefault",(e,t)=>{Me.init(e,t),e._zod.optin="defaulted",Be(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),tC=D("$ZodNonOptional",(e,t)=>{Me.init(e,t),Be(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>x4(o,e)):x4(i,e)}});function x4(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var nC=D("$ZodSuccess",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new fa("ZodSuccess");let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>(n.value=o.issues.length===0,n)):(n.value=i.issues.length===0,n)}});function E4(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(i=>Dr(i,r,Wt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var rC=D("$ZodCatch",(e,t)=>{Me.init(e,t),Be(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Be(e,"optout",n=>n.def.innerType._zod.optout),Be(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let i=t.innerType._zod.run({value:n.value,issues:[]},r);return i instanceof Promise?i.then(o=>E4(n,o,t,r)):E4(n,i,t,r)}}),iC=D("$ZodNaN",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),kw=D("$ZodPipe",(e,t)=>{Me.init(e,t),Be(e,"values",n=>n.def.in._zod.values),Be(e,"optin",n=>n.def.in._zod.optin),Be(e,"optout",n=>n.def.out._zod.optout),Be(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){let o=t.out._zod.run(n,r);return o instanceof Promise?o.then(s=>rw(s,t.in,r)):rw(o,t.in,r)}let i=t.in._zod.run(n,r);return i instanceof Promise?i.then(o=>rw(o,t.out,r)):rw(i,t.out,r)}});function rw(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Qg=D("$ZodCodec",(e,t)=>{Me.init(e,t),Be(e,"values",n=>n.def.in._zod.values),Be(e,"optin",n=>n.def.in._zod.optin),Be(e,"optout",n=>n.def.out._zod.optout),Be(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){let o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>iw(s,t,r)):iw(o,t,r)}else{let o=t.out._zod.run(n,r);return o instanceof Promise?o.then(s=>iw(s,t,r)):iw(o,t,r)}}});function iw(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let i=t.transform(e.value,e);return i instanceof Promise?i.then(o=>ow(e,o,t.out,n)):ow(e,i,t.out,n)}else{let i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(o=>ow(e,o,t.in,n)):ow(e,i,t.in,n)}}function ow(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var oC=D("$ZodPreprocess",(e,t)=>{kw.init(e,t)}),sC=D("$ZodReadonly",(e,t)=>{Me.init(e,t),Be(e,"propValues",n=>n.def.innerType._zod.propValues),Be(e,"values",n=>n.def.innerType._zod.values),Be(e,"optin",n=>n.def.innerType?._zod?.optin),Be(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(T4):T4(i)}});function T4(e){return e.memo||(e.value=Object.freeze(e.value)),e}function wye(e){let t=e._zod.def,n=t.pattern,r=!!t.format?.includes("int"),i,o;for(let a of t.checks??[]){let c=a._zod.def;c.pattern&&(n=c.pattern),r||(r=!!c.format?.includes("int"));let l=c.minimum??c.length,u=c.maximum??c.length;l!==void 0&&(i===void 0||l>i)&&(i=l),u!==void 0&&(o===void 0||uo)return"(?!)";if(i!==void 0||o!==void 0)return S0({minimum:i,maximum:o}).source;let s=e._zod.pattern;return(r&&s===hs?Vg:s)?.source}function Q0(e){let t=e._zod.def,n=e._zod.pattern?.source,r=t.innerType??e._zod.innerType;if(r){let i=r._zod.pattern?.source,o=Q0(r);return n&&i&&o&&o!==i?n.replace(gs(i),()=>gs(o)):n}if(t.options){let i=t.options.map(Q0);if(i.every(Boolean))return`^(${i.map(o=>gs(o)).join("|")})$`}return wye(e)}var aC=D("$ZodTemplateLiteral",(e,t)=>{Me.init(e,t);let n=[];for(let r of t.parts)if(typeof r=="object"&&r!==null){let i=Q0(r);if(!i)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);n.push(gs(i))}else if(r===null||UR.has(typeof r))n.push(Ti(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(r,i)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),cC=D("$ZodFunction",(e,t)=>(Me.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...r){let i=e._def.input?G_(e._def.input,r):r,o=Reflect.apply(n,this,i);return e._def.output?G_(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...r){let i=e._def.input?await B_(e._def.input,r):r,o=await Reflect.apply(n,this,i);return e._def.output?await B_(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(n,r)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let r=e.constructor;return Array.isArray(n[0])?new r({type:"function",input:new _w({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new r({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let r=e.constructor;return new r({type:"function",input:e._def.input,output:n})},e)),lC=D("$ZodPromise",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then(i=>t.innerType._zod.run({value:i,issues:[]},r))}),Xg=D("$ZodLazy",(e,t)=>{Me.init(e,t),MR(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),Be(e,"pattern",n=>n.innerType?._zod?.pattern),Be(e,"propValues",n=>n.innerType?._zod?.propValues),Be(e,"optin",n=>n.innerType?._zod?.optin??void 0),Be(e,"optout",n=>n.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),uC=D("$ZodCustom",(e,t)=>{St.init(e,t),Me.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(o=>A4(o,n,r,e));A4(i,n,r,e)}});function A4(e,t,n,r){if(!e){let i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(td(i))}}function I4(e,t,n){e.issues.length&&t.issues.push(...pr(n,e.issues))}var dC=D("$ZodProperties",(e,t)=>{Me.init(e,t),St.init(e,t);let n=_n.memoizer;n?.attach(e);let r,i=(o,s)=>{r??(r=Reflect.ownKeys(t.shape).map(l=>[l,t.shape[l]]));let a=o.value,c;for(let[l,u]of r){let d=u._zod.run({value:a[l],issues:[]},s);d instanceof Promise?(c??(c=[]),c.push(d.then(p=>I4(p,o,l)))):I4(d,o,l)}if(c)return Promise.all(c).then(()=>{})};e._zod.parse=(o,s)=>{let a=o.value;if(a===null||typeof a!="object"&&typeof a!="function")return o.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),o;s.direction==="backward"&&(s={...s,direction:"forward"}),n&&n.alloc(e,o,a,s);let c=i(o,s);return c instanceof Promise?c.then(()=>o):o},e._zod.check=o=>{if(o.value==null){o.issues.push({expected:"object",code:"invalid_type",input:o.value,inst:e});return}return i(o,{})}},{*[Symbol.iterator](){yield this}});var Ew=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},fC="~memo",M4=[];function L4(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function pC(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var F4=new WeakMap,cd=0,xw=1,eh=2;function th(e,t,n){let r=F4.get(e);if(r!==void 0)return r?eh:cd;if(t.has(e))return eh;t.add(e);let i=cd,o=u=>{if(i!==eh&&u?._zod){let d=th(u,t,n);d>i&&(i=d)}},s=(u,d)=>{let p=cd;for(let f of Reflect.ownKeys(u)){let m=Object.getOwnPropertyDescriptor(u,f);if(d&&!m.enumerable)continue;let g=m.get?xw:m.value?._zod?th(m.value,t,n):cd;g>p&&(p=g)}return p},a=u=>{u>i&&(i=u)},c=e._zod.def,l=c.type;switch(l){case"object":{let u=ed(c);a(u?s(u,!0):xw),o(c.catchall);break}case"properties":a(s(c.shape,!1));break;case"array":o(c.element);break;case"tuple":for(let u of c.items)o(u);o(c.rest);break;case"record":case"map":o(c.keyType),o(c.valueType);break;case"set":o(c.valueType);break;case"union":for(let u of c.options)o(u);break;case"intersection":o(c.left),o(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(c.innerType);break;case"pipe":o(c.in),o(c.out);break;case"function":o(c.input),o(c.output);break;case"lazy":{let u=c._cachedInner??(n?e._zod.innerType:void 0);a(u?th(u,t,!1):xw);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let u in c){let d=Object.getOwnPropertyDescriptor(c,u);if(!d||d.get)continue;let p=d.value;if(!(!p||typeof p!="object")){if(p._zod)o(p);else if(Array.isArray(p))for(let f of p)o(f)}}}return t.delete(e),kye(e,i)}function kye(e,t){return t!==xw&&F4.set(e,t===eh),t}function Tw(e){return th(e,new Set,!0)!==cd}function $ye(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var $w,Sw=[],Sye={alloc(e,t,n){let r=$w;if(!r)return n;$w=void 0;let i={value:n,issues:null};return r.set(t.value,i),Sw.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let n=e._zod.parse,r=(i,o)=>{if(o.direction!=="backward"&&Aw(o,i.value))throw new Ew;return n(i,o)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,i,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,l)=>{if(n===void 0){let v=th(e,new Set,!1);if(v===cd)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,l);v===eh||r?n=!0:r=!0}let u=c.value;if(!L4(u))return s(c,l);let d=l[fC];d||(d={buckets:new WeakMap,backEdges:void 0},l[fC]=d);let p;i===l?p=o:(p=$ye(d,e),i=l,o=p);let f=p.get(u);if(f)return c.value=f.value,f.issues?f.issues.length&&c.issues.push(...pC(f.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(f.value)),c;$w=p;let m=Sw.length,g=s(c,l);$w=void 0;let h=Sw.length>m?Sw.pop():void 0;return g instanceof Promise?g.then(v=>(h&&(h.issues=v.issues.length?pC(v.issues):M4),v)):(h&&(h.issues=g.issues.length?pC(g.issues):M4),g)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a)})}};function nh(){return Sye}function Aw(e,t){let n=e[fC]?.backEdges;return n!==void 0&&L4(t)&&n.has(t)}var ih={};Cr(ih,{ar:()=>U4,az:()=>j4,be:()=>G4,bg:()=>B4,bn:()=>V4,ca:()=>q4,ckb:()=>W4,cs:()=>H4,da:()=>K4,de:()=>J4,el:()=>Z4,en:()=>Iw,eo:()=>Y4,es:()=>Q4,fa:()=>X4,fi:()=>e6,fr:()=>t6,frCA:()=>n6,gu:()=>r6,he:()=>i6,hi:()=>o6,hr:()=>s6,hu:()=>a6,hy:()=>l6,id:()=>u6,is:()=>d6,it:()=>p6,ja:()=>f6,ka:()=>m6,kh:()=>g6,km:()=>Rw,kn:()=>h6,ko:()=>y6,lt:()=>v6,mk:()=>_6,ms:()=>w6,ne:()=>k6,nl:()=>$6,nn:()=>S6,no:()=>x6,ota:()=>E6,pl:()=>A6,ps:()=>T6,pt:()=>I6,ptBR:()=>R6,ro:()=>P6,ru:()=>N6,sk:()=>O6,sl:()=>D6,sv:()=>M6,ta:()=>L6,tg:()=>F6,th:()=>U6,tk:()=>j6,tr:()=>z6,ua:()=>G6,uk:()=>Pw,ur:()=>B6,uz:()=>V6,vi:()=>q6,yo:()=>K6,zhCN:()=>W6,zhTW:()=>H6});var xye=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},map:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(i){return e[i]??null}let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",mac:"\u0639\u0646\u0648\u0627\u0646 MAC",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",credit_card:"\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",iban:"IBAN",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${W(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${i.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${i.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${n[o.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${M(i.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function U4(){return{localeError:xye()}}var Eye=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"},map:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(i){return e[i]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"kredit kart\u0131 n\xF6mr\u0259si",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${i.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${W(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[o.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${M(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${i.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function j4(){return{localeError:Eye()}}function z4(e,t,n,r){let i=Math.abs(e),o=i%10,s=i%100;return s>=11&&s<=19?r:o===1?t:o>=2&&o<=4?n:r}var Tye=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},map:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(i){return e[i]??null}let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",mac:"MAC \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",credit_card:"\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},r={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${W(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);if(s){let a=Number(i.maximum),c=z4(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${i.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);if(s){let a=Number(i.minimum),c=z4(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${i.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${M(i.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${i.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function G4(){return{localeError:Tye()}}var Aye=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(i){return e[i]??null}let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",mac:"MAC \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${W(i.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${i.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${i.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u043E\u0432\u0435":""}: ${M(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function B4(){return{localeError:Aye()}}var Iye=()=>{let e={string:{unit:"\u0985\u0995\u09CD\u09B7\u09B0",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},file:{unit:"\u09AC\u09BE\u0987\u099F",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},array:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},set:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},map:{unit:"\u098F\u09A8\u09CD\u099F\u09CD\u09B0\u09BF",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"}};function t(i){return e[i]??null}let n={regex:"\u0987\u09A8\u09AA\u09C1\u099F",email:"\u0987\u09AE\u09C7\u0987\u09B2 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",url:"URL",emoji:"\u0987\u09AE\u09CB\u099C\u09BF",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u09A4\u09BE\u09B0\u09BF\u0996 \u0993 \u09B8\u09AE\u09AF\u09BC",date:"ISO \u09A4\u09BE\u09B0\u09BF\u0996",time:"ISO \u09B8\u09AE\u09AF\u09BC",duration:"ISO \u09B8\u09AE\u09AF\u09BC\u0995\u09BE\u09B2",ipv4:"IPv4 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",ipv6:"IPv6 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",mac:"MAC \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",cidrv4:"IPv4 \u09B0\u09C7\u099E\u09CD\u099C",cidrv6:"IPv6 \u09B0\u09C7\u099E\u09CD\u099C",base64:"base64-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",base64url:"base64url-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",json_string:"JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",e164:"E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",credit_card:"\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",iban:"IBAN",jwt:"JWT",template_literal:"\u0987\u09A8\u09AA\u09C1\u099F"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${o}, \u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4 ${a}`}case"invalid_value":return i.values.length===1?`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${W(i.values[0])}`:`\u0985\u09AC\u09C8\u09A7 \u0985\u09AA\u09B6\u09A8: ${M(i.values," | ")} \u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7 \u098F\u0995\u099F\u09BF \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${i.origin??"\u09AE\u09BE\u09A8"} ${o}${i.maximum.toString()} ${s.unit??"\u098F\u09B2\u09BF\u09AE\u09C7\u09A8\u09CD\u099F"} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${i.origin??"\u09AE\u09BE\u09A8"} ${o}${i.maximum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${i.origin} ${o}${i.minimum.toString()} ${s.unit} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${i.origin} ${o}${i.minimum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.prefix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C1\u09B0\u09C1 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="ends_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.suffix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C7\u09B7 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="includes"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.includes}" \u0985\u09A8\u09CD\u09A4\u09B0\u09CD\u09AD\u09C1\u0995\u09CD\u09A4 \u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="regex"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: ${o.pattern} \u09AA\u09CD\u09AF\u09BE\u099F\u09BE\u09B0\u09CD\u09A8 \u09AE\u09BF\u09B2\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09AC\u09C8\u09A7 ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0985\u09AC\u09C8\u09A7 \u09A8\u09AE\u09CD\u09AC\u09B0: ${i.divisor} \u098F\u09B0 \u0997\u09C1\u09A3\u09BF\u09A4\u0995 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`;case"unrecognized_keys":return`\u0985\u099A\u09C7\u09A8\u09BE \u0995\u09C0${i.keys.length>1?"\u0997\u09C1\u09B2\u09CB":""}: ${M(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u0995\u09C0`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u0985\u09AC\u09C8\u09A7 \u09A1\u09BF\u09B8\u0995\u09CD\u09B0\u09BF\u09AE\u09BF\u09A8\u09C7\u099F\u09B0 \u09AE\u09BE\u09A8\u0964 \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${i.options.map(s=>`'${s}'`).join(" | ")}`:"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F";case"invalid_element":return`${i.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u09AE\u09BE\u09A8`;default:return"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F"}}};function V4(){return{localeError:Iye()}}var Rye=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function t(i){return e[i]??null}let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",mac:"adre\xE7a MAC",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",credit_card:"n\xFAmero de targeta de cr\xE8dit",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${i.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${W(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${M(i.values," o ")}`;case"too_big":{let o=i.inclusive?"com a m\xE0xim":"menys de",s=t(i.origin);return s?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${o} ${i.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(i.origin);return s?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${o} ${i.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${n[o.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${M(i.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${i.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${i.origin}`;default:return"Entrada inv\xE0lida"}}};function q4(){return{localeError:Rye()}}var Pye=()=>{let e={string:{unit:"\u067E\u06CC\u062A",verb:"\u0628\u06CE\u062A"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u0628\u06CE\u062A"},array:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},set:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},map:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"}};function t(i){return e[i]??null}let n={regex:"regex",email:"\u0626\u06CC\u0645\u06D5\u06CC\u06B5",url:"\u0628\u06D5\u0633\u062A\u06D5\u0631 (URL)",emoji:"\u0626\u06CC\u0645\u06C6\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0695\u06CE\u06A9\u06D5\u0648\u062A \u0648 \u06A9\u0627\u062A",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",time:"\u06A9\u0627\u062A",duration:"\u0645\u0627\u0648\u06D5",ipv4:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv4",ipv6:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv6",mac:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC MAC",cidrv4:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv4",cidrv6:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv6",base64:"\u062F\u06D5\u0642\u06CC base64",base64url:"\u062F\u06D5\u0642\u06CC base64url",json_string:"\u062F\u06D5\u0642\u06CC JSON",e164:"\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",credit_card:"\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",iban:"IBAN",jwt:"JWT",template_literal:"\u062A\u06CE\u06A9\u0631\u062F\u06D5"},r={nan:"NaN",string:"\u0646\u0648\u0648\u0633\u06CC\u0646",number:"\u0698\u0645\u0627\u0631\u06D5",boolean:"boolean",array:"array",object:"object",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",integer:"\u0698\u0645\u0627\u0631\u06D5",float:"\u0698\u0645\u0627\u0631\u06D5",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s,c=["\u0627","\u0648","\u06C6","\u0648\u0648","\u06D5","\u06CC","\u06CE"].some(u=>a.endsWith(u))?"\u06CC\u06D5":"\u06D5",l=/^[a-zA-Z]+$/.test(a);return s==="null"||s==="undefined"?"\u062F\u0627\u0648\u0627\u06A9\u0631\u0627\u0648\u06D5":`\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${o} \u0628\u06CE\u062A\u060C \u0628\u06D5\u06B5\u0627\u0645 ${a}${l?"":c}`}case"invalid_value":return i.values.length===1?`\u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0648\u0633\u062A\u06D5: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${W(i.values[0])} \u0628\u06CE\u062A`:`\u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 \u06CC\u06D5\u06A9\u06CE\u06A9 \u0628\u06CE\u062A \u0644\u06D5 ${M(i.values,"|")}`;case"too_big":{let o=t(i.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${i.maximum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${i.maximum.toString()} \u0628\u06CE\u062A`}case"too_small":{let o=t(i.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${i.minimum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${i.minimum.toString()} \u0628\u06CE\u062A`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u062F\u06D5\u0633\u062A\u067E\u06CE\u0628\u06A9\u0627\u062A \u0628\u06D5 "${o.prefix}"`:o.format==="ends_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u06A9\u06C6\u062A\u0627\u06CC\u06CC\u0628\u06CE\u062A \u0628\u06D5 "${o.suffix}"`:o.format==="includes"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 "${o.includes}" \u0644\u06D5\u062E\u06C6\u0628\u06AF\u0631\u06CE\u062A`:o.format==="regex"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0644\u06D5\u06AF\u06D5\u06B5 \u067E\u0627\u062A\u06CE\u0631\u0646\u06CC ${o.pattern} \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A`:`\u0628\u06D5\u0647\u0627\u06CC ${n[o.format]??i.format} \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`}case"not_multiple_of":return`\u0698\u0645\u0627\u0631\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u062F\u06D5\u0628\u06CE\u062A \u0686\u06D5\u0646\u062F \u0647\u06CE\u0646\u062F\u06D5 \u0628\u06CE\u062A \u0628\u06C6 ${i.divisor}`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648: ${M(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A \u0644\u06D5 ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u0628\u06D5\u0647\u0627\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648 \u0647\u06D5\u06CC\u06D5. \u0628\u06D5\u0647\u0627\u06CC \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648: ${i.options.map(s=>`'${s}'`).join(" | ")}`:"\u06CC\u06D5\u06A9\u06AF\u0631\u062A\u0646\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A";case"invalid_element":return`${i.origin} \u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`;default:return"\u062A\u06CE\u06A9\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A"}}};function W4(){return{localeError:Pye()}}var Cye=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"},map:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(i){return e[i]??null}let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditn\xED karty",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${i.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${W(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${M(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}};function H4(){return{localeError:Cye()}}var Nye=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function t(i){return e[i]??null}let n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return i.values.length===1?`Ugyldig v\xE6rdi: forventede ${W(i.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin),a=r[i.origin]??i.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin),a=r[i.origin]??i.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${i.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${M(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${i.origin}`;default:return"Ugyldigt input"}}};function K4(){return{localeError:Nye()}}var Oye=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"},map:{unit:"Elemente",verb:"zu haben"}};function t(i){return e[i]??null}let n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",iban:"IBAN",jwt:"JWT",template_literal:"Eingabe"},r={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${i.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${W(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ist`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ist`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${n[o.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${M(i.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${i.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${i.origin}`;default:return"Ung\xFCltige Eingabe"}}};function J4(){return{localeError:Oye()}}var Dye=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(i){return e[i]??null}let n={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",credit_card:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",iban:"IBAN",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return typeof i.expected=="string"&&/^[A-Z]/.test(i.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${i.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return i.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${W(i.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${i.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${i.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${o.prefix}"`:o.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${o.suffix}"`:o.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${o.includes}"`:o.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[o.format]??i.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${i.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${i.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${i.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${M(i.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${i.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${i.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function Z4(){return{localeError:Dye()}}var Mye=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function i(o,s){return o==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):r[o]??o}return o=>{switch(o.code){case"invalid_type":{let s=i(o.expected),a=Z(o.input),c=i(a,o.input);return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${W(o.values[0])}`:`Invalid option: expected one of ${M(o.values,"|")}`;case"too_big":{let s=o.exact?"exactly ":o.inclusive?"<=":"<",a=t(o.origin);return a?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.exact?"exactly ":o.inclusive?">=":">",a=t(o.origin);return a?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${a.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${M(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(a=>`'${a}'`).join(" | ")}`:o.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function Iw(){return{localeError:Mye()}}var Lye=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function t(i){return e[i]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",mac:"MAC-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",credit_card:"kreditkarta numero",iban:"IBAN",jwt:"JWT",template_literal:"enigo"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${i.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${W(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${o}${i.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${M(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function Y4(){return{localeError:Lye()}}var Fye=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(i){return e[i]??null}let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",mac:"direcci\xF3n MAC",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",credit_card:"n\xFAmero de tarjeta de cr\xE9dito",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${i.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: se esperaba ${W(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin),a=r[i.origin]??i.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${i.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin),a=r[i.origin]??i.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${i.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${n[o.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${M(i.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${r[i.origin]??i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${r[i.origin]??i.origin}`;default:return"Entrada inv\xE1lida"}}};function Q4(){return{localeError:Fye()}}var Uye=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},map:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(i){return e[i]??null}let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",mac:"MAC \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",credit_card:"\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},r={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${W(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${M(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[o.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${M(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${i.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${i.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function X4(){return{localeError:Uye()}}var jye=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(i){return e[i]??null}let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",iban:"IBAN",jwt:"JWT",template_literal:"templaattimerkkijono"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${W(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${i.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${i.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${M(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function e6(){return{localeError:jye()}}var zye=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(i){return e[i]??null}let n={regex:"expression r\xE9guli\xE8re",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne de caract\xE8res encod\xE9e en base64",base64url:"cha\xEEne de caract\xE8res encod\xE9e en base64url",json_string:"cha\xEEne de caract\xE8res JSON",e164:"num\xE9ro au format E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},r={string:"cha\xEEne de caract\xE8res",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"record",map:"map",set:"ensemble",file:"fichier",nonoptional:"non optionnel",nan:"NaN",function:"fonction"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : instance de ${i.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${W(i.values[0])} attendu`:`Option invalide : une valeur parmi ${M(i.values,"|")} attendue`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Trop grand : ${r[i.origin]??"valeur"} doit ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${r[i.origin]??"valeur"} doit \xEAtre ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Trop petit : ${r[i.origin]??"valeur"} doit ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : ${r[i.origin]??"valeur"} doit \xEAtre ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cha\xEEne de caract\xE8res invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne de caract\xE8res invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne de caract\xE8res invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne de caract\xE8res invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${M(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function t6(){return{localeError:zye()}}var Gye=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"},map:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(i){return e[i]??null}let n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : attendu instanceof ${i.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${W(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u2264":"<",s=t(i.origin);return s?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${o}${i.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"\u2265":">",s=t(i.origin);return s?`Trop petit : attendu que ${i.origin} ait ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${i.origin} soit ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${M(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function n6(){return{localeError:Gye()}}var Bye=()=>{let e={string:{unit:"\u0A85\u0A95\u0ACD\u0AB7\u0AB0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},file:{unit:"\u0AAC\u0ABE\u0AAF\u0A9F",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},array:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},set:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},map:{unit:"\u0A8F\u0AA8\u0ACD\u0A9F\u0ACD\u0AB0\u0AC0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"}};function t(i){return e[i]??null}let n={regex:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F",email:"\u0A88\u0AAE\u0AC7\u0A87\u0AB2 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",url:"URL",emoji:"\u0A87\u0AAE\u0ACB\u0A9C\u0AC0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96 \u0A85\u0AA8\u0AC7 \u0AB8\u0AAE\u0AAF",date:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96",time:"ISO \u0AB8\u0AAE\u0AAF",duration:"ISO \u0A85\u0AB5\u0AA7\u0ABF",ipv4:"IPv4 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",ipv6:"IPv6 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",mac:"MAC \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",cidrv4:"IPv4 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",cidrv6:"IPv6 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",base64:"base64-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",base64url:"base64url-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",json_string:"JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",e164:"E.164 \u0AA8\u0A82\u0AAC\u0AB0",credit_card:"\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",iban:"IBAN",jwt:"JWT",template_literal:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${o}, \u0AAA\u0ACD\u0AB0\u0ABE\u0AAA\u0ACD\u0AA4 ${a}`}case"invalid_value":return i.values.length===1?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${W(i.values[0])}`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB5\u0ABF\u0A95\u0AB2\u0ACD\u0AAA: ${M(i.values," | ")} \u0AAE\u0ABE\u0AA7\u0ACD\u0AAF\u0AAE\u0AA5\u0AC0 \u0A8F\u0A95 \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${i.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${i.maximum.toString()} ${s.unit??"\u0A8F\u0AB2\u0ABF\u0AAE\u0AC7\u0AA8\u0ACD\u0A9F"} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${i.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${i.maximum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${i.origin} ${o}${i.minimum.toString()} ${s.unit} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${i.origin} ${o}${i.minimum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.prefix}" \u0AA5\u0AC0 \u0AB6\u0AB0\u0AC2 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="ends_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.suffix}" \u0AAA\u0AB0 \u0AB8\u0AAE\u0ABE\u0AAA\u0ACD\u0AA4 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="includes"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.includes}" \u0AB6\u0ABE\u0AAE\u0AC7\u0AB2 \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="regex"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: \u0AAA\u0AC7\u0A9F\u0AB0\u0ACD\u0AA8 ${o.pattern} \u0AB8\u0ABE\u0AA5\u0AC7 \u0AAE\u0AC7\u0AB3 \u0A96\u0ABE\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA8\u0A82\u0AAC\u0AB0: ${i.divisor} \u0AA8\u0ACB \u0A97\u0AC1\u0AA3\u0ABE\u0A82\u0A95 \u0AB9\u0ACB\u0AB5\u0ACB \u0A9C\u0ACB\u0A88\u0A8F`;case"unrecognized_keys":return`\u0A93\u0AB3\u0A96\u0AC0 \u0AB6\u0A95\u0ABE\u0AA4\u0ABE \u0AA8\u0AB9\u0AC0\u0A82 \u0AA4\u0AC7 \u0A95\u0AC0${i.keys.length>1?"\u0A93":""}: ${M(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A95\u0AC0`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA1\u0ABF\u0AB8\u0ACD\u0A95\u0ACD\u0AB0\u0ABF\u0AAE\u0ABF\u0AA8\u0AC7\u0A9F\u0AB0 \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF. \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${i.options.map(s=>`'${s}'`).join(" | ")}`:"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F";case"invalid_element":return`${i.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF`;default:return"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F"}}};function r6(){return{localeError:Bye()}}var Vye=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=l=>l?e[l]:void 0,r=l=>{let u=n(l);return u?u.label:l??e.unknown.label},i=l=>`\u05D4${r(l)}`,o=l=>(n(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?t[l]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},mac:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA MAC",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},credit_card:{label:"\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9",gender:"m"},iban:{label:"IBAN",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"\u05E7\u05DC\u05D8",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,d=c[u??""]??r(u),p=Z(l.input),f=c[p]??e[p]?.label??p;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${W(l.values[0])}`;let u=l.values.map(f=>W(f));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=s(l.origin),d=i(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",g=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let p=l.inclusive?"<=":"<",f=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),d=i(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let h=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`}let g=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let p=l.inclusive?">=":">",f=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let d=a[u.format],p=d?.label??u.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${m}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${M(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function i6(){return{localeError:Vye()}}var qye=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},file:{unit:"\u092C\u093E\u0907\u091F\u094D\u0938",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F\u092F\u093E\u0901",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"}};function t(i){return e[i]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0924\u093F\u0925\u093F \u0914\u0930 \u0938\u092E\u092F",date:"ISO \u0924\u093F\u0925\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u092A\u0924\u093E",ipv6:"IPv6 \u092A\u0924\u093E",mac:"MAC \u092A\u0924\u093E",cidrv4:"IPv4 \u0936\u094D\u0930\u0947\u0923\u0940",cidrv6:"IPv6 \u0936\u094D\u0930\u0947\u0923\u0940",base64:"Base64-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",base64url:"Base64URL-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",e164:"E.164 \u0938\u0902\u0916\u094D\u092F\u093E",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return i.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${W(i.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u094B\u0902 \u092E\u0947\u0902 \u0938\u0947 \u090F\u0915 ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${i.origin??"\u092E\u093E\u0928"} \u092E\u0947\u0902 ${o}${i.maximum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${i.origin??"\u092E\u093E\u0928"} ${o}${i.maximum} \u0939\u094B`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${i.origin} \u092E\u0947\u0902 ${o}${i.minimum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${i.origin} ${o}${i.minimum} \u0939\u094B`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.prefix}" \u0938\u0947 \u0936\u0941\u0930\u0942 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.suffix}" \u092A\u0930 \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u0907\u0938\u092E\u0947\u0902 "${o.includes}" \u0936\u093E\u092E\u093F\u0932 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u092A\u0948\u091F\u0930\u094D\u0928 ${o.pattern} \u0938\u0947 \u092E\u0947\u0932 \u0916\u093E\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: \u092F\u0939 ${i.divisor} \u0915\u093E \u0917\u0941\u0923\u091C \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u0902\u091C\u0940${i.keys.length>1?"\u092F\u093E\u0901":""}: ${M(i.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u0902\u091C\u0940: ${i.origin} \u092E\u0947\u0902`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${i.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${i.origin} \u092E\u0947\u0902`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function o6(){return{localeError:qye()}}var Wye=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(i){return e[i]??null}let n={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",iban:"IBAN",jwt:"JWT",template_literal:"unos"},r={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${i.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return i.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${W(i.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin),a=r[i.origin]??i.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${i.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin),a=r[i.origin]??i.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${i.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${n[o.format]??i.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${i.divisor}`;case"unrecognized_keys":return`Neprepoznat${i.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${M(i.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${r[i.origin]??i.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${r[i.origin]??i.origin}`;default:return"Neispravan unos"}}};function s6(){return{localeError:Wye()}}var Hye=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function t(i){return e[i]??null}let n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",mac:"MAC c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",credit_card:"hitelk\xE1rtyasz\xE1m",iban:"IBAN",jwt:"JWT",template_literal:"bemenet"},r={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${i.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${W(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${i.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${o}${i.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[o.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${M(i.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${i.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${i.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function a6(){return{localeError:Hye()}}function c6(e,t,n){return Math.abs(e)===1?t:n}function ld(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=e[e.length-1];return e+(t.includes(n)?"\u0576":"\u0568")}var Kye=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},map:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(i){return e[i]??null}let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",mac:"MAC \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",credit_card:"\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",iban:"IBAN",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},r={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${i.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return i.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${W(i.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);if(s){let a=Number(i.maximum),c=c6(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ld(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${i.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ld(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);if(s){let a=Number(i.minimum),c=c6(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ld(i.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${i.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ld(i.origin)} \u056C\u056B\u0576\u056B ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[o.format]??i.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${i.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${i.keys.length>1?"\u0576\u0565\u0580":""}. ${M(i.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${ld(i.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${ld(i.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function l6(){return{localeError:Kye()}}var Jye=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function t(i){return e[i]??null}let n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",credit_card:"nomor kartu kredit",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${W(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${o}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Terlalu kecil: diharapkan ${i.origin} memiliki ${o}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${M(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};function u6(){return{localeError:Jye()}}var Zye=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"},map:{unit:"hluti",verb:"a\xF0 hafa"}};function t(i){return e[i]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",credit_card:"kreditkortan\xFAmer",iban:"IBAN",jwt:"JWT",template_literal:"gildi"},r={nan:"NaN",number:"n\xFAmer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${i.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${W(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${o}${i.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${o}${i.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??i.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${M(i.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${i.origin}`;default:return"Rangt gildi"}}};function d6(){return{localeError:Zye()}}var Yye=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function t(i){return e[i]??null}let n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${W(i.values[0])}`:`Opzione non valida: atteso uno tra ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Troppo grande: ${i.origin??"valore"} deve avere ${o}${i.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Troppo piccolo: ${i.origin} deve avere ${o}${i.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${i.origin} deve essere ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${n[o.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${M(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};function p6(){return{localeError:Yye()}}var Qye=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},map:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(i){return e[i]??null}let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",mac:"MAC\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",credit_card:"\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",iban:"IBAN",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},r={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${W(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${M(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(i.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(i.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[o.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${M(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function f6(){return{localeError:Qye()}}var Xye=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},map:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(i){return e[i]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",mac:"MAC \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",credit_card:"\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",iban:"IBAN",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},r={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return i.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${W(i.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${M(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[o.format]??i.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${i.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${i.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${M(i.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${i.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${i.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function m6(){return{localeError:Xye()}}var ebe=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},map:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(i){return e[i]??null}let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",mac:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 MAC",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",credit_card:"\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",iban:"IBAN",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},r={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${W(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${i.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${o} ${i.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[o.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${M(i.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Rw(){return{localeError:ebe()}}function g6(){return Rw()}var tbe=()=>{let e={string:{unit:"\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},file:{unit:"\u0CAC\u0CC8\u0C9F\u0CCD\u200C\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},array:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},set:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},map:{unit:"entries",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"}};function t(i){return e[i]??null}let n={regex:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD",email:"email \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95\u0CA6 \u0CB8\u0CAE\u0CAF",date:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95",time:"ISO \u0CB8\u0CAE\u0CAF",duration:"ISO \u0C85\u0CB5\u0CA7\u0CBF",ipv4:"IPv4 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",ipv6:"IPv6 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",mac:"MAC \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",cidrv4:"IPv4 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",cidrv6:"IPv6 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",base64:"base64-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",base64url:"base64url-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",json_string:"JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",e164:"E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",credit_card:"\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",iban:"IBAN",jwt:"JWT",template_literal:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${o}, \u0CB8\u0CCD\u0CB5\u0CC0\u0C95\u0CB0\u0CBF\u0CB8\u0CBF\u0CA6\u0CA8\u0CC1 ${a}`}case"invalid_value":return i.values.length===1?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${W(i.values[0])}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C86\u0CAF\u0CCD\u0C95\u0CC6: \u0C87\u0CB5\u0CC1\u0C97\u0CB3\u0CB2\u0CCD\u0CB2\u0CBF \u0C92\u0C82\u0CA6\u0CA8\u0CCD\u0CA8\u0CC1 \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${i.origin??"value"} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${i.maximum.toString()} ${s.unit??"\u0C85\u0C82\u0CB6\u0C97\u0CB3\u0CC1"}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${i.origin??"value"} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${i.origin} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${i.minimum.toString()} ${s.unit}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${i.origin} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0CAA\u0CCD\u0CB0\u0CBE\u0CB0\u0C82\u0CAD\u0CBF\u0CB8\u0CAC\u0CC7\u0C95\u0CC1 "${o.prefix}"`:o.format==="ends_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0C95\u0CCA\u0CA8\u0CC6\u0C97\u0CCA\u0CB3\u0CCD\u0CB3\u0CAC\u0CC7\u0C95\u0CC1 "${o.suffix}"`:o.format==="includes"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C92\u0CB3\u0C97\u0CCA\u0C82\u0CA1\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 "${o.includes}"`:o.format==="regex"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0CAE\u0CBE\u0CA6\u0CB0\u0CBF\u0C97\u0CC6 \u0CB9\u0CCA\u0C82\u0CA6\u0CBF\u0C95\u0CC6\u0CAF\u0CBE\u0C97\u0CAC\u0CC7\u0C95\u0CC1 ${o.pattern}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6: \u0CAC\u0CB9\u0CC1\u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6\u0CAF\u0CBE\u0C97\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 ${i.divisor}`;case"unrecognized_keys":return`\u0C97\u0CC1\u0CB0\u0CC1\u0CA4\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CA6 \u0C95\u0CC0 ${i.keys.length>1?"s":""}: ${M(i.keys,", ")}`;case"invalid_key":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0C95\u0CC0 \u0C87\u0CA8\u0CCD ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CA4\u0CBE\u0CB0\u0CA4\u0CAE\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF. \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${i.options.map(s=>`'${s}'`).join(" | ")}`:"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD";case"invalid_element":return`\u0CB0\u0CB2\u0CCD\u0CB2\u0CBF \u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF ${i.origin}`;default:return"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD"}}};function h6(){return{localeError:tbe()}}var nbe=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"},map:{unit:"\uAC1C",verb:"to have"}};function t(i){return e[i]??null}let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",mac:"MAC \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",credit_card:"\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",iban:"IBAN",jwt:"JWT",template_literal:"\uC785\uB825"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${W(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${M(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(i.origin),c=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${c} ${o}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${o}${s}`}case"too_small":{let o=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(i.origin),c=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${c} ${o}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[o.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${M(i.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${i.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${i.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function y6(){return{localeError:nbe()}}var rh=e=>e.charAt(0).toUpperCase()+e.slice(1);function b6(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?"many":n===1?"one":"few"}var rbe=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(i,o,s,a){let c=e[i]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",mac:"MAC adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",credit_card:"kredito kortel\u0117s numeris",iban:"IBAN",jwt:"JWT",template_literal:"\u012Fvestis"},r={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${i.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${W(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${M(i.values,"|")} pasirinkim\u0173`;case"too_big":{let o=r[i.origin]??i.origin,s=t(i.origin,b6(Number(i.maximum)),i.inclusive??!1,"smaller");if(s?.verb)return`${rh(o??i.origin??"reik\u0161m\u0117")} ${s.verb} ${i.maximum.toString()} ${s.unit??"element\u0173"}`;let a=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${rh(o??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.maximum.toString()} ${s?.unit}`}case"too_small":{let o=r[i.origin]??i.origin,s=t(i.origin,b6(Number(i.minimum)),i.inclusive??!1,"bigger");if(s?.verb)return`${rh(o??i.origin??"reik\u0161m\u0117")} ${s.verb} ${i.minimum.toString()} ${s.unit??"element\u0173"}`;let a=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${rh(o??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??i.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${M(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=r[i.origin]??i.origin;return`${rh(o??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function v6(){return{localeError:rbe()}}var ibe=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},map:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(i){return e[i]??null}let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",mac:"MAC \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",credit_card:"\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},r={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${W(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${i.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${M(i.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${i.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${i.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function _6(){return{localeError:ibe()}}var obe=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function t(i){return e[i]??null}let n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${W(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Terlalu besar: dijangka ${i.origin??"nilai"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Terlalu kecil: dijangka ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${M(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};function w6(){return{localeError:obe()}}var sbe=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},file:{unit:"\u092C\u093E\u0907\u091F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"}};function t(i){return e[i]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0907\u092E\u0947\u0932 \u0920\u0947\u0917\u093E\u0928\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u092E\u093F\u0924\u093F \u0930 \u0938\u092E\u092F",date:"ISO \u092E\u093F\u0924\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u0920\u0947\u0917\u093E\u0928\u093E",ipv6:"IPv6 \u0920\u0947\u0917\u093E\u0928\u093E",mac:"MAC \u0920\u0947\u0917\u093E\u0928\u093E",cidrv4:"IPv4 \u0926\u093E\u092F\u0930\u093E",cidrv6:"IPv6 \u0926\u093E\u092F\u0930\u093E",base64:"base64-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",base64url:"base64url-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",e164:"E.164 \u0928\u092E\u094D\u092C\u0930",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return i.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${W(i.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u0939\u0930\u0942 \u092E\u0927\u094D\u092F\u0947 \u090F\u0915 ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${i.origin??"\u092E\u093E\u0928"} \u092E\u093E ${o}${i.maximum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${i.origin??"\u092E\u093E\u0928"} ${o}${i.maximum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${i.origin} \u092E\u093E ${o}${i.minimum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${i.origin} ${o}${i.minimum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.prefix}" \u092C\u093E\u091F \u0938\u0941\u0930\u0941 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.suffix}" \u092E\u093E \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.includes}" \u0938\u092E\u093E\u0935\u0947\u0936 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: \u0922\u093E\u0901\u091A\u093E ${o.pattern} \u0938\u0901\u0917 \u092E\u0947\u0932 \u0916\u093E\u0928\u0941\u092A\u0930\u094D\u091B`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: ${i.divisor} \u0915\u094B \u0917\u0941\u0923\u091C \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u091E\u094D\u091C\u0940${i.keys.length>1?"\u0939\u0930\u0942":""}: ${M(i.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u091E\u094D\u091C\u0940: ${i.origin} \u092E\u093E`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${i.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${i.origin} \u092E\u093E`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function k6(){return{localeError:sbe()}}var abe=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function t(i){return e[i]??null}let n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",iban:"IBAN",jwt:"JWT",template_literal:"invoer"},r={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${W(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin),a=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} is`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin),a=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} is`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${M(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function $6(){return{localeError:abe()}}var cbe=()=>{let e={string:{unit:"teikn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"element",verb:"\xE5 innehalde"},set:{unit:"element",verb:"\xE5 innehalde"},map:{unit:"element",verb:"\xE5 innehalde"}};function t(i){return e[i]??null}let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tal",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventa instanceof ${i.expected}, fekk ${a}`:`Ugyldig input: forventa ${o}, fekk ${a}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventa ${W(i.values[0])}`:`Ugyldig val: forventa eitt av ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`For stor(t): forventa ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()} ${s.unit??"element"}`:`For stor(t): forventa ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`For lite(n): forventa ${i.origin} til \xE5 ha ${o}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventa ${i.origin} til \xE5 ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 slutte med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 innehalde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??i.format}`}case"not_multiple_of":return`Ugyldig tal: m\xE5 vere eit multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjende n\xF8klar":"Ukjend n\xF8kkel"}: ${M(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function S6(){return{localeError:cbe()}}var lbe=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"},map:{unit:"elementer",verb:"\xE5 inneholde"}};function t(i){return e[i]??null}let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${W(i.values[0])}`:`Ugyldig valg: forventet en av ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${M(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function x6(){return{localeError:lbe()}}var ube=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"},map:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(i){return e[i]??null}let n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",mac:"MAC ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",credit_card:"i'tib\xE2r kart\u0131 numaras\u0131",iban:"IBAN",jwt:"JWT",template_literal:"giren"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`F\xE2sit giren: umulan instanceof ${i.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${W(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=i;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[o.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${M(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${i.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function E6(){return{localeError:ube()}}var dbe=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},map:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(i){return e[i]??null}let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",mac:"\u062F MAC \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",credit_card:"\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},r={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${W(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${M(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[o.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${M(i.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${i.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${i.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function T6(){return{localeError:dbe()}}var pbe=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"},map:{unit:"element\xF3w",verb:"mie\u0107"}};function t(i){return e[i]??null}let n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",mac:"adres MAC",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",credit_card:"numer karty kredytowej",iban:"IBAN",jwt:"JWT",template_literal:"wej\u015Bcie"},r={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${i.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${W(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${i.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${i.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[o.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${M(i.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${i.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${i.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function A6(){return{localeError:pbe()}}var fbe=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(s){return e[s]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"o intervalo de endere\xE7os IPv4",cidrv6:"o intervalo de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},r={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},i={string:{name:"texto",articles:r.masculine},number:{name:"n\xFAmero",articles:r.masculine},int:{name:"n\xFAmero inteiro",articles:r.masculine},boolean:{name:"valor booleano",articles:r.masculine},bigint:{name:"n\xFAmero bigint",articles:r.masculine},symbol:{name:"s\xEDmbolo",articles:r.masculine},undefined:{name:'valor "undefined"',articles:r.masculine},null:{name:'valor "nulo"',articles:r.masculine},never:{name:'valor "never"',articles:r.masculine},void:{name:'valor "void"',articles:r.masculine},date:{name:"data",articles:r.feminine},array:{name:"vetor",articles:r.masculine},object:{name:"objeto",articles:r.masculine},tuple:{name:"tuplo",articles:r.masculine},record:{name:"registo",articles:r.masculine},map:{name:"mapa",articles:r.masculine},set:{name:"conjunto",articles:r.masculine},file:{name:"ficheiro",articles:r.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:r.masculine},nan:{name:'valor "NaN"',articles:r.masculine},function:{name:"fun\xE7\xE3o",articles:r.feminine}};function o(s,a){let c=i[s]??{name:`valor "${s}"`,articles:r.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=Z(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${W(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${M(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=t(s.origin);return c?`Demasiado grande: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=t(s.origin);return c?`Demasiado pequeno: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Demasiado pequeno: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar por "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar em "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${n[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${M(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function I6(){return{localeError:fbe()}}var mbe=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(s){return e[s]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"a faixa de endere\xE7os IPv4",cidrv6:"a faixa de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},r={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},i={string:{name:"texto",articles:r.masculine},number:{name:"n\xFAmero",articles:r.masculine},int:{name:"n\xFAmero inteiro",articles:r.masculine},boolean:{name:"valor booleano",articles:r.masculine},bigint:{name:"n\xFAmero bigint",articles:r.masculine},symbol:{name:"s\xEDmbolo",articles:r.masculine},undefined:{name:'valor "undefined"',articles:r.masculine},null:{name:'valor "nulo"',articles:r.masculine},never:{name:'valor "never"',articles:r.masculine},void:{name:'valor "void"',articles:r.masculine},date:{name:"data",articles:r.feminine},array:{name:"vetor",articles:r.masculine},object:{name:"objeto",articles:r.masculine},tuple:{name:"tupla",articles:r.feminine},record:{name:"registro",articles:r.masculine},map:{name:"mapa",articles:r.masculine},set:{name:"conjunto",articles:r.masculine},file:{name:"arquivo",articles:r.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:r.masculine},nan:{name:'valor "NaN"',articles:r.masculine},function:{name:"fun\xE7\xE3o",articles:r.feminine}};function o(s,a){let c=i[s]??{name:`valor "${s}"`,articles:r.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=Z(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${W(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${M(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=t(s.origin);return c?`Grande demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Grande demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=t(s.origin);return c?`Pequeno demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Pequeno demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${n[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${M(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function R6(){return{localeError:mbe()}}var gbe=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(i){return e[i]??null}let n={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",credit_card:"num\u0103r de card de credit",iban:"IBAN",jwt:"JWT",template_literal:"intrare"},r={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return i.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${W(i.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} s\u0103 fie ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Prea mic: a\u0219teptat ca ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${i.origin} s\u0103 fie ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${n[o.format]??i.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${i.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${M(i.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${i.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${i.origin}`;default:return"Intrare invalid\u0103"}}};function P6(){return{localeError:gbe()}}function C6(e,t,n,r){let i=Math.abs(e),o=i%10,s=i%100;return s>=11&&s<=19?r:o===1?t:o>=2&&o<=4?n:r}var hbe=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},map:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(i){return e[i]??null}let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",mac:"MAC \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${W(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);if(s){let a=Number(i.maximum),c=C6(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${i.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);if(s){let a=Number(i.minimum),c=C6(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${i.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${M(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function N6(){return{localeError:hbe()}}var ybe=()=>{let e={string:{unit:"znakov",verb:"ma\u0165"},file:{unit:"bajtov",verb:"ma\u0165"},array:{unit:"prvkov",verb:"ma\u0165"},set:{unit:"prvkov",verb:"ma\u0165"},map:{unit:"polo\u017Eiek",verb:"ma\u0165"}};function t(i){return e[i]??null}let n={regex:"regul\xE1rny v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"d\xE1tum a \u010Das vo form\xE1te ISO",date:"d\xE1tum vo form\xE1te ISO",time:"\u010Das vo form\xE1te ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64",base64url:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64url",json_string:"re\u0165azec vo form\xE1te JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditnej karty",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"\u010D\xEDslo",string:"re\u0165azec",function:"funkcia",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 instanceof ${i.expected}, obdr\u017Ean\xE9 ${a}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${o}, obdr\u017Ean\xE9 ${a}`}case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${W(i.values[0])}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE1 jedna z hodn\xF4t ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${i.origin??"hodnota"} mus\xED ma\u0165 ${o}${i.maximum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${i.origin??"hodnota"} mus\xED by\u0165 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Hodnota je pr\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED ma\u0165 ${o}${i.minimum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED by\u0165 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neplatn\xFD re\u0165azec: mus\xED za\u010D\xEDna\u0165 na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD re\u0165azec: mus\xED kon\u010Di\u0165 na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD re\u0165azec: mus\xED obsahova\u0165 "${o.includes}"`:o.format==="regex"?`Neplatn\xFD re\u0165azec: mus\xED zodpoveda\u0165 vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED by\u0165 n\xE1sobkom ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1me kl\xFA\u010De: ${M(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xFA\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}};function O6(){return{localeError:ybe()}}var bbe=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function t(i){return e[i]??null}let n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",credit_card:"\u0161tevilka kreditne kartice",iban:"IBAN",jwt:"JWT",template_literal:"vnos"},r={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${i.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${W(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${o}${i.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${o}${i.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${M(i.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};function D6(){return{localeError:bbe()}}var vbe=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"},map:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(i){return e[i]??null}let n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-adress",ipv6:"IPv6-adress",mac:"MAC-adress",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",credit_card:"kreditkortsnummer",iban:"IBAN",jwt:"JWT",template_literal:"mall-literal"},r={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${i.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${W(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${M(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${i.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function M6(){return{localeError:vbe()}}var _be=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},map:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(i){return e[i]??null}let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",mac:"MAC \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",credit_card:"\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${W(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${M(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${i.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${o}${i.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${o}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${M(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function L6(){return{localeError:_be()}}var wbe=()=>{let e={string:{unit:"\u0430\u043B\u043E\u043C\u0430\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},file:{unit:"\u0431\u0430\u0439\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},array:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},set:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},map:{unit:"\u0441\u0430\u0431\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"}};function t(i){return e[i]??null}let n={regex:"\u0432\u0443\u0440\u0443\u0434",email:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",url:"URL",emoji:"\u044D\u043C\u043E\u04B7\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",date:"\u0441\u0430\u043D\u0430\u0438 ISO",time:"\u0432\u0430\u049B\u0442\u0438 ISO",duration:"\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",ipv4:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",ipv6:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",mac:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",cidrv4:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",cidrv6:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",base64:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",base64url:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",json_string:"\u0441\u0430\u0442\u0440\u0438 JSON",e164:"\u0440\u0430\u049B\u0430\u043C\u0438 E.164",credit_card:"\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0443\u0440\u0443\u0434"},r={nan:"NaN",number:"\u0440\u0430\u049B\u0430\u043C",string:"\u0441\u0430\u0442\u0440",array:"\u043C\u0430\u0441\u0441\u0438\u0432",object:"\u043E\u0431\u044A\u0435\u043A\u0442",date:"\u0441\u0430\u043D\u0430"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${o} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${a} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`}case"invalid_value":return i.values.length===1?`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${W(i.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:`\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${M(i.values,"|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${i.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${i.maximum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${i.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${i.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${i.origin} \u0431\u043E\u044F\u0434 ${o}${i.minimum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${i.origin} \u0431\u043E\u044F\u0434 ${o}${i.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`:o.format==="ends_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`:o.format==="includes"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${o.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`:o.format==="regex"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${o.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`:`${n[o.format]??i.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`}case"not_multiple_of":return`\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${i.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;case"unrecognized_keys":return`\u041A\u0430\u043B\u0438\u0434${i.keys.length>1?"\u04B3\u043E\u0438":"\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${M(i.keys,", ")}`;case"invalid_key":return`\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${i.options.map(s=>`'${s}'`).join(" | ")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";case"invalid_element":return`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${i.origin}`;default:return"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442"}}};function F6(){return{localeError:wbe()}}var kbe=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},map:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(i){return e[i]??null}let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",mac:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",credit_card:"\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",iban:"IBAN",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},r={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${W(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(i.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(i.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${M(i.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function U6(){return{localeError:kbe()}}var $be=()=>{let e={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"ba\xFDt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function t(i){return e[i]??null}let n={regex:"giri\u015F",email:"e-po\xE7ta salgysy",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen \u015Fifrlenen setir",base64url:"base64url bilen \u015Fifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartyny\u0148 nomeri",iban:"IBAN",jwt:"JWT",template_literal:"\u015Fablon"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return`N\xE4dogry baha: gara\u015Fylan ${o} \xFDerine ${a} alyndy`}case"invalid_value":return i.values.length===1?`N\xE4dogry baha: ${W(i.values[0])} bolmaly`:`N\xE4dogry sa\xFDlaw: a\u015Fakdakylardan biri bolmaly: ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Has uly: gara\u015Fyl\xFDan ${i.origin??"baha"} ${o} ${i.maximum.toString()} ${s.unit??"element"}`:`Has uly: gara\u015Fyl\xFDan ${i.origin??"baha"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Has ki\xE7i: gara\u015Fyl\xFDan ${i.origin} ${o} ${i.minimum.toString()} ${s.unit}`:`Has ki\xE7i: gara\u015Fyl\xFDan ${i.origin} ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`N\xE4dogry setir: "${o.prefix}" bilen ba\u015Flamaly`:o.format==="ends_with"?`N\xE4dogry setir: "${o.suffix}" bilen gutarmaly`:o.format==="includes"?`N\xE4dogry setir: "${o.includes}" saklamaly`:o.format==="regex"?`N\xE4dogry setir: ${o.pattern} nusga la\xFDyk bolmaly`:`N\xE4dogry ${n[o.format]??i.format}`}case"not_multiple_of":return`N\xE4dogry san: ${i.divisor} bilen galyndysyz b\xF6l\xFCnmeli`;case"unrecognized_keys":return`Tanalma\xFDan a\xE7ar${i.keys.length>1?"lar":""}: ${M(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde n\xE4dogry a\xE7ar`;case"invalid_union":return"N\xE4dogry baha";case"invalid_element":return`${i.origin} i\xE7inde n\xE4dogry baha`;default:return"N\xE4dogry baha"}}};function j6(){return{localeError:$be()}}var Sbe=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},map:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(i){return e[i]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",mac:"MAC adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",credit_card:"kredi kart\u0131 numaras\u0131",iban:"IBAN",jwt:"JWT",template_literal:"\u015Eablon dizesi"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${i.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${W(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${o}${i.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[o.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${M(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function z6(){return{localeError:Sbe()}}var xbe=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(i){return e[i]??null}let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",mac:"\u0430\u0434\u0440\u0435\u0441\u0430 MAC",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${W(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} \u0431\u0443\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${M(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${i.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Pw(){return{localeError:xbe()}}function G6(){return Pw()}var Ebe=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},map:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(i){return e[i]??null}let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",mac:"\u0627\u06CC\u0645 \u0627\u06D2 \u0633\u06CC \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",credit_card:"\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",iban:"IBAN",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},r={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${W(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${M(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${o}${i.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${o}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[o.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${M(i.keys,"\u060C ")}`;case"invalid_key":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function B6(){return{localeError:Ebe()}}var Tbe=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(i){return e[i]??null}let n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",credit_card:"kredit karta raqami",iban:"IBAN",jwt:"JWT",template_literal:"kirish"},r={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return i.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${W(i.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[o.format]??i.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${i.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${i.keys.length>1?"lar":""}: ${M(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${i.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function V6(){return{localeError:Tbe()}}var Abe=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},map:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(i){return e[i]??null}let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",mac:"\u0111\u1ECBa ch\u1EC9 MAC",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",credit_card:"s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",iban:"IBAN",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},r={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${W(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${n[o.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${M(i.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function q6(){return{localeError:Abe()}}var Ibe=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"},map:{unit:"\u9879",verb:"\u5305\u542B"}};function t(i){return e[i]??null}let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",mac:"MAC\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",credit_card:"\u4FE1\u7528\u5361\u53F7",iban:"IBAN",jwt:"JWT",template_literal:"\u8F93\u5165"},r={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${W(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${n[o.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${M(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${i.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function W6(){return{localeError:Ibe()}}var Rbe=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},map:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(i){return e[i]??null}let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",mac:"MAC \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",credit_card:"\u4FE1\u7528\u5361\u865F",iban:"IBAN",jwt:"JWT",template_literal:"\u8F38\u5165"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${i.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${W(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${n[o.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${M(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function H6(){return{localeError:Rbe()}}var Pbe=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"},map:{unit:"nkan",verb:"n\xED"}};function t(i){return e[i]??null}let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",mac:"\xE0d\xEDr\u1EB9\u0301s\xEC MAC",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",credit_card:"n\u1ECDmba kaadi gbese",iban:"IBAN",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},r={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=Z(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${i.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return i.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${W(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${M(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin??"iye"} ${s.verb} ${o}${i.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.maximum}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin} ${s.verb} ${o}${i.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.minimum}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${n[o.format]??i.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${i.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${M(i.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function K6(){return{localeError:Pbe()}}var J6,mC=Symbol("ZodOutput"),gC=Symbol("ZodInput"),Cw=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let r={...this.get(n)??{}};delete r.id;let i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Nw(){return new Cw}(J6=globalThis).__zod_globalRegistry??(J6.__zod_globalRegistry=Nw());var Un=globalThis.__zod_globalRegistry;var mr=Symbol.for("zod.compile.invalid"),Z6=Symbol.for("zod.compile.fallback"),to=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},We=class extends Error{constructor(t,n=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=n}};function Nbe(e,t){try{return Dw(e,{assertOnly:!0})}catch{return t}}function vC(e,t){try{let n=Dw(e),r=Ow(e,n);return r._zod.bag.validator=Nbe(e,n),r}catch(n){if(t?.strict)throw n;return e}}function Ow(e,t){if(Tw(e))throw new We("a schema whose subtree contains a reference cycle");let n=ct(e),r=e._zod.run,i=r.__originalRun??r,o=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[Z6]||a&&Aw(a,s.value))return i(s,a);let c=t(s.value);return c!==mr?(s.value=c,s):(a&&(a[Z6]=!0),i(s,a))};return o.__originalRun=i,n._zod.bag.fallbackRun=i,n._zod.bag.validator=t,n._zod.run=o,r.__originalRun||Obe(n,e,t),n}function Obe(e,t,n){let r=e,i=t;if(typeof i.safeParse=="function"){let o=i.safeParse;r.safeParse=(s,a)=>{let c=n(s);return c!==mr?{success:!0,data:c}:o(s,a)}}if(typeof i.parse=="function"){let o=i.parse;r.parse=(s,a)=>{let c=n(s);return c!==mr?c:o(s,a)}}}function Dw(e,t){let n=!0;try{n=Tw(e)}catch{}if(n)throw new We("a schema whose subtree contains a reference cycle");let r={constants:new Map,constantCounter:0,varCounter:0,definite:!0},i=new Gc(["input"]),o=Lt(i,r,e,"input",!t?.assertOnly);i.write(o===null?"return true;":`return ${o};`);let s=["INVALID",...r.constants.keys()],a=[mr,...r.constants.values()],c=i.content.join(` `),l=t?.debug?s.length>0?`// Constants: ${s.join(", ")} ${c}`:c:"",u=Function,d=`return (input) => { ${c} -}`,p;try{p=new u(...s,d)(...a)}catch(f){throw new Ve(`this schema (generated code failed to evaluate: ${f.message})`)}return t?.debug&&(p.code=l),p.definite=i.definite,p}function Ie(e,t){for(let[i,r]of e.constants)if(r===t)return i;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function Sc(e,t){return e.definite=!1,Ie(e,t)}function we(e){return`v${e.varCounter++}`}function spe(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return sr;let i=n;return i.issues.length===0?i.value:sr}function Bn(e,t,n,i,r=!0){let o=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return Rt(e,t,n,i,r)}catch(l){if(!(l instanceof Ve)||!l.islandable)throw l;if(e.content.length=o,t.constants.size>s){let u=Array.from(t.constants.keys()).slice(s);for(let d of u)t.constants.delete(d)}return t.constantCounter=a,t.varCounter=c,ape(e,t,n,i)}}function ape(e,t,n,i){t.definite=!1;let r=Ie(t,n),o=Ie(t,spe),s=we(t);return e.write(`const ${s} = ${o}(${r}, ${i});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var cpe=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function lpe(e,t,n,i){let r=n._zod.def.checks;if(!r||r.length===0)return i;let o=i;for(let s of r){let a=s._zod.def;if(a.when&&!cpe.has(a.check))throw new Ve('check with a custom "when" condition');switch(a.check){case"greater_than":upe(e,t,a,o);break;case"less_than":dpe(e,t,a,o);break;case"multiple_of":ppe(e,t,a,o);break;case"number_format":DB(e,a,o);break;case"min_length":{let c=$c(a.minimum,"min_length"),l=xA(e,t,o,`${o}.length >= ${c} && ${o}.length < ${a.minimum*2}`);e.write(`if (${l} < ${c}) return INVALID;`);break}case"max_length":{let c=$c(a.maximum,"max_length"),l=xA(e,t,o,`${o}.length > ${c}`);e.write(`if (${l} > ${c}) return INVALID;`);break}case"length_equals":{let c=$c(a.length,"length_equals"),l=xA(e,t,o,`${o}.length >= ${c} && ${o}.length <= ${a.length*2}`);e.write(`if (${l} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${o}.size < ${$c(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${o}.size > ${$c(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${o}.size !== ${$c(a.size,"size_equals")}) return INVALID;`);break;case"string_format":o=MB(e,t,a,o);break;case"custom":o=ype(e,t,s,o);break;case"bigint_format":fpe(e,a,o);break;case"mime_type":mpe(e,t,a,o);break;case"property":gpe(e,t,a,o);break;case"properties":OB(e,t,a,o,!1);break;case"overwrite":{let c=we(t);hpe(e,t,s,o,c),o=c;break}default:throw new Ve(`check type ${a.check}`)}}return o}function xA(e,t,n,i){let r=Ie(t,bc),o=we(t);return e.write(`const ${o} = typeof ${n} === "string" && ${i} ? ${r}(${n}) : ${n}.length;`),o}function $c(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Ve(`${t} bound of type ${typeof e}`);return`${e}`}function PB(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new Ve("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new Ve("comparison check with Invalid Date bound");return Ie(e,t)}throw new Ve(`comparison check bound of type ${typeof t}`)}function upe(e,t,n,i){let r=n.inclusive?"<":"<=";e.write(`if (${i} ${r} ${PB(t,n.value)}) return INVALID;`)}function dpe(e,t,n,i){let r=n.inclusive?">":">=";e.write(`if (${i} ${r} ${PB(t,n.value)}) return INVALID;`)}function ppe(e,t,n,i){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new Ve("multiple_of check with a zero divisor");e.write(`if (${i} % ${n.value}n !== 0n) return INVALID;`)}else{let r=Ie(t,xm);e.write(`if (${r}(${i}, ${$c(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function DB(e,t,n){let i=t.format;switch(i){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new Ve(`number format ${i}`)}}function fpe(e,t,n){let i=t.format;if(i)switch(i){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new Ve(`bigint format ${i}`)}}function mpe(e,t,n,i){let r=n.mime;if(r&&r.length>0){let o=Ie(t,new Set(r));e.write(`if (!${o}.has(${i}.type)) return INVALID;`)}}function OB(e,t,n,i,r){if(n.when)throw new Ve('check with a custom "when" condition');e.write(r?`if (${i} === null || (typeof ${i} !== "object" && typeof ${i} !== "function")) return INVALID;`:`if (${i} == null) return INVALID;`);let o=n.shape;for(let s of Reflect.ownKeys(o)){let a=typeof s=="symbol"?Ie(t,s):nr(s),c=we(t);e.write(`const ${c} = ${i}[${a}];`),Bn(e,t,o[s],c,!1)}}function gpe(e,t,n,i){let r=`${i}[${JSON.stringify(n.property)}]`;Rt(e,t,n.schema,r)}function hpe(e,t,n,i,r){let o=n._zod.def.tx;if(!o)throw new Ve("overwrite check without a transform function");if(xc(o))throw new Ui("z.compile: async overwrite transforms are not supported");let s=Ie(t,o);e.write(`const ${r} = ${s}(${i});`)}function EA(){throw new Tr}function AA(e){this.issues.push(e)}function ype(e,t,n,i){let r=n._zod.def;if(r.fn){if(xc(r.fn))throw new Ui("z.compile: async .refine() predicates are not supported");let o=Sc(t,r.fn),s=Ie(t,EA),a=we(t);return e.write(`const ${a} = ${o}(${i});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),i}if(n._zod.check){if(xc(n._zod.check))throw new Ui("z.compile: async .superRefine() / check functions are not supported");let o=n._zod.check,a=Sc(t,l=>{let u={value:l,issues:[],addIssue:AA};return o(u)instanceof Promise&&EA(),u.issues.length===0?u.value:sr}),c=we(t);return e.write(`const ${c} = ${a}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new Ve("custom check without a predicate or check function")}var bpe=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function MB(e,t,n,i){let r=n.format;if(r==="base64"){let c=Ie(t,jm);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="base64url"){let c=Ie(t,Dv);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="jwt"){let c=Ie(t,Lv),l=Ie(t,n.alg??null);return e.write(`if (!${c}(${i}, ${l})) return INVALID;`),i}if(r==="ipv6"){let c=Ie(t,Um);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="cidrv6"){let c=Ie(t,Cv);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="credit_card"){let c=Ie(t,Ov);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="iban"){let c=Ie(t,Mv);return e.write(`if (!${c}(${i})) return INVALID;`),i}let o=n;if(r==="url"||r==="httpurl"||o.normalize||o.hostname!==void 0||o.protocol!==void 0){let c=Ie(t,Iv),l=Ie(t,n),u=we(t),d=we(t);if(e.write(`const ${u} = ${i}.trim();`),e.write(`const ${d} = ${c}(${u}, ${l});`),e.write(`if (typeof ${d} === "number") return INVALID;`),o.hostname!==void 0){let m=Ie(t,Rv);e.write(`if (!${m}(${d}, ${l}.hostname)) return INVALID;`)}if(o.protocol!==void 0){let m=Ie(t,Nv);e.write(`if (!${m}(${d}, ${l}.protocol)) return INVALID;`)}let p=we(t),f=o.normalize?`${d}.href`:`${Ie(t,Av)}(${u})`;return e.write(`const ${p} = ${f};`),p}let s=n.fn;if(s){if(xc(s))throw new Ve(`async string format ${r}`);let c=Ie(t,s);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(bpe.has(r)&&n.pattern){let c=Ie(t,n.pattern);return e.write(`${c}.lastIndex = 0;`),e.write(`if (!${c}.test(${i})) return INVALID;`),i}let a=n.format;switch(a){case"regex":throw new Ve("regex format without a pattern");case"lowercase":e.write(`if (${i} !== ${i}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${i} !== ${i}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${i}.includes(${nr(n.includes)})) return INVALID;`);break;case"starts_with":{let c=n.prefix;e.write(`if (${i}.slice(0, ${c.length}) !== ${nr(c)}) return INVALID;`);break}case"ends_with":{let c=n.suffix;e.write(`if (${i}.slice(-${c.length}) !== ${nr(c)}) return INVALID;`);break}default:throw new Ve(`string format ${a}`)}return i}function Rt(e,t,n,i,r=!0){let o=n._zod.def,s=o.type;if(o.coerce)throw new Ve(`coercion (z.coerce.${s}())`);let a=r||!!o.checks?.length,c;switch(s){case"string":c=vpe(e,t,n,i);break;case"number":c=wpe(e,n,i);break;case"boolean":c=kpe(e,i);break;case"bigint":c=$pe(e,n,i);break;case"symbol":c=_pe(e,i);break;case"undefined":c=Spe(e,i);break;case"null":c=xpe(e,i);break;case"any":case"unknown":c=i;break;case"never":e.write("return INVALID;"),c=i;break;case"void":c=Epe(e,i);break;case"nan":c=Tpe(e,i);break;case"date":c=Ipe(e,i);break;case"object":c=Ape(e,t,n,i,a);break;case"optional":c=Rpe(e,t,n,i,a);break;case"nullable":c=Ppe(e,t,n,i,a);break;case"array":c=Dpe(e,t,n,i,a);break;case"literal":c=Ope(e,t,n,i);break;case"enum":c=Mpe(e,t,n,i);break;case"readonly":{let l=RB(e,t,n,i),u=we(t);e.write(`const ${u} = Object.freeze(${l});`),c=u;break}case"success":RB(e,t,n,i),c="true";break;case"default":case"prefault":c=Lpe(e,t,n,i);break;case"nonoptional":c=Fpe(e,t,n,i);break;case"tuple":c=Upe(e,t,n,i);break;case"union":c=jpe(e,t,n,i);break;case"intersection":c=Vpe(e,t,n,i);break;case"record":c=Bpe(e,t,n,i);break;case"map":c=Wpe(e,t,n,i);break;case"set":c=Hpe(e,t,n,i);break;case"file":c=Kpe(e,i);break;case"template_literal":c=Jpe(e,t,n,i);break;case"lazy":c=Zpe(e,t,n,i);break;case"pipe":c=Ype(e,t,n,i);break;case"custom":c=Qpe(e,t,n,i);break;case"properties":OB(e,t,n._zod.def,i,!0),c=i;break;case"transform":c=tfe(e,t,n,i);break;case"catch":c=efe(e,t,n,i);break;default:throw new Ve(`schema type ${s}`)}return c===null?null:lpe(e,t,n,c)}function vpe(e,t,n,i){e.write(`if (typeof ${i} !== "string") return INVALID;`);let r=n._zod.def;return r.format===void 0?i:MB(e,t,r,i)}function wpe(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let i=t._zod.def;return i.check==="number_format"&&i.format&&DB(e,{format:i.format},n),n}function kpe(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function $pe(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let i=t._zod.def;if(i.format)switch(i.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function _pe(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function Spe(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function xpe(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function Epe(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Tpe(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function Ipe(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function Ape(e,t,n,i,r=!0){let o=n._zod.def;e.write(`if (typeof ${i} !== "object" || ${i} === null || Array.isArray(${i})) return INVALID;`);let s=o.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),l=c.length?[...a,...c]:a,u=y=>typeof y=="symbol"?Ie(t,y):nr(y),d=y=>typeof y=="symbol"?`[${u(y)}]`:nr(y),p=s;if(a.includes("__proto__"))throw new Ve('object shape key "__proto__"');let f=new Map;for(let y of l){let w=p[y],k=u(y),_=we(t);if(e.write(`const ${_} = ${i}[${k}];`),w._zod.optin!==void 0){let S=we(t);e.write(`let ${S} = (() => {`),e.indented(x=>{let E=Bn(x,t,w,_);x.write(`return ${E};`)}),e.write("})();"),w._zod.optout==="optional"?(e.write(`if (${S} === INVALID) {`),e.indented(x=>{x.write(`if (${k} in ${i}) return INVALID;`),x.write(`${S} = undefined;`)}),e.write("}")):e.write(`if (${S} === INVALID) return INVALID;`),f.set(y,S)}else{Cpe(w)&&e.write(`if (!(${k} in ${i})) return INVALID;`);let S=Bn(e,t,w,_,r);S!==null&&f.set(y,S)}}let m=o.catchall,g="none";if(m){let y=m._zod.def.type;if(y==="never"){let w=a.map(k=>`k !== ${nr(k)}`).join(" && ")||"true";e.write(`for (const k in ${i}) {`),e.indented(k=>{k.write(`if (${w}) return INVALID;`)}),e.write("}")}else(y==="unknown"||y==="any")&&!m._zod.def.checks?.length?g="passthrough":g="schema"}let h=we(t),b=l.some(y=>AB(p[y])||TA(p[y]));if(!r){if(g==="schema"){let y=a.length>0?Ie(t,new Set(a)):null;e.write(`for (const k in ${i}) {`),e.indented(w=>{w.write('if (k === "__proto__") continue;'),y&&w.write(`if (${y}.has(k)) continue;`);let k=we(t);w.write(`const ${k} = ${i}[k];`),Bn(w,t,m,k,!1)}),e.write("}")}return null}if(b){e.write(`const ${h} = {};`);for(let y of l){let w=u(y),k=f.get(y);TA(p[y])?e.write(`if (${w} in ${i}) ${h}[${w}] = ${k};`):AB(p[y])?e.write(`if (${k} !== undefined || ${w} in ${i}) ${h}[${w}] = ${k};`):e.write(`${h}[${w}] = ${k};`)}}else{let y=l.map(w=>`${d(w)}: ${f.get(w)}`).join(", ");e.write(`const ${h} = { ${y} };`)}if(g!=="none"){let y=a.length>0?Ie(t,new Set(a)):null;e.write(`for (const k in ${i}) {`),e.indented(w=>{if(w.write('if (k === "__proto__") continue;'),y&&w.write(`if (${y}.has(k)) continue;`),g==="passthrough")w.write(`${h}[k] = ${i}[k];`);else{let k=we(t);w.write(`const ${k} = ${i}[k];`);let _=Bn(w,t,m,k);w.write(`${h}[k] = ${_};`)}}),e.write("}")}return h}function Rpe(e,t,n,i,r=!0){let o=n._zod.def;if(Npe(n))return Rt(e,t,o.innerType,i,r);if(o.innerType._zod.optin==="defaulted"){let a=we(t),c=we(t);return e.write(`let ${a};`),e.write(`if (${i} === undefined) {`),e.indented(l=>{l.write(`const ${c} = (() => {`),l.indented(u=>{let d=Rt(u,t,o.innerType,i);u.write(`return ${d};`)}),l.write("})();"),l.write(`if (${c} !== INVALID) ${a} = ${c};`)}),e.write("} else {"),e.indented(l=>{let u=Rt(l,t,o.innerType,i);l.write(`${a} = ${u};`)}),e.write("}"),a}let s=r?we(t):null;return s&&e.write(`let ${s};`),e.write(`if (${i} !== undefined) {`),e.indented(a=>{let c=Rt(a,t,o.innerType,i,r);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function Npe(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function Cpe(e){return e._zod.optin===void 0&&_c(e)}function _c(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?_c(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?_c(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(_c):!0;case"intersection":return!t.left||!t.right?!0:_c(t.left)&&_c(t.right);case"pipe":return t.in?_c(t.in):!0;default:return!0}}function TA(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function AB(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&ju(e)}function ju(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?ju(t.innerType):!0;case"union":return t.options?t.options.some(ju):!0;case"intersection":return!t.left||!t.right||ju(t.left)||ju(t.right);case"pipe":return t.out?ju(t.out):!0;default:return!0}}function Ppe(e,t,n,i,r=!0){let o=n._zod.def,s=r?we(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${i} !== null) {`),e.indented(a=>{let c=Rt(a,t,o.innerType,i,r);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function Dpe(e,t,n,i,r=!0){let o=n._zod.def;e.write(`if (!Array.isArray(${i})) return INVALID;`);let s=r?we(t):null,a=we(t),c=we(t);return s&&e.write(`const ${s} = new Array(${i}.length);`),e.write(`for (let ${a} = 0; ${a} < ${i}.length; ${a}++) {`),e.indented(l=>{l.write(`const ${c} = ${i}[${a}];`);let u=Bn(l,t,o.element,c,r);s&&u!==null&&l.write(`${s}[${a}] = ${u};`)}),e.write("}"),s}function Ope(e,t,n,i){let o=n._zod.def.values;if(o.length!==1){let a=Ie(t,new Set(o));return e.write(`if (!${a}.has(${i})) return INVALID;`),i}let s=o[0];if(typeof s=="number"&&Number.isNaN(s)){let a=Ie(t,new Set(o));return e.write(`if (!${a}.has(${i})) return INVALID;`),i}if(typeof s=="string")e.write(`if (${i} !== ${nr(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${i} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${i} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${i} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${i} !== ${s}n) return INVALID;`);else throw new Ve(`literal type ${typeof s}`);return i}function Mpe(e,t,n,i){let r=n._zod.values;if(!r)throw new Ve("enum schema without enumerated values");let o=Ie(t,r);return e.write(`if (!${o}.has(${i})) return INVALID;`),i}function RB(e,t,n,i){let r=n._zod.def;return Rt(e,t,r.innerType,i)}function Lpe(e,t,n,i){let r=n._zod.def,s=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!s)return Rt(e,t,r.innerType,i);let c=Ie(t,s),l=we(t);return e.write(`let ${l} = ${i};`),e.write(`if (${i} === undefined) ${l} = ${c}();`),Rt(e,t,r.innerType,l)}let a=we(t);if(s){let c=Ie(t,s),l=Ie(t,Em);e.write(`let ${a};`),e.write(`if (${i} === undefined) {`),e.indented(u=>{u.write(`${a} = ${l}(${c}());`)}),e.write("} else {"),e.indented(u=>{let d=Rt(u,t,r.innerType,i);u.write(`${a} = ${d} === undefined ? ${l}(${c}()) : ${d};`)}),e.write("}")}else e.write(`let ${a};`),e.write(`if (${i} !== undefined) {`),e.indented(c=>{let l=Rt(c,t,r.innerType,i);c.write(`${a} = ${l};`)}),e.write("}");return a}function Fpe(e,t,n,i){let r=n._zod.def,o=Rt(e,t,r.innerType,i),s=we(t);return e.write(`const ${s} = ${o};`),e.write(`if (${s} === undefined) return INVALID;`),s}function Upe(e,t,n,i){let r=n._zod.def,o=r.items,s=r.rest;e.write(`if (!Array.isArray(${i})) return INVALID;`);let a=NB(o,"optin"),c=NB(o,"optout");s?e.write(`if (${i}.length < ${a}) return INVALID;`):e.write(`if (${i}.length < ${a} || ${i}.length > ${o.length}) return INVALID;`);let l=we(t);e.write(`const ${l} = [];`);for(let u=0;u=c)e.write(`if (${l}.length === ${u}) {`),e.indented(p=>{p.write(`if (${u} < ${i}.length) {`),p.indented(f=>{let m=we(t);f.write(`const ${m} = ${i}[${u}];`);let g=Bn(f,t,d,m);f.write(`${l}[${u}] = ${g};`)}),p.write("} else {"),p.indented(f=>{if(TA(d)){f.write(`${l}.length = ${u};`);return}let m=we(t),g=we(t);f.write(`const ${m} = undefined;`),f.write(`const ${g} = (() => {`),f.indented(h=>{let b=Bn(h,t,d,m);h.write(`return ${b};`)}),f.write("})();"),f.write(`if (${g} === INVALID || ${g} === undefined) ${l}.length = ${u};`),f.write(`else ${l}[${u}] = ${g};`)}),p.write("}")}),e.write("}");else{let p=we(t);e.write(`const ${p} = ${i}[${u}];`);let f=Bn(e,t,d,p);e.write(`${l}[${u}] = ${f};`)}}if(s){let u=we(t),d=we(t);e.write(`for (let ${u} = ${o.length}; ${u} < ${i}.length; ${u}++) {`),e.indented(p=>{p.write(`const ${d} = ${i}[${u}];`);let f=Bn(p,t,s,d);p.write(`${l}[${u}] = ${f};`)}),e.write("}")}return l}function NB(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function jpe(e,t,n,i){let r=n._zod.def,o=r.options;if(r.discriminator)return zpe(e,t,r,i);if(r.inclusive===!1)throw new Ve("exclusive unions (z.xor)");if(o.length===0)return e.write("return INVALID;"),i;if(o.length===1)return Rt(e,t,o[0],i);if(o.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(o.flatMap(u=>u._zod.def.values)),l=Ie(t,c);return e.write(`if (!${l}.has(${i})) return INVALID;`),i}let a=we(t);e.write(`let ${a};`);for(let c=0;c {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(u=>{let d=Rt(u,t,l,i);u.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${a} === INVALID) return INVALID;`),a}function zpe(e,t,n,i){if(n.unionFallback)throw new Ve("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),i;let r=we(t),o=we(t);e.write(`const ${r} = ${i}?.[${nr(n.discriminator)}];`),e.write(`let ${o};`);let s=!0,a=new Set;for(let c of n.options){let l=c._zod.propValues?.[n.discriminator];if(!l||l.size===0)throw new Ve("discriminated union option without static discriminator values");for(let p of l){if(a.has(p))throw new Ve(`duplicate discriminator value ${String(p)}`);a.add(p)}let u=Array.from(l,p=>Gpe(t,r,p)),d=s?"if":"else if";e.write(`${d} (${u.join(" || ")}) {`),e.indented(p=>{let f=Rt(p,t,c,i);p.write(`${o} = ${f};`)}),e.write("}"),s=!1}return e.write("else { return INVALID; }"),o}function Gpe(e,t,n){if(typeof n=="string")return`${t} === ${nr(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let i=Ie(e,n);return`${t} === ${i}`}throw new Ve(`literal discriminator value ${String(n)}`)}function Vpe(e,t,n,i){let r=n._zod.def;t.definite=!1;let o=Bn(e,t,r.left,i),s=Bn(e,t,r.right,i),a=Ie(t,Lu),c=we(t);return e.write(`const ${c} = ${a}(${o}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function Bpe(e,t,n,i){let r=n._zod.def,o=Ie(t,ci);e.write(`if (!${o}(${i})) return INVALID;`);let s=we(t),a=we(t),c=we(t);e.write(`const ${s} = {};`);let l=r,u=l.partial?void 0:r.keyType._zod.values;if(u){let f=[];for(let g of u){if(!(typeof g=="string"||typeof g=="number"||typeof g=="symbol"))throw new Ve(`record key value ${String(g)}`);let h=typeof g=="number"?g.toString():g;if(h==="__proto__")throw new Ve('record key "__proto__"');f.push(h);let b=Ie(t,g),y=Rt(e,t,r.keyType,b),w=we(t);e.write(`const ${w} = ${i}[${qpe(t,h)}];`);let k=Bn(e,t,r.valueType,w);e.write(`${s}[${y}] = ${k};`)}let m=Ie(t,new Set(f));return e.write(`for (const ${a} in ${i}) {`),e.indented(g=>{g.write(`if (${m}.has(${a})) continue;`),l.mode==="loose"?g.write(`if (${a} !== "__proto__") ${s}[${a}] = ${i}[${a}];`):g.write("return INVALID;")}),e.write("}"),s}let d=r.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let f=r.mode==="loose",m=tw(r.keyType);m.definite===!1&&(t.definite=!1);let g=Ie(t,m),h=Ie(t,Ko),b=we(t);return CB(e,t,i,a,y=>{y.write(`let ${b} = ${g}(${a});`),y.write(`if (${b} === INVALID && typeof ${a} === "string" && ${h}.test(${a})) ${b} = ${g}(Number(${a}));`),f?y.write(`if (${b} === INVALID) { ${s}[${a}] = ${i}[${a}]; continue; }`):y.write(`if (${b} === INVALID) return INVALID;`),y.write(`if (${b} === "__proto__") continue;`);let w=we(t);y.write(`const ${w} = ${i}[${a}];`);let k=Bn(y,t,r.valueType,w);y.write(`${s}[${b}] = ${k};`)}),s}return CB(e,t,i,a,f=>{f.write(`const ${c} = ${i}[${a}];`);let m=Bn(f,t,r.valueType,c);f.write(`${s}[${a}] = ${m};`)},"return INVALID;"),s}function CB(e,t,n,i,r,o){let s=Ie(t,Object.prototype.propertyIsEnumerable),a=we(t),c=we(t),l=we(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${n});`),e.write(`const ${c} = Object.getOwnPropertyNames(${n});`),e.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${i} = ${c}[${l}];`),u.write(`if (${i} === "__proto__" || !${s}.call(${n}, ${i})) continue;`),r(u)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${a}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${i} = ${a}[${l}];`),u.write(`if (!${s}.call(${n}, ${i})) continue;`),o?u.write(o):r(u)}),e.write("}")}function qpe(e,t){return typeof t=="string"?nr(t):Ie(e,t)}function Wpe(e,t,n,i){let r=n._zod.def;e.write(`if (!(${i} instanceof Map)) return INVALID;`);let o=we(t),s=we(t),a=we(t);return e.write(`const ${o} = new Map();`),e.write(`for (const [${s}, ${a}] of ${i}) {`),e.indented(c=>{let l=Rt(c,t,r.keyType,s),u=Rt(c,t,r.valueType,a);c.write(`${o}.set(${l}, ${u});`)}),e.write("}"),o}function Hpe(e,t,n,i){let r=n._zod.def;e.write(`if (!(${i} instanceof Set)) return INVALID;`);let o=we(t),s=we(t);return e.write(`const ${o} = new Set();`),e.write(`for (const ${s} of ${i}) {`),e.indented(a=>{let c=Rt(a,t,r.valueType,s);a.write(`${o}.add(${c});`)}),e.write("}"),o}function Kpe(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function Jpe(e,t,n,i){e.write(`if (typeof ${i} !== "string") return INVALID;`);let r=n._zod.pattern;if(r){let o=Ie(t,r);e.write(`${o}.lastIndex = 0;`),e.write(`if (!${o}.test(${i})) return INVALID;`)}return i}function Zpe(e,t,n,i){let r=n._zod.def,o=Sc(t,r.getter),s=Ie(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${o}();`),c.write(`${s}.parser = function(input) {`),c.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let a=we(t);return e.write(`const ${a} = ${s}.parser(${i});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function Ype(e,t,n,i){let r=n._zod.def,o=Rt(e,t,r.in,i);if(r.transform){if(xc(r.transform))throw new Ui("z.compile: async transforms in pipes are not supported");let s=r.transform,c=Sc(t,u=>{let d={value:u,issues:[],addIssue:AA},p=s(u,d);return p instanceof Promise?sr:d.issues.length===0?p:sr}),l=we(t);return e.write(`const ${l} = ${c}(${o});`),e.write(`if (${l} === INVALID) return INVALID;`),Rt(e,t,r.out,l)}else return Rt(e,t,r.out,o)}function xc(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function Qpe(e,t,n,i){let r=n._zod.def;if(r.fn){if(xc(r.fn))throw new Ui("z.compile: async custom predicates are not supported");let o=Sc(t,r.fn),s=Ie(t,EA),a=we(t);e.write(`const ${a} = ${o}(${i});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`)}else throw new Ve("custom schema without a predicate function");return i}function Xpe(e,t,n){let i=e._zod.run({value:n,issues:[]},{});if(i&&typeof i.then=="function")return sr;let r=i;return r.issues.length===0?r.value:t()}function efe(e,t,n,i){let r=n._zod.def;if(!r.catchValue[sv])throw new Ve("catch with a callback (only a constant catch value compiles)",!1);let o=we(t);e.write(`let ${o} = (() => {`),e.indented(l=>{let u=Bn(l,t,r.innerType,i);l.write(`return ${u};`)}),e.write("})();");let s=Ie(t,r.innerType),a=Sc(t,r.catchValue),c=Ie(t,Xpe);return e.write(`if (${o} === INVALID) {`),e.indented(l=>{l.write(`${o} = ${c}(${s}, ${a}, ${i});`),l.write(`if (${o} === INVALID) return INVALID;`)}),e.write("}"),o}function tfe(e,t,n,i){let r=n._zod.def;if(r.transform){if(xc(r.transform))throw new Ui("z.compile: async transforms are not supported");let o=r.transform,a=Sc(t,l=>{let u={value:l,issues:[],addIssue:AA},d=o(l,u);return d instanceof Promise?sr:u.issues.length===0?d:sr}),c=we(t);return e.write(`const ${c} = ${a}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return i}function RA(e,t){return new e({type:"string",...Q(t)})}function NA(e,t){return new e({type:"string",coerce:!0,...Q(t)})}function nw(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Q(t)})}function rw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Q(t)})}function iw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Q(t)})}function ow(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Q(t)})}function sw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Q(t)})}function aw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Q(t)})}function Ym(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Q(t)})}function cw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Q(t)})}function lw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Q(t)})}function uw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Q(t)})}function dw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Q(t)})}function pw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Q(t)})}function fw(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Q(t)})}function mw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Q(t)})}function gw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Q(t)})}function hw(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Q(t)})}function CA(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Q(t)})}function yw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Q(t)})}function bw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Q(t)})}function vw(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Q(t)})}function ww(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Q(t)})}function kw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Q(t)})}function PA(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...Q(t)})}function DA(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...Q(t)})}function $w(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Q(t)})}var OA={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Qm(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Q(t)})}function Xm(e,t){return new e({type:"string",format:"date",check:"string_format",...Q(t)})}function eg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Q(t)})}function tg(e,t){return new e({type:"string",format:"duration",check:"string_format",...Q(t)})}function MA(e,t){return new e({type:"number",checks:[],...Q(t)})}function LA(e,t){return new e({type:"number",coerce:!0,checks:[],...Q(t)})}function FA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Q(t)})}function UA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Q(t)})}function jA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Q(t)})}function zA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Q(t)})}function GA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Q(t)})}function VA(e,t){return new e({type:"boolean",...Q(t)})}function BA(e,t){return new e({type:"boolean",coerce:!0,...Q(t)})}function qA(e,t){return new e({type:"bigint",...Q(t)})}function WA(e,t){return new e({type:"bigint",coerce:!0,...Q(t)})}function HA(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Q(t)})}function KA(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Q(t)})}function JA(e,t){return new e({type:"symbol",...Q(t)})}function ZA(e,t){return new e({type:"undefined",...Q(t)})}function YA(e,t){return new e({type:"null",...Q(t)})}function QA(e){return new e({type:"any"})}function XA(e){return new e({type:"unknown"})}function eR(e,t){return new e({type:"never",...Q(t)})}function tR(e,t){return new e({type:"void",...Q(t)})}function nR(e,t){return new e({type:"date",...Q(t)})}function rR(e,t){return new e({type:"date",coerce:!0,...Q(t)})}function iR(e,t){return new e({type:"nan",...Q(t)})}function po(e,t){return new kv({check:"less_than",...Q(t),value:e,inclusive:!1})}function Gr(e,t){return new kv({check:"less_than",...Q(t),value:e,inclusive:!0})}function fo(e,t){return new $v({check:"greater_than",...Q(t),value:e,inclusive:!1})}function Vr(e,t){return new $v({check:"greater_than",...Q(t),value:e,inclusive:!0})}function _w(e){return fo(0,e)}function Sw(e){return po(0,e)}function xw(e){return Gr(0,e)}function Ew(e){return Vr(0,e)}function zs(e,t){return new GI({check:"multiple_of",...Q(t),value:e})}function Gs(e,t){return new qI({check:"max_size",...Q(t),maximum:e})}function mo(e,t){return new WI({check:"min_size",...Q(t),minimum:e})}function Ec(e,t){return new HI({check:"size_equals",...Q(t),size:e})}function Tc(e,t){return new KI({check:"max_length",...Q(t),maximum:e})}function Jo(e,t){return new JI({check:"min_length",...Q(t),minimum:e})}function Ic(e,t){return new ZI({check:"length_equals",...Q(t),length:e})}function zu(e,t){return new YI({check:"string_format",format:"regex",...Q(t),pattern:e})}function Gu(e){return new QI({check:"string_format",format:"lowercase",...Q(e)})}function Vu(e){return new XI({check:"string_format",format:"uppercase",...Q(e)})}function Bu(e,t){return new e0({check:"string_format",format:"includes",...Q(t),includes:e})}function qu(e,t){return new t0({check:"string_format",format:"starts_with",...Q(t),prefix:e})}function Wu(e,t){return new n0({check:"string_format",format:"ends_with",...Q(t),suffix:e})}function Tw(e,t,n){return new r0({check:"property",property:e,schema:t,...Q(n)})}function oR(e,t,n){return new e({type:"properties",check:"properties",shape:t,...Q(n)})}function Hu(e,t){return new i0({check:"mime_type",mime:e,...Q(t)})}function ji(e){return new o0({check:"overwrite",tx:e})}function Ku(e){return ji(t=>t.normalize(e))}function Ju(){return ji(e=>e.trim())}function Zu(){return ji(e=>e.toLowerCase())}function Yu(){return ji(e=>e.toUpperCase())}function Qu(){return ji(e=>WT(e))}function sR(e,t,n){return new e({type:"array",element:t,...Q(n)})}function nfe(e,t,n){return new e({type:"union",options:t,...Q(n)})}function rfe(e,t,n){return new e({type:"union",options:t,inclusive:!1,...Q(n)})}function ife(e,t,n,i){return new e({type:"union",options:n,discriminator:t,...Q(i)})}function ofe(e,t,n){return new e({type:"intersection",left:t,right:n})}function sfe(e,t,n,i){let r=n instanceof Ce,o=r?i:n,s=r?n:null;return new e({type:"tuple",items:t,rest:s,...Q(o)})}function afe(e,t,n,i){return new e({type:"record",keyType:t,valueType:n,...Q(i)})}function cfe(e,t,n,i){return new e({type:"map",keyType:t,valueType:n,...Q(i)})}function lfe(e,t,n){return new e({type:"set",valueType:t,...Q(n)})}function ufe(e,t,n){let i=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:i,...Q(n)})}function dfe(e,t,n){return new e({type:"enum",entries:t,...Q(n)})}function pfe(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Q(n)})}function aR(e,t){return new e({type:"file",...Q(t)})}function ffe(e,t){return new e({type:"transform",transform:t})}function mfe(e,t){return new e({type:"optional",innerType:t})}function gfe(e,t){return new e({type:"nullable",innerType:t})}function hfe(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Em(n)}})}function yfe(e,t,n){return new e({type:"nonoptional",innerType:t,...Q(n)})}function bfe(e,t){return new e({type:"success",innerType:t})}function vfe(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:XT(n)})}function wfe(e,t,n){return new e({type:"pipe",in:t,out:n})}function kfe(e,t){return new e({type:"readonly",innerType:t})}function $fe(e,t,n){return new e({type:"template_literal",parts:t,...Q(n)})}function _fe(e,t){return new e({type:"lazy",getter:t})}function Sfe(e,t){return new e({type:"promise",innerType:t})}function cR(e,t,n){let i=Q(n);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function lR(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Q(n)})}function uR(e,t){let n=LB(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Nu(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(Nu(o))}},e(i.value,i)),t);return n}function LB(e,t){let n=new ht({check:"custom",...Q(t)});return n._zod.check=e,n}function dR(e){let t=new ht({check:"describe"});return t._zod.onattach=[n=>{let i=Dn.get(n)??{};Dn.add(n,{...i,description:e})}],t._zod.check=()=>{},t}function pR(e){let t=new ht({check:"meta"});return t._zod.onattach=[n=>{let i=Dn.get(n)??{};Dn.add(n,{...i,...e})}],t._zod.check=()=>{},t}function fR(e,t){let n=Q(t),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),r=r.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(r),a=e.Codec??Bm,c=e.Boolean??Gm,l=e.String??kc,u=new l({type:"string",error:n.error}),d=new c({type:"boolean",error:n.error}),p=new a({type:"pipe",in:u,out:d,transform:((f,m)=>{let g=f;return n.case!=="sensitive"&&(g=g.toLowerCase()),o.has(g)?!0:s.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:p,continue:!1}),{})}),reverseTransform:((f,m)=>f===!0?i[0]||"true":r[0]||"false"),error:n.error});return p._zod.bag.truthy=i,p._zod.bag.falsy=r,p._zod.bag.case=n.case??"insensitive",p}function Xu(e,t,n,i={}){let r=Q(i),o={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...r};return n instanceof RegExp&&(o.pattern=n),new e(o)}function ng(e,...t){for(let n of t)for(let i of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Sn(e,i,n[i]);return e}function Vs(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Dn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Zt(e,t,n,i,r){let o=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:i.path,message:r}):t.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(r);return Object.assign(n,o),!0}function st(e,t,n={path:[],schemaPath:[]}){var i;let r=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{let p=s.schema,f=t.processors[r.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);f(e,t,p,u)}let d=e._zod.parent;d&&(s.ref||(s.ref=d),st(d,t,u),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&ng(s.schema,c),t.io==="input"&&xn(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function FB(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Bs(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let i=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=i.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}let r=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(s[0])?.id,p=e.external.uri??(m=>m);if(d)return{ref:p(d)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${FB(f)}`}}let c="#",l=`${c}/${a}/`;if(s[1]===n&&!s[1].schema.id)return{ref:c};let u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+FB(u)}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=r(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/ +}`,p;try{p=new u(...s,d)(...a)}catch(f){throw new We(`this schema (generated code failed to evaluate: ${f.message})`)}return t?.debug&&(p.code=l),p.definite=r.definite,p}function Oe(e,t){for(let[r,i]of e.constants)if(i===t)return r;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function Wc(e,t){return e.definite=!1,Oe(e,t)}function Ee(e){return`v${e.varCounter++}`}function Dbe(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return mr;let r=n;return r.issues.length===0?r.value:mr}function Zn(e,t,n,r,i=!0){let o=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return Lt(e,t,n,r,i)}catch(l){if(!(l instanceof We)||!l.islandable)throw l;if(e.content.length=o,t.constants.size>s){let u=Array.from(t.constants.keys()).slice(s);for(let d of u)t.constants.delete(d)}return t.constantCounter=a,t.varCounter=c,Mbe(e,t,n,r)}}function Mbe(e,t,n,r){t.definite=!1;let i=Oe(t,n),o=Oe(t,Dbe),s=Ee(t);return e.write(`const ${s} = ${o}(${i}, ${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var Lbe=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function Fbe(e,t,n,r){let i=n._zod.def.checks;if(!i||i.length===0)return r;let o=r;for(let s of i){let a=s._zod.def;if(a.when&&!Lbe.has(a.check))throw new We('check with a custom "when" condition');switch(a.check){case"greater_than":Ube(e,t,a,o);break;case"less_than":jbe(e,t,a,o);break;case"multiple_of":zbe(e,t,a,o);break;case"number_format":nW(e,a,o);break;case"min_length":{let c=Vc(a.minimum,"min_length"),l=hC(e,t,o,`${o}.length >= ${c} && ${o}.length < ${a.minimum*2}`);e.write(`if (${l} < ${c}) return INVALID;`);break}case"max_length":{let c=Vc(a.maximum,"max_length"),l=hC(e,t,o,`${o}.length > ${c}`);e.write(`if (${l} > ${c}) return INVALID;`);break}case"length_equals":{let c=Vc(a.length,"length_equals"),l=hC(e,t,o,`${o}.length >= ${c} && ${o}.length <= ${a.length*2}`);e.write(`if (${l} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${o}.size < ${Vc(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${o}.size > ${Vc(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${o}.size !== ${Vc(a.size,"size_equals")}) return INVALID;`);break;case"string_format":o=iW(e,t,a,o);break;case"custom":o=Wbe(e,t,s,o);break;case"bigint_format":Gbe(e,a,o);break;case"mime_type":Bbe(e,t,a,o);break;case"property":Vbe(e,t,a,o);break;case"properties":rW(e,t,a,o,!1);break;case"overwrite":{let c=Ee(t);qbe(e,t,s,o,c),o=c;break}default:throw new We(`check type ${a.check}`)}}return o}function hC(e,t,n,r){let i=Oe(t,jc),o=Ee(t);return e.write(`const ${o} = typeof ${n} === "string" && ${r} ? ${i}(${n}) : ${n}.length;`),o}function Vc(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new We(`${t} bound of type ${typeof e}`);return`${e}`}function tW(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new We("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new We("comparison check with Invalid Date bound");return Oe(e,t)}throw new We(`comparison check bound of type ${typeof t}`)}function Ube(e,t,n,r){let i=n.inclusive?"<":"<=";e.write(`if (${r} ${i} ${tW(t,n.value)}) return INVALID;`)}function jbe(e,t,n,r){let i=n.inclusive?">":">=";e.write(`if (${r} ${i} ${tW(t,n.value)}) return INVALID;`)}function zbe(e,t,n,r){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new We("multiple_of check with a zero divisor");e.write(`if (${r} % ${n.value}n !== 0n) return INVALID;`)}else{let i=Oe(t,Ng);e.write(`if (${i}(${r}, ${Vc(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function nW(e,t,n){let r=t.format;switch(r){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new We(`number format ${r}`)}}function Gbe(e,t,n){let r=t.format;if(r)switch(r){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new We(`bigint format ${r}`)}}function Bbe(e,t,n,r){let i=n.mime;if(i&&i.length>0){let o=Oe(t,new Set(i));e.write(`if (!${o}.has(${r}.type)) return INVALID;`)}}function rW(e,t,n,r,i){if(n.when)throw new We('check with a custom "when" condition');e.write(i?`if (${r} === null || (typeof ${r} !== "object" && typeof ${r} !== "function")) return INVALID;`:`if (${r} == null) return INVALID;`);let o=n.shape;for(let s of Reflect.ownKeys(o)){let a=typeof s=="symbol"?Oe(t,s):ur(s),c=Ee(t);e.write(`const ${c} = ${r}[${a}];`),Zn(e,t,o[s],c,!1)}}function Vbe(e,t,n,r){let i=`${r}[${JSON.stringify(n.property)}]`;Lt(e,t,n.schema,i)}function qbe(e,t,n,r,i){let o=n._zod.def.tx;if(!o)throw new We("overwrite check without a transform function");if(Hc(o))throw new to("z.compile: async overwrite transforms are not supported");let s=Oe(t,o);e.write(`const ${i} = ${s}(${r});`)}function yC(){throw new Mr}function _C(e){this.issues.push(e)}function Wbe(e,t,n,r){let i=n._zod.def;if(i.fn){if(Hc(i.fn))throw new to("z.compile: async .refine() predicates are not supported");let o=Wc(t,i.fn),s=Oe(t,yC),a=Ee(t);return e.write(`const ${a} = ${o}(${r});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),r}if(n._zod.check){if(Hc(n._zod.check))throw new to("z.compile: async .superRefine() / check functions are not supported");let o=n._zod.check,a=Wc(t,l=>{let u={value:l,issues:[],addIssue:_C};return o(u)instanceof Promise&&yC(),u.issues.length===0?u.value:mr}),c=Ee(t);return e.write(`const ${c} = ${a}(${r});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new We("custom check without a predicate or check function")}var Hbe=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function iW(e,t,n,r){let i=n.format;if(i==="base64"){let c=Oe(t,Kg);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="base64url"){let c=Oe(t,mw);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="jwt"){let c=Oe(t,yw),l=Oe(t,n.alg??null);return e.write(`if (!${c}(${r}, ${l})) return INVALID;`),r}if(i==="ipv6"){let c=Oe(t,Hg);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="cidrv6"){let c=Oe(t,pw);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="credit_card"){let c=Oe(t,gw);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="iban"){let c=Oe(t,hw);return e.write(`if (!${c}(${r})) return INVALID;`),r}let o=n;if(i==="url"||i==="httpurl"||o.normalize||o.hostname!==void 0||o.protocol!==void 0){let c=Oe(t,cw),l=Oe(t,n),u=Ee(t),d=Ee(t);if(e.write(`const ${u} = ${r}.trim();`),e.write(`const ${d} = ${c}(${u}, ${l});`),e.write(`if (typeof ${d} === "number") return INVALID;`),o.hostname!==void 0){let m=Oe(t,uw);e.write(`if (!${m}(${d}, ${l}.hostname)) return INVALID;`)}if(o.protocol!==void 0){let m=Oe(t,dw);e.write(`if (!${m}(${d}, ${l}.protocol)) return INVALID;`)}let p=Ee(t),f=o.normalize?`${d}.href`:`${Oe(t,lw)}(${u})`;return e.write(`const ${p} = ${f};`),p}let s=n.fn;if(s){if(Hc(s))throw new We(`async string format ${i}`);let c=Oe(t,s);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(Hbe.has(i)&&n.pattern){let c=Oe(t,n.pattern);return e.write(`${c}.lastIndex = 0;`),e.write(`if (!${c}.test(${r})) return INVALID;`),r}let a=n.format;switch(a){case"regex":throw new We("regex format without a pattern");case"lowercase":e.write(`if (${r} !== ${r}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${r} !== ${r}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${r}.includes(${ur(n.includes)})) return INVALID;`);break;case"starts_with":{let c=n.prefix;e.write(`if (${r}.slice(0, ${c.length}) !== ${ur(c)}) return INVALID;`);break}case"ends_with":{let c=n.suffix;e.write(`if (${r}.slice(-${c.length}) !== ${ur(c)}) return INVALID;`);break}default:throw new We(`string format ${a}`)}return r}function Lt(e,t,n,r,i=!0){let o=n._zod.def,s=o.type;if(o.coerce)throw new We(`coercion (z.coerce.${s}())`);let a=i||!!o.checks?.length,c;switch(s){case"string":c=Kbe(e,t,n,r);break;case"number":c=Jbe(e,n,r);break;case"boolean":c=Zbe(e,r);break;case"bigint":c=Ybe(e,n,r);break;case"symbol":c=Qbe(e,r);break;case"undefined":c=Xbe(e,r);break;case"null":c=eve(e,r);break;case"any":case"unknown":c=r;break;case"never":e.write("return INVALID;"),c=r;break;case"void":c=tve(e,r);break;case"nan":c=nve(e,r);break;case"date":c=rve(e,r);break;case"object":c=ive(e,t,n,r,a);break;case"optional":c=ove(e,t,n,r,a);break;case"nullable":c=cve(e,t,n,r,a);break;case"array":c=lve(e,t,n,r,a);break;case"literal":c=uve(e,t,n,r);break;case"enum":c=dve(e,t,n,r);break;case"readonly":{let l=Q6(e,t,n,r),u=Ee(t);e.write(`const ${u} = Object.freeze(${l});`),c=u;break}case"success":Q6(e,t,n,r),c="true";break;case"default":case"prefault":c=pve(e,t,n,r);break;case"nonoptional":c=fve(e,t,n,r);break;case"tuple":c=mve(e,t,n,r);break;case"union":c=gve(e,t,n,r);break;case"intersection":c=bve(e,t,n,r);break;case"record":c=vve(e,t,n,r);break;case"map":c=wve(e,t,n,r);break;case"set":c=kve(e,t,n,r);break;case"file":c=$ve(e,r);break;case"template_literal":c=Sve(e,t,n,r);break;case"lazy":c=xve(e,t,n,r);break;case"pipe":c=Eve(e,t,n,r);break;case"custom":c=Tve(e,t,n,r);break;case"properties":rW(e,t,n._zod.def,r,!0),c=r;break;case"transform":c=Rve(e,t,n,r);break;case"catch":c=Ive(e,t,n,r);break;default:throw new We(`schema type ${s}`)}return c===null?null:Fbe(e,t,n,c)}function Kbe(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let i=n._zod.def;return i.format===void 0?r:iW(e,t,i,r)}function Jbe(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let r=t._zod.def;return r.check==="number_format"&&r.format&&nW(e,{format:r.format},n),n}function Zbe(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function Ybe(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let r=t._zod.def;if(r.format)switch(r.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function Qbe(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function Xbe(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function eve(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function tve(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function nve(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function rve(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function ive(e,t,n,r,i=!0){let o=n._zod.def;e.write(`if (typeof ${r} !== "object" || ${r} === null || Array.isArray(${r})) return INVALID;`);let s=o.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),l=c.length?[...a,...c]:a,u=b=>typeof b=="symbol"?Oe(t,b):ur(b),d=b=>typeof b=="symbol"?`[${u(b)}]`:ur(b),p=s;if(a.includes("__proto__"))throw new We('object shape key "__proto__"');let f=new Map;for(let b of l){let _=p[b],w=u(b),k=Ee(t);if(e.write(`const ${k} = ${r}[${w}];`),_._zod.optin!==void 0){let x=Ee(t);e.write(`let ${x} = (() => {`),e.indented(A=>{let I=Zn(A,t,_,k);A.write(`return ${I};`)}),e.write("})();"),_._zod.optout==="optional"?(e.write(`if (${x} === INVALID) {`),e.indented(A=>{A.write(`if (${w} in ${r}) return INVALID;`),A.write(`${x} = undefined;`)}),e.write("}")):e.write(`if (${x} === INVALID) return INVALID;`),f.set(b,x)}else{ave(_)&&e.write(`if (!(${w} in ${r})) return INVALID;`);let x=Zn(e,t,_,k,i);x!==null&&f.set(b,x)}}let m=o.catchall,g="none";if(m){let b=m._zod.def.type;if(b==="never"){let _=a.map(w=>`k !== ${ur(w)}`).join(" && ")||"true";e.write(`for (const k in ${r}) {`),e.indented(w=>{w.write(`if (${_}) return INVALID;`)}),e.write("}")}else(b==="unknown"||b==="any")&&!m._zod.def.checks?.length?g="passthrough":g="schema"}let h=Ee(t),v=l.some(b=>Y6(p[b])||bC(p[b]));if(!i){if(g==="schema"){let b=a.length>0?Oe(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented(_=>{_.write('if (k === "__proto__") continue;'),b&&_.write(`if (${b}.has(k)) continue;`);let w=Ee(t);_.write(`const ${w} = ${r}[k];`),Zn(_,t,m,w,!1)}),e.write("}")}return null}if(v){e.write(`const ${h} = {};`);for(let b of l){let _=u(b),w=f.get(b);bC(p[b])?e.write(`if (${_} in ${r}) ${h}[${_}] = ${w};`):Y6(p[b])?e.write(`if (${w} !== undefined || ${_} in ${r}) ${h}[${_}] = ${w};`):e.write(`${h}[${_}] = ${w};`)}}else{let b=l.map(_=>`${d(_)}: ${f.get(_)}`).join(", ");e.write(`const ${h} = { ${b} };`)}if(g!=="none"){let b=a.length>0?Oe(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented(_=>{if(_.write('if (k === "__proto__") continue;'),b&&_.write(`if (${b}.has(k)) continue;`),g==="passthrough")_.write(`${h}[k] = ${r}[k];`);else{let w=Ee(t);_.write(`const ${w} = ${r}[k];`);let k=Zn(_,t,m,w);_.write(`${h}[k] = ${k};`)}}),e.write("}")}return h}function ove(e,t,n,r,i=!0){let o=n._zod.def;if(sve(n))return Lt(e,t,o.innerType,r,i);if(o.innerType._zod.optin==="defaulted"){let a=Ee(t),c=Ee(t);return e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(l=>{l.write(`const ${c} = (() => {`),l.indented(u=>{let d=Lt(u,t,o.innerType,r);u.write(`return ${d};`)}),l.write("})();"),l.write(`if (${c} !== INVALID) ${a} = ${c};`)}),e.write("} else {"),e.indented(l=>{let u=Lt(l,t,o.innerType,r);l.write(`${a} = ${u};`)}),e.write("}"),a}let s=i?Ee(t):null;return s&&e.write(`let ${s};`),e.write(`if (${r} !== undefined) {`),e.indented(a=>{let c=Lt(a,t,o.innerType,r,i);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function sve(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function ave(e){return e._zod.optin===void 0&&qc(e)}function qc(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?qc(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?qc(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(qc):!0;case"intersection":return!t.left||!t.right?!0:qc(t.left)&&qc(t.right);case"pipe":return t.in?qc(t.in):!0;default:return!0}}function bC(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function Y6(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&ud(e)}function ud(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?ud(t.innerType):!0;case"union":return t.options?t.options.some(ud):!0;case"intersection":return!t.left||!t.right||ud(t.left)||ud(t.right);case"pipe":return t.out?ud(t.out):!0;default:return!0}}function cve(e,t,n,r,i=!0){let o=n._zod.def,s=i?Ee(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${r} !== null) {`),e.indented(a=>{let c=Lt(a,t,o.innerType,r,i);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function lve(e,t,n,r,i=!0){let o=n._zod.def;e.write(`if (!Array.isArray(${r})) return INVALID;`);let s=i?Ee(t):null,a=Ee(t),c=Ee(t);return s&&e.write(`const ${s} = new Array(${r}.length);`),e.write(`for (let ${a} = 0; ${a} < ${r}.length; ${a}++) {`),e.indented(l=>{l.write(`const ${c} = ${r}[${a}];`);let u=Zn(l,t,o.element,c,i);s&&u!==null&&l.write(`${s}[${a}] = ${u};`)}),e.write("}"),s}function uve(e,t,n,r){let o=n._zod.def.values;if(o.length!==1){let a=Oe(t,new Set(o));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}let s=o[0];if(typeof s=="number"&&Number.isNaN(s)){let a=Oe(t,new Set(o));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}if(typeof s=="string")e.write(`if (${r} !== ${ur(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${r} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${r} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${r} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${r} !== ${s}n) return INVALID;`);else throw new We(`literal type ${typeof s}`);return r}function dve(e,t,n,r){let i=n._zod.values;if(!i)throw new We("enum schema without enumerated values");let o=Oe(t,i);return e.write(`if (!${o}.has(${r})) return INVALID;`),r}function Q6(e,t,n,r){let i=n._zod.def;return Lt(e,t,i.innerType,r)}function pve(e,t,n,r){let i=n._zod.def,s=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!s)return Lt(e,t,i.innerType,r);let c=Oe(t,s),l=Ee(t);return e.write(`let ${l} = ${r};`),e.write(`if (${r} === undefined) ${l} = ${c}();`),Lt(e,t,i.innerType,l)}let a=Ee(t);if(s){let c=Oe(t,s),l=Oe(t,Og);e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(u=>{u.write(`${a} = ${l}(${c}());`)}),e.write("} else {"),e.indented(u=>{let d=Lt(u,t,i.innerType,r);u.write(`${a} = ${d} === undefined ? ${l}(${c}()) : ${d};`)}),e.write("}")}else e.write(`let ${a};`),e.write(`if (${r} !== undefined) {`),e.indented(c=>{let l=Lt(c,t,i.innerType,r);c.write(`${a} = ${l};`)}),e.write("}");return a}function fve(e,t,n,r){let i=n._zod.def,o=Lt(e,t,i.innerType,r),s=Ee(t);return e.write(`const ${s} = ${o};`),e.write(`if (${s} === undefined) return INVALID;`),s}function mve(e,t,n,r){let i=n._zod.def,o=i.items,s=i.rest;e.write(`if (!Array.isArray(${r})) return INVALID;`);let a=X6(o,"optin"),c=X6(o,"optout");s?e.write(`if (${r}.length < ${a}) return INVALID;`):e.write(`if (${r}.length < ${a} || ${r}.length > ${o.length}) return INVALID;`);let l=Ee(t);e.write(`const ${l} = [];`);for(let u=0;u=c)e.write(`if (${l}.length === ${u}) {`),e.indented(p=>{p.write(`if (${u} < ${r}.length) {`),p.indented(f=>{let m=Ee(t);f.write(`const ${m} = ${r}[${u}];`);let g=Zn(f,t,d,m);f.write(`${l}[${u}] = ${g};`)}),p.write("} else {"),p.indented(f=>{if(bC(d)){f.write(`${l}.length = ${u};`);return}let m=Ee(t),g=Ee(t);f.write(`const ${m} = undefined;`),f.write(`const ${g} = (() => {`),f.indented(h=>{let v=Zn(h,t,d,m);h.write(`return ${v};`)}),f.write("})();"),f.write(`if (${g} === INVALID || ${g} === undefined) ${l}.length = ${u};`),f.write(`else ${l}[${u}] = ${g};`)}),p.write("}")}),e.write("}");else{let p=Ee(t);e.write(`const ${p} = ${r}[${u}];`);let f=Zn(e,t,d,p);e.write(`${l}[${u}] = ${f};`)}}if(s){let u=Ee(t),d=Ee(t);e.write(`for (let ${u} = ${o.length}; ${u} < ${r}.length; ${u}++) {`),e.indented(p=>{p.write(`const ${d} = ${r}[${u}];`);let f=Zn(p,t,s,d);p.write(`${l}[${u}] = ${f};`)}),e.write("}")}return l}function X6(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function gve(e,t,n,r){let i=n._zod.def,o=i.options;if(i.discriminator)return hve(e,t,i,r);if(i.inclusive===!1)throw new We("exclusive unions (z.xor)");if(o.length===0)return e.write("return INVALID;"),r;if(o.length===1)return Lt(e,t,o[0],r);if(o.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(o.flatMap(u=>u._zod.def.values)),l=Oe(t,c);return e.write(`if (!${l}.has(${r})) return INVALID;`),r}let a=Ee(t);e.write(`let ${a};`);for(let c=0;c {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(u=>{let d=Lt(u,t,l,r);u.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${a} === INVALID) return INVALID;`),a}function hve(e,t,n,r){if(n.unionFallback)throw new We("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),r;let i=Ee(t),o=Ee(t);e.write(`const ${i} = ${r}?.[${ur(n.discriminator)}];`),e.write(`let ${o};`);let s=!0,a=new Set;for(let c of n.options){let l=c._zod.propValues?.[n.discriminator];if(!l||l.size===0)throw new We("discriminated union option without static discriminator values");for(let p of l){if(a.has(p))throw new We(`duplicate discriminator value ${String(p)}`);a.add(p)}let u=Array.from(l,p=>yve(t,i,p)),d=s?"if":"else if";e.write(`${d} (${u.join(" || ")}) {`),e.indented(p=>{let f=Lt(p,t,c,r);p.write(`${o} = ${f};`)}),e.write("}"),s=!1}return e.write("else { return INVALID; }"),o}function yve(e,t,n){if(typeof n=="string")return`${t} === ${ur(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let r=Oe(e,n);return`${t} === ${r}`}throw new We(`literal discriminator value ${String(n)}`)}function bve(e,t,n,r){let i=n._zod.def;t.definite=!1;let o=Zn(e,t,i.left,r),s=Zn(e,t,i.right,r),a=Oe(t,ad),c=Ee(t);return e.write(`const ${c} = ${a}(${o}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function vve(e,t,n,r){let i=n._zod.def,o=Oe(t,Ei);e.write(`if (!${o}(${r})) return INVALID;`);let s=Ee(t),a=Ee(t),c=Ee(t);e.write(`const ${s} = {};`);let l=i,u=l.partial?void 0:i.keyType._zod.values;if(u){let f=[];for(let g of u){if(!(typeof g=="string"||typeof g=="number"||typeof g=="symbol"))throw new We(`record key value ${String(g)}`);let h=typeof g=="number"?g.toString():g;if(h==="__proto__")throw new We('record key "__proto__"');f.push(h);let v=Oe(t,g),b=Lt(e,t,i.keyType,v),_=Ee(t);e.write(`const ${_} = ${r}[${_ve(t,h)}];`);let w=Zn(e,t,i.valueType,_);e.write(`${s}[${b}] = ${w};`)}let m=Oe(t,new Set(f));return e.write(`for (const ${a} in ${r}) {`),e.indented(g=>{g.write(`if (${m}.has(${a})) continue;`),l.mode==="loose"?g.write(`if (${a} !== "__proto__") ${s}[${a}] = ${r}[${a}];`):g.write("return INVALID;")}),e.write("}"),s}let d=i.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let f=i.mode==="loose",m=Dw(i.keyType);m.definite===!1&&(t.definite=!1);let g=Oe(t,m),h=Oe(t,hs),v=Ee(t);return eW(e,t,r,a,b=>{b.write(`let ${v} = ${g}(${a});`),b.write(`if (${v} === INVALID && typeof ${a} === "string" && ${h}.test(${a})) ${v} = ${g}(Number(${a}));`),f?b.write(`if (${v} === INVALID) { ${s}[${a}] = ${r}[${a}]; continue; }`):b.write(`if (${v} === INVALID) return INVALID;`),b.write(`if (${v} === "__proto__") continue;`);let _=Ee(t);b.write(`const ${_} = ${r}[${a}];`);let w=Zn(b,t,i.valueType,_);b.write(`${s}[${v}] = ${w};`)}),s}return eW(e,t,r,a,f=>{f.write(`const ${c} = ${r}[${a}];`);let m=Zn(f,t,i.valueType,c);f.write(`${s}[${a}] = ${m};`)},"return INVALID;"),s}function eW(e,t,n,r,i,o){let s=Oe(t,Object.prototype.propertyIsEnumerable),a=Ee(t),c=Ee(t),l=Ee(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${n});`),e.write(`const ${c} = Object.getOwnPropertyNames(${n});`),e.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${r} = ${c}[${l}];`),u.write(`if (${r} === "__proto__" || !${s}.call(${n}, ${r})) continue;`),i(u)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${a}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${r} = ${a}[${l}];`),u.write(`if (!${s}.call(${n}, ${r})) continue;`),o?u.write(o):i(u)}),e.write("}")}function _ve(e,t){return typeof t=="string"?ur(t):Oe(e,t)}function wve(e,t,n,r){let i=n._zod.def;e.write(`if (!(${r} instanceof Map)) return INVALID;`);let o=Ee(t),s=Ee(t),a=Ee(t);return e.write(`const ${o} = new Map();`),e.write(`for (const [${s}, ${a}] of ${r}) {`),e.indented(c=>{let l=Lt(c,t,i.keyType,s),u=Lt(c,t,i.valueType,a);c.write(`${o}.set(${l}, ${u});`)}),e.write("}"),o}function kve(e,t,n,r){let i=n._zod.def;e.write(`if (!(${r} instanceof Set)) return INVALID;`);let o=Ee(t),s=Ee(t);return e.write(`const ${o} = new Set();`),e.write(`for (const ${s} of ${r}) {`),e.indented(a=>{let c=Lt(a,t,i.valueType,s);a.write(`${o}.add(${c});`)}),e.write("}"),o}function $ve(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function Sve(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let i=n._zod.pattern;if(i){let o=Oe(t,i);e.write(`${o}.lastIndex = 0;`),e.write(`if (!${o}.test(${r})) return INVALID;`)}return r}function xve(e,t,n,r){let i=n._zod.def,o=Wc(t,i.getter),s=Oe(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${o}();`),c.write(`${s}.parser = function(input) {`),c.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let a=Ee(t);return e.write(`const ${a} = ${s}.parser(${r});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function Eve(e,t,n,r){let i=n._zod.def,o=Lt(e,t,i.in,r);if(i.transform){if(Hc(i.transform))throw new to("z.compile: async transforms in pipes are not supported");let s=i.transform,c=Wc(t,u=>{let d={value:u,issues:[],addIssue:_C},p=s(u,d);return p instanceof Promise?mr:d.issues.length===0?p:mr}),l=Ee(t);return e.write(`const ${l} = ${c}(${o});`),e.write(`if (${l} === INVALID) return INVALID;`),Lt(e,t,i.out,l)}else return Lt(e,t,i.out,o)}function Hc(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function Tve(e,t,n,r){let i=n._zod.def;if(i.fn){if(Hc(i.fn))throw new to("z.compile: async custom predicates are not supported");let o=Wc(t,i.fn),s=Oe(t,yC),a=Ee(t);e.write(`const ${a} = ${o}(${r});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`)}else throw new We("custom schema without a predicate function");return r}function Ave(e,t,n){let r=e._zod.run({value:n,issues:[]},{});if(r&&typeof r.then=="function")return mr;let i=r;return i.issues.length===0?i.value:t()}function Ive(e,t,n,r){let i=n._zod.def;if(!i.catchValue[j_])throw new We("catch with a callback (only a constant catch value compiles)",!1);let o=Ee(t);e.write(`let ${o} = (() => {`),e.indented(l=>{let u=Zn(l,t,i.innerType,r);l.write(`return ${u};`)}),e.write("})();");let s=Oe(t,i.innerType),a=Wc(t,i.catchValue),c=Oe(t,Ave);return e.write(`if (${o} === INVALID) {`),e.indented(l=>{l.write(`${o} = ${c}(${s}, ${a}, ${r});`),l.write(`if (${o} === INVALID) return INVALID;`)}),e.write("}"),o}function Rve(e,t,n,r){let i=n._zod.def;if(i.transform){if(Hc(i.transform))throw new to("z.compile: async transforms are not supported");let o=i.transform,a=Wc(t,l=>{let u={value:l,issues:[],addIssue:_C},d=o(l,u);return d instanceof Promise?mr:u.issues.length===0?d:mr}),c=Ee(t);return e.write(`const ${c} = ${a}(${r});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return r}function wC(e,t){return new e({type:"string",...re(t)})}function kC(e,t){return new e({type:"string",coerce:!0,...re(t)})}function Mw(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...re(t)})}function Lw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...re(t)})}function Fw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...re(t)})}function Uw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...re(t)})}function jw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...re(t)})}function zw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...re(t)})}function oh(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...re(t)})}function Gw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...re(t)})}function Bw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...re(t)})}function Vw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...re(t)})}function qw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...re(t)})}function Ww(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...re(t)})}function Hw(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...re(t)})}function Kw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...re(t)})}function Jw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...re(t)})}function Zw(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...re(t)})}function $C(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...re(t)})}function Yw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...re(t)})}function Qw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...re(t)})}function Xw(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...re(t)})}function ek(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...re(t)})}function tk(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...re(t)})}function SC(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...re(t)})}function xC(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...re(t)})}function nk(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...re(t)})}var EC={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function sh(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...re(t)})}function ah(e,t){return new e({type:"string",format:"date",check:"string_format",...re(t)})}function ch(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...re(t)})}function lh(e,t){return new e({type:"string",format:"duration",check:"string_format",...re(t)})}function TC(e,t){return new e({type:"number",checks:[],...re(t)})}function AC(e,t){return new e({type:"number",coerce:!0,checks:[],...re(t)})}function IC(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...re(t)})}function RC(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...re(t)})}function PC(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...re(t)})}function CC(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...re(t)})}function NC(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...re(t)})}function OC(e,t){return new e({type:"boolean",...re(t)})}function DC(e,t){return new e({type:"boolean",coerce:!0,...re(t)})}function MC(e,t){return new e({type:"bigint",...re(t)})}function LC(e,t){return new e({type:"bigint",coerce:!0,...re(t)})}function FC(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...re(t)})}function UC(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...re(t)})}function jC(e,t){return new e({type:"symbol",...re(t)})}function zC(e,t){return new e({type:"undefined",...re(t)})}function GC(e,t){return new e({type:"null",...re(t)})}function BC(e){return new e({type:"any"})}function VC(e){return new e({type:"unknown"})}function qC(e,t){return new e({type:"never",...re(t)})}function WC(e,t){return new e({type:"void",...re(t)})}function HC(e,t){return new e({type:"date",...re(t)})}function KC(e,t){return new e({type:"date",coerce:!0,...re(t)})}function JC(e,t){return new e({type:"nan",...re(t)})}function Eo(e,t){return new tw({check:"less_than",...re(t),value:e,inclusive:!1})}function ei(e,t){return new tw({check:"less_than",...re(t),value:e,inclusive:!0})}function To(e,t){return new nw({check:"greater_than",...re(t),value:e,inclusive:!1})}function ti(e,t){return new nw({check:"greater_than",...re(t),value:e,inclusive:!0})}function rk(e){return To(0,e)}function ik(e){return Eo(0,e)}function ok(e){return ei(0,e)}function sk(e){return ti(0,e)}function ma(e,t){return new N0({check:"multiple_of",...re(t),value:e})}function ga(e,t){return new M0({check:"max_size",...re(t),maximum:e})}function Ao(e,t){return new L0({check:"min_size",...re(t),minimum:e})}function Kc(e,t){return new F0({check:"size_equals",...re(t),size:e})}function Jc(e,t){return new U0({check:"max_length",...re(t),maximum:e})}function ys(e,t){return new j0({check:"min_length",...re(t),minimum:e})}function Zc(e,t){return new z0({check:"length_equals",...re(t),length:e})}function dd(e,t){return new G0({check:"string_format",format:"regex",...re(t),pattern:e})}function pd(e){return new B0({check:"string_format",format:"lowercase",...re(e)})}function fd(e){return new V0({check:"string_format",format:"uppercase",...re(e)})}function md(e,t){return new q0({check:"string_format",format:"includes",...re(t),includes:e})}function gd(e,t){return new W0({check:"string_format",format:"starts_with",...re(t),prefix:e})}function hd(e,t){return new H0({check:"string_format",format:"ends_with",...re(t),suffix:e})}function ak(e,t,n){return new K0({check:"property",property:e,schema:t,...re(n)})}function ZC(e,t,n){return new e({type:"properties",check:"properties",shape:t,...re(n)})}function yd(e,t){return new J0({check:"mime_type",mime:e,...re(t)})}function no(e){return new Z0({check:"overwrite",tx:e})}function bd(e){return no(t=>t.normalize(e))}function vd(){return no(e=>e.trim())}function _d(){return no(e=>e.toLowerCase())}function wd(){return no(e=>e.toUpperCase())}function kd(){return no(e=>LR(e))}function YC(e,t,n){return new e({type:"array",element:t,...re(n)})}function Pve(e,t,n){return new e({type:"union",options:t,...re(n)})}function Cve(e,t,n){return new e({type:"union",options:t,inclusive:!1,...re(n)})}function Nve(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...re(r)})}function Ove(e,t,n){return new e({type:"intersection",left:t,right:n})}function Dve(e,t,n,r){let i=n instanceof Me,o=i?r:n,s=i?n:null;return new e({type:"tuple",items:t,rest:s,...re(o)})}function Mve(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...re(r)})}function Lve(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...re(r)})}function Fve(e,t,n){return new e({type:"set",valueType:t,...re(n)})}function Uve(e,t,n){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new e({type:"enum",entries:r,...re(n)})}function jve(e,t,n){return new e({type:"enum",entries:t,...re(n)})}function zve(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...re(n)})}function QC(e,t){return new e({type:"file",...re(t)})}function Gve(e,t){return new e({type:"transform",transform:t})}function Bve(e,t){return new e({type:"optional",innerType:t})}function Vve(e,t){return new e({type:"nullable",innerType:t})}function qve(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Og(n)}})}function Wve(e,t,n){return new e({type:"nonoptional",innerType:t,...re(n)})}function Hve(e,t){return new e({type:"success",innerType:t})}function Kve(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:VR(n)})}function Jve(e,t,n){return new e({type:"pipe",in:t,out:n})}function Zve(e,t){return new e({type:"readonly",innerType:t})}function Yve(e,t,n){return new e({type:"template_literal",parts:t,...re(n)})}function Qve(e,t){return new e({type:"lazy",getter:t})}function Xve(e,t){return new e({type:"promise",innerType:t})}function XC(e,t,n){let r=re(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function eN(e,t,n){return new e({type:"custom",check:"custom",fn:t,...re(n)})}function tN(e,t){let n=oW(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(td(i,r.value,n._zod.def));else{let o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=r.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),r.issues.push(td(o))}},e(r.value,r)),t);return n}function oW(e,t){let n=new St({check:"custom",...re(t)});return n._zod.check=e,n}function nN(e){let t=new St({check:"describe"});return t._zod.onattach=[n=>{let r=Un.get(n)??{};Un.add(n,{...r,description:e})}],t._zod.check=()=>{},t}function rN(e){let t=new St({check:"meta"});return t._zod.onattach=[n=>{let r=Un.get(n)??{};Un.add(n,{...r,...e})}],t._zod.check=()=>{},t}function iN(e,t){let n=re(t),r=n.truthy??["true","1","yes","on","y","enabled"],i=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(r=r.map(f=>typeof f=="string"?f.toLowerCase():f),i=i.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(r),s=new Set(i),a=e.Codec??Qg,c=e.Boolean??Zg,l=e.String??Bc,u=new l({type:"string",error:n.error}),d=new c({type:"boolean",error:n.error}),p=new a({type:"pipe",in:u,out:d,transform:((f,m)=>{let g=f;return n.case!=="sensitive"&&(g=g.toLowerCase()),o.has(g)?!0:s.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:p,continue:!1}),{})}),reverseTransform:((f,m)=>f===!0?r[0]||"true":i[0]||"false"),error:n.error});return p._zod.bag.truthy=r,p._zod.bag.falsy=i,p._zod.bag.case=n.case??"insensitive",p}function $d(e,t,n,r={}){let i=re(r),o={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...i};return n instanceof RegExp&&(o.pattern=n),new e(o)}function uh(e,...t){for(let n of t)for(let r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&An(e,r,n[r]);return e}function ha(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Un,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function en(e,t,n,r,i){let o=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(i);return Object.assign(n,o),!0}function lt(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{let p=s.schema,f=t.processors[i.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);f(e,t,p,u)}let d=e._zod.parent;d&&(s.ref||(s.ref=d),lt(d,t,u),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&uh(s.schema,c),t.io==="input"&&In(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function sW(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function ya(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=r.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0])}}let i=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(s[0])?.id,p=e.external.uri??(m=>m);if(d)return{ref:p(d)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${sW(f)}`}}let c="#",l=`${c}/${a}/`;if(s[1]===n&&!s[1].schema.id)return{ref:c};let u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+sW(u)}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=i(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){o(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}a.count>1&&e.reused==="ref"&&o(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function zB(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let i of t){if(!i||typeof i!="object")return;zB(i);let r=Object.keys(i);if(r.length!==1||r[0]!=="type")return;let o=i.type;for(let s of Array.isArray(o)?o:[o]){if(typeof s!="string")return;n.includes(s)||n.push(s)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var GB=new Set(["type","properties","required","additionalProperties"]),UB=["oneOf","anyOf"];function jB(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function mR(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let s in o)if(!GB.has(s))return null;t.push(o)}let n={},i=new Set;for(let o of t){for(let s in o.properties){if(Object.prototype.hasOwnProperty.call(n,s))continue;let a=[];for(let l of t){let u=l.properties?.[s]??jB(l);u!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(u))||a.push(u))}let c=a.length===1?a[0]:mR(a)??{allOf:a};Sn(n,s,c)}for(let s of o.required??[])i.add(s)}let r={type:"object",properties:n};if(i.size&&(r.required=[...i]),t.every(o=>o.additionalProperties===!1))r.additionalProperties=!1;else{let o=[];for(let s of t){let a=jB(s);a&&!o.some(c=>JSON.stringify(c)===JSON.stringify(a))&&o.push(a)}o.length===1?r.additionalProperties=o[0]:o.length>1&&(r.additionalProperties={allOf:o})}return r}function xfe(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let r of GB)if(r in e)return;let n=t.filter(r=>UB.some(o=>Array.isArray(r[o]))),i=null;if(!n.length)i=mR(t);else{let r=n[0],o=UB.find(c=>Array.isArray(r[c]));if(Object.keys(r).length!==1)return;let s=t.filter(c=>c!==r),a=r[o].map(c=>mR([...s,c]));if(a.some(c=>!c))return;i={[o]:a}}i&&(delete e.allOf,ng(e,i))}function qs(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let c=e.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){i(d);let f=e.seen.get(d),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):ng(l,m),ng(l,u),a._zod.parent===d)for(let h in l)h==="$ref"||h==="allOf"||h in u||delete l[h];if(m.$ref&&f.def)for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}let p=a._zod.parent;if(p&&p!==d){i(p);let f=e.seen.get(p);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let m in l)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(l[m])===JSON.stringify(f.def[m])&&delete l[m]}e.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())i(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())zB(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let l of[c.schema,c.def]){let u=l?.allOf;if(!Array.isArray(u))continue;let d=a.get(u);d?d.push(l):a.set(u,[l])}for(let c of e.intersections)for(let l of a.get(c)??[])xfe(l)}}let r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(a)}ng(r,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&r.id===o&&delete r.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Sn(s,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{let a=JSON.parse(JSON.stringify(r));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:ed(t,"input",e.processors),output:ed(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function xn(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return xn(i.element,n);if(i.type==="set")return xn(i.valueType,n);if(i.type==="lazy")return xn(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return xn(i.innerType,n);if(i.type==="intersection")return xn(i.left,n)||xn(i.right,n);if(i.type==="record"||i.type==="map")return xn(i.keyType,n)||xn(i.valueType,n);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:xn(i.in,n)||xn(i.out,n);if(i.type==="object"){for(let r in i.shape)if(xn(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(xn(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(xn(r,n))return!0;return!!(i.rest&&xn(i.rest,n))}return!1}var gR=(e,t={})=>n=>{let i=Vs({...n,processors:t});return st(e,i),Bs(i,e),qs(i,e)},ed=(e,t,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=Vs({...r??{},target:o,io:t,processors:n});return st(e,s),Bs(s,e),qs(s,e)};var td=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},nd=(e,t,n)=>{(e[t]===void 0||n{td(e,"minimum",t),nd(e,"maximum",t)},HB=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},KB=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},JB=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},ZB=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},BB=(e,t)=>td(e,"minimum",t.minimum),qB=(e,t)=>nd(e,"maximum",t.maximum),WB=e=>(t,n)=>{ZB(t,n.format);let[i,r]=e[n.format];td(t,"minimum",i),nd(t,"maximum",r)},Efe={greater_than:(e,t)=>td(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>nd(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>HB(e,t.value),number_format:WB(Im),bigint_format:WB(Am),min_length:BB,max_length:qB,length_equals:(e,t)=>VB(e,t.length),min_size:BB,max_size:qB,size_equals:(e,t)=>VB(e,t.size),string_format:(e,t)=>{ZB(e,t.format),t.pattern&&KB(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>JB(e,t.mime)};function yn(e){let t={},n=e._zod.def,i=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let o of i)Efe[o._zod.def.check]?.(t,o._zod.def);let r=e._zod.bag;r.minimum!==void 0&&td(t,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&td(t,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&nd(t,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&nd(t,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&HB(t,r.multipleOf),r.format!==void 0&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&JB(t,r.mime);for(let o of r.patterns??[])KB(t,o);return t}var Tfe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ife=new Map([[Pv,xI],[zm,EI]]),YB=e=>Ife.get(e)??e,bR=(e,t,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l,laxFormat:u}=yn(e);if(typeof o=="number"&&(r.minLength=o),typeof s=="number"&&(r.maxLength=s),a&&(r.format=Tfe[a]??a,r.format===""&&delete r.format,(a==="time"||u)&&delete r.format),l&&(r.contentEncoding=l),c&&c.size>0){let d=[...c].map(YB);d.length===1?r.pattern=d[0].source:d.length>1&&(r.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},vR=(e,t,n,i)=>{let r=n,{minimum:o,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=yn(e);r.type=u?"integer":"number";let d=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";if(d?f?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:typeof o=="number"&&(r.minimum=o),p?f?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:typeof s=="number"&&(r.maximum=s),a){let m=new Set;for(let b of a)Number.isFinite(b)&&b!==0?m.add(Math.abs(b)):Zt(e,t,r,i,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);let[g,...h]=m;g!==void 0&&(r.multipleOf=g),h.length&&(r.allOf=[...r.allOf??[],...h.map(b=>({multipleOf:b}))])}},wR=(e,t,n,i)=>{n.type="boolean"},kR=(e,t,n,i)=>{Zt(e,t,n,i,"BigInt cannot be represented in JSON Schema")},$R=(e,t,n,i)=>{Zt(e,t,n,i,"Symbols cannot be represented in JSON Schema")},_R=(e,t,n,i)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},SR=(e,t,n,i)=>{Zt(e,t,n,i,"Undefined cannot be represented in JSON Schema")},xR=(e,t,n,i)=>{Zt(e,t,n,i,"Void cannot be represented in JSON Schema")},ER=(e,t,n,i)=>{n.not={}},TR=(e,t,n,i)=>{},IR=(e,t,n,i)=>{},AR=(e,t,n,i)=>{Zt(e,t,n,i,"Date cannot be represented in JSON Schema")},RR=(e,t,n,i)=>{let r=e._zod.def,o=Tu(r.entries);if(o.length===0){n.not={};return}o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},NR=(e,t,n,i)=>{let r=e._zod.def;if(r.values.length===0){n.not={};return}let o=[];for(let s of r.values)if(s===void 0){if(Zt(e,t,n,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Zt(e,t,n,i,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},CR=(e,t,n,i)=>{Zt(e,t,n,i,"NaN cannot be represented in JSON Schema")},PR=(e,t,n,i)=>{let r=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source},DR=(e,t,n,i)=>{let r=n;r.type="string",r.format="binary",r.contentEncoding="binary";let{minimum:o,maximum:s,mime:a}=yn(e);o!==void 0&&(r.minLength=o),s!==void 0&&(r.maxLength=s),a&&(a.length===0?r.not={}:a.length===1?r.contentMediaType=a[0]:r.anyOf=a.map(c=>({contentMediaType:c})))},OR=(e,t,n,i)=>{n.type="boolean"},MR=(e,t,n,i)=>{Zt(e,t,n,i,"Custom types cannot be represented in JSON Schema")},LR=(e,t,n,i)=>{Zt(e,t,n,i,"Function types cannot be represented in JSON Schema")},FR=(e,t,n,i)=>{Zt(e,t,n,i,"Transforms cannot be represented in JSON Schema")},UR=(e,t,n,i)=>{Zt(e,t,n,i,"Map cannot be represented in JSON Schema")},jR=(e,t,n,i)=>{Zt(e,t,n,i,"Set cannot be represented in JSON Schema")},zR=(e,t,n,i)=>{let r=n,o=e._zod.def,{minimum:s,maximum:a}=yn(e);typeof s=="number"&&(r.minItems=s),typeof a=="number"&&(r.maxItems=a),r.type="array",r.items=st(o.element,t,{...i,path:[...i.path,"items"]})};function rd(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?rd(t.out):t.type==="catch"?rd(t.innerType):e._zod.optin}var GR=(e,t,n,i)=>{let r=n,o=e._zod.def,s=o.shape;if(Object.getOwnPropertySymbols(s).length&&Zt(e,t,r,i,"Symbol keys cannot be represented in JSON Schema"))return;r.type="object",r.properties={};for(let u in s)Sn(r.properties,u,st(s[u],t,{...i,path:[...i.path,"properties",u]}));let c=new Set(Object.keys(s)),l=new Set([...c].filter(u=>{let d=o.shape[u];return t.io==="input"?rd(d)===void 0:d._zod.optout===void 0}));l.size>0&&(r.required=Array.from(l)),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=st(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},Afe=(e,t,n,i)=>{let r=n,o=e._zod.def;if(Object.getOwnPropertySymbols(o.shape).length&&Zt(e,t,r,i,"Symbol keys cannot be represented in JSON Schema"))return;if(t.io==="output"){for(let a in o.shape)if(xn(o.shape[a])&&Zt(e,t,r,i,`z.properties() returns its input, so the output of a transforming schema at key "${a}" cannot be represented in JSON Schema`))return}r.type="object",r.properties={};for(let a in o.shape)Sn(r.properties,a,st(o.shape[a],t,{...i,path:[...i.path,"properties",a]}));let s=Object.keys(o.shape).filter(a=>rd(o.shape[a])===void 0);s.length>0&&(r.required=s)},Aw=(e,t,n,i)=>{let r=e._zod.def,o=r.inclusive===!1,s=r.options.map((a,c)=>st(a,t,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=s:n.anyOf=s},VR=(e,t,n,i)=>{let r=e._zod.def,o=st(r.left,t,{...i,path:[...i.path,"allOf",0]}),s=st(r.right,t,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=c,t.intersections.push(c)},BR=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((g,h)=>st(g,t,{...i,path:[...i.path,s,h]})),l=o.rest?st(o.rest,t,{...i,path:[...i.path,a,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,u=o.items.length;for(;u>0;){let g=o.items[u-1];if(!(t.io==="input"?rd(g)!==void 0:g._zod.optout==="optional"))break;u--}let d=o.items.length,p=!o.rest;t.target==="draft-2020-12"?(r.prefixItems=c,p?r.items=!1:l&&(r.items=l),u>0&&(r.minItems=u),p&&(r.maxItems=d)):t.target==="openapi-3.0"?(r.items={anyOf:c},l&&r.items.anyOf.push(l),u>0&&(r.minItems=u),p&&(r.maxItems=d)):(r.items=c,p?r.additionalItems=!1:l&&(r.additionalItems=l),u>0&&(r.minItems=u),p&&(r.maxItems=d));let{minimum:f,maximum:m}=yn(e);typeof f=="number"&&(r.minItems=f),typeof m=="number"&&(r.maxItems=m)};function hR(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let m=e.get(t)?.def;if(!m)return t;let g=hR(e,m,n);return g===m?t:g}for(let m of["anyOf","oneOf"]){let g=t[m];if(!Array.isArray(g))continue;let h=g.map(b=>hR(e,b,n));h.some((b,y)=>b!==g[y])&&(t={...t,[m]:h})}let i=Array.isArray(t.type)?t.type:[t.type],r=!i.includes("string")&&i.some(m=>m==="number"||m==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!r&&!o?.some(m=>typeof m=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:p,...f}=t;return f.enum?f.enum=f.enum.map(m=>typeof m=="number"?String(m):m):typeof f.const=="number"&&(f.const=String(f.const)),r&&(f.type="string",o||(f.pattern=(i.includes("number")?Ko:Mm).source)),f}var yR=new WeakMap;function Rfe(e){let t=new Map;for(let i of e.seen.values())i.def&&!t.has(i.schema)&&t.set(i.schema,i);let n=new Map;for(let i of yR.get(e)??[]){let r=e.seen.get(i),o=(r?.def??r?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let s=hR(t,o,new Set);s!==o&&n.set(o,s)}if(n.size)for(let i of e.seen.values())for(let r of[i.schema,i.def]){let o=r&&n.get(r.propertyNames);o&&(r.propertyNames=o)}}var qR=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="object";let s=o.keyType,a=yn(s).patterns;if(o.mode==="loose"&&a&&a.size>0){let u=st(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let d of a)Sn(r.patternProperties,YB(d).source,u)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){r.propertyNames=st(o.keyType,t,{...i,path:[...i.path,"propertyNames"]});let u=yR.get(t);u||(u=[],yR.set(t,u),t.deferred.push(()=>Rfe(t))),u.push(e)}r.additionalProperties=st(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let c=s._zod.values,l=t.io==="input"&&rd(o.valueType)!==void 0;if(c&&!o.partial&&!l){let u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(r.required=u.map(String))}},WR=(e,t,n,i)=>{let r=e._zod.def,o=st(r.innerType,t,i),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},HR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},KR=Symbol();function QB(e,t,n,i,r){let o=!1,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(Zt(t,n,i,r,"BigInt defaults cannot be represented in JSON Schema"),KR):JSON.parse(s)}var JR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let s=QB(r.defaultValue,e,t,n,i);s!==KR&&(n.default=s)},ZR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);if(o.ref=r.innerType,t.io!=="input")return;let s=QB(r.defaultValue,e,t,n,i);s!==KR&&(n._prefault=s)},YR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{Zt(e,t,n,i,"Dynamic catch values are not supported in JSON Schema");return}n.default=s},QR=(e,t,n,i)=>{let r=e._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?o?r.out:r.in:r.out;st(s,t,i);let a=t.seen.get(e);a.ref=s},XR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType,n.readOnly=!0},eN=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},Rw=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},tN=(e,t,n,i)=>{let r=e._zod.innerType;st(r,t,i);let o=t.seen.get(e);o.ref=r},Iw={string:bR,number:vR,boolean:wR,bigint:kR,symbol:$R,null:_R,undefined:SR,void:xR,never:ER,any:TR,unknown:IR,date:AR,enum:RR,literal:NR,nan:CR,template_literal:PR,file:DR,success:OR,custom:MR,properties:Afe,function:LR,transform:FR,map:UR,set:jR,array:zR,object:GR,union:Aw,intersection:VR,tuple:BR,record:qR,nullable:WR,nonoptional:HR,default:JR,prefault:ZR,catch:YR,pipe:QR,readonly:XR,promise:eN,optional:Rw,lazy:tN};function Nw(e,t){if("_idmap"in e){let i=e,r=Vs({...t,processors:Iw}),o={};for(let c of i._idmap.entries()){let[l,u]=c;st(u,r)}let s={},a={registry:i,uri:t?.uri,defs:o};r.external=a;for(let c of i._idmap.entries()){let[l,u]=c;Bs(r,u),Sn(s,l,qs(r,u))}if(Object.keys(o).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let n=Vs({...t,processors:Iw});return st(e,n),Bs(n,e),qs(n,e)}var Cw=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Vs({processors:Iw,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return st(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Bs(this.ctx,t);let i=qs(this.ctx,t),{"~standard":r,...o}=i;return o}};var XB={};var pd={};_r(pd,{ZodAny:()=>_N,ZodArray:()=>TN,ZodBase64:()=>Yw,ZodBase64URL:()=>Qw,ZodBigInt:()=>ud,ZodBigIntFormat:()=>tk,ZodBoolean:()=>ld,ZodCIDRv4:()=>Jw,ZodCIDRv6:()=>Zw,ZodCUID:()=>Gw,ZodCUID2:()=>Vw,ZodCatch:()=>KN,ZodCodec:()=>pg,ZodCreditCard:()=>gN,ZodCustom:()=>fg,ZodCustomStringFormat:()=>ad,ZodDate:()=>sg,ZodDefault:()=>GN,ZodDiscriminatedUnion:()=>AN,ZodE164:()=>Xw,ZodEmail:()=>Fw,ZodEmoji:()=>jw,ZodEnum:()=>od,ZodExactOptional:()=>ok,ZodFile:()=>FN,ZodFunction:()=>iC,ZodGUID:()=>Uw,ZodIBAN:()=>hN,ZodIPv4:()=>Hw,ZodIPv6:()=>Kw,ZodISODate:()=>Ks,ZodISODateTime:()=>Hs,ZodISODuration:()=>Zs,ZodISOTime:()=>Js,ZodInstanceOf:()=>lC,ZodIntersection:()=>RN,ZodJWT:()=>ek,ZodKSUID:()=>Ww,ZodLazy:()=>tC,ZodLiteral:()=>LN,ZodMAC:()=>mN,ZodMap:()=>ON,ZodNaN:()=>ZN,ZodNanoID:()=>zw,ZodNever:()=>xN,ZodNonOptional:()=>sk,ZodNull:()=>kN,ZodNullable:()=>zN,ZodNumber:()=>cd,ZodNumberFormat:()=>Nc,ZodObject:()=>cg,ZodOptional:()=>ug,ZodPipe:()=>dg,ZodPrefault:()=>BN,ZodPreprocess:()=>YN,ZodPromise:()=>rC,ZodProperties:()=>oC,ZodReadonly:()=>QN,ZodRecord:()=>id,ZodSet:()=>MN,ZodString:()=>sd,ZodStringFormat:()=>mt,ZodSuccess:()=>HN,ZodSymbol:()=>vN,ZodTemplateLiteral:()=>eC,ZodTransform:()=>UN,ZodTuple:()=>CN,ZodType:()=>Le,ZodULID:()=>Bw,ZodURL:()=>og,ZodUUID:()=>go,ZodUndefined:()=>wN,ZodUnion:()=>lg,ZodUnknown:()=>SN,ZodVoid:()=>EN,ZodXID:()=>qw,ZodXor:()=>IN,_ZodString:()=>Lw,_default:()=>VN,_function:()=>u2,any:()=>zq,array:()=>ag,base64:()=>$q,base64url:()=>_q,bigint:()=>Mq,boolean:()=>bN,catch:()=>JN,check:()=>d2,cidrv4:()=>wq,cidrv6:()=>kq,codec:()=>s2,creditCard:()=>xq,cuid:()=>pq,cuid2:()=>fq,custom:()=>p2,date:()=>Vq,describe:()=>f2,discriminatedUnion:()=>Jq,e164:()=>Sq,email:()=>nq,emoji:()=>uq,enum:()=>rk,exactOptional:()=>jN,file:()=>n2,float32:()=>Cq,float64:()=>Pq,function:()=>u2,guid:()=>rq,hash:()=>Nq,hex:()=>Rq,hostname:()=>Aq,httpUrl:()=>lq,iban:()=>Eq,instanceof:()=>g2,int:()=>Ow,int32:()=>Dq,int64:()=>Lq,intersection:()=>NN,invertCodec:()=>a2,ipv4:()=>yq,ipv6:()=>vq,json:()=>y2,jwt:()=>Tq,keyof:()=>Bq,ksuid:()=>hq,lazy:()=>nC,literal:()=>t2,looseObject:()=>Hq,looseRecord:()=>Yq,mac:()=>bq,map:()=>Qq,meta:()=>m2,nan:()=>o2,nanoid:()=>dq,nativeEnum:()=>e2,never:()=>nk,nonoptional:()=>WN,null:()=>$N,nullable:()=>ig,nullish:()=>r2,number:()=>yN,object:()=>qq,optional:()=>Rc,partialRecord:()=>Zq,pipe:()=>Mw,prefault:()=>qN,preprocess:()=>b2,promise:()=>l2,properties:()=>sC,readonly:()=>XN,record:()=>DN,refine:()=>aC,set:()=>Xq,strictObject:()=>Wq,string:()=>rg,stringFormat:()=>Iq,stringbool:()=>h2,success:()=>i2,superRefine:()=>cC,symbol:()=>Uq,templateLiteral:()=>c2,transform:()=>ik,tuple:()=>PN,uint32:()=>Oq,uint64:()=>Fq,ulid:()=>mq,undefined:()=>jq,union:()=>dd,unknown:()=>Ac,url:()=>cq,uuid:()=>iq,uuidv4:()=>oq,uuidv6:()=>sq,uuidv7:()=>aq,void:()=>Gq,xid:()=>gq,xor:()=>Kq});var Pw={};_r(Pw,{endsWith:()=>Wu,gt:()=>fo,gte:()=>Vr,includes:()=>Bu,length:()=>Ic,lowercase:()=>Gu,lt:()=>po,lte:()=>Gr,maxLength:()=>Tc,maxSize:()=>Gs,mime:()=>Hu,minLength:()=>Jo,minSize:()=>mo,multipleOf:()=>zs,negative:()=>Sw,nonnegative:()=>Ew,nonpositive:()=>xw,normalize:()=>Ku,overwrite:()=>ji,positive:()=>_w,property:()=>Tw,regex:()=>zu,size:()=>Ec,slugify:()=>Qu,startsWith:()=>qu,toLowerCase:()=>Zu,toUpperCase:()=>Yu,trim:()=>Ju,uppercase:()=>Vu});var eq=new WeakSet([Object.prototype,Error.prototype]);function Dw(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let i=n(this);return Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0})}})}var tq=(e,t)=>{oI.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);eq.has(n)||(eq.add(n),Dw(n,"format",i=>r=>Pm(i,r)),Dw(n,"flatten",i=>r=>Cm(i,r)),Dw(n,"addIssue",i=>r=>{i.issues.push(r),i.message=JSON.stringify(i.issues,Iu,2)}),Dw(n,"addIssues",i=>r=>{i.issues.push(...r),i.message=JSON.stringify(i.issues,Iu,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Cfe=R("ZodError",tq),Ar=R("ZodError",tq,void 0,{Parent:Error});var nN=Cu(Ar),rN=Pu(Ar),iN=Du(Ar),oN=Ou(Ar),sN=uv(Ar),aN=dv(Ar),cN=pv(Ar),lN=fv(Ar),uN=mv(Ar),dN=gv(Ar),pN=hv(Ar),fN=yv(Ar);function Dfe(){hn.localeError||zt(Jv())}function Ws(){hn.memoizer||zt({memoizer:Km()})}var Le=R("ZodType",(e,t)=>(Dfe(),Ce.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(G.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ot(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(aC(e,t))},superRefine(e,t){return this.check(cC(e,t))},overwrite(e){return this.check(ji(e))},optional(){return Rc(this)},exactOptional(){return jN(this)},nullable(){return ig(this)},nullish(){return Rc(ig(this))},nonoptional(e){return WN(this,e)},array(){return ag(this)},or(e){return dd([this,e])},and(e){return NN(this,e)},transform(e){return Mw(this,ik(e))},default(e){return VN(this,e)},prefault(e){return qN(this,e)},catch(e){return JN(this,e)},pipe(e){return Mw(this,e)},readonly(){return XN(this)},describe(e){let t=this.clone();return Dn.add(t,{description:e}),t},meta(...e){if(e.length===0)return Dn.get(this);let t=this.clone();return Dn.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return G.hide(this,"~standard",{...Tv(this),jsonSchema:{input:ed(this,"input"),output:ed(this,"output")}})},set"~standard"(e){G.own(this,"~standard",e)},parse:function e(t,n){return nN(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await rN(this,t,n,{callee:e})},safeParse(e,t){return iN(this,e,t)},async safeParseAsync(e,t){return oN(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){G.own(this,"spa",e)},validate(e,t){return Dm(this,e,t)},validateAsync(e,t){return Om(this,e,t)},encode:function e(t,n){return sN(this,t,n,{callee:e})},decode:function e(t,n){return aN(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await cN(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await lN(this,t,n,{callee:e})},safeEncode(e,t){return uN(this,e,t)},safeDecode(e,t){return dN(this,e,t)},async safeEncodeAsync(e,t){return pN(this,e,t)},async safeDecodeAsync(e,t){return fN(this,e,t)},toJSONSchema(e){return gR(this,{})(e)},get description(){return Dn.get(this)?.description},get _def(){return this._zod.def}}),Lw=R("_ZodString",(e,t)=>{kc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>bR(e,n,i,r)},G.derived({format:e=>yn(e).format??null,minLength:e=>yn(e).minimum??null,maxLength:e=>yn(e).maximum??null},{regex(...e){return this.check(zu(...e))},includes(...e){return this.check(Bu(...e))},startsWith(...e){return this.check(qu(...e))},endsWith(...e){return this.check(Wu(...e))},min(...e){return this.check(Jo(...e))},max(...e){return this.check(Tc(...e))},length(...e){return this.check(Ic(...e))},nonempty(...e){return this.check(Jo(1,...e))},lowercase(e){return this.check(Gu(e))},uppercase(e){return this.check(Vu(e))},trim(){return this.check(Ju())},normalize(...e){return this.check(Ku(...e))},toLowerCase(){return this.check(Zu())},toUpperCase(){return this.check(Yu())},slugify(){return this.check(Qu())}})),sd=R("ZodString",(e,t)=>{kc.init(e,t),Lw.init(e,t)},{email(e){return this.check(nw(Fw,e))},url(e){return this.check(Ym(og,e))},jwt(e){return this.check($w(ek,e))},emoji(e){return this.check(cw(jw,e))},guid(e){return this.check(rw(Uw,e))},uuid(e){return this.check(iw(go,e))},uuidv4(e){return this.check(ow(go,e))},uuidv6(e){return this.check(sw(go,e))},uuidv7(e){return this.check(aw(go,e))},nanoid(e){return this.check(lw(zw,e))},cuid(e){return this.check(uw(Gw,e))},cuid2(e){return this.check(dw(Vw,e))},ulid(e){return this.check(pw(Bw,e))},base64(e){return this.check(vw(Yw,e))},base64url(e){return this.check(ww(Qw,e))},xid(e){return this.check(fw(qw,e))},ksuid(e){return this.check(mw(Ww,e))},ipv4(e){return this.check(gw(Hw,e))},ipv6(e){return this.check(hw(Kw,e))},cidrv4(e){return this.check(yw(Jw,e))},cidrv6(e){return this.check(bw(Zw,e))},e164(e){return this.check(kw(Xw,e))},datetime(e){return this.check(Qm(Hs,e))},date(e){return this.check(Xm(Ks,e))},time(e){return this.check(eg(Js,e))},duration(e){return this.check(tg(Zs,e))}});function rg(e){return RA(sd,e)}var mt=R("ZodStringFormat",(e,t)=>{ut.init(e,t),Lw.init(e,t)}),Hs=R("ZodISODateTime",(e,t)=>{k0.init(e,t),mt.init(e,t)}),Ks=R("ZodISODate",(e,t)=>{$0.init(e,t),mt.init(e,t)}),Js=R("ZodISOTime",(e,t)=>{_0.init(e,t),mt.init(e,t)}),Zs=R("ZodISODuration",(e,t)=>{S0.init(e,t),mt.init(e,t)}),Fw=R("ZodEmail",(e,t)=>{u0.init(e,t),mt.init(e,t)});function nq(e){return nw(Fw,e)}var Uw=R("ZodGUID",(e,t)=>{c0.init(e,t),mt.init(e,t)});function rq(e){return rw(Uw,e)}var go=R("ZodUUID",(e,t)=>{l0.init(e,t),mt.init(e,t)});function iq(e){return iw(go,e)}function oq(e){return ow(go,e)}function sq(e){return sw(go,e)}function aq(e){return aw(go,e)}var og=R("ZodURL",(e,t)=>{f0.init(e,t),mt.init(e,t)});function cq(e){return Ym(og,e)}function lq(e){return Ym(og,{protocol:or.httpProtocol,hostname:or.domain,...G.normalizeParams(e)})}var jw=R("ZodEmoji",(e,t)=>{m0.init(e,t),mt.init(e,t)});function uq(e){return cw(jw,e)}var zw=R("ZodNanoID",(e,t)=>{g0.init(e,t),mt.init(e,t)});function dq(e){return lw(zw,e)}var Gw=R("ZodCUID",(e,t)=>{h0.init(e,t),mt.init(e,t)});function pq(e){return uw(Gw,e)}var Vw=R("ZodCUID2",(e,t)=>{y0.init(e,t),mt.init(e,t)});function fq(e){return dw(Vw,e)}var Bw=R("ZodULID",(e,t)=>{b0.init(e,t),mt.init(e,t)});function mq(e){return pw(Bw,e)}var qw=R("ZodXID",(e,t)=>{v0.init(e,t),mt.init(e,t)});function gq(e){return fw(qw,e)}var Ww=R("ZodKSUID",(e,t)=>{w0.init(e,t),mt.init(e,t)});function hq(e){return mw(Ww,e)}var Hw=R("ZodIPv4",(e,t)=>{x0.init(e,t),mt.init(e,t)});function yq(e){return gw(Hw,e)}var mN=R("ZodMAC",(e,t)=>{T0.init(e,t),mt.init(e,t)});function bq(e){return CA(mN,e)}var Kw=R("ZodIPv6",(e,t)=>{E0.init(e,t),mt.init(e,t)});function vq(e){return hw(Kw,e)}var Jw=R("ZodCIDRv4",(e,t)=>{I0.init(e,t),mt.init(e,t)});function wq(e){return yw(Jw,e)}var Zw=R("ZodCIDRv6",(e,t)=>{A0.init(e,t),mt.init(e,t)});function kq(e){return bw(Zw,e)}var Yw=R("ZodBase64",(e,t)=>{R0.init(e,t),mt.init(e,t)});function $q(e){return vw(Yw,e)}var Qw=R("ZodBase64URL",(e,t)=>{N0.init(e,t),mt.init(e,t)});function _q(e){return ww(Qw,e)}var Xw=R("ZodE164",(e,t)=>{C0.init(e,t),mt.init(e,t)});function Sq(e){return kw(Xw,e)}var gN=R("ZodCreditCard",(e,t)=>{P0.init(e,t),mt.init(e,t)});function xq(e){return PA(gN,e)}var hN=R("ZodIBAN",(e,t)=>{D0.init(e,t),mt.init(e,t)});function Eq(e){return DA(hN,e)}var ek=R("ZodJWT",(e,t)=>{O0.init(e,t),mt.init(e,t)});function Tq(e){return $w(ek,e)}var ad=R("ZodCustomStringFormat",(e,t)=>{M0.init(e,t),mt.init(e,t)});function Iq(e,t,n={}){return Xu(ad,e,t,n)}function Aq(e){return Xu(ad,"hostname",or.hostname,e)}function Rq(e){return Xu(ad,"hex",or.hex,e)}function Nq(e,t){let n=t?.enc??"hex",i=`${e}_${n}`,r=or[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return Xu(ad,i,r,t)}var cd=R("ZodNumber",(e,t)=>{Fv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>vR(e,n,i,r),e.isFinite=!0},G.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=yn(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=yn(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=yn(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>yn(e).format??null},{gt(e,t){return this.check(fo(e,t))},gte(e,t){return this.check(Vr(e,t))},min(e,t){return this.check(Vr(e,t))},lt(e,t){return this.check(po(e,t))},lte(e,t){return this.check(Gr(e,t))},max(e,t){return this.check(Gr(e,t))},int(e){return this.check(Ow(e))},safe(e){return this.check(Ow(e))},positive(e){return this.check(fo(0,e))},nonnegative(e){return this.check(Vr(0,e))},negative(e){return this.check(po(0,e))},nonpositive(e){return this.check(Gr(0,e))},multipleOf(e,t){return this.check(zs(e,t))},step(e,t){return this.check(zs(e,t))},finite(){return this}}));function yN(e){return MA(cd,e)}var Nc=R("ZodNumberFormat",(e,t)=>{L0.init(e,t),cd.init(e,t)});function Ow(e){return FA(Nc,e)}function Cq(e){return UA(Nc,e)}function Pq(e){return jA(Nc,e)}function Dq(e){return zA(Nc,e)}function Oq(e){return GA(Nc,e)}var ld=R("ZodBoolean",(e,t)=>{Gm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>wR(e,n,i,r)});function bN(e){return VA(ld,e)}var ud=R("ZodBigInt",(e,t)=>{Uv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>kR(e,n,i,r)},G.derived({minValue:e=>yn(e).minimum??null,maxValue:e=>yn(e).maximum??null,format:e=>yn(e).format??null},{gte(e,t){return this.check(Vr(e,t))},min(e,t){return this.check(Vr(e,t))},gt(e,t){return this.check(fo(e,t))},lt(e,t){return this.check(po(e,t))},lte(e,t){return this.check(Gr(e,t))},max(e,t){return this.check(Gr(e,t))},positive(e){return this.check(fo(BigInt(0),e))},negative(e){return this.check(po(BigInt(0),e))},nonpositive(e){return this.check(Gr(BigInt(0),e))},nonnegative(e){return this.check(Vr(BigInt(0),e))},multipleOf(e,t){return this.check(zs(e,t))}}));function Mq(e){return qA(ud,e)}var tk=R("ZodBigIntFormat",(e,t)=>{F0.init(e,t),ud.init(e,t)});function Lq(e){return HA(tk,e)}function Fq(e){return KA(tk,e)}var vN=R("ZodSymbol",(e,t)=>{U0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>$R(e,n,i,r)});function Uq(e){return JA(vN,e)}var wN=R("ZodUndefined",(e,t)=>{j0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>SR(e,n,i,r)});function jq(e){return ZA(wN,e)}var kN=R("ZodNull",(e,t)=>{z0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_R(e,n,i,r)});function $N(e){return YA(kN,e)}var _N=R("ZodAny",(e,t)=>{G0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>TR(e,n,i,r)});function zq(){return QA(_N)}var SN=R("ZodUnknown",(e,t)=>{V0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>IR(e,n,i,r)});function Ac(){return XA(SN)}var xN=R("ZodNever",(e,t)=>{B0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ER(e,n,i,r)});function nk(e){return eR(xN,e)}var EN=R("ZodVoid",(e,t)=>{q0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>xR(e,n,i,r)});function Gq(e){return tR(EN,e)}var sg=R("ZodDate",(e,t)=>{W0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>AR(e,n,i,r),e.min=(n,i)=>e.check(Vr(n,i)),e.max=(n,i)=>e.check(Gr(n,i))},G.derived({minDate:e=>{let{minimum:t}=yn(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=yn(e);return t?new Date(t):null}},{}));function Vq(e){return nR(sg,e)}var TN=R("ZodArray",(e,t)=>{Ws(),H0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>zR(e,n,i,r),e.element=t.element},{min(e,t){return this.check(Jo(e,t))},nonempty(e){return this.check(Jo(1,e))},max(e,t){return this.check(Tc(e,t))},length(e,t){return this.check(Ic(e,t))},unwrap(){return this.element}});function ag(e,t){return sR(TN,e,t)}function Bq(e){let t=e._zod.def.shape;return rk(Object.keys(t))}var cg=R("ZodObject",(e,t)=>{Ws(),K0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>GR(e,n,i,r),G.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return rk(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(G.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(G.mergeDefs(this._zod.def,{catchall:Ac()}))},loose(){return this.clone(G.mergeDefs(this._zod.def,{catchall:Ac()}))},strict(){return this.clone(G.mergeDefs(this._zod.def,{catchall:nk()}))},strip(){return this.clone(G.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return G.extend(this,e)},safeExtend(e){return G.safeExtend(this,e)},merge(e){return G.merge(this,e)},pick(e){return G.pick(this,e)},omit(e){return G.omit(this,e)},partial(...e){return G.partial(ug,this,e[0])},exactPartial(...e){return G.partial(ok,this,e[0],"exactPartial")},required(...e){return G.required(sk,this,e[0])}});function qq(e,t){let n={type:"object",shape:e??{},...G.normalizeParams(t)};return new cg(n)}function Wq(e,t){return new cg({type:"object",shape:e,catchall:nk(),...G.normalizeParams(t)})}function Hq(e,t){return new cg({type:"object",shape:e,catchall:Ac(),...G.normalizeParams(t)})}var lg=R("ZodUnion",(e,t)=>{Vm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Aw(e,n,i,r),e.options=t.options});function dd(e,t){return new lg({type:"union",options:e,...G.normalizeParams(t)})}var IN=R("ZodXor",(e,t)=>{lg.init(e,t),J0.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Aw(e,n,i,r),e.options=t.options});function Kq(e,t){return new IN({type:"union",options:e,inclusive:!1,...G.normalizeParams(t)})}var AN=R("ZodDiscriminatedUnion",(e,t)=>{lg.init(e,t),Y0.init(e,t)});function Jq(e,t,n){return new AN({type:"union",options:t,discriminator:e,...G.normalizeParams(n)})}var RN=R("ZodIntersection",(e,t)=>{Q0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>VR(e,n,i,r)});function NN(e,t){return new RN({type:"intersection",left:e,right:t})}var CN=R("ZodTuple",(e,t)=>{Ws(),jv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>BR(e,n,i,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new ug({type:"optional",innerType:t}))})}});function PN(e,t,n){let i=t instanceof Ce,r=i?n:t,o=i?t:null;return new CN({type:"tuple",items:e,rest:o,...G.normalizeParams(r)})}var id=R("ZodRecord",(e,t)=>{Ws(),X0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>qR(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType});function DN(e,t,n){return!t||!t._zod?new id({type:"record",keyType:rg(),valueType:e,...G.normalizeParams(t)}):new id({type:"record",keyType:e,valueType:t,...G.normalizeParams(n)})}function Zq(e,t,n){return new id({type:"record",keyType:e,valueType:t,...G.normalizeParams(n),partial:!0})}function Yq(e,t,n){return new id({type:"record",keyType:e,valueType:t,mode:"loose",...G.normalizeParams(n)})}var ON=R("ZodMap",(e,t)=>{Ws(),eA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>UR(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(mo(...n)),e.nonempty=n=>e.check(mo(1,n)),e.max=(...n)=>e.check(Gs(...n)),e.size=(...n)=>e.check(Ec(...n))});function Qq(e,t,n){return new ON({type:"map",keyType:e,valueType:t,...G.normalizeParams(n)})}var MN=R("ZodSet",(e,t)=>{Ws(),tA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>jR(e,n,i,r),e.min=(...n)=>e.check(mo(...n)),e.nonempty=n=>e.check(mo(1,n)),e.max=(...n)=>e.check(Gs(...n)),e.size=(...n)=>e.check(Ec(...n))});function Xq(e,t){return new MN({type:"set",valueType:e,...G.normalizeParams(t)})}var od=R("ZodEnum",(e,t)=>{nA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,r,o)=>RR(e,i,r,o),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(i,r)=>{let o={};for(let s of i)if(n.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new od({...t,checks:[],...G.normalizeParams(r),entries:o})},e.exclude=(i,r)=>{let o={...t.entries};for(let s of i)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new od({...t,checks:[],...G.normalizeParams(r),entries:o})}});function rk(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new od({type:"enum",entries:n,...G.normalizeParams(t)})}function e2(e,t){return new od({type:"enum",entries:e,...G.normalizeParams(t)})}var LN=R("ZodLiteral",(e,t)=>{rA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>NR(e,n,i,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function t2(e,t){return new LN({type:"literal",values:Array.isArray(e)?e:[e],...G.normalizeParams(t)})}var FN=R("ZodFile",(e,t)=>{iA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>DR(e,n,i,r),e.min=(n,i)=>e.check(mo(n,i)),e.max=(n,i)=>e.check(Gs(n,i)),e.mime=(n,i)=>e.check(Hu(Array.isArray(n)?n:[n],i))});function n2(e){return aR(FN,e)}var UN=R("ZodTransform",(e,t)=>{Ws(),oA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>FR(e,n,i,r),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new js(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(G.issue(o,n.value,t));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=e),n.issues.push(G.issue(s))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n)):(n.value=r,n)}});function ik(e){return new UN({type:"transform",transform:e})}var ug=R("ZodOptional",(e,t)=>{zv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Rw(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Rc(e){return new ug({type:"optional",innerType:e})}var ok=R("ZodExactOptional",(e,t)=>{sA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Rw(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function jN(e){return new ok({type:"optional",innerType:e})}var zN=R("ZodNullable",(e,t)=>{aA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>WR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function ig(e){return new zN({type:"nullable",innerType:e})}function r2(e){return Rc(ig(e))}var GN=R("ZodDefault",(e,t)=>{cA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>JR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VN(e,t){return new GN({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var BN=R("ZodPrefault",(e,t)=>{lA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ZR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function qN(e,t){return new BN({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var sk=R("ZodNonOptional",(e,t)=>{uA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>HR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function WN(e,t){return new sk({type:"nonoptional",innerType:e,...G.normalizeParams(t)})}var HN=R("ZodSuccess",(e,t)=>{dA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>OR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function i2(e){return new HN({type:"success",innerType:e})}var KN=R("ZodCatch",(e,t)=>{pA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>YR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function JN(e,t){return new KN({type:"catch",innerType:e,catchValue:typeof t=="function"?t:G.constantCatch(t)})}var ZN=R("ZodNaN",(e,t)=>{fA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>CR(e,n,i,r)});function o2(e){return iR(ZN,e)}var dg=R("ZodPipe",(e,t)=>{Gv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>QR(e,n,i,r),e.in=t.in,e.out=t.out});function Mw(e,t){return new dg({type:"pipe",in:e,out:t})}var pg=R("ZodCodec",(e,t)=>{dg.init(e,t),Bm.init(e,t)});function s2(e,t,n){return new pg({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function a2(e){let t=e._zod.def;return new pg({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var YN=R("ZodPreprocess",(e,t)=>{dg.init(e,t),mA.init(e,t)}),QN=R("ZodReadonly",(e,t)=>{gA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>XR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function XN(e){return new QN({type:"readonly",innerType:e})}var eC=R("ZodTemplateLiteral",(e,t)=>{hA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>PR(e,n,i,r)});function c2(e,t){return new eC({type:"template_literal",parts:e,...G.normalizeParams(t)})}var tC=R("ZodLazy",(e,t)=>{qm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>tN(e,n,i,r),e.unwrap=()=>e._zod.def.getter()});function nC(e){return new tC({type:"lazy",getter:e})}var rC=R("ZodPromise",(e,t)=>{bA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>eN(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function l2(e){return new rC({type:"promise",innerType:e})}var iC=R("ZodFunction",(e,t)=>{yA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>LR(e,n,i,r)});function u2(e){return new iC({type:"function",input:Array.isArray(e?.input)?PN(e?.input):e?.input??ag(Ac()),output:e?.output??Ac()})}var fg=R("ZodCustom",(e,t)=>{vA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>MR(e,n,i,r)}),oC=R("ZodProperties",(e,t)=>{Ws(),wA.init(e,t),Le.init(e,t)});function sC(e,t){return oR(oC,e,t)}function d2(e){let t=new ht({check:"custom"});return t._zod.check=e,t}function p2(e,t){return cR(fg,e??(()=>!0),t)}function aC(e,t={}){return lR(fg,e,t)}function cC(e,t){return uR(e,t)}var f2=dR,m2=pR,lC=R("ZodInstanceOf",(e,t)=>{fg.init(e,t)},{properties(e,t){return this.check(sC(e,t))}});function g2(e,t={}){let n=new lC({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...G.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}var h2=(...e)=>fR({Codec:pg,Boolean:ld,String:sd},...e);function y2(e){let t=nC(()=>dd([rg(e),yN(),bN(),$N(),ag(t),DN(rg(),t)]));return t}function b2(e,t){return new YN({type:"pipe",in:ik(e),out:t})}var Ofe={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Mfe(e){zt({customError:e})}function Lfe(){return zt().customError}var uC;uC||(uC={});var mg={};_r(mg,{ZodISODate:()=>Ks,ZodISODateTime:()=>Hs,ZodISODuration:()=>Zs,ZodISOTime:()=>Js,date:()=>Ufe,datetime:()=>Ffe,duration:()=>zfe,time:()=>jfe});function Ffe(e){return Qm(Hs,e)}function Ufe(e){return Xm(Ks,e)}function jfe(e){return eg(Js,e)}function zfe(e){return tg(Zs,e)}var oe={...pd,...Pw,iso:mg},Gfe=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Vfe(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function v2(e,t){return e.map((n,i)=>ii).check(i=>{let r=i.value;if(typeof r!="object"||r===null||Array.isArray(r))return;let o=Object.getOwnPropertyNames(r);if(t.minProperties!==void 0&&o.length=${t.minProperties} properties`,input:r,inst:e,continue:!0}),t.maxProperties!==void 0&&o.length>t.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:r,inst:e,continue:!0}),t.keySchema)for(let s of o){let a=t.keySchema.safeParse(s);a.success||i.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:!0})}}).pipe(e)}function dC(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let i=String(e);return`${n[0]}${i.length}:${i}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let o=[];for(let s of e){let a=dC(s,t);if(a===null)return null;o.push(a)}return`a${o.length}:[${o.join(",")}]`}let i=Object.keys(e).sort(),r=[];for(let o of i){let s=dC(e[o],t);if(s===null)return null;r.push(`${o.length}:${o}=${s}`)}return`o${r.length}:{${r.join(",")}}`}finally{t.delete(e)}}var Hfe=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),Kfe=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function gg(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(gg):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>Hfe.has(t)?gg(n):!Kfe.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(gg))}function w2(e){return e===1?"element":"elements"}function Jfe(e,t){return oe.transform(i=>i).check(i=>{let r=i.value;if(Array.isArray(r)){if(t.uniqueItems===!0){let o=new Map;for(let s=0;s=s)break;at.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${w2(t.maxContains)}`,input:r,continue:!0})}}}).pipe(e)}function k2(e,t){if(e!==!1)return e===void 0||e===!0?oe.any():ar(e,t)}var Zfe=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function $2(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return oe.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return oe.lazy(()=>{if(!t.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let o=qfe(r,t),s=ar(o,t);return t.refs.set(r,s),t.processing.delete(r),s}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return oe.null();if(r.length===0)return oe.never();if(r.length===1)return oe.literal(r[0]);if(r.every(s=>typeof s=="string"))return oe.enum(r);let o=r.map(s=>oe.literal(s));return o.length<2?o[0]:oe.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return oe.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(o=>{let s={...e,type:o};return $2(s,t)});return r.length===0?oe.never():r.length===1?r[0]:oe.union(r)}if(!n)return oe.any();let i;switch(n){case"string":{let r=oe.string();if(e.format){let o=e.format;o==="email"?r=r.check(oe.email()):o==="uri"||o==="uri-reference"?r=r.check(oe.url()):o==="uuid"||o==="guid"?r=r.check(oe.uuid()):o==="date-time"?r=r.check(oe.iso.datetime({offset:!0})):o==="date"?r=r.check(oe.iso.date()):o==="time"?r=r.check(oe.regex(Zfe)):o==="duration"?r=r.check(oe.iso.duration()):o==="hostname"?r=r.check(oe.hostname()):o==="ipv4"?r=r.check(oe.ipv4()):o==="ipv6"?r=r.check(oe.ipv6()):o==="mac"?r=r.check(oe.mac()):o==="cidr"?r=r.check(oe.cidrv4()):o==="cidr-v6"?r=r.check(oe.cidrv6()):o==="base64"?r=r.check(oe.base64()):o==="base64url"?r=r.check(oe.base64url()):o==="e164"?r=r.check(oe.e164()):o==="credit_card"?r=r.check(oe.creditCard()):o==="iban"?r=r.check(oe.iban()):o==="jwt"?r=r.check(oe.jwt()):o==="emoji"?r=r.check(oe.emoji()):o==="nanoid"?r=r.check(oe.nanoid()):o==="cuid"?r=r.check(oe.cuid()):o==="cuid2"?r=r.check(oe.cuid2()):o==="ulid"?r=r.check(oe.ulid()):o==="xid"?r=r.check(oe.xid()):o==="ksuid"&&(r=r.check(oe.ksuid()))}typeof e.minLength=="number"&&(r=r.min(e.minLength)),typeof e.maxLength=="number"&&(r=r.max(e.maxLength)),e.pattern&&(r=r.regex(new RegExp(e.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?oe.number().int():oe.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(r=r.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(r=r.max(e.maximum)),typeof e.exclusiveMinimum=="number"?r=r.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(r=r.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?r=r.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(r=r.lt(e.maximum)),typeof e.multipleOf=="number"&&(r=r.multipleOf(e.multipleOf)),i=r;break}case"boolean":{i=oe.boolean();break}case"null":{i=oe.null();break}case"object":{let r={},o=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?ar(e.additionalProperties,t):void 0;for(let[d,p]of Object.entries(o)){let f=ar(p,t);Sn(r,d,s.has(d)?f:f.optional())}if(e.patternProperties){let d=e.patternProperties,p=Object.keys(d),f=[];for(let g of p){let h=ar(d[g],t),b=oe.string().regex(new RegExp(g));f.push(oe.looseRecord(b,h))}let m=[];if(Object.keys(r).length>0&&m.push(oe.object(r).passthrough()),m.push(...f),m.length===0)i=oe.object({}).passthrough();else if(m.length===1)i=m[0];else{let g=oe.intersection(m[0],m[1]);for(let h=2;hnew RegExp(y)),b=i;i=i.check(y=>{if(!ci(y.value))return;let w=[];for(let k of Object.keys(y.value))g.includes(k)||h.some(_=>_.test(k))||w.push(k);w.length&&y.issues.push({code:"unrecognized_keys",keys:w,input:y.value,inst:b})})}}else{let d=oe.object(r);e.additionalProperties===!1?i=d.strict():a?i=d.catchall(a):i=d.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,u=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||l!==void 0||u!==void 0){let d;if(c){let p=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=ar(p,t)}i=Wfe(i,{keySchema:d,minProperties:l,maxProperties:u})}break}case"array":{let r=e.prefixItems,o=e.items;if(r&&Array.isArray(r)){let s=typeof e.minItems=="number"?e.minItems:0,a=r.map(d=>ar(d,t)),c=v2(a,s),l=Array.isArray(o)?void 0:k2(o,t),u=oe.tuple(c);i=l?u.rest(l):u,typeof e.minItems=="number"&&(i=i.check(oe.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(oe.maxLength(e.maxItems)))}else if(Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(d=>ar(d,t)),c=v2(a,s),l=k2(e.additionalItems,t),u=oe.tuple(c);i=l?u.rest(l):u,typeof e.minItems=="number"&&(i=i.check(oe.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(oe.maxLength(e.maxItems)))}else if(o!==void 0){let s=ar(o,t),a=oe.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),i=a}else i=oe.array(oe.any());(e.uniqueItems===!0||e.contains!==void 0)&&(i=Jfe(i,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?ar(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return i}function ar(e,t){if(typeof e=="boolean")return e?oe.any():oe.never();let n=$2(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(l=>ar(l,t)),c=oe.union(a);n=i?oe.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(l=>ar(l,t)),c=oe.xor(a);n=i?oe.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=i?n:oe.any();else{let a=i?n:ar(e.allOf[0],t),c=i?0:1;for(let l=c;l0&&t.registry.add(n,r),e.description&&(n=n.describe(e.description)),n}function _2(e,t){if(typeof e=="boolean")return e?oe.any():oe.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=Vfe(n,t?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Dn};return ar(n,o)}var S2=Symbol("z.visit/resolving");function hg(e,t){let n=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},i=new Map;function r(s){let a=i.get(s);if(a===S2)return new qm({type:"lazy",getter:()=>i.get(s)});if(a!==void 0)return a;i.set(s,S2);let c=o(s),l=n(c,c!==s);return i.set(s,l),l}function o(s){let a=s._zod.def,c=a.type;switch(c){case"object":{let l=a.shape,u=Object.keys(l),d=!1,p={};for(let m of u){let g=r(l[m]);g!==l[m]&&(d=!0),p[m]=g}let f=a.catchall;return a.catchall&&(f=r(a.catchall),f!==a.catchall&&(d=!0)),d?ot(s,{...a,shape:p,catchall:f}):s}case"array":{let l=r(a.element);return l===a.element?s:ot(s,{...a,element:l})}case"tuple":{let l=a.items,u=!1,d=[];for(let f of l){let m=r(f);m!==f&&(u=!0),d.push(m)}let p=a.rest;return a.rest&&(p=r(a.rest),p!==a.rest&&(u=!0)),u?ot(s,{...a,items:d,rest:p}):s}case"record":case"map":{let l=r(a.keyType),u=r(a.valueType);return l===a.keyType&&u===a.valueType?s:ot(s,{...a,keyType:l,valueType:u})}case"set":{let l=r(a.valueType);return l===a.valueType?s:ot(s,{...a,valueType:l})}case"union":{let l=a.options,u=!1,d=[];for(let p of l){let f=r(p);f!==p&&(u=!0),d.push(f)}return u?ot(s,{...a,options:d}):s}case"intersection":{let l=r(a.left),u=r(a.right);return l===a.left&&u===a.right?s:ot(s,{...a,left:l,right:u})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=r(a.innerType);return l===a.innerType?s:ot(s,{...a,innerType:l})}case"pipe":{let l=r(a.in),u=r(a.out);return l===a.in&&u===a.out?s:ot(s,{...a,in:l,out:u})}case"function":{let l=r(a.input),u=r(a.output);return l===a.input&&u===a.output?s:ot(s,{...a,input:l,output:u})}case"lazy":{let l=a.getter,{_cachedInner:u,...d}=a;return ot(s,{...d,getter:()=>r(l())})}case"properties":{let l=a.shape,u=!1,d={};for(let p of Reflect.ownKeys(l)){let f=r(l[p]);f!==l[p]&&(u=!0),d[p]=f}return u?ot(s,{...a,shape:d}):s}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return r(e)}function x2(e){return hg(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:dd(n.options)}})}function Yfe(e,t){if(!t?.length)return e;let n=e._zod.def;return ot(e,Fi(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function E2(e){return Yfe(e.out,e.checks)}function Qfe(e){return e.in._zod.traits.has("$ZodTransform")?E2(e):e.in}function T2(e){return hg(e,{pipe:t=>Qfe(t._zod.def),default:(t,n)=>n?Rc(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function I2(e){return hg(e,{pipe:t=>E2(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var pC={};_r(pC,{bigint:()=>nme,boolean:()=>tme,date:()=>rme,number:()=>eme,string:()=>Xfe});function Xfe(e){return NA(sd,e)}function eme(e){return LA(cd,e)}function tme(e){return BA(ld,e)}function nme(e){return WA(ud,e)}function rme(e){return rR(sg,e)}var A2=U.enum(["npm","pypi","go","cargo","maven","rubygems","nuget","packagist","hex","pub","swift","cocoapods","opam","conan","vcpkg","arduino"]),ime=U.string().trim().min(1),ome=U.enum(["low","medium","high","xhigh"]);var fC=U.object({mode:U.enum(["auto","approve"]).default("approve"),maxAutoRisk:U.enum(["none","low","medium","high"]).default("medium"),watchBranches:U.array(U.string()).default(["main","master","develop"]),ecosystems:U.array(A2).default([...A2.options]),ignore:U.array(U.string()).default([]),alwaysApprove:U.array(U.string()).default([]),triggerOn:U.object({major:U.boolean().default(!0),minor:U.boolean().default(!0),patch:U.boolean().default(!1),transitive:U.boolean().default(!1),dev:U.boolean().default(!0)}).prefault({}),evidence:U.object({githubReleases:U.boolean().default(!0),changelog:U.boolean().default(!0),typeSurface:U.boolean().default(!0),openapi:U.boolean().default(!0),openapiSpecs:U.array(U.string()).default([]),protobuf:U.boolean().default(!0),protobufSpecs:U.array(U.string()).default([]),graphql:U.boolean().default(!0),graphqlSchemas:U.array(U.string()).default([]),maxReleases:U.number().int().min(1).max(100).default(25)}).prefault({}),rationale:U.object({security:U.boolean().default(!0),maintenance:U.boolean().default(!0),summary:U.boolean().default(!0)}).prefault({}),licenses:U.object({enabled:U.boolean().default(!1),allow:U.array(U.string()).default([]),deny:U.array(U.string()).default([]),requireDeclared:U.boolean().default(!1)}).prefault({}),guardrails:U.object({protectedPaths:U.array(U.string()).default([".github/workflows/**","**/*.lock","infra/**","terraform/**","**/secrets/**"]),maxFilesChanged:U.number().int().min(1).default(50),maxDependenciesPerRun:U.number().int().min(1).default(10),requireEvidence:U.boolean().default(!0),minConfidence:U.enum(["low","medium","high"]).default("medium"),experimentalDispatchBelowMinConfidence:U.boolean().default(!1),forbidTestWeakening:U.boolean().default(!0)}).prefault({}),remediation:U.object({commitGranularity:U.enum(["per-breaking-change","per-dependency","single"]).default("per-breaking-change"),branchPrefix:U.string().default("drift/"),draftPr:U.boolean().optional(),model:U.string().optional(),agent:U.object({provider:ime.default("auto"),model:U.string().optional(),effort:ome.optional(),fast:U.boolean().default(!1),timeoutSeconds:U.number().int().min(30).max(1440*60).default(1800)}).prefault({}),customInstructions:U.string().default(""),awaitCompletion:U.object({enabled:U.boolean().default(!1),timeoutMinutes:U.number().int().min(1).max(360).default(20),pollIntervalSeconds:U.number().int().min(5).max(300).default(30)}).prefault({}),communityRecipes:U.boolean().default(!1),fixPlans:U.object({enabled:U.boolean().default(!1),minCoverage:U.number().min(0).max(1).default(.5),autoApply:U.enum(["review","proven","verified"]).default("review"),cache:U.boolean().default(!0)}).prefault({})}).prefault({}),verification:U.object({behavioural:U.object({enabled:U.boolean().default(!1),sandbox:U.literal("required").default("required"),maxSymbols:U.number().int().min(1).max(100).default(10),maxCasesPerSymbol:U.number().int().min(1).max(100).default(20),timeoutSeconds:U.number().int().min(1).max(1800).default(120),network:U.boolean().default(!1),memoryMb:U.number().int().min(128).max(16384).default(1024),cpuLimit:U.number().min(.1).max(32).default(1),retainArtifacts:U.boolean().default(!1)}).prefault({})}).prefault({}),telemetry:U.object({enabled:U.boolean().default(!1),endpoint:U.string().url().optional(),installationId:U.string().optional(),rotationSalt:U.string().optional(),retentionDays:U.number().int().min(1).max(730).default(180)}).prefault({}),pullRequest:U.object({enabled:U.boolean().default(!0),confirm:U.enum(["ask","never"]).default("ask"),base:U.enum(["branched-from","default-branch"]).default("branched-from"),draft:U.boolean().optional(),labels:U.array(U.string()).default([]),reviewers:U.array(U.string()).default([]),branchTemplate:U.string().default("{prefix}upgrade-{summary}-{date}"),titleTemplate:U.string().default("chore(deps): upgrade {summary}"),coAuthor:U.boolean().default(!0)}).prefault({}),llm:U.object({enabled:U.boolean().default(!1),provider:U.enum(["anthropic"]).default("anthropic"),model:U.string().default("claude-opus-5"),effort:U.enum(["low","medium","high","xhigh","max"]).default("medium"),apiKeyEnv:U.string().default("ANTHROPIC_API_KEY")}).prefault({}),codeScanning:U.object({enabled:U.boolean().default(!0),includeInformational:U.boolean().default(!1),granularity:U.enum(["package","breakingChange","affectedSite"]).default("package"),createIssuesPerAlert:U.boolean().default(!1)}).prefault({}),issueCreation:U.object({default:U.enum(["issue","branch","both"]).default("issue"),granularity:U.enum(["package","change"]).default("package"),assignees:U.array(U.string()).default([])}).prefault({}),outdated:U.object({enabled:U.boolean().default(!1)}).prefault({}),check:U.object({enabled:U.boolean().default(!1)}).prefault({}),tools:U.object({autoInstall:U.boolean().default(!0)}).prefault({}),verify:U.object({enabled:U.boolean().default(!0),checks:U.array(U.enum(["typecheck","build","test"])).default(["typecheck","build","test"]),timeoutMs:U.number().int().positive().default(15*6e4),generatedSourceGlobs:U.array(U.string()).default([])}).prefault({})}),fd=fC.parse({});function R2(e){return e.pullRequest.draft??e.remediation.draftPr??!0}var ak={none:0,low:1,medium:2,high:3};function mC(e,t){return ak[e]<=ak[t]}function N2(e,t){return ak[e]-ak[t]}var sme=[".github/drift.yml",".github/drift.yaml","drift.yml","drift.yaml"];function ame(e,t=null){let n=[];if(!e.trim())return{config:fd,path:t,problems:n};let i;try{i=(0,C2.parse)(e)}catch(c){return n.push(`Could not parse ${t??"config"} as YAML: ${c.message}`),{config:fd,path:t,problems:n}}if(i==null)return{config:fd,path:t,problems:n};let r=lme(i),o=cme(i),s=fC.safeParse(i);if(!s.success){for(let c of s.error.issues){let l=c.path.length?c.path.join("."):"(root)";n.push(`${l}: ${c.message}`)}return n.push("Falling back to Drift defaults (mode: approve)."),{config:fd,path:t,problems:n}}let a=s.data;return r&&!o&&(a.remediation.agent={...a.remediation.agent,provider:"copilot-cloud",model:r},n.push("`remediation.model` is deprecated and now treated as `remediation.agent.model` for `copilot-cloud`. Use `remediation.agent` for new configuration.")),{config:a,path:t,problems:n}}function cme(e){if(!ck(e))return!1;let t=e.remediation;return ck(t)&&t.agent!==void 0}function lme(e){if(!ck(e))return null;let t=e.remediation;return ck(t)&&typeof t.model=="string"&&t.model.trim()?t.model:null}function ck(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}async function lk(e){for(let t of sme){let n;try{n=await e(t)}catch{continue}if(n!==null)return ame(n,t)}return{config:fd,path:null,problems:[]}}var $4=require("node:zlib");function Ys(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}function uk(e,t,n,i){if(typeof n!="function")throw new Error("method for before hook must be a function");return i||(i={}),Array.isArray(t)?t.reverse().reduce((r,o)=>uk.bind(null,e,o,r,i),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((r,o)=>o.hook.bind(null,r,i),n)():n(i))}function P2(e,t,n,i){let r=i;e.registry[n]||(e.registry[n]=[]),t==="before"&&(i=(o,s)=>Promise.resolve().then(r.bind(null,s)).then(o.bind(null,s))),t==="after"&&(i=(o,s)=>{let a;return Promise.resolve().then(o.bind(null,s)).then(c=>(a=c,r(a,s))).then(()=>a)}),t==="error"&&(i=(o,s)=>Promise.resolve().then(o.bind(null,s)).catch(a=>r(a,s))),e.registry[n].push({hook:i,orig:r})}function D2(e,t,n){if(!e.registry[t])return;let i=e.registry[t].map(r=>r.orig).indexOf(n);i!==-1&&e.registry[t].splice(i,1)}var O2=Function.bind,M2=O2.bind(O2);function L2(e,t,n){let i=M2(D2,null).apply(null,n?[t,n]:[t]);e.api={remove:i},e.remove=i,["before","error","after","wrap"].forEach(r=>{let o=n?[t,r,n]:[t,r];e[r]=e.api[r]=M2(P2,null).apply(null,o)})}function ume(){let e=Symbol("Singular"),t={registry:{}},n=uk.bind(null,t,e);return L2(n,t,e),n}function dme(){let e={registry:{}},t=uk.bind(null,e);return L2(t,e),t}var F2={Singular:ume,Collection:dme};var pme="0.0.0-development",fme=`octokit-endpoint.js/${pme} ${Ys()}`,mme={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":fme},mediaType:{format:""}};function gme(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function hme(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function z2(e,t){let n=Object.assign({},e);return Object.keys(t).forEach(i=>{hme(t[i])?i in e?n[i]=z2(e[i],t[i]):Object.assign(n,{[i]:t[i]}):Object.assign(n,{[i]:t[i]})}),n}function U2(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function hC(e,t,n){if(typeof t=="string"){let[r,o]=t.split(" ");n=Object.assign(o?{method:r,url:o}:{url:r},n)}else n=Object.assign({},t);n.headers=gme(n.headers),U2(n),U2(n.headers);let i=z2(e||{},n);return n.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(i.mediaType.previews=e.mediaType.previews.filter(r=>!i.mediaType.previews.includes(r)).concat(i.mediaType.previews)),i.mediaType.previews=(i.mediaType.previews||[]).map(r=>r.replace(/-preview/,""))),i}function yme(e,t){let n=/\?/.test(e)?"&":"?",i=Object.keys(t);return i.length===0?e:e+n+i.map(r=>r==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${r}=${encodeURIComponent(t[r])}`).join("&")}var bme=/\{[^{}}]+\}/g;function vme(e){return e.replace(/(?:^\W+)|(?:(?n.concat(i),[]):[]}function j2(e,t){let n={__proto__:null};for(let i of Object.keys(e))t.indexOf(i)===-1&&(n[i]=e[i]);return n}function G2(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function gd(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function yg(e,t,n){return t=e==="+"||e==="#"?G2(t):gd(t),n?gd(n)+"="+t:t}function md(e){return e!=null}function gC(e){return e===";"||e==="&"||e==="?"}function kme(e,t,n,i){var r=e[n],o=[];if(md(r)&&r!=="")if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"||typeof r=="boolean")r=r.toString(),i&&i!=="*"&&(r=r.substring(0,parseInt(i,10))),o.push(yg(t,r,gC(t)?n:""));else if(i==="*")Array.isArray(r)?r.filter(md).forEach(function(s){o.push(yg(t,s,gC(t)?n:""))}):Object.keys(r).forEach(function(s){md(r[s])&&o.push(yg(t,r[s],s))});else{let s=[];Array.isArray(r)?r.filter(md).forEach(function(a){s.push(yg(t,a))}):Object.keys(r).forEach(function(a){md(r[a])&&(s.push(gd(a)),s.push(yg(t,r[a].toString())))}),gC(t)?o.push(gd(n)+"="+s.join(",")):s.length!==0&&o.push(s.join(","))}else t===";"?md(r)&&o.push(gd(n)):r===""&&(t==="&"||t==="?")?o.push(gd(n)+"="):r===""&&o.push("");return o}function $me(e){return{expand:_me.bind(null,e)}}function _me(e,t){var n=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(i,r,o){if(r){let a="",c=[];if(n.indexOf(r.charAt(0))!==-1&&(a=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach(function(l){var u=/([^:\*]*)(?::(\d+)|(\*))?/.exec(l);c.push(kme(t,a,u[1],u[2]||u[3]))}),a&&a!=="+"){var s=",";return a==="?"?s="&":a!=="#"&&(s=a),(c.length!==0?a:"")+c.join(s)}else return c.join(",")}else return G2(o)}),e==="/"?e:e.replace(/\/$/,"")}function V2(e){let t=e.method.toUpperCase(),n=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),i=Object.assign({},e.headers),r,o=j2(e,["method","baseUrl","url","headers","request","mediaType"]),s=wme(n);n=$me(n).expand(o),/^http/.test(n)||(n=e.baseUrl+n);let a=Object.keys(e).filter(u=>s.includes(u)).concat("baseUrl"),c=j2(o,a);if(!/application\/octet-stream/i.test(i.accept)&&(e.mediaType.format&&(i.accept=i.accept.split(/,/).map(u=>u.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&e.mediaType.previews?.length)){let u=i.accept.match(/(?{let p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${d}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?n=yme(n,c):"data"in c?r=c.data:Object.keys(c).length&&(r=c),!i["content-type"]&&typeof r<"u"&&(i["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof r>"u"&&(r=""),Object.assign({method:t,url:n,headers:i},typeof r<"u"?{body:r}:null,e.request?{request:e.request}:null)}function Sme(e,t,n){return V2(hC(e,t,n))}function B2(e,t){let n=hC(e,t),i=Sme.bind(null,n);return Object.assign(i,{DEFAULTS:n,defaults:B2.bind(null,n),merge:hC.bind(null,n),parse:V2})}var q2=B2(null,mme);var H2=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function K2(e,t){let n=t?.comma===!0?Tme:65536,i=e.length,r=bC(e,t?.start??0,i),o=r;r=yC(e,r,i,n);let s=vC(e,o,r),a=e.slice(o,s).toLowerCase();return t?.parameters===!1?{type:a,index:r,parameters:new H2}:Ime(e,a,r,i,n)}var J2=32,Z2=9,Y2=59,xme=61,W2=34,Eme=92,Tme=44;function Ime(e,t,n,i,r){let o=new H2;e:for(;nt;){let i=e.charCodeAt(n-1);if(i!==J2&&i!==Z2)break;n--}return n}var Ame=/^-?\d+$/,pk=/^-?\d+n+$/,Qs=JSON.stringify,wC=JSON.parse,n4=/^-?\d+n$/,Q2=/([\[:])?"(-?\d+)n"($|\s*[,\}\]])/g,X2=/([\[:])?("-?\d+n+)n("$|"\s*[,\}\]])/g,kC=e=>e===void 0||typeof e=="function"||typeof e=="symbol",$C=e=>e!==null&&typeof e=="object"&&e.constructor&&e.constructor.name==="RawJSON",Rme=(e,t,n)=>{let i="";typeof n=="number"?i=" ".repeat(Math.min(10,Math.max(0,Math.floor(n)))):typeof n=="string"&&(i=n.slice(0,10));let r=typeof t=="function",o=Array.isArray(t)?new Set(t.map(String)):null,s=(m,g,h)=>(h!==null&&typeof h=="object"&&typeof h.toJSON=="function"&&(h=h.toJSON(g)),typeof h=="string"&&pk.test(h)?h+"n":typeof h=="bigint"?"rawJSON"in JSON?JSON.rawJSON(h.toString()):h.toString()+"n":(r&&(h=t.call(m,g,h)),h!==null&&typeof h=="object"&&(h instanceof Number||h instanceof String||h instanceof Boolean)&&(h=h.valueOf()),h)),a=s({"":e},"",e);if(kC(a))return;let c=a===null||typeof a!="object",l=$C(a);if(c||l)return Qs(a);let u=[],d=0,p=[{parent:{"":a},key:"",val:a,isArray:Array.isArray(a),keys:Array.isArray(a)?null:Object.keys(a),index:0,first:!0}],f=new WeakSet([a]);for(;p.length>0;){let m=p[p.length-1];m.index===0&&(u.push(m.isArray?"[":"{"),d++);let g=!1;if(m.isArray)if(m.index=m.keys.length&&p[p.length-1]===m&&(g=!0)}g&&(d--,!m.first&&i&&u.push(` -`+i.repeat(d)),u.push(m.isArray?"]":"}"),f.delete(m.val),p.pop())}return u.join("")},r4=(e,t,n)=>{try{return"rawJSON"in JSON?Qs(e,(a,c)=>typeof c=="bigint"?JSON.rawJSON(c.toString()):typeof t=="function"?t(a,c):(Array.isArray(t)&&t.includes(a),c),n):e?Qs(e,(a,c)=>typeof c=="string"&&pk.test(c)||typeof c=="bigint"?c.toString()+"n":typeof t=="function"?t(a,c):(Array.isArray(t)&&t.includes(a),c),n).replace(Q2,"$1$2$3").replace(X2,"$1$2$3"):Qs(e,t,n)}catch(i){if(i instanceof RangeError){let r=Rme(e,t,n);return r===void 0?void 0:"rawJSON"in JSON?r:r.replace(Q2,"$1$2$3").replace(X2,"$1$2$3")}throw i}},dk=new Map,Nme=()=>{let e=JSON.parse.toString();if(dk.has(e))return dk.get(e);try{let t=JSON.parse("1",(n,i,r)=>!!r?.source&&r.source==="1");return dk.set(e,t),t}catch{return dk.set(e,!1),!1}},Cme=(e,t,n,i)=>typeof t=="string"&&n4.test(t)?BigInt(t.slice(0,-1)):typeof t=="string"&&pk.test(t)?t.slice(0,-1):typeof i=="function"?i(e,t,n):t,Pme=(e,t)=>JSON.parse(e,(n,i,r)=>{let o=typeof i=="number",s=i>Number.MAX_SAFE_INTEGER||i{let n={"":e},i=[{parent:n,key:"",visited:!1}];for(;i.length>0;){let r=i[i.length-1];if(r.visited){let{parent:o,key:s}=r,a=o[s];typeof a=="string"&&(n4.test(a)?a=BigInt(a.slice(0,-1)):pk.test(a)&&(a=a.slice(0,-1))),typeof t=="function"&&(a=t.call(o,s,a)),a===void 0?delete o[s]:o[s]=a,i.pop()}else{r.visited=!0;let o=r.parent[r.key];if(o!==null&&typeof o=="object"){let a=Object.keys(o);for(let c=a.length-1;c>=0;c--)i.push({parent:o,key:a[c],visited:!1})}}}return n[""]},t4=e=>e.replace(Dme,(t,n,i,r)=>{let o=t[0]==='"';if(o&&Ome.test(t))return t.substring(0,t.length-1)+'n"';let a=i||r,c=n&&(n.length{if(!e)return wC(e,t);try{if(Nme())return Pme(e,t);let n=t4(e);return wC(n,(i,r,o)=>Cme(i,r,o,t))}catch(n){if(n instanceof RangeError){let i=t4(e),r=wC(i);return Mme(r,t)}throw n}};var Cc=class extends Error{name;status;request;response;constructor(t,n,i){super(t,{cause:i.cause}),this.name="HttpError",this.status=Number.parseInt(n),Number.isNaN(this.status)&&(this.status=0);"response"in i&&(this.response=i.response);let r=Object.assign({},i.request);i.request.headers.authorization&&(r.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/(?"";async function a4(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let n=e.request?.log||console,i=e.request?.parseSuccessResponseBody!==!1,r=Ume(e.body)||Array.isArray(e.body)?r4(e.body):e.body,o=Object.fromEntries(Object.entries(e.headers).map(([d,p])=>[d,String(p)])),s;try{s=await t(e.url,{method:e.method,body:r,redirect:e.request?.redirect,headers:o,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(d){let p="Unknown Error";if(d instanceof Error){if(d.name==="AbortError")throw d.status=500,d;p=d.message,d.name==="TypeError"&&"cause"in d&&(d.cause instanceof Error?p=d.cause.message:typeof d.cause=="string"&&(p=d.cause))}let f=new Cc(p,500,{request:e});throw f.cause=d,f}let a=s.status,c=s.url,l={};for(let[d,p]of s.headers)l[d]=p;let u={url:c,status:a,headers:l,data:""};if("deprecation"in l){let d=l.link&&l.link.match(/<([^<>]+)>; rel="deprecation"/),p=d&&d.pop();n.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${l.sunset}${p?`. See ${p}`:""}`)}if(a===204||a===205)return u;if(e.method==="HEAD"){if(a<400)return u;throw new Cc(s.statusText,a,{response:u,request:e})}if(a===304)throw u.data=await _C(s),new Cc("Not modified",a,{response:u,request:e});if(a>=400)throw u.data=await _C(s),new Cc(zme(u.data),a,{response:u,request:e});return u.data=i?await _C(s):s.body,u}async function _C(e){let t=e.headers.get("content-type");if(!t)return e.text().catch(s4);let n=K2(t);if(jme(n)){let i="";try{return i=await e.text(),o4(i)}catch{return i}}else return n.type.startsWith("text/")||n.parameters.charset?.toLowerCase()==="utf-8"&&n.type!=="application/octet-stream"?e.text().catch(s4):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function jme(e){return e.type==="application/json"||e.type==="application/scim+json"}function zme(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if(typeof e=="object"&&e!==null&&"message"in e){let t=e,n="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(i=>JSON.stringify(i)).join(", ")}${n}`:`${t.message}${n}`}return`Unknown error: ${JSON.stringify(e)}`}function SC(e,t){let n=e.defaults(t);return Object.assign(function(r,o){let s=n.merge(r,o);if(!s.request||!s.request.hook)return a4(n.parse(s));let a=(c,l)=>a4(n.parse(n.merge(c,l)));return Object.assign(a,{endpoint:n,defaults:SC.bind(null,n)}),s.request.hook(a,s)},{endpoint:n,defaults:SC.bind(null,n)})}var bg=SC(q2,Fme);var Gme="0.0.0-development";function Vme(e){return`Request failed due to following response errors: +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){o(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}a.count>1&&e.reused==="ref"&&o(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function lW(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let r of t){if(!r||typeof r!="object")return;lW(r);let i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;let o=r.type;for(let s of Array.isArray(o)?o:[o]){if(typeof s!="string")return;n.includes(s)||n.push(s)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var uW=new Set(["type","properties","required","additionalProperties"]),aW=["oneOf","anyOf"];function cW(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function oN(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let s in o)if(!uW.has(s))return null;t.push(o)}let n={},r=new Set;for(let o of t){for(let s in o.properties){if(Object.prototype.hasOwnProperty.call(n,s))continue;let a=[];for(let l of t){let u=l.properties?.[s]??cW(l);u!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(u))||a.push(u))}let c=a.length===1?a[0]:oN(a)??{allOf:a};An(n,s,c)}for(let s of o.required??[])r.add(s)}let i={type:"object",properties:n};if(r.size&&(i.required=[...r]),t.every(o=>o.additionalProperties===!1))i.additionalProperties=!1;else{let o=[];for(let s of t){let a=cW(s);a&&!o.some(c=>JSON.stringify(c)===JSON.stringify(a))&&o.push(a)}o.length===1?i.additionalProperties=o[0]:o.length>1&&(i.additionalProperties={allOf:o})}return i}function e_e(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let i of uW)if(i in e)return;let n=t.filter(i=>aW.some(o=>Array.isArray(i[o]))),r=null;if(!n.length)r=oN(t);else{let i=n[0],o=aW.find(c=>Array.isArray(i[c]));if(Object.keys(i).length!==1)return;let s=t.filter(c=>c!==i),a=i[o].map(c=>oN([...s,c]));if(a.some(c=>!c))return;r={[o]:a}}r&&(delete e.allOf,uh(e,r))}function ba(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=a=>{let c=e.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){r(d);let f=e.seen.get(d),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):uh(l,m),uh(l,u),a._zod.parent===d)for(let h in l)h==="$ref"||h==="allOf"||h in u||delete l[h];if(m.$ref&&f.def)for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}let p=a._zod.parent;if(p&&p!==d){r(p);let f=e.seen.get(p);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let m in l)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(l[m])===JSON.stringify(f.def[m])&&delete l[m]}e.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())r(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())lW(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let l of[c.schema,c.def]){let u=l?.allOf;if(!Array.isArray(u))continue;let d=a.get(u);d?d.push(l):a.set(u,[l])}for(let c of e.intersections)for(let l of a.get(c)??[])e_e(l)}}let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(a)}uh(i,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&i.id===o&&delete i.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,An(s,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Sd(t,"input",e.processors),output:Sd(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function In(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return In(r.element,n);if(r.type==="set")return In(r.valueType,n);if(r.type==="lazy")return In(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return In(r.innerType,n);if(r.type==="intersection")return In(r.left,n)||In(r.right,n);if(r.type==="record"||r.type==="map")return In(r.keyType,n)||In(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:In(r.in,n)||In(r.out,n);if(r.type==="object"){for(let i in r.shape)if(In(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(let i of r.options)if(In(i,n))return!0;return!1}if(r.type==="tuple"){for(let i of r.items)if(In(i,n))return!0;return!!(r.rest&&In(r.rest,n))}return!1}var sN=(e,t={})=>n=>{let r=ha({...n,processors:t});return lt(e,r),ya(r,e),ba(r,e)},Sd=(e,t,n={})=>r=>{let{libraryOptions:i,target:o}=r??{},s=ha({...i??{},target:o,io:t,processors:n});return lt(e,s),ya(s,e),ba(s,e)};var xd=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Ed=(e,t,n)=>{(e[t]===void 0||n{xd(e,"minimum",t),Ed(e,"maximum",t)},gW=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},hW=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},yW=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},bW=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},pW=(e,t)=>xd(e,"minimum",t.minimum),fW=(e,t)=>Ed(e,"maximum",t.maximum),mW=e=>(t,n)=>{bW(t,n.format);let[r,i]=e[n.format];xd(t,"minimum",r),Ed(t,"maximum",i)},t_e={greater_than:(e,t)=>xd(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Ed(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>gW(e,t.value),number_format:mW(Mg),bigint_format:mW(Lg),min_length:pW,max_length:fW,length_equals:(e,t)=>dW(e,t.length),min_size:pW,max_size:fW,size_equals:(e,t)=>dW(e,t.size),string_format:(e,t)=>{bW(e,t.format),t.pattern&&hW(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>yW(e,t.mime)};function wn(e){let t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let o of r)t_e[o._zod.def.check]?.(t,o._zod.def);let i=e._zod.bag;i.minimum!==void 0&&xd(t,"minimum",i.minimum),i.exclusiveMinimum!==void 0&&xd(t,"exclusiveMinimum",i.exclusiveMinimum),i.maximum!==void 0&&Ed(t,"maximum",i.maximum),i.exclusiveMaximum!==void 0&&Ed(t,"exclusiveMaximum",i.exclusiveMaximum),i.multipleOf!==void 0&&gW(t,i.multipleOf),i.format!==void 0&&(t.format??(t.format=i.format),i.format.includes("int")&&(t.isInt=!0)),i.mime&&yW(t,i.mime);for(let o of i.patterns??[])hW(t,o);return t}var n_e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},r_e=new Map([[fw,h0],[Jg,y0]]),vW=e=>r_e.get(e)??e,lN=(e,t,n,r)=>{let i=n;i.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l,laxFormat:u}=wn(e);if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=n_e[a]??a,i.format===""&&delete i.format,(a==="time"||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let d=[...c].map(vW);d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},uN=(e,t,n,r)=>{let i=n,{minimum:o,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=wn(e);i.type=u?"integer":"number";let d=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";if(d?f?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof o=="number"&&(i.minimum=o),p?f?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof s=="number"&&(i.maximum=s),a){let m=new Set;for(let v of a)Number.isFinite(v)&&v!==0?m.add(Math.abs(v)):en(e,t,i,r,`A multipleOf divisor of ${v} cannot be represented in JSON Schema`);let[g,...h]=m;g!==void 0&&(i.multipleOf=g),h.length&&(i.allOf=[...i.allOf??[],...h.map(v=>({multipleOf:v}))])}},dN=(e,t,n,r)=>{n.type="boolean"},pN=(e,t,n,r)=>{en(e,t,n,r,"BigInt cannot be represented in JSON Schema")},fN=(e,t,n,r)=>{en(e,t,n,r,"Symbols cannot be represented in JSON Schema")},mN=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},gN=(e,t,n,r)=>{en(e,t,n,r,"Undefined cannot be represented in JSON Schema")},hN=(e,t,n,r)=>{en(e,t,n,r,"Void cannot be represented in JSON Schema")},yN=(e,t,n,r)=>{n.not={}},bN=(e,t,n,r)=>{},vN=(e,t,n,r)=>{},_N=(e,t,n,r)=>{en(e,t,n,r,"Date cannot be represented in JSON Schema")},wN=(e,t,n,r)=>{let i=e._zod.def,o=Yu(i.entries);if(o.length===0){n.not={};return}o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},kN=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let o=[];for(let s of i.values)if(s===void 0){if(en(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(en(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},$N=(e,t,n,r)=>{en(e,t,n,r,"NaN cannot be represented in JSON Schema")},SN=(e,t,n,r)=>{let i=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},xN=(e,t,n,r)=>{let i=n;i.type="string",i.format="binary",i.contentEncoding="binary";let{minimum:o,maximum:s,mime:a}=wn(e);o!==void 0&&(i.minLength=o),s!==void 0&&(i.maxLength=s),a&&(a.length===0?i.not={}:a.length===1?i.contentMediaType=a[0]:i.anyOf=a.map(c=>({contentMediaType:c})))},EN=(e,t,n,r)=>{n.type="boolean"},TN=(e,t,n,r)=>{en(e,t,n,r,"Custom types cannot be represented in JSON Schema")},AN=(e,t,n,r)=>{en(e,t,n,r,"Function types cannot be represented in JSON Schema")},IN=(e,t,n,r)=>{en(e,t,n,r,"Transforms cannot be represented in JSON Schema")},RN=(e,t,n,r)=>{en(e,t,n,r,"Map cannot be represented in JSON Schema")},PN=(e,t,n,r)=>{en(e,t,n,r,"Set cannot be represented in JSON Schema")},CN=(e,t,n,r)=>{let i=n,o=e._zod.def,{minimum:s,maximum:a}=wn(e);typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=lt(o.element,t,{...r,path:[...r.path,"items"]})};function Td(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Td(t.out):t.type==="catch"?Td(t.innerType):e._zod.optin}var NN=(e,t,n,r)=>{let i=n,o=e._zod.def,s=o.shape;if(Object.getOwnPropertySymbols(s).length&&en(e,t,i,r,"Symbol keys cannot be represented in JSON Schema"))return;i.type="object",i.properties={};for(let u in s)An(i.properties,u,lt(s[u],t,{...r,path:[...r.path,"properties",u]}));let c=new Set(Object.keys(s)),l=new Set([...c].filter(u=>{let d=o.shape[u];return t.io==="input"?Td(d)===void 0:d._zod.optout===void 0}));l.size>0&&(i.required=Array.from(l)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=lt(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},i_e=(e,t,n,r)=>{let i=n,o=e._zod.def;if(Object.getOwnPropertySymbols(o.shape).length&&en(e,t,i,r,"Symbol keys cannot be represented in JSON Schema"))return;if(t.io==="output"){for(let a in o.shape)if(In(o.shape[a])&&en(e,t,i,r,`z.properties() returns its input, so the output of a transforming schema at key "${a}" cannot be represented in JSON Schema`))return}i.type="object",i.properties={};for(let a in o.shape)An(i.properties,a,lt(o.shape[a],t,{...r,path:[...r.path,"properties",a]}));let s=Object.keys(o.shape).filter(a=>Td(o.shape[a])===void 0);s.length>0&&(i.required=s)},lk=(e,t,n,r)=>{let i=e._zod.def,o=i.inclusive===!1,s=i.options.map((a,c)=>lt(a,t,{...r,path:[...r.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=s:n.anyOf=s},ON=(e,t,n,r)=>{let i=e._zod.def,o=lt(i.left,t,{...r,path:[...r.path,"allOf",0]}),s=lt(i.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=c,t.intersections.push(c)},DN=(e,t,n,r)=>{let i=n,o=e._zod.def;i.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((g,h)=>lt(g,t,{...r,path:[...r.path,s,h]})),l=o.rest?lt(o.rest,t,{...r,path:[...r.path,a,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,u=o.items.length;for(;u>0;){let g=o.items[u-1];if(!(t.io==="input"?Td(g)!==void 0:g._zod.optout==="optional"))break;u--}let d=o.items.length,p=!o.rest;t.target==="draft-2020-12"?(i.prefixItems=c,p?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),p&&(i.maxItems=d)):t.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),p&&(i.maxItems=d)):(i.items=c,p?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),p&&(i.maxItems=d));let{minimum:f,maximum:m}=wn(e);typeof f=="number"&&(i.minItems=f),typeof m=="number"&&(i.maxItems=m)};function aN(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let m=e.get(t)?.def;if(!m)return t;let g=aN(e,m,n);return g===m?t:g}for(let m of["anyOf","oneOf"]){let g=t[m];if(!Array.isArray(g))continue;let h=g.map(v=>aN(e,v,n));h.some((v,b)=>v!==g[b])&&(t={...t,[m]:h})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes("string")&&r.some(m=>m==="number"||m==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!i&&!o?.some(m=>typeof m=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:p,...f}=t;return f.enum?f.enum=f.enum.map(m=>typeof m=="number"?String(m):m):typeof f.const=="number"&&(f.const=String(f.const)),i&&(f.type="string",o||(f.pattern=(r.includes("number")?hs:Vg).source)),f}var cN=new WeakMap;function o_e(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let n=new Map;for(let r of cN.get(e)??[]){let i=e.seen.get(r),o=(i?.def??i?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let s=aN(t,o,new Set);s!==o&&n.set(o,s)}if(n.size)for(let r of e.seen.values())for(let i of[r.schema,r.def]){let o=i&&n.get(i.propertyNames);o&&(i.propertyNames=o)}}var MN=(e,t,n,r)=>{let i=n,o=e._zod.def;i.type="object";let s=o.keyType,a=wn(s).patterns;if(o.mode==="loose"&&a&&a.size>0){let u=lt(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(let d of a)An(i.patternProperties,vW(d).source,u)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){i.propertyNames=lt(o.keyType,t,{...r,path:[...r.path,"propertyNames"]});let u=cN.get(t);u||(u=[],cN.set(t,u),t.deferred.push(()=>o_e(t))),u.push(e)}i.additionalProperties=lt(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let c=s._zod.values,l=t.io==="input"&&Td(o.valueType)!==void 0;if(c&&!o.partial&&!l){let u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(i.required=u.map(String))}},LN=(e,t,n,r)=>{let i=e._zod.def,o=lt(i.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},FN=(e,t,n,r)=>{let i=e._zod.def;lt(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType},UN=Symbol();function _W(e,t,n,r,i){let o=!1,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(en(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),UN):JSON.parse(s)}var jN=(e,t,n,r)=>{let i=e._zod.def;lt(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType;let s=_W(i.defaultValue,e,t,n,r);s!==UN&&(n.default=s)},zN=(e,t,n,r)=>{let i=e._zod.def;lt(i.innerType,t,r);let o=t.seen.get(e);if(o.ref=i.innerType,t.io!=="input")return;let s=_W(i.defaultValue,e,t,n,r);s!==UN&&(n._prefault=s)},GN=(e,t,n,r)=>{let i=e._zod.def;lt(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{en(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=s},BN=(e,t,n,r)=>{let i=e._zod.def,o=i.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?o?i.out:i.in:i.out;lt(s,t,r);let a=t.seen.get(e);a.ref=s},VN=(e,t,n,r)=>{let i=e._zod.def;lt(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType,n.readOnly=!0},qN=(e,t,n,r)=>{let i=e._zod.def;lt(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType},uk=(e,t,n,r)=>{let i=e._zod.def;lt(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType},WN=(e,t,n,r)=>{let i=e._zod.innerType;lt(i,t,r);let o=t.seen.get(e);o.ref=i},ck={string:lN,number:uN,boolean:dN,bigint:pN,symbol:fN,null:mN,undefined:gN,void:hN,never:yN,any:bN,unknown:vN,date:_N,enum:wN,literal:kN,nan:$N,template_literal:SN,file:xN,success:EN,custom:TN,properties:i_e,function:AN,transform:IN,map:RN,set:PN,array:CN,object:NN,union:lk,intersection:ON,tuple:DN,record:MN,nullable:LN,nonoptional:FN,default:jN,prefault:zN,catch:GN,pipe:BN,readonly:VN,promise:qN,optional:uk,lazy:WN};function dk(e,t){if("_idmap"in e){let r=e,i=ha({...t,processors:ck}),o={};for(let c of r._idmap.entries()){let[l,u]=c;lt(u,i)}let s={},a={registry:r,uri:t?.uri,defs:o};i.external=a;for(let c of r._idmap.entries()){let[l,u]=c;ya(i,u),An(s,l,ba(i,u))}if(Object.keys(o).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let n=ha({...t,processors:ck});return lt(e,n),ya(n,e),ba(n,e)}var pk=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=ha({processors:ck,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return lt(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,ya(this.ctx,t);let r=ba(this.ctx,t),{"~standard":i,...o}=r;return o}};var wW={};var Md={};Cr(Md,{ZodAny:()=>mO,ZodArray:()=>bO,ZodBase64:()=>Pk,ZodBase64URL:()=>Ck,ZodBigInt:()=>Od,ZodBigIntFormat:()=>Dk,ZodBoolean:()=>Nd,ZodCIDRv4:()=>Ik,ZodCIDRv6:()=>Rk,ZodCUID:()=>kk,ZodCUID2:()=>$k,ZodCatch:()=>UO,ZodCodec:()=>_h,ZodCreditCard:()=>sO,ZodCustom:()=>wh,ZodCustomStringFormat:()=>Pd,ZodDate:()=>mh,ZodDefault:()=>NO,ZodDiscriminatedUnion:()=>_O,ZodE164:()=>Nk,ZodEmail:()=>bk,ZodEmoji:()=>_k,ZodEnum:()=>Id,ZodExactOptional:()=>Uk,ZodFile:()=>IO,ZodFunction:()=>JO,ZodGUID:()=>vk,ZodIBAN:()=>aO,ZodIPv4:()=>Tk,ZodIPv6:()=>Ak,ZodISODate:()=>wa,ZodISODateTime:()=>_a,ZodISODuration:()=>$a,ZodISOTime:()=>ka,ZodInstanceOf:()=>eD,ZodIntersection:()=>wO,ZodJWT:()=>Ok,ZodKSUID:()=>Ek,ZodLazy:()=>WO,ZodLiteral:()=>AO,ZodMAC:()=>oO,ZodMap:()=>EO,ZodNaN:()=>zO,ZodNanoID:()=>wk,ZodNever:()=>hO,ZodNonOptional:()=>jk,ZodNull:()=>pO,ZodNullable:()=>CO,ZodNumber:()=>Cd,ZodNumberFormat:()=>Xc,ZodObject:()=>hh,ZodOptional:()=>bh,ZodPipe:()=>vh,ZodPrefault:()=>DO,ZodPreprocess:()=>GO,ZodPromise:()=>KO,ZodProperties:()=>ZO,ZodReadonly:()=>BO,ZodRecord:()=>Ad,ZodSet:()=>TO,ZodString:()=>Rd,ZodStringFormat:()=>vt,ZodSuccess:()=>FO,ZodSymbol:()=>uO,ZodTemplateLiteral:()=>qO,ZodTransform:()=>RO,ZodTuple:()=>$O,ZodType:()=>ze,ZodULID:()=>Sk,ZodURL:()=>fh,ZodUUID:()=>Io,ZodUndefined:()=>dO,ZodUnion:()=>yh,ZodUnknown:()=>gO,ZodVoid:()=>yO,ZodXID:()=>xk,ZodXor:()=>vO,_ZodString:()=>yk,_default:()=>OO,_function:()=>CH,any:()=>lH,array:()=>gh,base64:()=>VW,base64url:()=>qW,bigint:()=>iH,boolean:()=>lO,catch:()=>jO,check:()=>NH,cidrv4:()=>GW,cidrv6:()=>BW,codec:()=>AH,creditCard:()=>HW,cuid:()=>OW,cuid2:()=>DW,custom:()=>OH,date:()=>dH,describe:()=>DH,discriminatedUnion:()=>yH,e164:()=>WW,email:()=>SW,emoji:()=>CW,enum:()=>Lk,exactOptional:()=>PO,file:()=>SH,float32:()=>eH,float64:()=>tH,function:()=>CH,guid:()=>xW,hash:()=>XW,hex:()=>QW,hostname:()=>YW,httpUrl:()=>PW,iban:()=>KW,instanceof:()=>LH,int:()=>gk,int32:()=>nH,int64:()=>oH,intersection:()=>kO,invertCodec:()=>IH,ipv4:()=>UW,ipv6:()=>zW,json:()=>UH,jwt:()=>JW,keyof:()=>pH,ksuid:()=>FW,lazy:()=>HO,literal:()=>$H,looseObject:()=>gH,looseRecord:()=>vH,mac:()=>jW,map:()=>_H,meta:()=>MH,nan:()=>TH,nanoid:()=>NW,nativeEnum:()=>kH,never:()=>Mk,nonoptional:()=>LO,null:()=>fO,nullable:()=>ph,nullish:()=>xH,number:()=>cO,object:()=>fH,optional:()=>Qc,partialRecord:()=>bH,pipe:()=>hk,prefault:()=>MO,preprocess:()=>jH,promise:()=>PH,properties:()=>YO,readonly:()=>VO,record:()=>xO,refine:()=>QO,set:()=>wH,strictObject:()=>mH,string:()=>dh,stringFormat:()=>ZW,stringbool:()=>FH,success:()=>EH,superRefine:()=>XO,symbol:()=>aH,templateLiteral:()=>RH,transform:()=>Fk,tuple:()=>SO,uint32:()=>rH,uint64:()=>sH,ulid:()=>MW,undefined:()=>cH,union:()=>Dd,unknown:()=>Yc,url:()=>RW,uuid:()=>EW,uuidv4:()=>TW,uuidv6:()=>AW,uuidv7:()=>IW,void:()=>uH,xid:()=>LW,xor:()=>hH});var fk={};Cr(fk,{endsWith:()=>hd,gt:()=>To,gte:()=>ti,includes:()=>md,length:()=>Zc,lowercase:()=>pd,lt:()=>Eo,lte:()=>ei,maxLength:()=>Jc,maxSize:()=>ga,mime:()=>yd,minLength:()=>ys,minSize:()=>Ao,multipleOf:()=>ma,negative:()=>ik,nonnegative:()=>sk,nonpositive:()=>ok,normalize:()=>bd,overwrite:()=>no,positive:()=>rk,property:()=>ak,regex:()=>dd,size:()=>Kc,slugify:()=>kd,startsWith:()=>gd,toLowerCase:()=>_d,toUpperCase:()=>wd,trim:()=>vd,uppercase:()=>fd});var kW=new WeakSet([Object.prototype,Error.prototype]);function mk(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}var $W=(e,t)=>{ZR.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);kW.has(n)||(kW.add(n),mk(n,"format",r=>i=>zg(r,i)),mk(n,"flatten",r=>i=>jg(r,i)),mk(n,"addIssue",r=>i=>{r.issues.push(i),r.message=JSON.stringify(r.issues,Qu,2)}),mk(n,"addIssues",r=>i=>{r.issues.push(...i),r.message=JSON.stringify(r.issues,Qu,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},a_e=D("ZodError",$W),Fr=D("ZodError",$W,void 0,{Parent:Error});var HN=nd(Fr),KN=rd(Fr),JN=id(Fr),ZN=od(Fr),YN=V_(Fr),QN=q_(Fr),XN=W_(Fr),eO=H_(Fr),tO=K_(Fr),nO=J_(Fr),rO=Z_(Fr),iO=Y_(Fr);function l_e(){_n.localeError||Wt(Iw())}function va(){_n.memoizer||Wt({memoizer:nh()})}var ze=D("ZodType",(e,t)=>(l_e(),Me.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(q.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ct(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(QO(e,t))},superRefine(e,t){return this.check(XO(e,t))},overwrite(e){return this.check(no(e))},optional(){return Qc(this)},exactOptional(){return PO(this)},nullable(){return ph(this)},nullish(){return Qc(ph(this))},nonoptional(e){return LO(this,e)},array(){return gh(this)},or(e){return Dd([this,e])},and(e){return kO(this,e)},transform(e){return hk(this,Fk(e))},default(e){return OO(this,e)},prefault(e){return MO(this,e)},catch(e){return jO(this,e)},pipe(e){return hk(this,e)},readonly(){return VO(this)},describe(e){let t=this.clone();return Un.add(t,{description:e}),t},meta(...e){if(e.length===0)return Un.get(this);let t=this.clone();return Un.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return q.hide(this,"~standard",{...aw(this),jsonSchema:{input:Sd(this,"input"),output:Sd(this,"output")}})},set"~standard"(e){q.own(this,"~standard",e)},parse:function e(t,n){return HN(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await KN(this,t,n,{callee:e})},safeParse(e,t){return JN(this,e,t)},async safeParseAsync(e,t){return ZN(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){q.own(this,"spa",e)},validate(e,t){return Gg(this,e,t)},validateAsync(e,t){return Bg(this,e,t)},encode:function e(t,n){return YN(this,t,n,{callee:e})},decode:function e(t,n){return QN(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await XN(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await eO(this,t,n,{callee:e})},safeEncode(e,t){return tO(this,e,t)},safeDecode(e,t){return nO(this,e,t)},async safeEncodeAsync(e,t){return rO(this,e,t)},async safeDecodeAsync(e,t){return iO(this,e,t)},toJSONSchema(e){return sN(this,{})(e)},get description(){return Un.get(this)?.description},get _def(){return this._zod.def}}),yk=D("_ZodString",(e,t)=>{Bc.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lN(e,n,r,i)},q.derived({format:e=>wn(e).format??null,minLength:e=>wn(e).minimum??null,maxLength:e=>wn(e).maximum??null},{regex(...e){return this.check(dd(...e))},includes(...e){return this.check(md(...e))},startsWith(...e){return this.check(gd(...e))},endsWith(...e){return this.check(hd(...e))},min(...e){return this.check(ys(...e))},max(...e){return this.check(Jc(...e))},length(...e){return this.check(Zc(...e))},nonempty(...e){return this.check(ys(1,...e))},lowercase(e){return this.check(pd(e))},uppercase(e){return this.check(fd(e))},trim(){return this.check(vd())},normalize(...e){return this.check(bd(...e))},toLowerCase(){return this.check(_d())},toUpperCase(){return this.check(wd())},slugify(){return this.check(kd())}})),Rd=D("ZodString",(e,t)=>{Bc.init(e,t),yk.init(e,t)},{email(e){return this.check(Mw(bk,e))},url(e){return this.check(oh(fh,e))},jwt(e){return this.check(nk(Ok,e))},emoji(e){return this.check(Gw(_k,e))},guid(e){return this.check(Lw(vk,e))},uuid(e){return this.check(Fw(Io,e))},uuidv4(e){return this.check(Uw(Io,e))},uuidv6(e){return this.check(jw(Io,e))},uuidv7(e){return this.check(zw(Io,e))},nanoid(e){return this.check(Bw(wk,e))},cuid(e){return this.check(Vw(kk,e))},cuid2(e){return this.check(qw($k,e))},ulid(e){return this.check(Ww(Sk,e))},base64(e){return this.check(Xw(Pk,e))},base64url(e){return this.check(ek(Ck,e))},xid(e){return this.check(Hw(xk,e))},ksuid(e){return this.check(Kw(Ek,e))},ipv4(e){return this.check(Jw(Tk,e))},ipv6(e){return this.check(Zw(Ak,e))},cidrv4(e){return this.check(Yw(Ik,e))},cidrv6(e){return this.check(Qw(Rk,e))},e164(e){return this.check(tk(Nk,e))},datetime(e){return this.check(sh(_a,e))},date(e){return this.check(ah(wa,e))},time(e){return this.check(ch(ka,e))},duration(e){return this.check(lh($a,e))}});function dh(e){return wC(Rd,e)}var vt=D("ZodStringFormat",(e,t)=>{ft.init(e,t),yk.init(e,t)}),_a=D("ZodISODateTime",(e,t)=>{pP.init(e,t),vt.init(e,t)}),wa=D("ZodISODate",(e,t)=>{fP.init(e,t),vt.init(e,t)}),ka=D("ZodISOTime",(e,t)=>{mP.init(e,t),vt.init(e,t)}),$a=D("ZodISODuration",(e,t)=>{gP.init(e,t),vt.init(e,t)}),bk=D("ZodEmail",(e,t)=>{tP.init(e,t),vt.init(e,t)});function SW(e){return Mw(bk,e)}var vk=D("ZodGUID",(e,t)=>{X0.init(e,t),vt.init(e,t)});function xW(e){return Lw(vk,e)}var Io=D("ZodUUID",(e,t)=>{eP.init(e,t),vt.init(e,t)});function EW(e){return Fw(Io,e)}function TW(e){return Uw(Io,e)}function AW(e){return jw(Io,e)}function IW(e){return zw(Io,e)}var fh=D("ZodURL",(e,t)=>{iP.init(e,t),vt.init(e,t)});function RW(e){return oh(fh,e)}function PW(e){return oh(fh,{protocol:fr.httpProtocol,hostname:fr.domain,...q.normalizeParams(e)})}var _k=D("ZodEmoji",(e,t)=>{oP.init(e,t),vt.init(e,t)});function CW(e){return Gw(_k,e)}var wk=D("ZodNanoID",(e,t)=>{sP.init(e,t),vt.init(e,t)});function NW(e){return Bw(wk,e)}var kk=D("ZodCUID",(e,t)=>{aP.init(e,t),vt.init(e,t)});function OW(e){return Vw(kk,e)}var $k=D("ZodCUID2",(e,t)=>{cP.init(e,t),vt.init(e,t)});function DW(e){return qw($k,e)}var Sk=D("ZodULID",(e,t)=>{lP.init(e,t),vt.init(e,t)});function MW(e){return Ww(Sk,e)}var xk=D("ZodXID",(e,t)=>{uP.init(e,t),vt.init(e,t)});function LW(e){return Hw(xk,e)}var Ek=D("ZodKSUID",(e,t)=>{dP.init(e,t),vt.init(e,t)});function FW(e){return Kw(Ek,e)}var Tk=D("ZodIPv4",(e,t)=>{hP.init(e,t),vt.init(e,t)});function UW(e){return Jw(Tk,e)}var oO=D("ZodMAC",(e,t)=>{bP.init(e,t),vt.init(e,t)});function jW(e){return $C(oO,e)}var Ak=D("ZodIPv6",(e,t)=>{yP.init(e,t),vt.init(e,t)});function zW(e){return Zw(Ak,e)}var Ik=D("ZodCIDRv4",(e,t)=>{vP.init(e,t),vt.init(e,t)});function GW(e){return Yw(Ik,e)}var Rk=D("ZodCIDRv6",(e,t)=>{_P.init(e,t),vt.init(e,t)});function BW(e){return Qw(Rk,e)}var Pk=D("ZodBase64",(e,t)=>{wP.init(e,t),vt.init(e,t)});function VW(e){return Xw(Pk,e)}var Ck=D("ZodBase64URL",(e,t)=>{kP.init(e,t),vt.init(e,t)});function qW(e){return ek(Ck,e)}var Nk=D("ZodE164",(e,t)=>{$P.init(e,t),vt.init(e,t)});function WW(e){return tk(Nk,e)}var sO=D("ZodCreditCard",(e,t)=>{SP.init(e,t),vt.init(e,t)});function HW(e){return SC(sO,e)}var aO=D("ZodIBAN",(e,t)=>{xP.init(e,t),vt.init(e,t)});function KW(e){return xC(aO,e)}var Ok=D("ZodJWT",(e,t)=>{EP.init(e,t),vt.init(e,t)});function JW(e){return nk(Ok,e)}var Pd=D("ZodCustomStringFormat",(e,t)=>{TP.init(e,t),vt.init(e,t)});function ZW(e,t,n={}){return $d(Pd,e,t,n)}function YW(e){return $d(Pd,"hostname",fr.hostname,e)}function QW(e){return $d(Pd,"hex",fr.hex,e)}function XW(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,i=fr[r];if(!i)throw new Error(`Unrecognized hash format: ${r}`);return $d(Pd,r,i,t)}var Cd=D("ZodNumber",(e,t)=>{bw.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uN(e,n,r,i),e.isFinite=!0},q.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=wn(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=wn(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=wn(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>wn(e).format??null},{gt(e,t){return this.check(To(e,t))},gte(e,t){return this.check(ti(e,t))},min(e,t){return this.check(ti(e,t))},lt(e,t){return this.check(Eo(e,t))},lte(e,t){return this.check(ei(e,t))},max(e,t){return this.check(ei(e,t))},int(e){return this.check(gk(e))},safe(e){return this.check(gk(e))},positive(e){return this.check(To(0,e))},nonnegative(e){return this.check(ti(0,e))},negative(e){return this.check(Eo(0,e))},nonpositive(e){return this.check(ei(0,e))},multipleOf(e,t){return this.check(ma(e,t))},step(e,t){return this.check(ma(e,t))},finite(){return this}}));function cO(e){return TC(Cd,e)}var Xc=D("ZodNumberFormat",(e,t)=>{AP.init(e,t),Cd.init(e,t)});function gk(e){return IC(Xc,e)}function eH(e){return RC(Xc,e)}function tH(e){return PC(Xc,e)}function nH(e){return CC(Xc,e)}function rH(e){return NC(Xc,e)}var Nd=D("ZodBoolean",(e,t)=>{Zg.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dN(e,n,r,i)});function lO(e){return OC(Nd,e)}var Od=D("ZodBigInt",(e,t)=>{vw.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pN(e,n,r,i)},q.derived({minValue:e=>wn(e).minimum??null,maxValue:e=>wn(e).maximum??null,format:e=>wn(e).format??null},{gte(e,t){return this.check(ti(e,t))},min(e,t){return this.check(ti(e,t))},gt(e,t){return this.check(To(e,t))},lt(e,t){return this.check(Eo(e,t))},lte(e,t){return this.check(ei(e,t))},max(e,t){return this.check(ei(e,t))},positive(e){return this.check(To(BigInt(0),e))},negative(e){return this.check(Eo(BigInt(0),e))},nonpositive(e){return this.check(ei(BigInt(0),e))},nonnegative(e){return this.check(ti(BigInt(0),e))},multipleOf(e,t){return this.check(ma(e,t))}}));function iH(e){return MC(Od,e)}var Dk=D("ZodBigIntFormat",(e,t)=>{IP.init(e,t),Od.init(e,t)});function oH(e){return FC(Dk,e)}function sH(e){return UC(Dk,e)}var uO=D("ZodSymbol",(e,t)=>{RP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fN(e,n,r,i)});function aH(e){return jC(uO,e)}var dO=D("ZodUndefined",(e,t)=>{PP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gN(e,n,r,i)});function cH(e){return zC(dO,e)}var pO=D("ZodNull",(e,t)=>{CP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mN(e,n,r,i)});function fO(e){return GC(pO,e)}var mO=D("ZodAny",(e,t)=>{NP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bN(e,n,r,i)});function lH(){return BC(mO)}var gO=D("ZodUnknown",(e,t)=>{OP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vN(e,n,r,i)});function Yc(){return VC(gO)}var hO=D("ZodNever",(e,t)=>{DP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yN(e,n,r,i)});function Mk(e){return qC(hO,e)}var yO=D("ZodVoid",(e,t)=>{MP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hN(e,n,r,i)});function uH(e){return WC(yO,e)}var mh=D("ZodDate",(e,t)=>{LP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_N(e,n,r,i),e.min=(n,r)=>e.check(ti(n,r)),e.max=(n,r)=>e.check(ei(n,r))},q.derived({minDate:e=>{let{minimum:t}=wn(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=wn(e);return t?new Date(t):null}},{}));function dH(e){return HC(mh,e)}var bO=D("ZodArray",(e,t)=>{va(),FP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CN(e,n,r,i),e.element=t.element},{min(e,t){return this.check(ys(e,t))},nonempty(e){return this.check(ys(1,e))},max(e,t){return this.check(Jc(e,t))},length(e,t){return this.check(Zc(e,t))},unwrap(){return this.element}});function gh(e,t){return YC(bO,e,t)}function pH(e){let t=e._zod.def.shape;return Lk(Object.keys(t))}var hh=D("ZodObject",(e,t)=>{va(),UP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>NN(e,n,r,i),q.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Lk(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(q.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(q.mergeDefs(this._zod.def,{catchall:Yc()}))},loose(){return this.clone(q.mergeDefs(this._zod.def,{catchall:Yc()}))},strict(){return this.clone(q.mergeDefs(this._zod.def,{catchall:Mk()}))},strip(){return this.clone(q.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return q.extend(this,e)},safeExtend(e){return q.safeExtend(this,e)},merge(e){return q.merge(this,e)},pick(e){return q.pick(this,e)},omit(e){return q.omit(this,e)},partial(...e){return q.partial(bh,this,e[0])},exactPartial(...e){return q.partial(Uk,this,e[0],"exactPartial")},required(...e){return q.required(jk,this,e[0])}});function fH(e,t){let n={type:"object",shape:e??{},...q.normalizeParams(t)};return new hh(n)}function mH(e,t){return new hh({type:"object",shape:e,catchall:Mk(),...q.normalizeParams(t)})}function gH(e,t){return new hh({type:"object",shape:e,catchall:Yc(),...q.normalizeParams(t)})}var yh=D("ZodUnion",(e,t)=>{Yg.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lk(e,n,r,i),e.options=t.options});function Dd(e,t){return new yh({type:"union",options:e,...q.normalizeParams(t)})}var vO=D("ZodXor",(e,t)=>{yh.init(e,t),jP.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lk(e,n,r,i),e.options=t.options});function hH(e,t){return new vO({type:"union",options:e,inclusive:!1,...q.normalizeParams(t)})}var _O=D("ZodDiscriminatedUnion",(e,t)=>{yh.init(e,t),GP.init(e,t)});function yH(e,t,n){return new _O({type:"union",options:t,discriminator:e,...q.normalizeParams(n)})}var wO=D("ZodIntersection",(e,t)=>{BP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ON(e,n,r,i)});function kO(e,t){return new wO({type:"intersection",left:e,right:t})}var $O=D("ZodTuple",(e,t)=>{va(),_w.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DN(e,n,r,i)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new bh({type:"optional",innerType:t}))})}});function SO(e,t,n){let r=t instanceof Me,i=r?n:t,o=r?t:null;return new $O({type:"tuple",items:e,rest:o,...q.normalizeParams(i)})}var Ad=D("ZodRecord",(e,t)=>{va(),VP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>MN(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function xO(e,t,n){return!t||!t._zod?new Ad({type:"record",keyType:dh(),valueType:e,...q.normalizeParams(t)}):new Ad({type:"record",keyType:e,valueType:t,...q.normalizeParams(n)})}function bH(e,t,n){return new Ad({type:"record",keyType:e,valueType:t,...q.normalizeParams(n),partial:!0})}function vH(e,t,n){return new Ad({type:"record",keyType:e,valueType:t,mode:"loose",...q.normalizeParams(n)})}var EO=D("ZodMap",(e,t)=>{va(),qP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>RN(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(Ao(...n)),e.nonempty=n=>e.check(Ao(1,n)),e.max=(...n)=>e.check(ga(...n)),e.size=(...n)=>e.check(Kc(...n))});function _H(e,t,n){return new EO({type:"map",keyType:e,valueType:t,...q.normalizeParams(n)})}var TO=D("ZodSet",(e,t)=>{va(),WP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>PN(e,n,r,i),e.min=(...n)=>e.check(Ao(...n)),e.nonempty=n=>e.check(Ao(1,n)),e.max=(...n)=>e.check(ga(...n)),e.size=(...n)=>e.check(Kc(...n))});function wH(e,t){return new TO({type:"set",valueType:e,...q.normalizeParams(t)})}var Id=D("ZodEnum",(e,t)=>{HP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,i,o)=>wN(e,r,i,o),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{let o={};for(let s of r)if(n.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Id({...t,checks:[],...q.normalizeParams(i),entries:o})},e.exclude=(r,i)=>{let o={...t.entries};for(let s of r)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new Id({...t,checks:[],...q.normalizeParams(i),entries:o})}});function Lk(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Id({type:"enum",entries:n,...q.normalizeParams(t)})}function kH(e,t){return new Id({type:"enum",entries:e,...q.normalizeParams(t)})}var AO=D("ZodLiteral",(e,t)=>{KP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>kN(e,n,r,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function $H(e,t){return new AO({type:"literal",values:Array.isArray(e)?e:[e],...q.normalizeParams(t)})}var IO=D("ZodFile",(e,t)=>{JP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xN(e,n,r,i),e.min=(n,r)=>e.check(Ao(n,r)),e.max=(n,r)=>e.check(ga(n,r)),e.mime=(n,r)=>e.check(yd(Array.isArray(n)?n:[n],r))});function SH(e){return QC(IO,e)}var RO=D("ZodTransform",(e,t)=>{va(),ZP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>IN(e,n,r,i),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new fa(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(q.issue(o,n.value,t));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=e),n.issues.push(q.issue(s))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(o=>(n.value=o,n)):(n.value=i,n)}});function Fk(e){return new RO({type:"transform",transform:e})}var bh=D("ZodOptional",(e,t)=>{ww.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uk(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Qc(e){return new bh({type:"optional",innerType:e})}var Uk=D("ZodExactOptional",(e,t)=>{YP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uk(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function PO(e){return new Uk({type:"optional",innerType:e})}var CO=D("ZodNullable",(e,t)=>{QP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>LN(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function ph(e){return new CO({type:"nullable",innerType:e})}function xH(e){return Qc(ph(e))}var NO=D("ZodDefault",(e,t)=>{XP.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>jN(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function OO(e,t){return new NO({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():q.shallowClone(t)}})}var DO=D("ZodPrefault",(e,t)=>{eC.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zN(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function MO(e,t){return new DO({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():q.shallowClone(t)}})}var jk=D("ZodNonOptional",(e,t)=>{tC.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FN(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function LO(e,t){return new jk({type:"nonoptional",innerType:e,...q.normalizeParams(t)})}var FO=D("ZodSuccess",(e,t)=>{nC.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>EN(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function EH(e){return new FO({type:"success",innerType:e})}var UO=D("ZodCatch",(e,t)=>{rC.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>GN(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jO(e,t){return new UO({type:"catch",innerType:e,catchValue:typeof t=="function"?t:q.constantCatch(t)})}var zO=D("ZodNaN",(e,t)=>{iC.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$N(e,n,r,i)});function TH(e){return JC(zO,e)}var vh=D("ZodPipe",(e,t)=>{kw.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>BN(e,n,r,i),e.in=t.in,e.out=t.out});function hk(e,t){return new vh({type:"pipe",in:e,out:t})}var _h=D("ZodCodec",(e,t)=>{vh.init(e,t),Qg.init(e,t)});function AH(e,t,n){return new _h({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function IH(e){let t=e._zod.def;return new _h({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var GO=D("ZodPreprocess",(e,t)=>{vh.init(e,t),oC.init(e,t)}),BO=D("ZodReadonly",(e,t)=>{sC.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VN(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function VO(e){return new BO({type:"readonly",innerType:e})}var qO=D("ZodTemplateLiteral",(e,t)=>{aC.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>SN(e,n,r,i)});function RH(e,t){return new qO({type:"template_literal",parts:e,...q.normalizeParams(t)})}var WO=D("ZodLazy",(e,t)=>{Xg.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>WN(e,n,r,i),e.unwrap=()=>e._zod.def.getter()});function HO(e){return new WO({type:"lazy",getter:e})}var KO=D("ZodPromise",(e,t)=>{lC.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qN(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function PH(e){return new KO({type:"promise",innerType:e})}var JO=D("ZodFunction",(e,t)=>{cC.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>AN(e,n,r,i)});function CH(e){return new JO({type:"function",input:Array.isArray(e?.input)?SO(e?.input):e?.input??gh(Yc()),output:e?.output??Yc()})}var wh=D("ZodCustom",(e,t)=>{uC.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(n,r,i)=>TN(e,n,r,i)}),ZO=D("ZodProperties",(e,t)=>{va(),dC.init(e,t),ze.init(e,t)});function YO(e,t){return ZC(ZO,e,t)}function NH(e){let t=new St({check:"custom"});return t._zod.check=e,t}function OH(e,t){return XC(wh,e??(()=>!0),t)}function QO(e,t={}){return eN(wh,e,t)}function XO(e,t){return tN(e,t)}var DH=nN,MH=rN,eD=D("ZodInstanceOf",(e,t)=>{wh.init(e,t)},{properties(e,t){return this.check(YO(e,t))}});function LH(e,t={}){let n=new eD({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...q.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var FH=(...e)=>iN({Codec:_h,Boolean:Nd,String:Rd},...e);function UH(e){let t=HO(()=>Dd([dh(e),cO(),lO(),fO(),gh(t),xO(dh(),t)]));return t}function jH(e,t){return new GO({type:"pipe",in:Fk(e),out:t})}var u_e={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function d_e(e){Wt({customError:e})}function p_e(){return Wt().customError}var tD;tD||(tD={});var kh={};Cr(kh,{ZodISODate:()=>wa,ZodISODateTime:()=>_a,ZodISODuration:()=>$a,ZodISOTime:()=>ka,date:()=>m_e,datetime:()=>f_e,duration:()=>h_e,time:()=>g_e});function f_e(e){return sh(_a,e)}function m_e(e){return ah(wa,e)}function g_e(e){return ch(ka,e)}function h_e(e){return lh($a,e)}var ue={...Md,...fk,iso:kh},y_e=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function b_e(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function zH(e,t){return e.map((n,r)=>rr).check(r=>{let i=r.value;if(typeof i!="object"||i===null||Array.isArray(i))return;let o=Object.getOwnPropertyNames(i);if(t.minProperties!==void 0&&o.length=${t.minProperties} properties`,input:i,inst:e,continue:!0}),t.maxProperties!==void 0&&o.length>t.maxProperties&&r.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:i,inst:e,continue:!0}),t.keySchema)for(let s of o){let a=t.keySchema.safeParse(s);a.success||r.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:!0})}}).pipe(e)}function nD(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let r=String(e);return`${n[0]}${r.length}:${r}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let o=[];for(let s of e){let a=nD(s,t);if(a===null)return null;o.push(a)}return`a${o.length}:[${o.join(",")}]`}let r=Object.keys(e).sort(),i=[];for(let o of r){let s=nD(e[o],t);if(s===null)return null;i.push(`${o.length}:${o}=${s}`)}return`o${i.length}:{${i.join(",")}}`}finally{t.delete(e)}}var k_e=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),$_e=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function $h(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some($h):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>k_e.has(t)?$h(n):!$_e.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some($h))}function GH(e){return e===1?"element":"elements"}function S_e(e,t){return ue.transform(r=>r).check(r=>{let i=r.value;if(Array.isArray(i)){if(t.uniqueItems===!0){let o=new Map;for(let s=0;s=s)break;at.maxContains&&r.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${GH(t.maxContains)}`,input:i,continue:!0})}}}).pipe(e)}function BH(e,t){if(e!==!1)return e===void 0||e===!0?ue.any():gr(e,t)}var x_e=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function VH(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return ue.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let i=e.$ref;if(t.refs.has(i))return t.refs.get(i);if(t.processing.has(i))return ue.lazy(()=>{if(!t.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return t.refs.get(i)});t.processing.add(i);let o=__e(i,t),s=gr(o,t);return t.refs.set(i,s),t.processing.delete(i),s}if(e.enum!==void 0){let i=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&i.length===1&&i[0]===null)return ue.null();if(i.length===0)return ue.never();if(i.length===1)return ue.literal(i[0]);if(i.every(s=>typeof s=="string"))return ue.enum(i);let o=i.map(s=>ue.literal(s));return o.length<2?o[0]:ue.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return ue.literal(e.const);let n=e.type;if(Array.isArray(n)){let i=n.map(o=>{let s={...e,type:o};return VH(s,t)});return i.length===0?ue.never():i.length===1?i[0]:ue.union(i)}if(!n)return ue.any();let r;switch(n){case"string":{let i=ue.string();if(e.format){let o=e.format;o==="email"?i=i.check(ue.email()):o==="uri"||o==="uri-reference"?i=i.check(ue.url()):o==="uuid"||o==="guid"?i=i.check(ue.uuid()):o==="date-time"?i=i.check(ue.iso.datetime({offset:!0})):o==="date"?i=i.check(ue.iso.date()):o==="time"?i=i.check(ue.regex(x_e)):o==="duration"?i=i.check(ue.iso.duration()):o==="hostname"?i=i.check(ue.hostname()):o==="ipv4"?i=i.check(ue.ipv4()):o==="ipv6"?i=i.check(ue.ipv6()):o==="mac"?i=i.check(ue.mac()):o==="cidr"?i=i.check(ue.cidrv4()):o==="cidr-v6"?i=i.check(ue.cidrv6()):o==="base64"?i=i.check(ue.base64()):o==="base64url"?i=i.check(ue.base64url()):o==="e164"?i=i.check(ue.e164()):o==="credit_card"?i=i.check(ue.creditCard()):o==="iban"?i=i.check(ue.iban()):o==="jwt"?i=i.check(ue.jwt()):o==="emoji"?i=i.check(ue.emoji()):o==="nanoid"?i=i.check(ue.nanoid()):o==="cuid"?i=i.check(ue.cuid()):o==="cuid2"?i=i.check(ue.cuid2()):o==="ulid"?i=i.check(ue.ulid()):o==="xid"?i=i.check(ue.xid()):o==="ksuid"&&(i=i.check(ue.ksuid()))}typeof e.minLength=="number"&&(i=i.min(e.minLength)),typeof e.maxLength=="number"&&(i=i.max(e.maxLength)),e.pattern&&(i=i.regex(new RegExp(e.pattern))),r=i;break}case"number":case"integer":{let i=n==="integer"?ue.number().int():ue.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(i=i.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(i=i.max(e.maximum)),typeof e.exclusiveMinimum=="number"?i=i.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(i=i.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?i=i.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(i=i.lt(e.maximum)),typeof e.multipleOf=="number"&&(i=i.multipleOf(e.multipleOf)),r=i;break}case"boolean":{r=ue.boolean();break}case"null":{r=ue.null();break}case"object":{let i={},o=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?gr(e.additionalProperties,t):void 0;for(let[d,p]of Object.entries(o)){let f=gr(p,t);An(i,d,s.has(d)?f:f.optional())}if(e.patternProperties){let d=e.patternProperties,p=Object.keys(d),f=[];for(let g of p){let h=gr(d[g],t),v=ue.string().regex(new RegExp(g));f.push(ue.looseRecord(v,h))}let m=[];if(Object.keys(i).length>0&&m.push(ue.object(i).passthrough()),m.push(...f),m.length===0)r=ue.object({}).passthrough();else if(m.length===1)r=m[0];else{let g=ue.intersection(m[0],m[1]);for(let h=2;hnew RegExp(b)),v=r;r=r.check(b=>{if(!Ei(b.value))return;let _=[];for(let w of Object.keys(b.value))g.includes(w)||h.some(k=>k.test(w))||_.push(w);_.length&&b.issues.push({code:"unrecognized_keys",keys:_,input:b.value,inst:v})})}}else{let d=ue.object(i);e.additionalProperties===!1?r=d.strict():a?r=d.catchall(a):r=d.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,u=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||l!==void 0||u!==void 0){let d;if(c){let p=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=gr(p,t)}r=w_e(r,{keySchema:d,minProperties:l,maxProperties:u})}break}case"array":{let i=e.prefixItems,o=e.items;if(i&&Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(d=>gr(d,t)),c=zH(a,s),l=Array.isArray(o)?void 0:BH(o,t),u=ue.tuple(c);r=l?u.rest(l):u,typeof e.minItems=="number"&&(r=r.check(ue.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(ue.maxLength(e.maxItems)))}else if(Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(d=>gr(d,t)),c=zH(a,s),l=BH(e.additionalItems,t),u=ue.tuple(c);r=l?u.rest(l):u,typeof e.minItems=="number"&&(r=r.check(ue.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(ue.maxLength(e.maxItems)))}else if(o!==void 0){let s=gr(o,t),a=ue.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),r=a}else r=ue.array(ue.any());(e.uniqueItems===!0||e.contains!==void 0)&&(r=S_e(r,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?gr(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return r}function gr(e,t){if(typeof e=="boolean")return e?ue.any():ue.never();let n=VH(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(l=>gr(l,t)),c=ue.union(a);n=r?ue.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(l=>gr(l,t)),c=ue.xor(a);n=r?ue.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:ue.any();else{let a=r?n:gr(e.allOf[0],t),c=r?0:1;for(let l=c;l0&&t.registry.add(n,i),e.description&&(n=n.describe(e.description)),n}function qH(e,t){if(typeof e=="boolean")return e?ue.any():ue.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=b_e(n,t?.defaultTarget),i=n.$defs||n.definitions||{},o={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Un};return gr(n,o)}var WH=Symbol("z.visit/resolving");function Sh(e,t){let n=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},r=new Map;function i(s){let a=r.get(s);if(a===WH)return new Xg({type:"lazy",getter:()=>r.get(s)});if(a!==void 0)return a;r.set(s,WH);let c=o(s),l=n(c,c!==s);return r.set(s,l),l}function o(s){let a=s._zod.def,c=a.type;switch(c){case"object":{let l=a.shape,u=Object.keys(l),d=!1,p={};for(let m of u){let g=i(l[m]);g!==l[m]&&(d=!0),p[m]=g}let f=a.catchall;return a.catchall&&(f=i(a.catchall),f!==a.catchall&&(d=!0)),d?ct(s,{...a,shape:p,catchall:f}):s}case"array":{let l=i(a.element);return l===a.element?s:ct(s,{...a,element:l})}case"tuple":{let l=a.items,u=!1,d=[];for(let f of l){let m=i(f);m!==f&&(u=!0),d.push(m)}let p=a.rest;return a.rest&&(p=i(a.rest),p!==a.rest&&(u=!0)),u?ct(s,{...a,items:d,rest:p}):s}case"record":case"map":{let l=i(a.keyType),u=i(a.valueType);return l===a.keyType&&u===a.valueType?s:ct(s,{...a,keyType:l,valueType:u})}case"set":{let l=i(a.valueType);return l===a.valueType?s:ct(s,{...a,valueType:l})}case"union":{let l=a.options,u=!1,d=[];for(let p of l){let f=i(p);f!==p&&(u=!0),d.push(f)}return u?ct(s,{...a,options:d}):s}case"intersection":{let l=i(a.left),u=i(a.right);return l===a.left&&u===a.right?s:ct(s,{...a,left:l,right:u})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=i(a.innerType);return l===a.innerType?s:ct(s,{...a,innerType:l})}case"pipe":{let l=i(a.in),u=i(a.out);return l===a.in&&u===a.out?s:ct(s,{...a,in:l,out:u})}case"function":{let l=i(a.input),u=i(a.output);return l===a.input&&u===a.output?s:ct(s,{...a,input:l,output:u})}case"lazy":{let l=a.getter,{_cachedInner:u,...d}=a;return ct(s,{...d,getter:()=>i(l())})}case"properties":{let l=a.shape,u=!1,d={};for(let p of Reflect.ownKeys(l)){let f=i(l[p]);f!==l[p]&&(u=!0),d[p]=f}return u?ct(s,{...a,shape:d}):s}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return i(e)}function HH(e){return Sh(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:Dd(n.options)}})}function E_e(e,t){if(!t?.length)return e;let n=e._zod.def;return ct(e,eo(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function KH(e){return E_e(e.out,e.checks)}function T_e(e){return e.in._zod.traits.has("$ZodTransform")?KH(e):e.in}function JH(e){return Sh(e,{pipe:t=>T_e(t._zod.def),default:(t,n)=>n?Qc(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function ZH(e){return Sh(e,{pipe:t=>KH(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var rD={};Cr(rD,{bigint:()=>P_e,boolean:()=>R_e,date:()=>C_e,number:()=>I_e,string:()=>A_e});function A_e(e){return kC(Rd,e)}function I_e(e){return AC(Cd,e)}function R_e(e){return DC(Nd,e)}function P_e(e){return LC(Od,e)}function C_e(e){return KC(mh,e)}var YH=B.enum(["npm","pypi","go","cargo","maven","rubygems","nuget","packagist","hex","pub","swift","cocoapods","opam","conan","vcpkg","arduino"]),N_e=B.string().trim().min(1),O_e=B.enum(["low","medium","high","xhigh"]);var iD=B.object({mode:B.enum(["auto","approve"]).default("approve"),maxAutoRisk:B.enum(["none","low","medium","high"]).default("medium"),watchBranches:B.array(B.string()).default(["main","master","develop"]),ecosystems:B.array(YH).default([...YH.options]),ignore:B.array(B.string()).default([]),alwaysApprove:B.array(B.string()).default([]),triggerOn:B.object({major:B.boolean().default(!0),minor:B.boolean().default(!0),patch:B.boolean().default(!1),transitive:B.boolean().default(!1),dev:B.boolean().default(!0)}).prefault({}),evidence:B.object({githubReleases:B.boolean().default(!0),changelog:B.boolean().default(!0),typeSurface:B.boolean().default(!0),openapi:B.boolean().default(!0),openapiSpecs:B.array(B.string()).default([]),protobuf:B.boolean().default(!0),protobufSpecs:B.array(B.string()).default([]),graphql:B.boolean().default(!0),graphqlSchemas:B.array(B.string()).default([]),maxReleases:B.number().int().min(1).max(100).default(25)}).prefault({}),rationale:B.object({security:B.boolean().default(!0),maintenance:B.boolean().default(!0),summary:B.boolean().default(!0)}).prefault({}),licenses:B.object({enabled:B.boolean().default(!1),allow:B.array(B.string()).default([]),deny:B.array(B.string()).default([]),requireDeclared:B.boolean().default(!1)}).prefault({}),guardrails:B.object({protectedPaths:B.array(B.string()).default([".github/workflows/**","**/*.lock","infra/**","terraform/**","**/secrets/**"]),maxFilesChanged:B.number().int().min(1).default(50),maxDependenciesPerRun:B.number().int().min(1).default(10),requireEvidence:B.boolean().default(!0),minConfidence:B.enum(["low","medium","high"]).default("medium"),experimentalDispatchBelowMinConfidence:B.boolean().default(!1),forbidTestWeakening:B.boolean().default(!0)}).prefault({}),remediation:B.object({commitGranularity:B.enum(["per-breaking-change","per-dependency","single"]).default("per-breaking-change"),branchPrefix:B.string().default("drift/"),draftPr:B.boolean().optional(),model:B.string().optional(),agent:B.object({provider:N_e.default("auto"),model:B.string().optional(),effort:O_e.optional(),fast:B.boolean().default(!1),timeoutSeconds:B.number().int().min(30).max(1440*60).default(1800)}).prefault({}),customInstructions:B.string().default(""),awaitCompletion:B.object({enabled:B.boolean().default(!1),timeoutMinutes:B.number().int().min(1).max(360).default(20),pollIntervalSeconds:B.number().int().min(5).max(300).default(30)}).prefault({}),communityRecipes:B.boolean().default(!1),fixPlans:B.object({enabled:B.boolean().default(!1),minCoverage:B.number().min(0).max(1).default(.5),autoApply:B.enum(["review","proven","verified"]).default("review"),cache:B.boolean().default(!0)}).prefault({})}).prefault({}),verification:B.object({behavioural:B.object({enabled:B.boolean().default(!1),sandbox:B.literal("required").default("required"),maxSymbols:B.number().int().min(1).max(100).default(10),maxCasesPerSymbol:B.number().int().min(1).max(100).default(20),timeoutSeconds:B.number().int().min(1).max(1800).default(120),network:B.boolean().default(!1),memoryMb:B.number().int().min(128).max(16384).default(1024),cpuLimit:B.number().min(.1).max(32).default(1),retainArtifacts:B.boolean().default(!1)}).prefault({})}).prefault({}),telemetry:B.object({enabled:B.boolean().default(!1),endpoint:B.string().url().optional(),installationId:B.string().optional(),rotationSalt:B.string().optional(),retentionDays:B.number().int().min(1).max(730).default(180)}).prefault({}),pullRequest:B.object({enabled:B.boolean().default(!0),confirm:B.enum(["ask","never"]).default("ask"),base:B.enum(["branched-from","default-branch"]).default("branched-from"),draft:B.boolean().optional(),labels:B.array(B.string()).default([]),reviewers:B.array(B.string()).default([]),branchTemplate:B.string().default("{prefix}upgrade-{summary}-{date}"),titleTemplate:B.string().default("chore(deps): upgrade {summary}"),coAuthor:B.boolean().default(!0)}).prefault({}),llm:B.object({enabled:B.boolean().default(!1),provider:B.enum(["anthropic"]).default("anthropic"),model:B.string().default("claude-opus-5"),effort:B.enum(["low","medium","high","xhigh","max"]).default("medium"),apiKeyEnv:B.string().default("ANTHROPIC_API_KEY")}).prefault({}),codeScanning:B.object({enabled:B.boolean().default(!0),includeInformational:B.boolean().default(!1),granularity:B.enum(["package","breakingChange","affectedSite"]).default("package"),createIssuesPerAlert:B.boolean().default(!1)}).prefault({}),issueCreation:B.object({default:B.enum(["issue","branch","both"]).default("issue"),granularity:B.enum(["package","change"]).default("package"),assignees:B.array(B.string()).default([])}).prefault({}),outdated:B.object({enabled:B.boolean().default(!1)}).prefault({}),check:B.object({enabled:B.boolean().default(!1)}).prefault({}),tools:B.object({autoInstall:B.boolean().default(!0)}).prefault({}),verify:B.object({enabled:B.boolean().default(!0),checks:B.array(B.enum(["typecheck","build","test"])).default(["typecheck","build","test"]),timeoutMs:B.number().int().positive().default(15*6e4),generatedSourceGlobs:B.array(B.string()).default([])}).prefault({})}),Ld=iD.parse({});function QH(e){return e.pullRequest.draft??e.remediation.draftPr??!0}var zk={none:0,low:1,medium:2,high:3};function oD(e,t){return zk[e]<=zk[t]}function XH(e,t){return zk[e]-zk[t]}var D_e=[".github/drift.yml",".github/drift.yaml","drift.yml","drift.yaml"];function M_e(e,t=null){let n=[];if(!e.trim())return{config:Ld,path:t,problems:n};let r;try{r=(0,eK.parse)(e)}catch(c){return n.push(`Could not parse ${t??"config"} as YAML: ${c.message}`),{config:Ld,path:t,problems:n}}if(r==null)return{config:Ld,path:t,problems:n};let i=F_e(r),o=L_e(r),s=iD.safeParse(r);if(!s.success){for(let c of s.error.issues){let l=c.path.length?c.path.join("."):"(root)";n.push(`${l}: ${c.message}`)}return n.push("Falling back to Drift defaults (mode: approve)."),{config:Ld,path:t,problems:n}}let a=s.data;return i&&!o&&(a.remediation.agent={...a.remediation.agent,provider:"copilot-cloud",model:i},n.push("`remediation.model` is deprecated and now treated as `remediation.agent.model` for `copilot-cloud`. Use `remediation.agent` for new configuration.")),{config:a,path:t,problems:n}}function L_e(e){if(!Gk(e))return!1;let t=e.remediation;return Gk(t)&&t.agent!==void 0}function F_e(e){if(!Gk(e))return null;let t=e.remediation;return Gk(t)&&typeof t.model=="string"&&t.model.trim()?t.model:null}function Gk(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}async function Bk(e){for(let t of D_e){let n;try{n=await e(t)}catch{continue}if(n!==null)return M_e(n,t)}return{config:Ld,path:null,problems:[]}}var VK=require("node:zlib");function Sa(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}function Vk(e,t,n,r){if(typeof n!="function")throw new Error("method for before hook must be a function");return r||(r={}),Array.isArray(t)?t.reverse().reduce((i,o)=>Vk.bind(null,e,o,i,r),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((i,o)=>o.hook.bind(null,i,r),n)():n(r))}function tK(e,t,n,r){let i=r;e.registry[n]||(e.registry[n]=[]),t==="before"&&(r=(o,s)=>Promise.resolve().then(i.bind(null,s)).then(o.bind(null,s))),t==="after"&&(r=(o,s)=>{let a;return Promise.resolve().then(o.bind(null,s)).then(c=>(a=c,i(a,s))).then(()=>a)}),t==="error"&&(r=(o,s)=>Promise.resolve().then(o.bind(null,s)).catch(a=>i(a,s))),e.registry[n].push({hook:r,orig:i})}function nK(e,t,n){if(!e.registry[t])return;let r=e.registry[t].map(i=>i.orig).indexOf(n);r!==-1&&e.registry[t].splice(r,1)}var rK=Function.bind,iK=rK.bind(rK);function oK(e,t,n){let r=iK(nK,null).apply(null,n?[t,n]:[t]);e.api={remove:r},e.remove=r,["before","error","after","wrap"].forEach(i=>{let o=n?[t,i,n]:[t,i];e[i]=e.api[i]=iK(tK,null).apply(null,o)})}function U_e(){let e=Symbol("Singular"),t={registry:{}},n=Vk.bind(null,t,e);return oK(n,t,e),n}function j_e(){let e={registry:{}},t=Vk.bind(null,e);return oK(t,e),t}var sK={Singular:U_e,Collection:j_e};var z_e="0.0.0-development",G_e=`octokit-endpoint.js/${z_e} ${Sa()}`,B_e={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":G_e},mediaType:{format:""}};function V_e(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function q_e(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function lK(e,t){let n=Object.assign({},e);return Object.keys(t).forEach(r=>{q_e(t[r])?r in e?n[r]=lK(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}function aK(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function aD(e,t,n){if(typeof t=="string"){let[i,o]=t.split(" ");n=Object.assign(o?{method:i,url:o}:{url:i},n)}else n=Object.assign({},t);n.headers=V_e(n.headers),aK(n),aK(n.headers);let r=lK(e||{},n);return n.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(r.mediaType.previews=e.mediaType.previews.filter(i=>!r.mediaType.previews.includes(i)).concat(r.mediaType.previews)),r.mediaType.previews=(r.mediaType.previews||[]).map(i=>i.replace(/-preview/,""))),r}function W_e(e,t){let n=/\?/.test(e)?"&":"?",r=Object.keys(t);return r.length===0?e:e+n+r.map(i=>i==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${i}=${encodeURIComponent(t[i])}`).join("&")}var H_e=/\{[^{}}]+\}/g;function K_e(e){return e.replace(/(?:^\W+)|(?:(?n.concat(r),[]):[]}function cK(e,t){let n={__proto__:null};for(let r of Object.keys(e))t.indexOf(r)===-1&&(n[r]=e[r]);return n}function uK(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function Ud(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function xh(e,t,n){return t=e==="+"||e==="#"?uK(t):Ud(t),n?Ud(n)+"="+t:t}function Fd(e){return e!=null}function sD(e){return e===";"||e==="&"||e==="?"}function Z_e(e,t,n,r){var i=e[n],o=[];if(Fd(i)&&i!=="")if(typeof i=="string"||typeof i=="number"||typeof i=="bigint"||typeof i=="boolean")i=i.toString(),r&&r!=="*"&&(i=i.substring(0,parseInt(r,10))),o.push(xh(t,i,sD(t)?n:""));else if(r==="*")Array.isArray(i)?i.filter(Fd).forEach(function(s){o.push(xh(t,s,sD(t)?n:""))}):Object.keys(i).forEach(function(s){Fd(i[s])&&o.push(xh(t,i[s],s))});else{let s=[];Array.isArray(i)?i.filter(Fd).forEach(function(a){s.push(xh(t,a))}):Object.keys(i).forEach(function(a){Fd(i[a])&&(s.push(Ud(a)),s.push(xh(t,i[a].toString())))}),sD(t)?o.push(Ud(n)+"="+s.join(",")):s.length!==0&&o.push(s.join(","))}else t===";"?Fd(i)&&o.push(Ud(n)):i===""&&(t==="&"||t==="?")?o.push(Ud(n)+"="):i===""&&o.push("");return o}function Y_e(e){return{expand:Q_e.bind(null,e)}}function Q_e(e,t){var n=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(r,i,o){if(i){let a="",c=[];if(n.indexOf(i.charAt(0))!==-1&&(a=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(l){var u=/([^:\*]*)(?::(\d+)|(\*))?/.exec(l);c.push(Z_e(t,a,u[1],u[2]||u[3]))}),a&&a!=="+"){var s=",";return a==="?"?s="&":a!=="#"&&(s=a),(c.length!==0?a:"")+c.join(s)}else return c.join(",")}else return uK(o)}),e==="/"?e:e.replace(/\/$/,"")}function dK(e){let t=e.method.toUpperCase(),n=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),r=Object.assign({},e.headers),i,o=cK(e,["method","baseUrl","url","headers","request","mediaType"]),s=J_e(n);n=Y_e(n).expand(o),/^http/.test(n)||(n=e.baseUrl+n);let a=Object.keys(e).filter(u=>s.includes(u)).concat("baseUrl"),c=cK(o,a);if(!/application\/octet-stream/i.test(r.accept)&&(e.mediaType.format&&(r.accept=r.accept.split(/,/).map(u=>u.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&e.mediaType.previews?.length)){let u=r.accept.match(/(?{let p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${d}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?n=W_e(n,c):"data"in c?i=c.data:Object.keys(c).length&&(i=c),!r["content-type"]&&typeof i<"u"&&(r["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof i>"u"&&(i=""),Object.assign({method:t,url:n,headers:r},typeof i<"u"?{body:i}:null,e.request?{request:e.request}:null)}function X_e(e,t,n){return dK(aD(e,t,n))}function pK(e,t){let n=aD(e,t),r=X_e.bind(null,n);return Object.assign(r,{DEFAULTS:n,defaults:pK.bind(null,n),merge:aD.bind(null,n),parse:dK})}var fK=pK(null,B_e);var gK=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function hK(e,t){let n=t?.comma===!0?nwe:65536,r=e.length,i=lD(e,t?.start??0,r),o=i;i=cD(e,i,r,n);let s=uD(e,o,i),a=e.slice(o,s).toLowerCase();return t?.parameters===!1?{type:a,index:i,parameters:new gK}:rwe(e,a,i,r,n)}var yK=32,bK=9,vK=59,ewe=61,mK=34,twe=92,nwe=44;function rwe(e,t,n,r,i){let o=new gK;e:for(;nt;){let r=e.charCodeAt(n-1);if(r!==yK&&r!==bK)break;n--}return n}var iwe=/^-?\d+$/,Wk=/^-?\d+n+$/,xa=JSON.stringify,dD=JSON.parse,SK=/^-?\d+n$/,_K=/([\[:])?"(-?\d+)n"($|\s*[,\}\]])/g,wK=/([\[:])?("-?\d+n+)n("$|"\s*[,\}\]])/g,pD=e=>e===void 0||typeof e=="function"||typeof e=="symbol",fD=e=>e!==null&&typeof e=="object"&&e.constructor&&e.constructor.name==="RawJSON",owe=(e,t,n)=>{let r="";typeof n=="number"?r=" ".repeat(Math.min(10,Math.max(0,Math.floor(n)))):typeof n=="string"&&(r=n.slice(0,10));let i=typeof t=="function",o=Array.isArray(t)?new Set(t.map(String)):null,s=(m,g,h)=>(h!==null&&typeof h=="object"&&typeof h.toJSON=="function"&&(h=h.toJSON(g)),typeof h=="string"&&Wk.test(h)?h+"n":typeof h=="bigint"?"rawJSON"in JSON?JSON.rawJSON(h.toString()):h.toString()+"n":(i&&(h=t.call(m,g,h)),h!==null&&typeof h=="object"&&(h instanceof Number||h instanceof String||h instanceof Boolean)&&(h=h.valueOf()),h)),a=s({"":e},"",e);if(pD(a))return;let c=a===null||typeof a!="object",l=fD(a);if(c||l)return xa(a);let u=[],d=0,p=[{parent:{"":a},key:"",val:a,isArray:Array.isArray(a),keys:Array.isArray(a)?null:Object.keys(a),index:0,first:!0}],f=new WeakSet([a]);for(;p.length>0;){let m=p[p.length-1];m.index===0&&(u.push(m.isArray?"[":"{"),d++);let g=!1;if(m.isArray)if(m.index=m.keys.length&&p[p.length-1]===m&&(g=!0)}g&&(d--,!m.first&&r&&u.push(` +`+r.repeat(d)),u.push(m.isArray?"]":"}"),f.delete(m.val),p.pop())}return u.join("")},xK=(e,t,n)=>{try{return"rawJSON"in JSON?xa(e,(a,c)=>typeof c=="bigint"?JSON.rawJSON(c.toString()):typeof t=="function"?t(a,c):(Array.isArray(t)&&t.includes(a),c),n):e?xa(e,(a,c)=>typeof c=="string"&&Wk.test(c)||typeof c=="bigint"?c.toString()+"n":typeof t=="function"?t(a,c):(Array.isArray(t)&&t.includes(a),c),n).replace(_K,"$1$2$3").replace(wK,"$1$2$3"):xa(e,t,n)}catch(r){if(r instanceof RangeError){let i=owe(e,t,n);return i===void 0?void 0:"rawJSON"in JSON?i:i.replace(_K,"$1$2$3").replace(wK,"$1$2$3")}throw r}},qk=new Map,swe=()=>{let e=JSON.parse.toString();if(qk.has(e))return qk.get(e);try{let t=JSON.parse("1",(n,r,i)=>!!i?.source&&i.source==="1");return qk.set(e,t),t}catch{return qk.set(e,!1),!1}},awe=(e,t,n,r)=>typeof t=="string"&&SK.test(t)?BigInt(t.slice(0,-1)):typeof t=="string"&&Wk.test(t)?t.slice(0,-1):typeof r=="function"?r(e,t,n):t,cwe=(e,t)=>JSON.parse(e,(n,r,i)=>{let o=typeof r=="number",s=r>Number.MAX_SAFE_INTEGER||r{let n={"":e},r=[{parent:n,key:"",visited:!1}];for(;r.length>0;){let i=r[r.length-1];if(i.visited){let{parent:o,key:s}=i,a=o[s];typeof a=="string"&&(SK.test(a)?a=BigInt(a.slice(0,-1)):Wk.test(a)&&(a=a.slice(0,-1))),typeof t=="function"&&(a=t.call(o,s,a)),a===void 0?delete o[s]:o[s]=a,r.pop()}else{i.visited=!0;let o=i.parent[i.key];if(o!==null&&typeof o=="object"){let a=Object.keys(o);for(let c=a.length-1;c>=0;c--)r.push({parent:o,key:a[c],visited:!1})}}}return n[""]},$K=e=>e.replace(lwe,(t,n,r,i)=>{let o=t[0]==='"';if(o&&uwe.test(t))return t.substring(0,t.length-1)+'n"';let a=r||i,c=n&&(n.length{if(!e)return dD(e,t);try{if(swe())return cwe(e,t);let n=$K(e);return dD(n,(r,i,o)=>awe(r,i,o,t))}catch(n){if(n instanceof RangeError){let r=$K(e),i=dD(r);return dwe(i,t)}throw n}};var el=class extends Error{name;status;request;response;constructor(t,n,r){super(t,{cause:r.cause}),this.name="HttpError",this.status=Number.parseInt(n),Number.isNaN(this.status)&&(this.status=0);"response"in r&&(this.response=r.response);let i=Object.assign({},r.request);r.request.headers.authorization&&(i.headers=Object.assign({},r.request.headers,{authorization:r.request.headers.authorization.replace(/(?"";async function IK(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let n=e.request?.log||console,r=e.request?.parseSuccessResponseBody!==!1,i=mwe(e.body)||Array.isArray(e.body)?xK(e.body):e.body,o=Object.fromEntries(Object.entries(e.headers).map(([d,p])=>[d,String(p)])),s;try{s=await t(e.url,{method:e.method,body:i,redirect:e.request?.redirect,headers:o,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(d){let p="Unknown Error";if(d instanceof Error){if(d.name==="AbortError")throw d.status=500,d;p=d.message,d.name==="TypeError"&&"cause"in d&&(d.cause instanceof Error?p=d.cause.message:typeof d.cause=="string"&&(p=d.cause))}let f=new el(p,500,{request:e});throw f.cause=d,f}let a=s.status,c=s.url,l={};for(let[d,p]of s.headers)l[d]=p;let u={url:c,status:a,headers:l,data:""};if("deprecation"in l){let d=l.link&&l.link.match(/<([^<>]+)>; rel="deprecation"/),p=d&&d.pop();n.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${l.sunset}${p?`. See ${p}`:""}`)}if(a===204||a===205)return u;if(e.method==="HEAD"){if(a<400)return u;throw new el(s.statusText,a,{response:u,request:e})}if(a===304)throw u.data=await mD(s),new el("Not modified",a,{response:u,request:e});if(a>=400)throw u.data=await mD(s),new el(hwe(u.data),a,{response:u,request:e});return u.data=r?await mD(s):s.body,u}async function mD(e){let t=e.headers.get("content-type");if(!t)return e.text().catch(AK);let n=hK(t);if(gwe(n)){let r="";try{return r=await e.text(),TK(r)}catch{return r}}else return n.type.startsWith("text/")||n.parameters.charset?.toLowerCase()==="utf-8"&&n.type!=="application/octet-stream"?e.text().catch(AK):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function gwe(e){return e.type==="application/json"||e.type==="application/scim+json"}function hwe(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if(typeof e=="object"&&e!==null&&"message"in e){let t=e,n="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(r=>JSON.stringify(r)).join(", ")}${n}`:`${t.message}${n}`}return`Unknown error: ${JSON.stringify(e)}`}function gD(e,t){let n=e.defaults(t);return Object.assign(function(i,o){let s=n.merge(i,o);if(!s.request||!s.request.hook)return IK(n.parse(s));let a=(c,l)=>IK(n.parse(n.merge(c,l)));return Object.assign(a,{endpoint:n,defaults:gD.bind(null,n)}),s.request.hook(a,s)},{endpoint:n,defaults:gD.bind(null,n)})}var Eh=gD(fK,fwe);var ywe="0.0.0-development";function bwe(e){return`Request failed due to following response errors: `+e.errors.map(t=>` - ${t.message}`).join(` -`)}var Bme=class extends Error{constructor(e,t,n){super(Vme(n)),this.request=e,this.headers=t,this.response=n,this.errors=n.errors,this.data=n.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}request;headers;response;name="GraphqlResponseError";errors;data},qme=["method","baseUrl","url","headers","request","query","mediaType","operationName"],Wme=["query","method","url"],c4=/\/api\/v3\/?$/;function Hme(e,t,n){if(n){if(typeof t=="string"&&"query"in n)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let s in n)if(Wme.includes(s))return Promise.reject(new Error(`[@octokit/graphql] "${s}" cannot be used as variable name`))}let i=typeof t=="string"?Object.assign({query:t},n):t,r=Object.keys(i).reduce((s,a)=>qme.includes(a)?(s[a]=i[a],s):(s.variables||(s.variables={}),s.variables[a]=i[a],s),{}),o=i.baseUrl||e.endpoint.DEFAULTS.baseUrl;return c4.test(o)&&(r.url=o.replace(c4,"/api/graphql")),e(r).then(s=>{if(s.data.errors){let a={};for(let c of Object.keys(s.headers))a[c]=s.headers[c];throw new Bme(r,a,s.data)}return s.data.data})}function xC(e,t){let n=e.defaults(t);return Object.assign((r,o)=>Hme(n,r,o),{defaults:xC.bind(null,n),endpoint:n.endpoint})}var UHe=xC(bg,{headers:{"user-agent":`octokit-graphql.js/${Gme} ${Ys()}`},method:"POST",url:"/graphql"});function l4(e){return xC(e,{method:"POST",url:"/graphql"})}var EC="(?:[a-zA-Z0-9_-]+)",u4="\\.",d4=new RegExp(`^${EC}${u4}${EC}${u4}${EC}$`),Kme=d4.test.bind(d4);async function Jme(e){let t=Kme(e),n=e.startsWith("v1.")||e.startsWith("ghs_"),i=e.startsWith("ghu_");return{type:"token",token:e,tokenType:t?"app":n?"installation":i?"user-to-server":"oauth"}}function Zme(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function Yme(e,t,n,i){let r=t.endpoint.merge(n,i);return r.headers.authorization=Zme(e),t(r)}var p4=function(t){if(!t)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof t!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return t=t.replace(/^(token|bearer) +/i,""),Object.assign(Jme.bind(null,t),{hook:Yme.bind(null,t)})};var TC="7.0.8";var f4=()=>{},Qme=console.warn.bind(console),Xme=console.error.bind(console);function ege(e={}){return typeof e.debug!="function"&&(e.debug=f4),typeof e.info!="function"&&(e.info=f4),typeof e.warn!="function"&&(e.warn=Qme),typeof e.error!="function"&&(e.error=Xme),e}var m4=`octokit-core.js/${TC} ${Ys()}`,fk=class{static VERSION=TC;static defaults(t){return class extends this{constructor(...i){let r=i[0]||{};if(typeof t=="function"){super(t(r));return}super(Object.assign({},t,r,r.userAgent&&t.userAgent?{userAgent:`${r.userAgent} ${t.userAgent}`}:null))}}}static plugins=[];static plugin(...t){let n=this.plugins;return class extends this{static plugins=n.concat(t.filter(r=>!n.includes(r)))}}constructor(t={}){let n=new F2.Collection,i={baseUrl:bg.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(i.headers["user-agent"]=t.userAgent?`${t.userAgent} ${m4}`:m4,t.baseUrl&&(i.baseUrl=t.baseUrl),t.previews&&(i.mediaType.previews=t.previews),t.timeZone&&(i.headers["time-zone"]=t.timeZone),this.request=bg.defaults(i),this.graphql=l4(this.request).defaults(i),this.log=ege(t.log),this.hook=n,t.authStrategy){let{authStrategy:o,...s}=t,a=o(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:s},t.auth));n.wrap("request",a.hook),this.auth=a}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{let o=p4(t.auth);n.wrap("request",o.hook),this.auth=o}let r=this.constructor;for(let o=0;o{e.log.debug("request",n);let i=Date.now(),r=e.request.endpoint.parse(n),o=r.url.replace(n.baseUrl,"");return t(n).then(s=>{let a=s.headers["x-github-request-id"];return e.log.info(`${r.method} ${o} - ${s.status} with id ${a} in ${Date.now()-i}ms`),s}).catch(s=>{let a=s.response?.headers["x-github-request-id"]||"UNKNOWN";throw e.log.error(`${r.method} ${o} - ${s.status} with id ${a} in ${Date.now()-i}ms`),s})})}IC.VERSION=g4;var tge="0.0.0-development";function nge(e){if(!e.data)return{...e,data:[]};if(!(("total_count"in e.data||"total_commits"in e.data)&&!("url"in e.data)))return e;let n=e.data.incomplete_results,i=e.data.repository_selection,r=e.data.total_count,o=e.data.total_commits;delete e.data.incomplete_results,delete e.data.repository_selection,delete e.data.total_count,delete e.data.total_commits;let s=Object.keys(e.data)[0],a=e.data[s];return e.data=a,typeof n<"u"&&(e.data.incomplete_results=n),typeof i<"u"&&(e.data.repository_selection=i),e.data.total_count=r,e.data.total_commits=o,e}function AC(e,t,n){let i=typeof t=="function"?t.endpoint(n):e.request.endpoint(t,n),r=typeof t=="function"?t:e.request,o=i.method,s=i.headers,a=i.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!a)return{done:!0};try{let c=await r({method:o,url:a,headers:s}),l=nge(c);if(a=((l.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!a&&"total_commits"in l.data){let u=new URL(l.url),d=u.searchParams,p=parseInt(d.get("page")||"1",10),f=parseInt(d.get("per_page")||"250",10);p*f{if(r.done)return t;let o=!1;function s(){o=!0}return t=t.concat(i?i(r.value,s):r.value.data),o?t:y4(e,t,n,i)})}var nKe=Object.assign(h4,{iterator:AC});function RC(e){return{paginate:Object.assign(h4.bind(null,e),{iterator:AC.bind(null,e)})}}RC.VERSION=tge;var NC="17.0.0";var rge={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteCustomImageFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],deleteCustomImageVersionFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomImageForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],getCustomImageVersionForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listCustomImageVersionsForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"],listCustomImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingPremiumRequestUsageReportOrg:["GET /organizations/{org}/settings/billing/premium_request/usage"],getGithubBillingPremiumRequestUsageReportUser:["GET /users/{username}/settings/billing/premium_request/usage"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],repositoryAccessForOrg:["GET /organizations/{org}/dependabot/repository-access"],setRepositoryAccessDefaultLevel:["PUT /organizations/{org}/dependabot/repository-access/default-level"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],updateRepositoryAccessForOrg:["PATCH /organizations/{org}/dependabot/repository-access"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},enterpriseTeamMemberships:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"],get:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],list:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],remove:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"]},enterpriseTeamOrganizations:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"],delete:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignment:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignments:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"]},enterpriseTeams:{create:["POST /enterprises/{enterprise}/teams"],delete:["DELETE /enterprises/{enterprise}/teams/{team_slug}"],get:["GET /enterprises/{enterprise}/teams/{team_slug}"],list:["GET /enterprises/{enterprise}/teams"],update:["PATCH /enterprises/{enterprise}/teams/{team_slug}"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addBlockedByDependency:["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],getParent:["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listDependenciesBlockedBy:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],listDependenciesBlocking:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeDependencyBlockedBy:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createArtifactStorageRecord:["POST /orgs/{org}/artifacts/metadata/storage-record"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createWebhook:["POST /orgs/{org}/hooks"],customPropertiesForOrgsCreateOrUpdateOrganizationValues:["PATCH /organizations/{org}/org-properties/values"],customPropertiesForOrgsGetOrganizationValues:["GET /organizations/{org}/org-properties/values"],customPropertiesForReposCreateOrUpdateOrganizationDefinition:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposCreateOrUpdateOrganizationDefinitions:["PATCH /orgs/{org}/properties/schema"],customPropertiesForReposCreateOrUpdateOrganizationValues:["PATCH /orgs/{org}/properties/values"],customPropertiesForReposDeleteOrganizationDefinition:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinition:["GET /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinitions:["GET /orgs/{org}/properties/schema"],customPropertiesForReposGetOrganizationValues:["GET /orgs/{org}/properties/values"],delete:["DELETE /orgs/{org}"],deleteAttestationsBulk:["POST /orgs/{org}/attestations/delete-request"],deleteAttestationsById:["DELETE /orgs/{org}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /orgs/{org}/attestations/digest/{subject_digest}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],disableSelectedRepositoryImmutableReleasesOrganization:["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],enableSelectedRepositoryImmutableReleasesOrganization:["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],get:["GET /orgs/{org}"],getImmutableReleasesSettings:["GET /orgs/{org}/settings/immutable-releases"],getImmutableReleasesSettingsRepositories:["GET /orgs/{org}/settings/immutable-releases/repositories"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listArtifactStorageRecords:["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"],listAttestationRepositories:["GET /orgs/{org}/attestations/repositories"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listAttestationsBulk:["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setImmutableReleasesSettings:["PUT /orgs/{org}/settings/immutable-releases"],setImmutableReleasesSettingsRepositories:["PUT /orgs/{org}/settings/immutable-releases/repositories"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addItemForOrg:["POST /orgs/{org}/projectsV2/{project_number}/items"],addItemForUser:["POST /users/{username}/projectsV2/{project_number}/items"],deleteItemForOrg:["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],deleteItemForUser:["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"],getFieldForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"],getFieldForUser:["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"],getForOrg:["GET /orgs/{org}/projectsV2/{project_number}"],getForUser:["GET /users/{username}/projectsV2/{project_number}"],getOrgItem:["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],getUserItem:["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"],listFieldsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields"],listFieldsForUser:["GET /users/{username}/projectsV2/{project_number}/fields"],listForOrg:["GET /orgs/{org}/projectsV2"],listForUser:["GET /users/{username}/projectsV2"],listItemsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/items"],listItemsForUser:["GET /users/{username}/projectsV2/{project_number}/items"],updateItemForOrg:["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],updateItemForUser:["PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkImmutableReleases:["GET /repos/{owner}/{repo}/immutable-releases"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],customPropertiesForReposCreateOrUpdateRepositoryValues:["PATCH /repos/{owner}/{repo}/properties/values"],customPropertiesForReposGetRepositoryValues:["GET /repos/{owner}/{repo}/properties/values"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disableImmutableReleases:["DELETE /repos/{owner}/{repo}/immutable-releases"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enableImmutableReleases:["PUT /repos/{owner}/{repo}/immutable-releases"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],listOrgPatternConfigs:["GET /orgs/{org}/secret-scanning/pattern-configurations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],updateOrgPatternConfigs:["PATCH /orgs/{org}/secret-scanning/pattern-configurations"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteAttestationsBulk:["POST /users/{username}/attestations/delete-request"],deleteAttestationsById:["DELETE /users/{username}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /users/{username}/attestations/digest/{subject_digest}"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listAttestationsBulk:["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},b4=rge;var Pc=new Map;for(let[e,t]of Object.entries(b4))for(let[n,i]of Object.entries(t)){let[r,o,s]=i,[a,c]=r.split(/ /),l=Object.assign({method:a,url:c},o);Pc.has(e)||Pc.set(e,new Map),Pc.get(e).set(n,{scope:e,methodName:n,endpointDefaults:l,decorations:s})}var ige={has({scope:e},t){return Pc.get(e).has(t)},getOwnPropertyDescriptor(e,t){return{value:this.get(e,t),configurable:!0,writable:!0,enumerable:!0}},defineProperty(e,t,n){return Object.defineProperty(e.cache,t,n),!0},deleteProperty(e,t){return delete e.cache[t],!0},ownKeys({scope:e}){return[...Pc.get(e).keys()]},set(e,t,n){return e.cache[t]=n},get({octokit:e,scope:t,cache:n},i){if(n[i])return n[i];let r=Pc.get(t).get(i);if(!r)return;let{endpointDefaults:o,decorations:s}=r;return s?n[i]=oge(e,t,i,o,s):n[i]=e.request.defaults(o),n[i]}};function CC(e){let t={};for(let n of Pc.keys())t[n]=new Proxy({octokit:e,scope:n,cache:{}},ige);return t}function oge(e,t,n,i,r){let o=e.request.defaults(i);function s(...a){let c=o.endpoint.merge(...a);if(r.mapToData)return c=Object.assign({},c,{data:c[r.mapToData],[r.mapToData]:void 0}),o(c);if(r.renamed){let[l,u]=r.renamed;e.log.warn(`octokit.${t}.${n}() has been renamed to octokit.${l}.${u}()`)}if(r.deprecated&&e.log.warn(r.deprecated),r.renamedParameters){let l=o.endpoint.merge(...a);for(let[u,d]of Object.entries(r.renamedParameters))u in l&&(e.log.warn(`"${u}" parameter is deprecated for "octokit.${t}.${n}()". Use "${d}" instead`),d in l||(l[d]=l[u]),delete l[u]);return o(l)}return o(...a)}return Object.assign(s,o)}function sge(e){return{rest:CC(e)}}sge.VERSION=NC;function PC(e){let t=CC(e);return{...t,rest:t}}PC.VERSION=NC;var v4="22.0.1";var w4=fk.plugin(IC,PC,RC).defaults({userAgent:`octokit-rest.js/${v4}`});var age="drift",mk=class{octokit;logger;selfLogin;constructor(t){this.octokit=new w4({auth:t.repoToken,baseUrl:t.baseUrl??"https://api.github.com",userAgent:"drift-bot/0.1"}),this.logger=t.logger}async readFile(t,n,i){try{let o=(await this.octokit.repos.getContent({owner:t.owner,repo:t.repo,path:n,ref:i})).data;return Array.isArray(o)||o.type!=="file"||!("content"in o)?null:Buffer.from(o.content,"base64").toString("utf8")}catch(r){if(k4(r))return null;throw this.logger.debug(`Failed to read ${n}@${i}: ${r.message}`),r}}async listFiles(t,n){try{let i=await this.octokit.git.getTree({owner:t.owner,repo:t.repo,tree_sha:n,recursive:"true"});return i.data.truncated?(this.logger.warn(`The file tree at ${n} is too large for GitHub to return in full, so path patterns cannot be expanded against it. List the contract documents by literal path instead.`),null):i.data.tree.filter(r=>r.type==="blob"&&typeof r.path=="string").map(r=>r.path)}catch(i){return this.logger.debug(`Could not list the tree at ${n}: ${i.message}`),null}}async changedFiles(t){try{let n=await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${t.beforeSha}...${t.afterSha}`}),i=n.data.files??[],r=n.data.commits??[];return i.length>=300||r.lengths.filename)}catch(n){throw this.logger.warn(`Could not compare ${t.beforeSha}...${t.afterSha}: ${n.message}`),n}}async changedFilesByCommit(t){let n=new Set;for await(let r of this.octokit.paginate.iterator(this.octokit.repos.compareCommitsWithBasehead,{owner:t.owner,repo:t.repo,basehead:`${t.beforeSha}...${t.afterSha}`,per_page:250})){let o=r.data;for(let s of o.commits??[])n.add(s.sha)}let i=new Set;for(let r of n)for await(let o of this.octokit.paginate.iterator(this.octokit.repos.getCommit,{owner:t.owner,repo:t.repo,ref:r,per_page:300})){let s=o.data;for(let a of s.files??[])i.add(a.filename)}return[...i]}async createBranch(t,n,i){try{return await this.octokit.git.createRef({owner:t.owner,repo:t.repo,ref:`refs/heads/${n}`,sha:i}),this.logger.info(`Created branch ${n} at ${i.slice(0,7)}`),!0}catch(r){if(lge(r)){let o=await this.getBranchHead(t,n);return o===i?(this.logger.info(`Branch ${n} already exists at ${i.slice(0,7)}; reusing it`),!0):o&&await this.isAncestor(t,i,o)?await this.commitsAreAllBots(t,i,o)?(this.logger.info(`Branch ${n} already exists ahead of ${i.slice(0,7)}; reusing it`),!0):(this.logger.error(`Branch ${n} already exists ahead of ${i.slice(0,7)} with commit(s) not made by Drift; refusing to reuse a branch that may carry manual changes`),!1):(this.logger.error(`Branch ${n} already exists but is not based on ${i.slice(0,7)} (current head: ${o??"unknown"}); refusing to reuse a stale branch`),!1)}return this.logger.error(`Could not create branch ${n}: ${r.message}`),!1}}async isAncestor(t,n,i){if(n===i)return!0;try{let r=await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${n}...${i}`});return r.data.status==="ahead"||r.data.status==="identical"}catch{return!1}}async commitsAreAllBots(t,n,i){try{let o=(await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${n}...${i}`})).data.commits??[];return o.length===0?!0:o.every(s=>(s.author?.login??s.committer?.login??"").endsWith("[bot]"))}catch{return!1}}async commitFiles(t,n,i,r){if(i.length===0)return null;try{let s=(await this.octokit.git.getRef({owner:t.owner,repo:t.repo,ref:`heads/${n}`})).data.object.sha,a=await this.octokit.git.getCommit({owner:t.owner,repo:t.repo,commit_sha:s}),c=await Promise.all(i.map(async d=>{let p=await this.octokit.git.createBlob({owner:t.owner,repo:t.repo,content:Buffer.from(d.content,"utf8").toString("base64"),encoding:"base64"});return{path:d.path,mode:"100644",type:"blob",sha:p.data.sha}})),l=await this.octokit.git.createTree({owner:t.owner,repo:t.repo,base_tree:a.data.tree.sha,tree:c}),u=await this.octokit.git.createCommit({owner:t.owner,repo:t.repo,message:r,tree:l.data.sha,parents:[s]});return await this.octokit.git.updateRef({owner:t.owner,repo:t.repo,ref:`heads/${n}`,sha:u.data.sha}),this.logger.info(`Committed ${i.length} file(s) to ${n}: ${u.data.sha.slice(0,7)}`),{sha:u.data.sha}}catch(o){return this.logger.error(`Could not commit to ${n}: ${o.message}`),null}}async createIssue(t,n){try{let i=await this.octokit.issues.create({owner:t.owner,repo:t.repo,title:n.title,body:n.body,labels:n.labels,assignees:n.assignees});return{number:i.data.number,url:i.data.html_url}}catch(i){return this.logger.error(`Could not create issue: ${i.message}`),null}}async getCollaboratorPermission(t,n){try{let i=await this.octokit.repos.getCollaboratorPermissionLevel({owner:t.owner,repo:t.repo,username:n}),r=i.data.permission,s=(i.data.role_name??r??"").toLowerCase();switch(s){case"admin":case"maintain":case"write":case"triage":case"read":case"none":return s;case"push":return"write";case"pull":return"read";default:return this.logger.warn(`Unrecognised permission \`${s}\` for ${n}; treating it as unknown and refusing.`),null}}catch(i){return k4(i)?"none":(this.logger.warn(`Could not determine ${n}'s permission on ${t.owner}/${t.repo}: ${i.message}`),null)}}async getAuthenticatedLogin(){if(this.selfLogin!==void 0)return this.selfLogin;try{let t=await this.octokit.users.getAuthenticated();this.selfLogin=t.data.login}catch{this.selfLogin=null}return this.selfLogin}async getIssue(t,n){try{let i=await this.octokit.issues.get({owner:t.owner,repo:t.repo,issue_number:n});return{number:i.data.number,body:i.data.body??null,state:i.data.state,labels:i.data.labels.map(r=>typeof r=="string"?r:r.name??"").filter(Boolean),pullRequest:!!i.data.pull_request}}catch(i){return this.logger.warn(`Could not read issue #${n}: ${i.message}`),null}}async listIssueComments(t,n){try{return(await this.octokit.issues.listComments({owner:t.owner,repo:t.repo,issue_number:n,per_page:100})).data.map(r=>({id:r.id,body:r.body??null,authorLogin:r.user?.login??null}))}catch(i){throw this.logger.warn(`Could not list comments on #${n}: ${i.message}`),i}}async commitExists(t,n){try{return await this.octokit.repos.getCommit({owner:t.owner,repo:t.repo,ref:n}),!0}catch{return!1}}async getBranchHead(t,n){try{return(await this.octokit.repos.getBranch({owner:t.owner,repo:t.repo,branch:n})).data.commit.sha}catch{return null}}async commentOnIssue(t,n,i){try{return await this.octokit.issues.createComment({owner:t.owner,repo:t.repo,issue_number:n,body:i}),!0}catch(r){return this.logger.warn(`Could not comment on #${n}: ${r.message}`),!1}}async findOpenPlanIssue(t,n){try{return(await this.octokit.search.issuesAndPullRequests({q:`repo:${t.owner}/${t.repo} is:issue is:open in:body "${n}"`,per_page:1})).data.items[0]?.number??null}catch{return null}}async findOpenAlertIssues(t){try{let n=await this.octokit.search.issuesAndPullRequests({q:`repo:${t.owner}/${t.repo} is:issue is:open label:${age} "drift-alert:"`,per_page:100}),i=[];for(let r of n.data.items){let o=//.exec(r.body??"");o&&i.push({number:r.number,marker:o[1]})}return i}catch{return[]}}async updateIssueBody(t,n,i){try{await this.octokit.issues.update({owner:t.owner,repo:t.repo,issue_number:n,body:i})}catch(r){this.logger.warn(`Could not update issue #${n}: ${r.message}`)}}async updateIssueComment(t,n,i){try{await this.octokit.issues.updateComment({owner:t.owner,repo:t.repo,comment_id:n,body:i})}catch(r){this.logger.warn(`Could not update comment ${n}: ${r.message}`)}}async closeIssue(t,n,i){try{i&&await this.commentOnIssue(t,n,i),await this.octokit.issues.update({owner:t.owner,repo:t.repo,issue_number:n,state:"closed"})}catch(r){this.logger.warn(`Could not close issue #${n}: ${r.message}`)}}async createCheckRun(t,n){try{await this.octokit.checks.create({owner:t.owner,repo:t.repo,name:n.name,head_sha:t.afterSha,status:"completed",conclusion:n.conclusion,output:{title:n.title,summary:n.summary,text:n.text}})}catch(i){this.logger.debug(`Could not create check run: ${i.message}`)}}async uploadSarif(t,n){let i=(0,$4.gzipSync)(Buffer.from(JSON.stringify(n.sarif),"utf8")),r=3;for(let o=1;o<=r;o++)try{return await this.octokit.codeScanning.uploadSarif({owner:t.owner,repo:t.repo,commit_sha:n.commitSha,ref:n.ref,sarif:i.toString("base64")}),this.logger.info("Uploaded SARIF results to code scanning."),!0}catch(s){let a=s?.status;if(a===403)return this.logger.warn("Could not upload code scanning results: the token is missing `security-events: write`. Add it to the workflow job's `permissions` to enable Drift's code scanning alerts."),!1;if((a===void 0||a>=500)&&os.includes("/")).map(s=>s.split("/").pop()),o=i.reviewers.filter(s=>!s.includes("/"));await this.octokit.pulls.requestReviewers({owner:t.owner,repo:t.repo,pull_number:n,reviewers:o,team_reviewers:r})}catch(r){this.logger.warn(`Could not request reviewers on #${n}: ${r.message}`)}}async updatePullRequestBody(t,n,i){try{await this.octokit.pulls.update({owner:t.owner,repo:t.repo,pull_number:n,body:i})}catch(r){this.logger.warn(`Could not update PR #${n}: ${r.message}`)}}async getDefaultBranch(t,n){try{return(await this.octokit.repos.get({owner:t,repo:n})).data.default_branch}catch{return null}}asRepoProvider(t){return{changedFiles:()=>this.changedFiles(t),readFile:(n,i)=>this.readFile(t,n,i),listFiles:n=>this.listFiles(t,n)}}get rest(){return this.octokit}};function cge(e){return new Promise(t=>setTimeout(t,e))}function k4(e){return e?.status===404}function lge(e){let t=e?.status,n=e?.message??"";return t===422&&/already exists/i.test(n)}var Cx=require("node:path"),Ff=require("node:fs/promises");function DC(e,t){return uge(e).test(t)}function Yo(e,t){return e.some(n=>DC(n,t))}var _4=new Map;function uge(e){let t=_4.get(e);if(t)return t;let n="^";for(let r=0;r{let c={kind:"list",items:[]};i.items.push(c),i=c,r.push(c)};for(let c=0;cs&&(i.items.length>0&&a(),i.items.push(vW(t.slice(s,c),!0)),s=c,a()),o=!0):(o&&c>s&&(i.items.push(Tk(!0,t.slice(s,c))),s=c,a()),o=!1)}for(t.length>s&&i.items.push(Tk(o,t.slice(s)));r.length;)$be(r.pop());return{items:n}}function hW(e,t){return Ik(e.items,t.items)}function yW(e){let t=[],n=e.items;for(;n;){let i=null;for(let r of n.items){if(r.kind==="int"){t.push(Number(r.value));continue}r.kind==="list"&&t.length>0&&(i=r);break}n=i}return t.length?t:null}function bW(e){let t=n=>n.items.some(i=>i.kind==="list"?t(i):i.kind!=="string"?!1:Sg(i.value)="0"&&e<="9"}function nP(e){return{kind:"int",value:e}}function Tk(e,t){if(e){let n=t.replace(/^0+/,"")||"0";return nP(BigInt(n))}return vW(t,!1)}function vW(e,t){let n=e;return t&&n.length===1&&(n=vbe.get(n)??n),{kind:"string",value:bbe.get(n)??n}}function Sg(e){let t=tP.indexOf(e);return t===-1?`${tP.length}-${e}`:String(t)}function kbe(e){switch(e.kind){case"int":return e.value===0n;case"string":return Sg(e.value)===rP;case"list":return e.items.length===0}}function $be(e){for(let t=e.items.length-1;t>=0;t--){let n=e.items[t];if(kbe(n))e.items.splice(t,1);else if(n.kind!=="list")break}}function mW(e,t){return et?1:0}function Ik(e,t){switch(e.kind){case"int":return _be(e,t);case"string":return Sbe(e,t);case"list":return xbe(e,t)}}function _be(e,t){if(t===null)return e.value===0n?0:1;switch(t.kind){case"int":return e.valuet.value?1:0;case"string":return 1;case"list":return 1}}function Sbe(e,t){if(t===null)return mW(Sg(e.value),rP);switch(t.kind){case"int":return-1;case"string":return mW(Sg(e.value),Sg(t.value));case"list":return-1}}function xbe(e,t){if(t===null)return e.items.length===0?0:Ik(e.items[0],null);switch(t.kind){case"int":return-1;case"string":return 1;case"list":{let n=Math.max(e.items.length,t.items.length);for(let i=0;iTe(t,e),compare:Qe,satisfies:(t,n)=>AW(t,n),sameCompatibilityLine:Ebe,classifyBump:sP,exactVersion:t=>RW(t,e)}}function Te(e,t){let n=e.trim();if(!n||/\s/.test(n))return null;if(SW.has(t)){let r=t==="go"||t==="swift"||t==="cocoapods"?n.replace(/^v(?=\d)/,""):n,o=ea.default.valid(r);if(!o){let a=/^(\d+(?:\.\d+){0,1})([-+][0-9A-Za-z.-]+)?$/.exec(r);if(a){let c=a[1].split(".");o=ea.default.valid(`${c.join(".")}${".0".repeat(3-c.length)}${a[2]??""}`)}}if(!o)return null;let s=ea.default.parse(o);return{raw:n,ecosystem:t,prerelease:s.prerelease.length>0,comparable:{kind:"semver",value:o},release:[s.major,s.minor,s.patch]}}if(t==="pypi"){let i=CW(n);return i?{raw:n,ecosystem:t,prerelease:i.pre!==null||i.dev!==null,comparable:{kind:"pep440",value:i},release:i.release}:null}if(t==="rubygems"){if(!/^\d[0-9A-Za-z._-]*$/.test(n))return null;let i=Pbe(n);return{raw:n,ecosystem:t,prerelease:i.some(r=>typeof r=="string"),comparable:{kind:"ruby",value:i},release:zbe(i)}}if(t==="maven"){if(!/^\d[0-9A-Za-z._+-]*$/.test(n))return null;let i=gW(n);return{raw:n,ecosystem:t,prerelease:bW(i),comparable:{kind:"maven",value:i},release:yW(i)}}if(t==="nuget"){let i=Mbe(n);return i?{raw:n,ecosystem:t,prerelease:i.prerelease!==null,comparable:{kind:"nuget",value:i},release:i.release}:null}if(t==="opam"){if(!/\d/.test(n))return null;let i=/^v?(\d+(?:\.\d+)*)/.exec(n)?.[1]?.split(".").map(Number)??null;return{raw:n,ecosystem:t,prerelease:/(?:^|[._+-])(?:alpha|beta|pre|preview|rc|dev)\d*/i.test(n),comparable:{kind:"opam",value:n},release:i}}return null}function Qe(e,t){if(e.ecosystem!==t.ecosystem||e.comparable.kind!==t.comparable.kind)return null;switch(e.comparable.kind){case"semver":return ea.default.compare(e.comparable.value,t.comparable.value);case"pep440":return zi(e.comparable.value,t.comparable.value);case"ruby":return Dbe(e.comparable.value,t.comparable.value);case"maven":return hW(e.comparable.value,t.comparable.value);case"nuget":return Lbe(e.comparable.value,t.comparable.value);case"opam":return Fbe(e.comparable.value,t.comparable.value)}}function Eg(e,t,n){if(NW(n)){let s=iP(e),a=iP(t);return s&&a&&s===a?0:null}let i=Gi(n),r=i.parse(e),o=i.parse(t);return r&&o?i.compare(r,o):null}function xW(e,t,n){let i=Te(e,n);return i?AW(i,t):null}function oP(e,t,n){if(e===null&&t!==null)return"added";if(e!==null&&t===null)return"removed";if(e===null||t===null)return"unknown";let i=Te(e,n),r=Te(t,n);return i&&r?sP(i,r):"unknown"}function EW(e,t,n){if(e===null||t===null)return oP(e,t,n);let i=kW(e,n),r=kW(t,n);return i&&r?sP(i,r):"unknown"}function TW(e,t,n){if(!e||!t)return null;let i=Eg(t,e,n);return i===null?null:i<0}function IW(e,t,n){if(!e||!t||!SW.has(n))return!1;let i=Te(e,n),r=Te(t,n);return!!(i?.release&&r?.release&&i.release[0]===0&&r.release[0]===0&&i.release[1]!==r.release[1])}function sP(e,t){let n=Qe(e,t);if(n===null||n===0)return"unknown";let i=e.release,r=t.release;return!i||!r?"unknown":(i[0]??0)!==(r[0]??0)?"major":(i[1]??0)!==(r[1]??0)?"minor":(i[2]??0)!==(r[2]??0)?"patch":e.prerelease||t.prerelease?"prerelease":"unknown"}function Ebe(e,t){if(e.ecosystem!==t.ecosystem||!e.release||!t.release||e.ecosystem==="maven"||e.ecosystem==="opam")return null;let n=e.release[0]??0;return n===0?(t.release[0]??0)===0&&(t.release[1]??0)===(e.release[1]??0):(t.release[0]??0)===n}function AW(e,t){let n=t.trim();if(!n||n==="*")return!0;if(e.comparable.kind==="semver"){let i=n;e.ecosystem==="cargo"&&/^v?\d+(?:\.\d+){0,2}$/.test(n)&&(i=`^${n}`);let r=ea.default.validRange(i);return r?ea.default.satisfies(e.comparable.value,r):null}if(e.comparable.kind==="pep440")return Rbe(e.comparable.value,e.raw,n);if(e.comparable.kind==="ruby")return Obe(e,n);if(e.comparable.kind==="maven")return wW(e,n,/^([[(])\s*([^,]*)\s*,\s*([^\])]*?)\s*([\])])$/);if(e.comparable.kind==="nuget"){if(/^[[(]/.test(n))return wW(e,n,/^([[(])\s*([^,]*)\s*,?\s*([^\])]*?)\s*([\])])$/);let i=Te(n,"nuget"),r=i?Qe(e,i):null;return r===null?null:r>=0}return e.comparable.kind==="opam"?jbe(e,n):null}function wW(e,t,n){let i=n.exec(t);if(!i){let c=Te(t,e.ecosystem),l=c?Qe(e,c):null;return l===null?null:l===0}let[,r,o,s,a]=i;if(o){let c=Te(o,e.ecosystem),l=c?Qe(e,c):null;if(l===null)return null;if(l<0||l===0&&r==="(")return!1}if(s){let c=Te(s,e.ecosystem),l=c?Qe(e,c):null;if(l===null)return null;if(l>0||l===0&&a===")")return!1}return!0}function RW(e,t){let n=e.trim();if(NW(t))return iP(n);if(t==="npm")return ea.default.valid(n)?n:null;if(t==="cargo"){let i=/^=\s*(v?\d+(?:\.\d+){2}(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)$/.exec(n);return i&&Te(i[1],t)?i[1]:null}if(t==="pypi"){let i=/^==\s*([^,;\s]+)$/.exec(n);return i&&!i[1].includes("*")&&Te(i[1],t)?i[1]:null}if(t==="rubygems"){let i=/^(?:=|==)\s*([^,\s]+)$/.exec(n);return i&&Te(i[1],t)?i[1]:null}if(t==="nuget"){let i=/^\[\s*([^,\]]+)\s*\]$/.exec(n);return i&&Te(i[1],t)?i[1]:null}return Te(n,t)?n:null}function iP(e){let t=e.trim();return!t||/\s/.test(t)||/[\[\]<>~=^*,|&]/.test(t)?null:t}function NW(e){return e==="conan"||e==="vcpkg"}function kW(e,t){let n=RW(e,t);if(n)return Te(n,t);let i=e.trim().match(/(?:^|[<>=~^\[(,{"'\s])(v?\d+(?:!\d+)?(?:\.\d+)*(?:(?:a|b|rc)\d+|[-.](?:alpha|beta|rc)[-.]?\d*)?)/i);return i?Te(i[1],t):null}var Tbe=/^v?(?:(?:(\d+)!)?(\d+(?:\.\d+)*)(?:[-_.]?(alpha|a|beta|b|preview|pre|c|rc)[-_.]?(\d+)?)?(?:(?:-(\d+))|(?:[-_.]?(post|rev|r)[-_.]?(\d+)?))?(?:[-_.]?(dev)[-_.]?(\d+)?)?)(?:\+([a-z0-9]+(?:[-_.][a-z0-9]+)*))?$/;function CW(e){let t=Tbe.exec(e.trim().toLowerCase());if(!t)return null;let n=t[3],i=n?/^(a|alpha)$/.test(n)?0:/^(b|beta)$/.test(n)?1:2:null;return{epoch:Number(t[1]??0),release:t[2].split(".").map(Number),pre:i===null?null:[i,Number(t[4]??0)],post:t[5]!==void 0?Number(t[5]):t[6]?Number(t[7]??0):null,dev:t[8]?Number(t[9]??0):null,local:t[10]?t[10].split(/[-_.]/).map(r=>/^\d+$/.test(r)?Number(r):r):null}}function bd(e){return{epoch:e.epoch,release:e.release,pre:null,post:null,dev:null,local:null}}function xg(e){return e.local===null?e:{...e,local:null}}function $W(e){return e.pre!==null||e.dev!==null}function zi(e,t){let n=Rk(e.epoch,t.epoch)||Ak(e.release,t.release);return n||(n=Ibe(e,t),n)||(n=_W(e.post,t.post,-1),n)||(n=_W(e.dev,t.dev,1),n)?n:Abe(e.local,t.local)}function Ibe(e,t){let n=e.pre??(e.dev!==null&&e.post===null?[-1,0]:[3,0]),i=t.pre??(t.dev!==null&&t.post===null?[-1,0]:[3,0]);return Ak(n,i)}function Abe(e,t){if(!e||!t)return e?1:t?-1:0;let n=Math.max(e.length,t.length);for(let i=0;ir.trim()).filter(Boolean);if(!i.length)return!0;for(let r of i){let o=Nbe(e,t,r);if(o!==!0)return o}return!0}function Nbe(e,t,n){let i=/^(===|~=|==|!=|<=|>=|<|>)\s*(.+)$/.exec(n);if(!i)return null;let r=i[1],o=i[2].trim();if(r==="===")return t.trim().toLowerCase()===o.toLowerCase();if(o.endsWith(".*")){if(r!=="=="&&r!=="!=")return null;let a=Cbe(e,o.slice(0,-2));return a===null?null:r==="=="?a:!a}let s=CW(o);if(!s)return null;switch(r){case"==":return zi(s.local===null?xg(e):e,s)===0;case"!=":return zi(s.local===null?xg(e):e,s)!==0;case"<=":return zi(xg(e),s)<=0;case">=":return zi(xg(e),s)>=0;case"<":return!(zi(e,s)>=0||!$W(s)&&$W(e)&&zi(bd(e),bd(s))===0);case">":return!(zi(e,s)<=0||s.post===null&&e.post!==null&&zi(bd(e),bd(s))===0||e.local!==null&&zi(bd(e),bd(s))===0);case"~=":{if(s.local!==null)return null;let a=s.pre===null?s.release.length:s.release.length+1;if(a<2)return null;if(zi(xg(e),s)<0)return!1;let c=s.release.slice(0,Math.min(a-1,s.release.length));return e.epoch===s.epoch&&c.every((l,u)=>(e.release[u]??0)===l)}default:return null}}function Cbe(e,t){let n=/^v?(?:(\d+)!)?(\d+(?:\.\d+)*)$/.exec(t.trim());if(!n)return null;let i=Number(n[1]??0),r=n[2].split(".").map(Number);return e.epoch===i&&r.every((o,s)=>(e.release[s]??0)===o)}function Pbe(e){return e.replace(/-/g,".pre.").match(/[0-9]+|[A-Za-z]+/g)?.map(t=>/^\d+$/.test(t)?Number(t):t.toLowerCase())??[]}function Dbe(e,t){let n=Math.max(e.length,t.length);for(let i=0;ii.trim()).filter(Boolean);if(!n.length)return!0;for(let i of n){let r=/^(~>|>=|<=|>|<|=|==)?\s*([^\s]+)$/.exec(i);if(!r)return null;let o=r[1]??"=",s=Te(r[2],"rubygems");if(!s)return null;let a=Qe(e,s);if((o==="="||o==="==")&&a!==0||o===">="&&a<0||o===">"&&a<=0||o==="<="&&a>0||o==="<"&&a>=0)return!1;if(o==="~>"){if(a<0||!s.release)return!1;let c=r[2].match(/\d+/g)?.length??0,l=[...s.release],u=c>=3?1:0;if(l[u]=(l[u]??0)+1,l.splice(u+1),Ak(e.release??[],l)>=0)return!1}}return!0}function Mbe(e){let t=/^[vV]?(\d+(?:\.\d+){0,3})(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z.-]+)?$/.exec(e);return t?{release:t[1].split(".").map(Number),prerelease:t[2]?t[2].toLowerCase().split(".").map(n=>/^\d+$/.test(n)?Number(n):n):null}:null}function Lbe(e,t){let n=Ak(e.release,t.release);if(n)return n;if(!e.prerelease||!t.prerelease)return e.prerelease?-1:t.prerelease?1:0;let i=Math.max(e.prerelease.length,t.prerelease.length);for(let r=0;ri==="~"?-1:i===void 0?0:/[A-Za-z]/.test(i)?i.charCodeAt(0):i.charCodeAt(0)+256;return Rk(n(e),n(t))}function jbe(e,t){let i=t.trim().replace(/^\{\s*|\s*\}$/g,"").split(/\s*(?:&|&&)\s*/).filter(Boolean);if(!i.length)return null;for(let r of i){let o=/^(>=|<=|>|<|=)?\s*["']?([^"'\s]+)["']?$/.exec(r);if(!o)return null;let s=Te(o[2],"opam"),a=s?Qe(e,s):null;if(a===null)return null;let c=o[1]??"=";if(c==="="&&a!==0||c===">="&&a<0||c===">"&&a<=0||c==="<="&&a>0||c==="<"&&a>=0)return!1}return!0}function zbe(e){let t=[];for(let n of e){if(typeof n!="number")break;t.push(n)}return t.length?t:null}function Ak(e,t){let n=Math.max(e.length,t.length);for(let i=0;it?1:0}function Gbe(e){if(!e)return null;let t=e.trim();if(!t)return null;let n=/^npm:(?:@[^/]+\/)?[^@]+@(.+)$/i.exec(t);if(n)t=n[1].trim();else if(/^(git|github|file|link|workspace|npm|https?):/i.test(t))return null;return t==="*"||t==="latest"||t===""?null:(t=t.split(/\|\||,/)[0].trim(),t=t.replace(/^[\^~><=!]+\s*/,"").replace(/^[[(]\s*/,""),t=t.split(/\s+/)[0].trim(),t=t.replace(/^v/i,"").replace(/[\])]$/,""),t=t.replace(/\+incompatible$/,""),t||null)}function Ck(e){let t=Gbe(e);return t?Nk.default.valid(t)??Nk.default.valid(Nk.default.coerce(t)??"")??null:null}function ta(e,t,n="npm"){return oP(e,t,n)}function Tg(e,t,n="npm"){return TW(e,t,n)===!0}function Ig(e,t,n="npm"){return IW(e,t,n)}function me(e){let t=e.split("/");return(t[t.length-1]??"").toLowerCase()}function Gt(e){try{return JSON.parse(e)}catch{return null}}var DW={ecosystem:"arduino",name:"arduino",handles(e){let t=me(e);return t==="library.properties"||t==="platformio.ini"},isLockfile(){return!1},parse(e,t){return me(t)==="platformio.ini"?qbe(e):Vbe(e)}};function Vbe(e){let t=new Map;for(let n of e.split(` -`)){let i=n.trim();if(i.startsWith("#"))continue;let r=/^depends\s*=\s*(.*)$/i.exec(i);if(r)for(let o of r[1].split(",")){let s=Bbe(o);s&&t.set(s.name,{version:s.version,kind:"runtime"})}}return t}function Bbe(e){let t=e.trim();if(!t)return null;let n=/^(.*?)\s*\(([^)]*)\)\s*$/.exec(t);if(n){let i=n[1].trim(),r=n[2].trim();return i?{name:i,version:r||null}:null}return{name:t,version:null}}function qbe(e){let t=new Map,n=e.split(` -`),i=!1;for(let r of n){let o=r.split(/\s+[;#]/)[0],s=o.trim();if(/^\[/.test(s)){i=!1;continue}let a=/^(lib_deps[\w.]*|lib_extra_dirs|lib_ignore)\s*=\s*(.*)$/.exec(s);if(a){i=a[1].startsWith("lib_deps"),i&&a[2]&&PW(t,a[2],"runtime");continue}if(i&&/^\s/.test(o)&&s!==""){PW(t,s,"runtime");continue}s!==""&&(i=!1)}return t}function PW(e,t,n){let i=t.trim();if(!i||/^[a-z+]+:\/\//i.test(i)||i.startsWith("file://")||i.startsWith(".")||i.includes("${")||/\.(git|zip|tar\.gz)$/i.test(i))return;let r=i.lastIndexOf("@"),o=r>0,s=o?i.slice(0,r):i,a=o?i.slice(r+1).trim():null,c=s.lastIndexOf("/"),l=(c===-1?s:s.slice(c+1)).trim();l&&e.set(l,{version:a||null,kind:n})}function pi(e){let t=[],n={header:"",entries:new Map,lines:[]};t.push(n);let i=e.split(` -`);for(let r=0;rvd(u,"]")){let d=vd(u,"[")-vd(u,"]");for(;d>0&&r+1n.header===t)}function Ag(e){let t=e.trim().replace(/^\[/,"").replace(/\]$/,""),n=[];for(let i of t.matchAll(/"((?:[^"\\]|\\.)*)"|'([^']*)'/g)){let r=i[1]??i[2];r!==void 0&&n.push(r)}return n}function wd(e){let t=e.trim();return t.startsWith("{")?/(?:^|[{,]\s*)version\s*=\s*"([^"]*)"/.exec(t)?.[1]??null:/^"([^"]*)"$/.exec(t)?.[1]??/^'([^']*)'$/.exec(t)?.[1]??null}function Pk(e){return e.replace(/^["']|["']$/g,"")}function OW(e){let t=!1,n=!1;for(let i=0;i<=!]*\s*\d[^"']*)["']/g)].map(f=>f[1].trim()).filter(f=>!/^https?:/.test(f)),d=/:(path|git|podspec|svn|hg)\s*(?:=>|:)/.test(c)||l.length===0?null:l.join(", "),p=n.some(f=>/test|spec|uitest/i.test(f))?"dev":"runtime";t.set(a,{version:d,kind:p})}return t}function rve(e){let t=new Map,n=!1;for(let i of e.split(` -`)){let r=i.replace(/\r$/,"");if(!r.trim())continue;if(/^[A-Z][A-Z ]*:\s*$/.test(r.trim())&&!/^\s/.test(r)){n=r.trim()==="PODS:";continue}if(!n)continue;let o=/^ {2}- "?([\w.+/-]+)"? \(([^)]+)\)/.exec(r);o&&t.set(o[1],{version:o[2],kind:"transitive"})}return t}function ive(e){let t=new Map,n=/\.dependency\s+["']([^"']+)["'](?:\s*,\s*["']([^"']+)["'])?/g;for(let i of e.matchAll(n))t.set(i[1],{version:i[2]??null,kind:"runtime"});return t}function ove(e){let t=!1,n=!1;for(let i=0;iu.includes("indirect")?u:"").trim(),s=r.trim();if(/^require\s*\($/.test(s)){n=!0;continue}if(/^replace\s*\($/.test(s)||/^exclude\s*\($/.test(s)){i=!0;continue}if(s===")"){n=!1,i=!1;continue}if(i||s.startsWith("replace ")||s.startsWith("exclude "))continue;let a=/^require\s+(\S+)\s+(\S+)/.exec(s);if(a){t.set(a[1],{version:a[2],kind:"runtime"});continue}if(!n)continue;let c=/^(\S+)\s+(v\S+)/.exec(o||s);if(!c)continue;let l=s.includes("// indirect");t.set(c[1],{version:c[2],kind:l?"transitive":"runtime"})}return t}function lve(e){let t=new Map;for(let n of e.split(` -`)){let i=n.trim().split(/\s+/);if(i.length<3)continue;let[r,o]=i;o.endsWith("/go.mod")||t.set(r,{version:o,kind:"transitive"})}return t}var WW={ecosystem:"hex",name:"Mix",handles(e){let t=me(e);return t==="mix.exs"||t==="mix.lock"||t==="rebar.config"},isLockfile(e){return me(e)==="mix.lock"},parse(e,t){let n=me(t);return n==="mix.lock"?dve(e):n==="rebar.config"?pve(e):uve(e)}};function uve(e){let t=new Map;for(let n of e.matchAll(/\{\s*:([a-z_][a-zA-Z0-9_]*)\s*(,[^}]*)?\}/g)){let i=n[1],r=n[2]??"",o=/^,\s*"([^"]+)"/.exec(r)?.[1]??null,s=/\b(path|git|github|hg|svn):\s*/.test(r),a=s?null:o;if(!o&&!s&&!/\b(only|runtime|optional|app|manager):/.test(r))continue;let c=/\bonly:\s*(\[[^\]]*\]|:[a-z_]+)/.exec(r)?.[1]??"",l=/:(dev|test)\b/.test(c)?"dev":"runtime";t.set(i,{version:a,kind:l})}return t}function dve(e){let t=new Map,n=/"([a-z_][a-zA-Z0-9_]*)"\s*:\s*\{\s*:hex\s*,\s*:[a-zA-Z0-9_]+\s*,\s*"([^"]+)"/g;for(let i of e.matchAll(n))t.set(i[1],{version:i[2],kind:"transitive"});return t}function pve(e){let t=new Map,n=/\{\s*deps\s*,\s*\[/.exec(e);if(!n)return t;let i=1,r=n.index+n[0].length;for(;r0;r++)e[r]==="["?i+=1:e[r]==="]"&&(i-=1);let o=e.slice(n.index+n[0].length,r-1);for(let s of o.matchAll(/\{\s*([a-z_][a-zA-Z0-9_]*)\s*,\s*"([^"]+)"/g))t.set(s[1],{version:s[2],kind:"runtime"});for(let s of o.matchAll(/(?:^|[[,])\s*([a-z_][a-zA-Z0-9_]*)\s*(?=[,\]]|$)/g))t.has(s[1])||t.set(s[1],{version:null,kind:"runtime"});return t}var HW={ecosystem:"maven",name:"maven/gradle",handles(e){let t=me(e);return t==="pom.xml"||t==="build.gradle"||t==="build.gradle.kts"||t==="libs.versions.toml"||t==="gradle.lockfile"},isLockfile(e){return me(e)==="gradle.lockfile"},parse(e,t){let n=me(t);return n==="pom.xml"?fve(e):n==="gradle.lockfile"?bve(e):n==="libs.versions.toml"?yve(e):hve(e)}};function fve(e){let t=new Map,n=gve(e),i=mve(e,n);for(let r of e.matchAll(/([\s\S]*?)<\/dependency>/g)){let o=r[1],s=na(o,"groupId"),a=na(o,"artifactId");if(!s||!a)continue;let c=`${s}:${a}`,u=KW(na(o,"version"),n)??i.get(c)??null,d=na(o,"scope"),f=na(o,"optional")==="true"?"optional":d==="test"||d==="provided"?"dev":"runtime",m=t.get(c);t.set(c,{version:u??m?.version??null,kind:f})}return t}function mve(e,t){let n=new Map;for(let i of e.matchAll(/([\s\S]*?)<\/dependencyManagement>/g))for(let r of i[1].matchAll(/([\s\S]*?)<\/dependency>/g)){let o=r[1],s=na(o,"groupId"),a=na(o,"artifactId"),c=KW(na(o,"version"),t);s&&a&&c&&n.set(`${s}:${a}`,c)}return n}function gve(e){let t=new Map;for(let n of e.matchAll(/([\s\S]*?)<\/properties>/g))for(let i of n[1].matchAll(/<([\w.-]+)>([^<]*)<\/\1>/g))t.set(i[1],i[2].trim());return t}function KW(e,t){if(!e)return null;let n=e;for(let i=0;i<2;i++)n=n.replace(/\$\{([^}]+)\}/g,(r,o)=>t.get(o)??r);return n.includes("${")?null:n.trim()||null}function na(e,t){return new RegExp(`<${t}>([^<]*)`).exec(e)?.[1]?.trim()??null}function hve(e){let t=new Map,n="(?:implementation|api|compileOnly|runtimeOnly|testImplementation|testCompileOnly|annotationProcessor|kapt|ksp)";for(let i of e.matchAll(new RegExp(`${n}\\s*\\(?\\s*["']([^"']+:[^"']+)["']`,"g"))){let r=i[1].split(":");if(r.length<2)continue;let[o,s,a]=r,c=/test|androidTest/i.test(i[0]);t.set(`${o}:${s}`,{version:a??null,kind:c?"dev":"runtime"})}for(let i of e.matchAll(new RegExp(`${n}\\s*\\(?\\s*group:\\s*["']([^"']+)["'],\\s*name:\\s*["']([^"']+)["'](?:,\\s*version:\\s*["']([^"']+)["'])?`,"g")))t.set(`${i[1]}:${i[2]}`,{version:i[3]??null,kind:/test/i.test(i[0])?"dev":"runtime"});return t}function yve(e){let t=new Map,n=new Map,i="";for(let r of e.split(` -`)){let o=r.split("#")[0].trim();if(!o)continue;let s=/^\[([^\]]+)\]$/.exec(o)?.[1];if(s){i=s;continue}if(i==="versions"){let m=/^([\w.-]+)\s*=\s*["']([^"']+)["']/.exec(o);m&&n.set(m[1],m[2]);continue}if(i!=="libraries")continue;let a=/module\s*=\s*["']([^"']+)["']/.exec(o)?.[1],c=/group\s*=\s*["']([^"']+)["']/.exec(o)?.[1],l=/name\s*=\s*["']([^"']+)["']/.exec(o)?.[1],u=a??(c&&l?`${c}:${l}`:null);if(!u)continue;let d=/version\s*=\s*["']([^"']+)["']/.exec(o)?.[1],p=/version\.ref\s*=\s*["']([^"']+)["']/.exec(o)?.[1],f=d??(p?n.get(p)??null:null);t.set(u,{version:f,kind:"runtime"})}return t}function bve(e){let t=new Map;for(let n of e.split(` -`)){let i=n.trim();if(!i||i.startsWith("#"))continue;let o=i.split("=")[0].split(":");o.length<3||t.set(`${o[0]}:${o[1]}`,{version:o[2],kind:"transitive"})}return t}var ZW=gt(gc(),1);var vve=new Set(["package.json"]),JW=new Set(["package-lock.json","npm-shrinkwrap.json","yarn.lock","pnpm-lock.yaml","bun.lock"]),YW={ecosystem:"npm",name:"npm/yarn/pnpm",handles(e){let t=me(e);return e.includes("node_modules/")?!1:vve.has(t)||JW.has(t)},isLockfile(e){return JW.has(me(e))},parse(e,t){let n=me(t);return n==="package.json"?$ve(e):n==="yarn.lock"?Eve(e):n==="pnpm-lock.yaml"?Tve(e):n==="bun.lock"?wve(e):_ve(e)}};function wve(e){let t=new Map,n=Gt(kve(e));if(!n?.packages)return t;for(let i of Object.values(n.packages)){let r=Array.isArray(i)?i[0]:i;if(typeof r!="string")continue;let o=r.lastIndexOf("@");if(o<=0)continue;let s=r.slice(0,o),a=r.slice(o+1);/^\d/.test(a)&&t.set(s,{version:a,kind:"transitive"})}return t}function kve(e){let t="",n=!1;for(let i=0;io.split(/[.+-]/).map(s=>Number.parseInt(s,10)),i=n(e),r=n(t);for(let o=0;oa}return!1}function Eve(e){let t=new Map,n=null;for(let i of e.split(` -`)){let r=i.replace(/\r$/,"");if(!r.trim()||r.startsWith("#"))continue;if(!/^\s/.test(r)){let s=r.replace(/:\s*$/,"").split(",")[0].trim().replace(/^"|"$/g,"");n=XW(s);continue}let o=/^\s+version:?\s+"?([^"\s]+)"?/.exec(r)?.[1];if(o&&n){let s=t.get(n);(!s||QW(o,s.version??""))&&t.set(n,{version:o,kind:"transitive"}),n=null}}return t}function Tve(e){let t=new Map,n;try{n=(0,ZW.parse)(e)}catch{return t}let i=n?.packages;if(!i||typeof i!="object")return t;for(let r of Object.keys(i)){let o=r.startsWith("/")?r.slice(1):r,s=XW(o),a=Ive(o);if(!s||!a)continue;let c=t.get(s);(!c||QW(a,c.version??""))&&t.set(s,{version:a,kind:"transitive"})}return t}function XW(e){let t=e.lastIndexOf("@");return t<=0?e||null:e.slice(0,t)||null}function Ive(e){let t=e.lastIndexOf("@");return t<=0?null:e.slice(t+1).split("(")[0]||null}var tH={ecosystem:"nuget",name:"NuGet",handles(e){let t=me(e);return/\.(cs|fs|vb)proj$/.test(t)||t==="directory.packages.props"||t==="directory.build.props"||t==="packages.lock.json"||t==="packages.config"||t.endsWith(".nuspec")},isLockfile(e){return me(e)==="packages.lock.json"},parse(e,t){let n=me(t);return n==="packages.lock.json"?Rve(e):n==="packages.config"?Nve(e):n.endsWith(".nuspec")?Cve(e):Ave(e)}};function Ave(e){let t=new Map,n=/<(PackageReference|PackageVersion|GlobalPackageReference)\b([^>]*?)(\/>|>([\s\S]*?)<\/\1>)/g;for(let i of e.matchAll(n)){let r=i[2]??"",o=i[4]??"",s=yo(r,"Include")??yo(r,"Update");if(!s)continue;let a=yo(r,"Version")??yo(r,"VersionOverride")??eH(o,"Version"),c=a&&!a.includes("$(")?a:null,u=(yo(r,"PrivateAssets")??eH(o,"PrivateAssets"))?.toLowerCase()==="all"?"dev":"runtime";t.set(s,{version:c,kind:u})}return t}function Rve(e){let t=new Map,n=Gt(e);if(!n?.dependencies)return t;for(let i of Object.values(n.dependencies))if(!(!i||typeof i!="object"))for(let[r,o]of Object.entries(i)){let s=o?.resolved??null;if(!s)continue;let a=o.type==="Direct"?"runtime":"transitive";t.get(r)?.kind==="runtime"&&a==="transitive"||t.set(r,{version:s,kind:a})}return t}function Nve(e){let t=new Map;for(let n of e.matchAll(/]*?)\/?>/g)){let i=n[1]??"",r=yo(i,"id");if(!r)continue;let o=yo(i,"developmentDependency");t.set(r,{version:yo(i,"version"),kind:o?.toLowerCase()==="true"?"dev":"runtime"})}return t}function Cve(e){let t=new Map;for(let n of e.matchAll(/]*?)\/?>/g)){let i=n[1]??"",r=yo(i,"id");r&&t.set(r,{version:yo(i,"version"),kind:"runtime"})}return t}function yo(e,t){let n=new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i").exec(e);return(n?.[2]??n?.[3])?.trim()||null}function eH(e,t){return new RegExp(`<${t}\\s*>([^<]*)`,"i").exec(e)?.[1]?.trim()||null}var nH={ecosystem:"opam",name:"opam",handles(e){let t=me(e);return t.endsWith(".opam")||t.endsWith(".opam.locked")||t==="dune-project"},isLockfile(e){return me(e).endsWith(".opam.locked")},parse(e,t){if(me(t)==="dune-project")return Pve(e);let n=me(t).endsWith(".opam.locked");return Fve(e,n)}};function Pve(e){let t=new Map;for(let n of Ove(e,"depends"))for(let i of Mve(n)){let r=/^\(\s*([\w.+-]+)([\s\S]*)\)$/.exec(i),o=r?.[1]??(/^[\w.+-]+$/.test(i)?i:void 0);if(!o)continue;let s=r?.[2]??"",a=/:with-test|:with-doc|:dev/.test(s)?"dev":"runtime";t.set(o,{version:Dve(s),kind:a})}return t}function Dve(e){let t=[...e.matchAll(/([<>=]+)\s*([\w.~+-]+)/g)].map(n=>`${n[1]} ${n[2]}`);return t.length===0?null:t.length===1&&t[0].startsWith("= ")?t[0].slice(2):t.join(" & ")}function Ove(e,t){let n=[],i=new RegExp(`\\(\\s*${t}\\b`,"g");for(let r of e.matchAll(i)){let o=1,s=r.index+r[0].length,a=s;for(;s0;s++){let c=e[s];c==="("?o+=1:c===")"&&(o-=1)}n.push(e.slice(a,s-1))}return n}function Mve(e){let t=[],n="",i=0;for(let r of e){if(r==="("?i+=1:r===")"&&(i-=1),i===0&&/\s/.test(r)){n.trim()&&t.push(n.trim()),n="";continue}n+=r}return n.trim()&&t.push(n.trim()),t}var Lve={depends:"runtime",depopts:"optional"};function Fve(e,t){let n=new Map;for(let[i,r]of Object.entries(Lve))for(let o of jve(e,i))for(let s of zve(o)){let a=/^"([^"]+)"/.exec(s)?.[1];if(!a)continue;let c=/\{([\s\S]*)\}/.exec(s)?.[1]??"",l=/\bwith-test\b|\bwith-doc\b|\bdev\b/.test(c)?"dev":r;n.set(a,{version:Uve(c),kind:t?"transitive":l})}return n}function Uve(e){if(!e.trim())return null;let t=[...e.matchAll(/([<>=!]+)\s*"([^"]+)"/g)].map(i=>`${i[1]} ${i[2]}`);return t.length===0?null:/^=\s/.exec(t[0])&&t.length===1?t[0].slice(2):t.join(" & ")}function jve(e,t){let n=[],i=new RegExp(`(?:^|\\n)\\s*${t}\\s*:\\s*\\[`,"g");for(let r of e.matchAll(i)){let o=1,s=r.index+r[0].length,a=s;for(;s0;s++){let c=e[s];if(c==='"'){for(s+=1;si))continue;if(c")return Dk(e);for(let r=n+1;r{r&&o&&t.set(r,{version:o,kind:s}),r=null,o=null,s="transitive"};for(let c of n){let l=cP(c.replace(/\r$/,""));if(!l.trim())continue;let u=l.length-l.trimStart().length;if(u===0){a(),i=/^packages\s*:/.test(l.trim());continue}if(!i)continue;if(u===2){a(),r=/^\s*"?([A-Za-z_][\w.-]*)"?\s*:/.exec(l)?.[1]??null;continue}if(!r)continue;let d=/^\s*([A-Za-z_][\w-]*)\s*:(.*)$/.exec(l);if(d){if(d[1]==="version")o=Dk(d[2].trim())||null;else if(d[1]==="dependency"){let p=Dk(d[2].trim());s=p.startsWith("direct dev")?"dev":p.startsWith("direct")?"runtime":"transitive"}}}return a(),t}function cP(e){let t=!1,n=!1;for(let i=0;i_we.includes(a)?(s[a]=r[a],s):(s.variables||(s.variables={}),s.variables[a]=r[a],s),{}),o=r.baseUrl||e.endpoint.DEFAULTS.baseUrl;return RK.test(o)&&(i.url=o.replace(RK,"/api/graphql")),e(i).then(s=>{if(s.data.errors){let a={};for(let c of Object.keys(s.headers))a[c]=s.headers[c];throw new vwe(i,a,s.data)}return s.data.data})}function hD(e,t){let n=e.defaults(t);return Object.assign((i,o)=>kwe(n,i,o),{defaults:hD.bind(null,n),endpoint:n.endpoint})}var sQe=hD(Eh,{headers:{"user-agent":`octokit-graphql.js/${ywe} ${Sa()}`},method:"POST",url:"/graphql"});function PK(e){return hD(e,{method:"POST",url:"/graphql"})}var yD="(?:[a-zA-Z0-9_-]+)",CK="\\.",NK=new RegExp(`^${yD}${CK}${yD}${CK}${yD}$`),$we=NK.test.bind(NK);async function Swe(e){let t=$we(e),n=e.startsWith("v1.")||e.startsWith("ghs_"),r=e.startsWith("ghu_");return{type:"token",token:e,tokenType:t?"app":n?"installation":r?"user-to-server":"oauth"}}function xwe(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function Ewe(e,t,n,r){let i=t.endpoint.merge(n,r);return i.headers.authorization=xwe(e),t(i)}var OK=function(t){if(!t)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof t!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return t=t.replace(/^(token|bearer) +/i,""),Object.assign(Swe.bind(null,t),{hook:Ewe.bind(null,t)})};var bD="7.0.8";var DK=()=>{},Twe=console.warn.bind(console),Awe=console.error.bind(console);function Iwe(e={}){return typeof e.debug!="function"&&(e.debug=DK),typeof e.info!="function"&&(e.info=DK),typeof e.warn!="function"&&(e.warn=Twe),typeof e.error!="function"&&(e.error=Awe),e}var MK=`octokit-core.js/${bD} ${Sa()}`,Hk=class{static VERSION=bD;static defaults(t){return class extends this{constructor(...r){let i=r[0]||{};if(typeof t=="function"){super(t(i));return}super(Object.assign({},t,i,i.userAgent&&t.userAgent?{userAgent:`${i.userAgent} ${t.userAgent}`}:null))}}}static plugins=[];static plugin(...t){let n=this.plugins;return class extends this{static plugins=n.concat(t.filter(i=>!n.includes(i)))}}constructor(t={}){let n=new sK.Collection,r={baseUrl:Eh.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(r.headers["user-agent"]=t.userAgent?`${t.userAgent} ${MK}`:MK,t.baseUrl&&(r.baseUrl=t.baseUrl),t.previews&&(r.mediaType.previews=t.previews),t.timeZone&&(r.headers["time-zone"]=t.timeZone),this.request=Eh.defaults(r),this.graphql=PK(this.request).defaults(r),this.log=Iwe(t.log),this.hook=n,t.authStrategy){let{authStrategy:o,...s}=t,a=o(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:s},t.auth));n.wrap("request",a.hook),this.auth=a}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{let o=OK(t.auth);n.wrap("request",o.hook),this.auth=o}let i=this.constructor;for(let o=0;o{e.log.debug("request",n);let r=Date.now(),i=e.request.endpoint.parse(n),o=i.url.replace(n.baseUrl,"");return t(n).then(s=>{let a=s.headers["x-github-request-id"];return e.log.info(`${i.method} ${o} - ${s.status} with id ${a} in ${Date.now()-r}ms`),s}).catch(s=>{let a=s.response?.headers["x-github-request-id"]||"UNKNOWN";throw e.log.error(`${i.method} ${o} - ${s.status} with id ${a} in ${Date.now()-r}ms`),s})})}vD.VERSION=LK;var Rwe="0.0.0-development";function Pwe(e){if(!e.data)return{...e,data:[]};if(!(("total_count"in e.data||"total_commits"in e.data)&&!("url"in e.data)))return e;let n=e.data.incomplete_results,r=e.data.repository_selection,i=e.data.total_count,o=e.data.total_commits;delete e.data.incomplete_results,delete e.data.repository_selection,delete e.data.total_count,delete e.data.total_commits;let s=Object.keys(e.data)[0],a=e.data[s];return e.data=a,typeof n<"u"&&(e.data.incomplete_results=n),typeof r<"u"&&(e.data.repository_selection=r),e.data.total_count=i,e.data.total_commits=o,e}function _D(e,t,n){let r=typeof t=="function"?t.endpoint(n):e.request.endpoint(t,n),i=typeof t=="function"?t:e.request,o=r.method,s=r.headers,a=r.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!a)return{done:!0};try{let c=await i({method:o,url:a,headers:s}),l=Pwe(c);if(a=((l.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!a&&"total_commits"in l.data){let u=new URL(l.url),d=u.searchParams,p=parseInt(d.get("page")||"1",10),f=parseInt(d.get("per_page")||"250",10);p*f{if(i.done)return t;let o=!1;function s(){o=!0}return t=t.concat(r?r(i.value,s):i.value.data),o?t:UK(e,t,n,r)})}var $Qe=Object.assign(FK,{iterator:_D});function wD(e){return{paginate:Object.assign(FK.bind(null,e),{iterator:_D.bind(null,e)})}}wD.VERSION=Rwe;var kD="17.0.0";var Cwe={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteCustomImageFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],deleteCustomImageVersionFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomImageForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],getCustomImageVersionForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listCustomImageVersionsForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"],listCustomImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingPremiumRequestUsageReportOrg:["GET /organizations/{org}/settings/billing/premium_request/usage"],getGithubBillingPremiumRequestUsageReportUser:["GET /users/{username}/settings/billing/premium_request/usage"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],repositoryAccessForOrg:["GET /organizations/{org}/dependabot/repository-access"],setRepositoryAccessDefaultLevel:["PUT /organizations/{org}/dependabot/repository-access/default-level"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],updateRepositoryAccessForOrg:["PATCH /organizations/{org}/dependabot/repository-access"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},enterpriseTeamMemberships:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"],get:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],list:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],remove:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"]},enterpriseTeamOrganizations:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"],delete:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignment:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignments:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"]},enterpriseTeams:{create:["POST /enterprises/{enterprise}/teams"],delete:["DELETE /enterprises/{enterprise}/teams/{team_slug}"],get:["GET /enterprises/{enterprise}/teams/{team_slug}"],list:["GET /enterprises/{enterprise}/teams"],update:["PATCH /enterprises/{enterprise}/teams/{team_slug}"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addBlockedByDependency:["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],getParent:["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listDependenciesBlockedBy:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],listDependenciesBlocking:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeDependencyBlockedBy:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createArtifactStorageRecord:["POST /orgs/{org}/artifacts/metadata/storage-record"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createWebhook:["POST /orgs/{org}/hooks"],customPropertiesForOrgsCreateOrUpdateOrganizationValues:["PATCH /organizations/{org}/org-properties/values"],customPropertiesForOrgsGetOrganizationValues:["GET /organizations/{org}/org-properties/values"],customPropertiesForReposCreateOrUpdateOrganizationDefinition:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposCreateOrUpdateOrganizationDefinitions:["PATCH /orgs/{org}/properties/schema"],customPropertiesForReposCreateOrUpdateOrganizationValues:["PATCH /orgs/{org}/properties/values"],customPropertiesForReposDeleteOrganizationDefinition:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinition:["GET /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinitions:["GET /orgs/{org}/properties/schema"],customPropertiesForReposGetOrganizationValues:["GET /orgs/{org}/properties/values"],delete:["DELETE /orgs/{org}"],deleteAttestationsBulk:["POST /orgs/{org}/attestations/delete-request"],deleteAttestationsById:["DELETE /orgs/{org}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /orgs/{org}/attestations/digest/{subject_digest}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],disableSelectedRepositoryImmutableReleasesOrganization:["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],enableSelectedRepositoryImmutableReleasesOrganization:["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],get:["GET /orgs/{org}"],getImmutableReleasesSettings:["GET /orgs/{org}/settings/immutable-releases"],getImmutableReleasesSettingsRepositories:["GET /orgs/{org}/settings/immutable-releases/repositories"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listArtifactStorageRecords:["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"],listAttestationRepositories:["GET /orgs/{org}/attestations/repositories"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listAttestationsBulk:["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setImmutableReleasesSettings:["PUT /orgs/{org}/settings/immutable-releases"],setImmutableReleasesSettingsRepositories:["PUT /orgs/{org}/settings/immutable-releases/repositories"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addItemForOrg:["POST /orgs/{org}/projectsV2/{project_number}/items"],addItemForUser:["POST /users/{username}/projectsV2/{project_number}/items"],deleteItemForOrg:["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],deleteItemForUser:["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"],getFieldForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"],getFieldForUser:["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"],getForOrg:["GET /orgs/{org}/projectsV2/{project_number}"],getForUser:["GET /users/{username}/projectsV2/{project_number}"],getOrgItem:["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],getUserItem:["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"],listFieldsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields"],listFieldsForUser:["GET /users/{username}/projectsV2/{project_number}/fields"],listForOrg:["GET /orgs/{org}/projectsV2"],listForUser:["GET /users/{username}/projectsV2"],listItemsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/items"],listItemsForUser:["GET /users/{username}/projectsV2/{project_number}/items"],updateItemForOrg:["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],updateItemForUser:["PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkImmutableReleases:["GET /repos/{owner}/{repo}/immutable-releases"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],customPropertiesForReposCreateOrUpdateRepositoryValues:["PATCH /repos/{owner}/{repo}/properties/values"],customPropertiesForReposGetRepositoryValues:["GET /repos/{owner}/{repo}/properties/values"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disableImmutableReleases:["DELETE /repos/{owner}/{repo}/immutable-releases"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enableImmutableReleases:["PUT /repos/{owner}/{repo}/immutable-releases"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],listOrgPatternConfigs:["GET /orgs/{org}/secret-scanning/pattern-configurations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],updateOrgPatternConfigs:["PATCH /orgs/{org}/secret-scanning/pattern-configurations"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteAttestationsBulk:["POST /users/{username}/attestations/delete-request"],deleteAttestationsById:["DELETE /users/{username}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /users/{username}/attestations/digest/{subject_digest}"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listAttestationsBulk:["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},jK=Cwe;var tl=new Map;for(let[e,t]of Object.entries(jK))for(let[n,r]of Object.entries(t)){let[i,o,s]=r,[a,c]=i.split(/ /),l=Object.assign({method:a,url:c},o);tl.has(e)||tl.set(e,new Map),tl.get(e).set(n,{scope:e,methodName:n,endpointDefaults:l,decorations:s})}var Nwe={has({scope:e},t){return tl.get(e).has(t)},getOwnPropertyDescriptor(e,t){return{value:this.get(e,t),configurable:!0,writable:!0,enumerable:!0}},defineProperty(e,t,n){return Object.defineProperty(e.cache,t,n),!0},deleteProperty(e,t){return delete e.cache[t],!0},ownKeys({scope:e}){return[...tl.get(e).keys()]},set(e,t,n){return e.cache[t]=n},get({octokit:e,scope:t,cache:n},r){if(n[r])return n[r];let i=tl.get(t).get(r);if(!i)return;let{endpointDefaults:o,decorations:s}=i;return s?n[r]=Owe(e,t,r,o,s):n[r]=e.request.defaults(o),n[r]}};function $D(e){let t={};for(let n of tl.keys())t[n]=new Proxy({octokit:e,scope:n,cache:{}},Nwe);return t}function Owe(e,t,n,r,i){let o=e.request.defaults(r);function s(...a){let c=o.endpoint.merge(...a);if(i.mapToData)return c=Object.assign({},c,{data:c[i.mapToData],[i.mapToData]:void 0}),o(c);if(i.renamed){let[l,u]=i.renamed;e.log.warn(`octokit.${t}.${n}() has been renamed to octokit.${l}.${u}()`)}if(i.deprecated&&e.log.warn(i.deprecated),i.renamedParameters){let l=o.endpoint.merge(...a);for(let[u,d]of Object.entries(i.renamedParameters))u in l&&(e.log.warn(`"${u}" parameter is deprecated for "octokit.${t}.${n}()". Use "${d}" instead`),d in l||(l[d]=l[u]),delete l[u]);return o(l)}return o(...a)}return Object.assign(s,o)}function Dwe(e){return{rest:$D(e)}}Dwe.VERSION=kD;function SD(e){let t=$D(e);return{...t,rest:t}}SD.VERSION=kD;var zK="22.0.1";var GK=Hk.plugin(vD,SD,wD).defaults({userAgent:`octokit-rest.js/${zK}`});var Mwe="drift",Kk=class{octokit;logger;selfLogin;constructor(t){this.octokit=new GK({auth:t.repoToken,baseUrl:t.baseUrl??"https://api.github.com",userAgent:"drift-bot/0.1"}),this.logger=t.logger}async readFile(t,n,r){try{let o=(await this.octokit.repos.getContent({owner:t.owner,repo:t.repo,path:n,ref:r})).data;return Array.isArray(o)||o.type!=="file"||!("content"in o)?null:Buffer.from(o.content,"base64").toString("utf8")}catch(i){if(BK(i))return null;throw this.logger.debug(`Failed to read ${n}@${r}: ${i.message}`),i}}async listFiles(t,n){try{let r=await this.octokit.git.getTree({owner:t.owner,repo:t.repo,tree_sha:n,recursive:"true"});return r.data.truncated?(this.logger.warn(`The file tree at ${n} is too large for GitHub to return in full, so path patterns cannot be expanded against it. List the contract documents by literal path instead.`),null):r.data.tree.filter(i=>i.type==="blob"&&typeof i.path=="string").map(i=>i.path)}catch(r){return this.logger.debug(`Could not list the tree at ${n}: ${r.message}`),null}}async changedFiles(t){try{let n=await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${t.beforeSha}...${t.afterSha}`}),r=n.data.files??[],i=n.data.commits??[];return r.length>=300||i.lengths.filename)}catch(n){throw this.logger.warn(`Could not compare ${t.beforeSha}...${t.afterSha}: ${n.message}`),n}}async changedFilesByCommit(t){let n=new Set;for await(let i of this.octokit.paginate.iterator(this.octokit.repos.compareCommitsWithBasehead,{owner:t.owner,repo:t.repo,basehead:`${t.beforeSha}...${t.afterSha}`,per_page:250})){let o=i.data;for(let s of o.commits??[])n.add(s.sha)}let r=new Set;for(let i of n)for await(let o of this.octokit.paginate.iterator(this.octokit.repos.getCommit,{owner:t.owner,repo:t.repo,ref:i,per_page:300})){let s=o.data;for(let a of s.files??[])r.add(a.filename)}return[...r]}async createBranch(t,n,r){try{return await this.octokit.git.createRef({owner:t.owner,repo:t.repo,ref:`refs/heads/${n}`,sha:r}),this.logger.info(`Created branch ${n} at ${r.slice(0,7)}`),!0}catch(i){if(Fwe(i)){let o=await this.getBranchHead(t,n);return o===r?(this.logger.info(`Branch ${n} already exists at ${r.slice(0,7)}; reusing it`),!0):o&&await this.isAncestor(t,r,o)?await this.commitsAreAllBots(t,r,o)?(this.logger.info(`Branch ${n} already exists ahead of ${r.slice(0,7)}; reusing it`),!0):(this.logger.error(`Branch ${n} already exists ahead of ${r.slice(0,7)} with commit(s) not made by Drift; refusing to reuse a branch that may carry manual changes`),!1):(this.logger.error(`Branch ${n} already exists but is not based on ${r.slice(0,7)} (current head: ${o??"unknown"}); refusing to reuse a stale branch`),!1)}return this.logger.error(`Could not create branch ${n}: ${i.message}`),!1}}async isAncestor(t,n,r){if(n===r)return!0;try{let i=await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${n}...${r}`});return i.data.status==="ahead"||i.data.status==="identical"}catch{return!1}}async commitsAreAllBots(t,n,r){try{let o=(await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${n}...${r}`})).data.commits??[];return o.length===0?!0:o.every(s=>(s.author?.login??s.committer?.login??"").endsWith("[bot]"))}catch{return!1}}async commitFiles(t,n,r,i){if(r.length===0)return null;try{let s=(await this.octokit.git.getRef({owner:t.owner,repo:t.repo,ref:`heads/${n}`})).data.object.sha,a=await this.octokit.git.getCommit({owner:t.owner,repo:t.repo,commit_sha:s}),c=await Promise.all(r.map(async d=>{let p=await this.octokit.git.createBlob({owner:t.owner,repo:t.repo,content:Buffer.from(d.content,"utf8").toString("base64"),encoding:"base64"});return{path:d.path,mode:"100644",type:"blob",sha:p.data.sha}})),l=await this.octokit.git.createTree({owner:t.owner,repo:t.repo,base_tree:a.data.tree.sha,tree:c}),u=await this.octokit.git.createCommit({owner:t.owner,repo:t.repo,message:i,tree:l.data.sha,parents:[s]});return await this.octokit.git.updateRef({owner:t.owner,repo:t.repo,ref:`heads/${n}`,sha:u.data.sha}),this.logger.info(`Committed ${r.length} file(s) to ${n}: ${u.data.sha.slice(0,7)}`),{sha:u.data.sha}}catch(o){return this.logger.error(`Could not commit to ${n}: ${o.message}`),null}}async createIssue(t,n){try{let r=await this.octokit.issues.create({owner:t.owner,repo:t.repo,title:n.title,body:n.body,labels:n.labels,assignees:n.assignees});return{number:r.data.number,url:r.data.html_url}}catch(r){return this.logger.error(`Could not create issue: ${r.message}`),null}}async getCollaboratorPermission(t,n){try{let r=await this.octokit.repos.getCollaboratorPermissionLevel({owner:t.owner,repo:t.repo,username:n}),i=r.data.permission,s=(r.data.role_name??i??"").toLowerCase();switch(s){case"admin":case"maintain":case"write":case"triage":case"read":case"none":return s;case"push":return"write";case"pull":return"read";default:return this.logger.warn(`Unrecognised permission \`${s}\` for ${n}; treating it as unknown and refusing.`),null}}catch(r){return BK(r)?"none":(this.logger.warn(`Could not determine ${n}'s permission on ${t.owner}/${t.repo}: ${r.message}`),null)}}async getAuthenticatedLogin(){if(this.selfLogin!==void 0)return this.selfLogin;try{let t=await this.octokit.users.getAuthenticated();this.selfLogin=t.data.login}catch{this.selfLogin=null}return this.selfLogin}async getIssue(t,n){try{let r=await this.octokit.issues.get({owner:t.owner,repo:t.repo,issue_number:n});return{number:r.data.number,body:r.data.body??null,state:r.data.state,labels:r.data.labels.map(i=>typeof i=="string"?i:i.name??"").filter(Boolean),pullRequest:!!r.data.pull_request}}catch(r){return this.logger.warn(`Could not read issue #${n}: ${r.message}`),null}}async listIssueComments(t,n){try{return(await this.octokit.issues.listComments({owner:t.owner,repo:t.repo,issue_number:n,per_page:100})).data.map(i=>({id:i.id,body:i.body??null,authorLogin:i.user?.login??null}))}catch(r){throw this.logger.warn(`Could not list comments on #${n}: ${r.message}`),r}}async commitExists(t,n){try{return await this.octokit.repos.getCommit({owner:t.owner,repo:t.repo,ref:n}),!0}catch{return!1}}async getBranchHead(t,n){try{return(await this.octokit.repos.getBranch({owner:t.owner,repo:t.repo,branch:n})).data.commit.sha}catch{return null}}async commentOnIssue(t,n,r){try{return await this.octokit.issues.createComment({owner:t.owner,repo:t.repo,issue_number:n,body:r}),!0}catch(i){return this.logger.warn(`Could not comment on #${n}: ${i.message}`),!1}}async findOpenPlanIssue(t,n){try{return(await this.octokit.search.issuesAndPullRequests({q:`repo:${t.owner}/${t.repo} is:issue is:open in:body "${n}"`,per_page:1})).data.items[0]?.number??null}catch{return null}}async findOpenAlertIssues(t){try{let n=await this.octokit.search.issuesAndPullRequests({q:`repo:${t.owner}/${t.repo} is:issue is:open label:${Mwe} "drift-alert:"`,per_page:100}),r=[];for(let i of n.data.items){let o=//.exec(i.body??"");o&&r.push({number:i.number,marker:o[1]})}return r}catch{return[]}}async updateIssueBody(t,n,r){try{await this.octokit.issues.update({owner:t.owner,repo:t.repo,issue_number:n,body:r})}catch(i){this.logger.warn(`Could not update issue #${n}: ${i.message}`)}}async updateIssueComment(t,n,r){try{await this.octokit.issues.updateComment({owner:t.owner,repo:t.repo,comment_id:n,body:r})}catch(i){this.logger.warn(`Could not update comment ${n}: ${i.message}`)}}async closeIssue(t,n,r){try{r&&await this.commentOnIssue(t,n,r),await this.octokit.issues.update({owner:t.owner,repo:t.repo,issue_number:n,state:"closed"})}catch(i){this.logger.warn(`Could not close issue #${n}: ${i.message}`)}}async createCheckRun(t,n){try{await this.octokit.checks.create({owner:t.owner,repo:t.repo,name:n.name,head_sha:t.afterSha,status:"completed",conclusion:n.conclusion,output:{title:n.title,summary:n.summary,text:n.text}})}catch(r){this.logger.debug(`Could not create check run: ${r.message}`)}}async uploadSarif(t,n){let r=(0,VK.gzipSync)(Buffer.from(JSON.stringify(n.sarif),"utf8")),i=3;for(let o=1;o<=i;o++)try{return await this.octokit.codeScanning.uploadSarif({owner:t.owner,repo:t.repo,commit_sha:n.commitSha,ref:n.ref,sarif:r.toString("base64")}),this.logger.info("Uploaded SARIF results to code scanning."),!0}catch(s){let a=s?.status;if(a===403)return this.logger.warn("Could not upload code scanning results: the token is missing `security-events: write`. Add it to the workflow job's `permissions` to enable Drift's code scanning alerts."),!1;if((a===void 0||a>=500)&&os.includes("/")).map(s=>s.split("/").pop()),o=r.reviewers.filter(s=>!s.includes("/"));await this.octokit.pulls.requestReviewers({owner:t.owner,repo:t.repo,pull_number:n,reviewers:o,team_reviewers:i})}catch(i){this.logger.warn(`Could not request reviewers on #${n}: ${i.message}`)}}async updatePullRequestBody(t,n,r){try{await this.octokit.pulls.update({owner:t.owner,repo:t.repo,pull_number:n,body:r})}catch(i){this.logger.warn(`Could not update PR #${n}: ${i.message}`)}}async getDefaultBranch(t,n){try{return(await this.octokit.repos.get({owner:t,repo:n})).data.default_branch}catch{return null}}asRepoProvider(t){return{changedFiles:()=>this.changedFiles(t),readFile:(n,r)=>this.readFile(t,n,r),listFiles:n=>this.listFiles(t,n)}}get rest(){return this.octokit}};function Lwe(e){return new Promise(t=>setTimeout(t,e))}function BK(e){return e?.status===404}function Fwe(e){let t=e?.status,n=e?.message??"";return t===422&&/already exists/i.test(n)}var $A=require("node:path"),Wm=require("node:fs/promises");function xD(e,t){return Uwe(e).test(t)}function vs(e,t){return e.some(n=>xD(n,t))}var qK=new Map;function Uwe(e){let t=qK.get(e);if(t)return t;let n="^";for(let i=0;i{let c={kind:"list",items:[]};r.items.push(c),r=c,i.push(c)};for(let c=0;cs&&(r.items.length>0&&a(),r.items.push(zZ(t.slice(s,c),!0)),s=c,a()),o=!0):(o&&c>s&&(r.items.push(a$(!0,t.slice(s,c))),s=c,a()),o=!1)}for(t.length>s&&r.items.push(a$(o,t.slice(s)));i.length;)YSe(i.pop());return{items:n}}function FZ(e,t){return c$(e.items,t.items)}function UZ(e){let t=[],n=e.items;for(;n;){let r=null;for(let i of n.items){if(i.kind==="int"){t.push(Number(i.value));continue}i.kind==="list"&&t.length>0&&(r=i);break}n=r}return t.length?t:null}function jZ(e){let t=n=>n.items.some(r=>r.kind==="list"?t(r):r.kind!=="string"?!1:Ch(r.value)="0"&&e<="9"}function HD(e){return{kind:"int",value:e}}function a$(e,t){if(e){let n=t.replace(/^0+/,"")||"0";return HD(BigInt(n))}return zZ(t,!1)}function zZ(e,t){let n=e;return t&&n.length===1&&(n=KSe.get(n)??n),{kind:"string",value:HSe.get(n)??n}}function Ch(e){let t=WD.indexOf(e);return t===-1?`${WD.length}-${e}`:String(t)}function ZSe(e){switch(e.kind){case"int":return e.value===0n;case"string":return Ch(e.value)===KD;case"list":return e.items.length===0}}function YSe(e){for(let t=e.items.length-1;t>=0;t--){let n=e.items[t];if(ZSe(n))e.items.splice(t,1);else if(n.kind!=="list")break}}function MZ(e,t){return et?1:0}function c$(e,t){switch(e.kind){case"int":return QSe(e,t);case"string":return XSe(e,t);case"list":return exe(e,t)}}function QSe(e,t){if(t===null)return e.value===0n?0:1;switch(t.kind){case"int":return e.valuet.value?1:0;case"string":return 1;case"list":return 1}}function XSe(e,t){if(t===null)return MZ(Ch(e.value),KD);switch(t.kind){case"int":return-1;case"string":return MZ(Ch(e.value),Ch(t.value));case"list":return-1}}function exe(e,t){if(t===null)return e.items.length===0?0:c$(e.items[0],null);switch(t.kind){case"int":return-1;case"string":return 1;case"list":{let n=Math.max(e.items.length,t.items.length);for(let r=0;rNe(t,e),compare:Xe,satisfies:(t,n)=>YZ(t,n),sameCompatibilityLine:txe,classifyBump:YD,exactVersion:t=>QZ(t,e)}}function Ne(e,t){let n=e.trim();if(!n||/\s/.test(n))return null;if(WZ.has(t)){let i=t==="go"||t==="swift"||t==="cocoapods"?n.replace(/^v(?=\d)/,""):n,o=Ta.default.valid(i);if(!o){let a=/^(\d+(?:\.\d+){0,1})([-+][0-9A-Za-z.-]+)?$/.exec(i);if(a){let c=a[1].split(".");o=Ta.default.valid(`${c.join(".")}${".0".repeat(3-c.length)}${a[2]??""}`)}}if(!o)return null;let s=Ta.default.parse(o);return{raw:n,ecosystem:t,prerelease:s.prerelease.length>0,comparable:{kind:"semver",value:o},release:[s.major,s.minor,s.patch]}}if(t==="pypi"){let r=e3(n);return r?{raw:n,ecosystem:t,prerelease:r.pre!==null||r.dev!==null,comparable:{kind:"pep440",value:r},release:r.release}:null}if(t==="rubygems"){if(!/^\d[0-9A-Za-z._-]*$/.test(n))return null;let r=cxe(n);return{raw:n,ecosystem:t,prerelease:r.some(i=>typeof i=="string"),comparable:{kind:"ruby",value:r},release:hxe(r)}}if(t==="maven"){if(!/^\d[0-9A-Za-z._+-]*$/.test(n))return null;let r=LZ(n);return{raw:n,ecosystem:t,prerelease:jZ(r),comparable:{kind:"maven",value:r},release:UZ(r)}}if(t==="nuget"){let r=dxe(n);return r?{raw:n,ecosystem:t,prerelease:r.prerelease!==null,comparable:{kind:"nuget",value:r},release:r.release}:null}if(t==="opam"){if(!/\d/.test(n))return null;let r=/^v?(\d+(?:\.\d+)*)/.exec(n)?.[1]?.split(".").map(Number)??null;return{raw:n,ecosystem:t,prerelease:/(?:^|[._+-])(?:alpha|beta|pre|preview|rc|dev)\d*/i.test(n),comparable:{kind:"opam",value:n},release:r}}return null}function Xe(e,t){if(e.ecosystem!==t.ecosystem||e.comparable.kind!==t.comparable.kind)return null;switch(e.comparable.kind){case"semver":return Ta.default.compare(e.comparable.value,t.comparable.value);case"pep440":return ro(e.comparable.value,t.comparable.value);case"ruby":return lxe(e.comparable.value,t.comparable.value);case"maven":return FZ(e.comparable.value,t.comparable.value);case"nuget":return pxe(e.comparable.value,t.comparable.value);case"opam":return fxe(e.comparable.value,t.comparable.value)}}function Oh(e,t,n){if(XZ(n)){let s=JD(e),a=JD(t);return s&&a&&s===a?0:null}let r=io(n),i=r.parse(e),o=r.parse(t);return i&&o?r.compare(i,o):null}function HZ(e,t,n){let r=Ne(e,n);return r?YZ(r,t):null}function ZD(e,t,n){if(e===null&&t!==null)return"added";if(e!==null&&t===null)return"removed";if(e===null||t===null)return"unknown";let r=Ne(e,n),i=Ne(t,n);return r&&i?YD(r,i):"unknown"}function KZ(e,t,n){if(e===null||t===null)return ZD(e,t,n);let r=BZ(e,n),i=BZ(t,n);return r&&i?YD(r,i):"unknown"}function JZ(e,t,n){if(!e||!t)return null;let r=Oh(t,e,n);return r===null?null:r<0}function ZZ(e,t,n){if(!e||!t||!WZ.has(n))return!1;let r=Ne(e,n),i=Ne(t,n);return!!(r?.release&&i?.release&&r.release[0]===0&&i.release[0]===0&&r.release[1]!==i.release[1])}function YD(e,t){let n=Xe(e,t);if(n===null||n===0)return"unknown";let r=e.release,i=t.release;return!r||!i?"unknown":(r[0]??0)!==(i[0]??0)?"major":(r[1]??0)!==(i[1]??0)?"minor":(r[2]??0)!==(i[2]??0)?"patch":e.prerelease||t.prerelease?"prerelease":"unknown"}function txe(e,t){if(e.ecosystem!==t.ecosystem||!e.release||!t.release||e.ecosystem==="maven"||e.ecosystem==="opam")return null;let n=e.release[0]??0;return n===0?(t.release[0]??0)===0&&(t.release[1]??0)===(e.release[1]??0):(t.release[0]??0)===n}function YZ(e,t){let n=t.trim();if(!n||n==="*")return!0;if(e.comparable.kind==="semver"){let r=n;e.ecosystem==="cargo"&&/^v?\d+(?:\.\d+){0,2}$/.test(n)&&(r=`^${n}`);let i=Ta.default.validRange(r);return i?Ta.default.satisfies(e.comparable.value,i):null}if(e.comparable.kind==="pep440")return oxe(e.comparable.value,e.raw,n);if(e.comparable.kind==="ruby")return uxe(e,n);if(e.comparable.kind==="maven")return GZ(e,n,/^([[(])\s*([^,]*)\s*,\s*([^\])]*?)\s*([\])])$/);if(e.comparable.kind==="nuget"){if(/^[[(]/.test(n))return GZ(e,n,/^([[(])\s*([^,]*)\s*,?\s*([^\])]*?)\s*([\])])$/);let r=Ne(n,"nuget"),i=r?Xe(e,r):null;return i===null?null:i>=0}return e.comparable.kind==="opam"?gxe(e,n):null}function GZ(e,t,n){let r=n.exec(t);if(!r){let c=Ne(t,e.ecosystem),l=c?Xe(e,c):null;return l===null?null:l===0}let[,i,o,s,a]=r;if(o){let c=Ne(o,e.ecosystem),l=c?Xe(e,c):null;if(l===null)return null;if(l<0||l===0&&i==="(")return!1}if(s){let c=Ne(s,e.ecosystem),l=c?Xe(e,c):null;if(l===null)return null;if(l>0||l===0&&a===")")return!1}return!0}function QZ(e,t){let n=e.trim();if(XZ(t))return JD(n);if(t==="npm")return Ta.default.valid(n)?n:null;if(t==="cargo"){let r=/^=\s*(v?\d+(?:\.\d+){2}(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)$/.exec(n);return r&&Ne(r[1],t)?r[1]:null}if(t==="pypi"){let r=/^==\s*([^,;\s]+)$/.exec(n);return r&&!r[1].includes("*")&&Ne(r[1],t)?r[1]:null}if(t==="rubygems"){let r=/^(?:=|==)\s*([^,\s]+)$/.exec(n);return r&&Ne(r[1],t)?r[1]:null}if(t==="nuget"){let r=/^\[\s*([^,\]]+)\s*\]$/.exec(n);return r&&Ne(r[1],t)?r[1]:null}return Ne(n,t)?n:null}function JD(e){let t=e.trim();return!t||/\s/.test(t)||/[\[\]<>~=^*,|&]/.test(t)?null:t}function XZ(e){return e==="conan"||e==="vcpkg"}function BZ(e,t){let n=QZ(e,t);if(n)return Ne(n,t);let r=e.trim().match(/(?:^|[<>=~^\[(,{"'\s])(v?\d+(?:!\d+)?(?:\.\d+)*(?:(?:a|b|rc)\d+|[-.](?:alpha|beta|rc)[-.]?\d*)?)/i);return r?Ne(r[1],t):null}var nxe=/^v?(?:(?:(\d+)!)?(\d+(?:\.\d+)*)(?:[-_.]?(alpha|a|beta|b|preview|pre|c|rc)[-_.]?(\d+)?)?(?:(?:-(\d+))|(?:[-_.]?(post|rev|r)[-_.]?(\d+)?))?(?:[-_.]?(dev)[-_.]?(\d+)?)?)(?:\+([a-z0-9]+(?:[-_.][a-z0-9]+)*))?$/;function e3(e){let t=nxe.exec(e.trim().toLowerCase());if(!t)return null;let n=t[3],r=n?/^(a|alpha)$/.test(n)?0:/^(b|beta)$/.test(n)?1:2:null;return{epoch:Number(t[1]??0),release:t[2].split(".").map(Number),pre:r===null?null:[r,Number(t[4]??0)],post:t[5]!==void 0?Number(t[5]):t[6]?Number(t[7]??0):null,dev:t[8]?Number(t[9]??0):null,local:t[10]?t[10].split(/[-_.]/).map(i=>/^\d+$/.test(i)?Number(i):i):null}}function Gd(e){return{epoch:e.epoch,release:e.release,pre:null,post:null,dev:null,local:null}}function Nh(e){return e.local===null?e:{...e,local:null}}function VZ(e){return e.pre!==null||e.dev!==null}function ro(e,t){let n=u$(e.epoch,t.epoch)||l$(e.release,t.release);return n||(n=rxe(e,t),n)||(n=qZ(e.post,t.post,-1),n)||(n=qZ(e.dev,t.dev,1),n)?n:ixe(e.local,t.local)}function rxe(e,t){let n=e.pre??(e.dev!==null&&e.post===null?[-1,0]:[3,0]),r=t.pre??(t.dev!==null&&t.post===null?[-1,0]:[3,0]);return l$(n,r)}function ixe(e,t){if(!e||!t)return e?1:t?-1:0;let n=Math.max(e.length,t.length);for(let r=0;ri.trim()).filter(Boolean);if(!r.length)return!0;for(let i of r){let o=sxe(e,t,i);if(o!==!0)return o}return!0}function sxe(e,t,n){let r=/^(===|~=|==|!=|<=|>=|<|>)\s*(.+)$/.exec(n);if(!r)return null;let i=r[1],o=r[2].trim();if(i==="===")return t.trim().toLowerCase()===o.toLowerCase();if(o.endsWith(".*")){if(i!=="=="&&i!=="!=")return null;let a=axe(e,o.slice(0,-2));return a===null?null:i==="=="?a:!a}let s=e3(o);if(!s)return null;switch(i){case"==":return ro(s.local===null?Nh(e):e,s)===0;case"!=":return ro(s.local===null?Nh(e):e,s)!==0;case"<=":return ro(Nh(e),s)<=0;case">=":return ro(Nh(e),s)>=0;case"<":return!(ro(e,s)>=0||!VZ(s)&&VZ(e)&&ro(Gd(e),Gd(s))===0);case">":return!(ro(e,s)<=0||s.post===null&&e.post!==null&&ro(Gd(e),Gd(s))===0||e.local!==null&&ro(Gd(e),Gd(s))===0);case"~=":{if(s.local!==null)return null;let a=s.pre===null?s.release.length:s.release.length+1;if(a<2)return null;if(ro(Nh(e),s)<0)return!1;let c=s.release.slice(0,Math.min(a-1,s.release.length));return e.epoch===s.epoch&&c.every((l,u)=>(e.release[u]??0)===l)}default:return null}}function axe(e,t){let n=/^v?(?:(\d+)!)?(\d+(?:\.\d+)*)$/.exec(t.trim());if(!n)return null;let r=Number(n[1]??0),i=n[2].split(".").map(Number);return e.epoch===r&&i.every((o,s)=>(e.release[s]??0)===o)}function cxe(e){return e.replace(/-/g,".pre.").match(/[0-9]+|[A-Za-z]+/g)?.map(t=>/^\d+$/.test(t)?Number(t):t.toLowerCase())??[]}function lxe(e,t){let n=Math.max(e.length,t.length);for(let r=0;rr.trim()).filter(Boolean);if(!n.length)return!0;for(let r of n){let i=/^(~>|>=|<=|>|<|=|==)?\s*([^\s]+)$/.exec(r);if(!i)return null;let o=i[1]??"=",s=Ne(i[2],"rubygems");if(!s)return null;let a=Xe(e,s);if((o==="="||o==="==")&&a!==0||o===">="&&a<0||o===">"&&a<=0||o==="<="&&a>0||o==="<"&&a>=0)return!1;if(o==="~>"){if(a<0||!s.release)return!1;let c=i[2].match(/\d+/g)?.length??0,l=[...s.release],u=c>=3?1:0;if(l[u]=(l[u]??0)+1,l.splice(u+1),l$(e.release??[],l)>=0)return!1}}return!0}function dxe(e){let t=/^[vV]?(\d+(?:\.\d+){0,3})(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z.-]+)?$/.exec(e);return t?{release:t[1].split(".").map(Number),prerelease:t[2]?t[2].toLowerCase().split(".").map(n=>/^\d+$/.test(n)?Number(n):n):null}:null}function pxe(e,t){let n=l$(e.release,t.release);if(n)return n;if(!e.prerelease||!t.prerelease)return e.prerelease?-1:t.prerelease?1:0;let r=Math.max(e.prerelease.length,t.prerelease.length);for(let i=0;ir==="~"?-1:r===void 0?0:/[A-Za-z]/.test(r)?r.charCodeAt(0):r.charCodeAt(0)+256;return u$(n(e),n(t))}function gxe(e,t){let r=t.trim().replace(/^\{\s*|\s*\}$/g,"").split(/\s*(?:&|&&)\s*/).filter(Boolean);if(!r.length)return null;for(let i of r){let o=/^(>=|<=|>|<|=)?\s*["']?([^"'\s]+)["']?$/.exec(i);if(!o)return null;let s=Ne(o[2],"opam"),a=s?Xe(e,s):null;if(a===null)return null;let c=o[1]??"=";if(c==="="&&a!==0||c===">="&&a<0||c===">"&&a<=0||c==="<="&&a>0||c==="<"&&a>=0)return!1}return!0}function hxe(e){let t=[];for(let n of e){if(typeof n!="number")break;t.push(n)}return t.length?t:null}function l$(e,t){let n=Math.max(e.length,t.length);for(let r=0;rt?1:0}function yxe(e){if(!e)return null;let t=e.trim();if(!t)return null;let n=/^npm:(?:@[^/]+\/)?[^@]+@(.+)$/i.exec(t);if(n)t=n[1].trim();else if(/^(git|github|file|link|workspace|npm|https?):/i.test(t))return null;return t==="*"||t==="latest"||t===""?null:(t=t.split(/\|\||,/)[0].trim(),t=t.replace(/^[\^~><=!]+\s*/,"").replace(/^[[(]\s*/,""),t=t.split(/\s+/)[0].trim(),t=t.replace(/^v/i,"").replace(/[\])]$/,""),t=t.replace(/\+incompatible$/,""),t||null)}function p$(e){let t=yxe(e);return t?d$.default.valid(t)??d$.default.valid(d$.default.coerce(t)??"")??null:null}function Aa(e,t,n="npm"){return ZD(e,t,n)}function Dh(e,t,n="npm"){return JZ(e,t,n)===!0}function Mh(e,t,n="npm"){return ZZ(e,t,n)}function ve(e){let t=e.split("/");return(t[t.length-1]??"").toLowerCase()}function Ht(e){try{return JSON.parse(e)}catch{return null}}var n3={ecosystem:"arduino",name:"arduino",handles(e){let t=ve(e);return t==="library.properties"||t==="platformio.ini"},isLockfile(){return!1},parse(e,t){return ve(t)==="platformio.ini"?_xe(e):bxe(e)}};function bxe(e){let t=new Map;for(let n of e.split(` +`)){let r=n.trim();if(r.startsWith("#"))continue;let i=/^depends\s*=\s*(.*)$/i.exec(r);if(i)for(let o of i[1].split(",")){let s=vxe(o);s&&t.set(s.name,{version:s.version,kind:"runtime"})}}return t}function vxe(e){let t=e.trim();if(!t)return null;let n=/^(.*?)\s*\(([^)]*)\)\s*$/.exec(t);if(n){let r=n[1].trim(),i=n[2].trim();return r?{name:r,version:i||null}:null}return{name:t,version:null}}function _xe(e){let t=new Map,n=e.split(` +`),r=!1;for(let i of n){let o=i.split(/\s+[;#]/)[0],s=o.trim();if(/^\[/.test(s)){r=!1;continue}let a=/^(lib_deps[\w.]*|lib_extra_dirs|lib_ignore)\s*=\s*(.*)$/.exec(s);if(a){r=a[1].startsWith("lib_deps"),r&&a[2]&&t3(t,a[2],"runtime");continue}if(r&&/^\s/.test(o)&&s!==""){t3(t,s,"runtime");continue}s!==""&&(r=!1)}return t}function t3(e,t,n){let r=t.trim();if(!r||/^[a-z+]+:\/\//i.test(r)||r.startsWith("file://")||r.startsWith(".")||r.includes("${")||/\.(git|zip|tar\.gz)$/i.test(r))return;let i=r.lastIndexOf("@"),o=i>0,s=o?r.slice(0,i):r,a=o?r.slice(i+1).trim():null,c=s.lastIndexOf("/"),l=(c===-1?s:s.slice(c+1)).trim();l&&e.set(l,{version:a||null,kind:n})}function Ri(e){let t=[],n={header:"",entries:new Map,lines:[]};t.push(n);let r=e.split(` +`);for(let i=0;iBd(u,"]")){let d=Bd(u,"[")-Bd(u,"]");for(;d>0&&i+1n.header===t)}function Lh(e){let t=e.trim().replace(/^\[/,"").replace(/\]$/,""),n=[];for(let r of t.matchAll(/"((?:[^"\\]|\\.)*)"|'([^']*)'/g)){let i=r[1]??r[2];i!==void 0&&n.push(i)}return n}function Vd(e){let t=e.trim();return t.startsWith("{")?/(?:^|[{,]\s*)version\s*=\s*"([^"]*)"/.exec(t)?.[1]??null:/^"([^"]*)"$/.exec(t)?.[1]??/^'([^']*)'$/.exec(t)?.[1]??null}function f$(e){return e.replace(/^["']|["']$/g,"")}function r3(e){let t=!1,n=!1;for(let r=0;r<=!]*\s*\d[^"']*)["']/g)].map(f=>f[1].trim()).filter(f=>!/^https?:/.test(f)),d=/:(path|git|podspec|svn|hg)\s*(?:=>|:)/.test(c)||l.length===0?null:l.join(", "),p=n.some(f=>/test|spec|uitest/i.test(f))?"dev":"runtime";t.set(a,{version:d,kind:p})}return t}function Cxe(e){let t=new Map,n=!1;for(let r of e.split(` +`)){let i=r.replace(/\r$/,"");if(!i.trim())continue;if(/^[A-Z][A-Z ]*:\s*$/.test(i.trim())&&!/^\s/.test(i)){n=i.trim()==="PODS:";continue}if(!n)continue;let o=/^ {2}- "?([\w.+/-]+)"? \(([^)]+)\)/.exec(i);o&&t.set(o[1],{version:o[2],kind:"transitive"})}return t}function Nxe(e){let t=new Map,n=/\.dependency\s+["']([^"']+)["'](?:\s*,\s*["']([^"']+)["'])?/g;for(let r of e.matchAll(n))t.set(r[1],{version:r[2]??null,kind:"runtime"});return t}function Oxe(e){let t=!1,n=!1;for(let r=0;ru.includes("indirect")?u:"").trim(),s=i.trim();if(/^require\s*\($/.test(s)){n=!0;continue}if(/^replace\s*\($/.test(s)||/^exclude\s*\($/.test(s)){r=!0;continue}if(s===")"){n=!1,r=!1;continue}if(r||s.startsWith("replace ")||s.startsWith("exclude "))continue;let a=/^require\s+(\S+)\s+(\S+)/.exec(s);if(a){t.set(a[1],{version:a[2],kind:"runtime"});continue}if(!n)continue;let c=/^(\S+)\s+(v\S+)/.exec(o||s);if(!c)continue;let l=s.includes("// indirect");t.set(c[1],{version:c[2],kind:l?"transitive":"runtime"})}return t}function Fxe(e){let t=new Map;for(let n of e.split(` +`)){let r=n.trim().split(/\s+/);if(r.length<3)continue;let[i,o]=r;o.endsWith("/go.mod")||t.set(i,{version:o,kind:"transitive"})}return t}var m3={ecosystem:"hex",name:"Mix",handles(e){let t=ve(e);return t==="mix.exs"||t==="mix.lock"||t==="rebar.config"},isLockfile(e){return ve(e)==="mix.lock"},parse(e,t){let n=ve(t);return n==="mix.lock"?jxe(e):n==="rebar.config"?zxe(e):Uxe(e)}};function Uxe(e){let t=new Map;for(let n of e.matchAll(/\{\s*:([a-z_][a-zA-Z0-9_]*)\s*(,[^}]*)?\}/g)){let r=n[1],i=n[2]??"",o=/^,\s*"([^"]+)"/.exec(i)?.[1]??null,s=/\b(path|git|github|hg|svn):\s*/.test(i),a=s?null:o;if(!o&&!s&&!/\b(only|runtime|optional|app|manager):/.test(i))continue;let c=/\bonly:\s*(\[[^\]]*\]|:[a-z_]+)/.exec(i)?.[1]??"",l=/:(dev|test)\b/.test(c)?"dev":"runtime";t.set(r,{version:a,kind:l})}return t}function jxe(e){let t=new Map,n=/"([a-z_][a-zA-Z0-9_]*)"\s*:\s*\{\s*:hex\s*,\s*:[a-zA-Z0-9_]+\s*,\s*"([^"]+)"/g;for(let r of e.matchAll(n))t.set(r[1],{version:r[2],kind:"transitive"});return t}function zxe(e){let t=new Map,n=/\{\s*deps\s*,\s*\[/.exec(e);if(!n)return t;let r=1,i=n.index+n[0].length;for(;i0;i++)e[i]==="["?r+=1:e[i]==="]"&&(r-=1);let o=e.slice(n.index+n[0].length,i-1);for(let s of o.matchAll(/\{\s*([a-z_][a-zA-Z0-9_]*)\s*,\s*"([^"]+)"/g))t.set(s[1],{version:s[2],kind:"runtime"});for(let s of o.matchAll(/(?:^|[[,])\s*([a-z_][a-zA-Z0-9_]*)\s*(?=[,\]]|$)/g))t.has(s[1])||t.set(s[1],{version:null,kind:"runtime"});return t}var g3={ecosystem:"maven",name:"maven/gradle",handles(e){let t=ve(e);return t==="pom.xml"||t==="build.gradle"||t==="build.gradle.kts"||t==="libs.versions.toml"||t==="gradle.lockfile"},isLockfile(e){return ve(e)==="gradle.lockfile"},parse(e,t){let n=ve(t);return n==="pom.xml"?Gxe(e):n==="gradle.lockfile"?Hxe(e):n==="libs.versions.toml"?Wxe(e):qxe(e)}};function Gxe(e){let t=new Map,n=Vxe(e),r=Bxe(e,n);for(let i of e.matchAll(/([\s\S]*?)<\/dependency>/g)){let o=i[1],s=Ia(o,"groupId"),a=Ia(o,"artifactId");if(!s||!a)continue;let c=`${s}:${a}`,u=h3(Ia(o,"version"),n)??r.get(c)??null,d=Ia(o,"scope"),f=Ia(o,"optional")==="true"?"optional":d==="test"||d==="provided"?"dev":"runtime",m=t.get(c);t.set(c,{version:u??m?.version??null,kind:f})}return t}function Bxe(e,t){let n=new Map;for(let r of e.matchAll(/([\s\S]*?)<\/dependencyManagement>/g))for(let i of r[1].matchAll(/([\s\S]*?)<\/dependency>/g)){let o=i[1],s=Ia(o,"groupId"),a=Ia(o,"artifactId"),c=h3(Ia(o,"version"),t);s&&a&&c&&n.set(`${s}:${a}`,c)}return n}function Vxe(e){let t=new Map;for(let n of e.matchAll(/([\s\S]*?)<\/properties>/g))for(let r of n[1].matchAll(/<([\w.-]+)>([^<]*)<\/\1>/g))t.set(r[1],r[2].trim());return t}function h3(e,t){if(!e)return null;let n=e;for(let r=0;r<2;r++)n=n.replace(/\$\{([^}]+)\}/g,(i,o)=>t.get(o)??i);return n.includes("${")?null:n.trim()||null}function Ia(e,t){return new RegExp(`<${t}>([^<]*)`).exec(e)?.[1]?.trim()??null}function qxe(e){let t=new Map,n="(?:implementation|api|compileOnly|runtimeOnly|testImplementation|testCompileOnly|annotationProcessor|kapt|ksp)";for(let r of e.matchAll(new RegExp(`${n}\\s*\\(?\\s*["']([^"']+:[^"']+)["']`,"g"))){let i=r[1].split(":");if(i.length<2)continue;let[o,s,a]=i,c=/test|androidTest/i.test(r[0]);t.set(`${o}:${s}`,{version:a??null,kind:c?"dev":"runtime"})}for(let r of e.matchAll(new RegExp(`${n}\\s*\\(?\\s*group:\\s*["']([^"']+)["'],\\s*name:\\s*["']([^"']+)["'](?:,\\s*version:\\s*["']([^"']+)["'])?`,"g")))t.set(`${r[1]}:${r[2]}`,{version:r[3]??null,kind:/test/i.test(r[0])?"dev":"runtime"});return t}function Wxe(e){let t=new Map,n=new Map,r="";for(let i of e.split(` +`)){let o=i.split("#")[0].trim();if(!o)continue;let s=/^\[([^\]]+)\]$/.exec(o)?.[1];if(s){r=s;continue}if(r==="versions"){let m=/^([\w.-]+)\s*=\s*["']([^"']+)["']/.exec(o);m&&n.set(m[1],m[2]);continue}if(r!=="libraries")continue;let a=/module\s*=\s*["']([^"']+)["']/.exec(o)?.[1],c=/group\s*=\s*["']([^"']+)["']/.exec(o)?.[1],l=/name\s*=\s*["']([^"']+)["']/.exec(o)?.[1],u=a??(c&&l?`${c}:${l}`:null);if(!u)continue;let d=/version\s*=\s*["']([^"']+)["']/.exec(o)?.[1],p=/version\.ref\s*=\s*["']([^"']+)["']/.exec(o)?.[1],f=d??(p?n.get(p)??null:null);t.set(u,{version:f,kind:"runtime"})}return t}function Hxe(e){let t=new Map;for(let n of e.split(` +`)){let r=n.trim();if(!r||r.startsWith("#"))continue;let o=r.split("=")[0].split(":");o.length<3||t.set(`${o[0]}:${o[1]}`,{version:o[2],kind:"transitive"})}return t}var b3=$t(Lc(),1);var Kxe=new Set(["package.json"]),y3=new Set(["package-lock.json","npm-shrinkwrap.json","yarn.lock","pnpm-lock.yaml","bun.lock"]),v3={ecosystem:"npm",name:"npm/yarn/pnpm",handles(e){let t=ve(e);return e.includes("node_modules/")?!1:Kxe.has(t)||y3.has(t)},isLockfile(e){return y3.has(ve(e))},parse(e,t){let n=ve(t);return n==="package.json"?Yxe(e):n==="yarn.lock"?tEe(e):n==="pnpm-lock.yaml"?nEe(e):n==="bun.lock"?Jxe(e):Qxe(e)}};function Jxe(e){let t=new Map,n=Ht(Zxe(e));if(!n?.packages)return t;for(let r of Object.values(n.packages)){let i=Array.isArray(r)?r[0]:r;if(typeof i!="string")continue;let o=i.lastIndexOf("@");if(o<=0)continue;let s=i.slice(0,o),a=i.slice(o+1);/^\d/.test(a)&&t.set(s,{version:a,kind:"transitive"})}return t}function Zxe(e){let t="",n=!1;for(let r=0;ro.split(/[.+-]/).map(s=>Number.parseInt(s,10)),r=n(e),i=n(t);for(let o=0;oa}return!1}function tEe(e){let t=new Map,n=null;for(let r of e.split(` +`)){let i=r.replace(/\r$/,"");if(!i.trim()||i.startsWith("#"))continue;if(!/^\s/.test(i)){let s=i.replace(/:\s*$/,"").split(",")[0].trim().replace(/^"|"$/g,"");n=w3(s);continue}let o=/^\s+version:?\s+"?([^"\s]+)"?/.exec(i)?.[1];if(o&&n){let s=t.get(n);(!s||_3(o,s.version??""))&&t.set(n,{version:o,kind:"transitive"}),n=null}}return t}function nEe(e){let t=new Map,n;try{n=(0,b3.parse)(e)}catch{return t}let r=n?.packages;if(!r||typeof r!="object")return t;for(let i of Object.keys(r)){let o=i.startsWith("/")?i.slice(1):i,s=w3(o),a=rEe(o);if(!s||!a)continue;let c=t.get(s);(!c||_3(a,c.version??""))&&t.set(s,{version:a,kind:"transitive"})}return t}function w3(e){let t=e.lastIndexOf("@");return t<=0?e||null:e.slice(0,t)||null}function rEe(e){let t=e.lastIndexOf("@");return t<=0?null:e.slice(t+1).split("(")[0]||null}var $3={ecosystem:"nuget",name:"NuGet",handles(e){let t=ve(e);return/\.(cs|fs|vb)proj$/.test(t)||t==="directory.packages.props"||t==="directory.build.props"||t==="packages.lock.json"||t==="packages.config"||t.endsWith(".nuspec")},isLockfile(e){return ve(e)==="packages.lock.json"},parse(e,t){let n=ve(t);return n==="packages.lock.json"?oEe(e):n==="packages.config"?sEe(e):n.endsWith(".nuspec")?aEe(e):iEe(e)}};function iEe(e){let t=new Map,n=/<(PackageReference|PackageVersion|GlobalPackageReference)\b([^>]*?)(\/>|>([\s\S]*?)<\/\1>)/g;for(let r of e.matchAll(n)){let i=r[2]??"",o=r[4]??"",s=Po(i,"Include")??Po(i,"Update");if(!s)continue;let a=Po(i,"Version")??Po(i,"VersionOverride")??k3(o,"Version"),c=a&&!a.includes("$(")?a:null,u=(Po(i,"PrivateAssets")??k3(o,"PrivateAssets"))?.toLowerCase()==="all"?"dev":"runtime";t.set(s,{version:c,kind:u})}return t}function oEe(e){let t=new Map,n=Ht(e);if(!n?.dependencies)return t;for(let r of Object.values(n.dependencies))if(!(!r||typeof r!="object"))for(let[i,o]of Object.entries(r)){let s=o?.resolved??null;if(!s)continue;let a=o.type==="Direct"?"runtime":"transitive";t.get(i)?.kind==="runtime"&&a==="transitive"||t.set(i,{version:s,kind:a})}return t}function sEe(e){let t=new Map;for(let n of e.matchAll(/]*?)\/?>/g)){let r=n[1]??"",i=Po(r,"id");if(!i)continue;let o=Po(r,"developmentDependency");t.set(i,{version:Po(r,"version"),kind:o?.toLowerCase()==="true"?"dev":"runtime"})}return t}function aEe(e){let t=new Map;for(let n of e.matchAll(/]*?)\/?>/g)){let r=n[1]??"",i=Po(r,"id");i&&t.set(i,{version:Po(r,"version"),kind:"runtime"})}return t}function Po(e,t){let n=new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i").exec(e);return(n?.[2]??n?.[3])?.trim()||null}function k3(e,t){return new RegExp(`<${t}\\s*>([^<]*)`,"i").exec(e)?.[1]?.trim()||null}var S3={ecosystem:"opam",name:"opam",handles(e){let t=ve(e);return t.endsWith(".opam")||t.endsWith(".opam.locked")||t==="dune-project"},isLockfile(e){return ve(e).endsWith(".opam.locked")},parse(e,t){if(ve(t)==="dune-project")return cEe(e);let n=ve(t).endsWith(".opam.locked");return fEe(e,n)}};function cEe(e){let t=new Map;for(let n of uEe(e,"depends"))for(let r of dEe(n)){let i=/^\(\s*([\w.+-]+)([\s\S]*)\)$/.exec(r),o=i?.[1]??(/^[\w.+-]+$/.test(r)?r:void 0);if(!o)continue;let s=i?.[2]??"",a=/:with-test|:with-doc|:dev/.test(s)?"dev":"runtime";t.set(o,{version:lEe(s),kind:a})}return t}function lEe(e){let t=[...e.matchAll(/([<>=]+)\s*([\w.~+-]+)/g)].map(n=>`${n[1]} ${n[2]}`);return t.length===0?null:t.length===1&&t[0].startsWith("= ")?t[0].slice(2):t.join(" & ")}function uEe(e,t){let n=[],r=new RegExp(`\\(\\s*${t}\\b`,"g");for(let i of e.matchAll(r)){let o=1,s=i.index+i[0].length,a=s;for(;s0;s++){let c=e[s];c==="("?o+=1:c===")"&&(o-=1)}n.push(e.slice(a,s-1))}return n}function dEe(e){let t=[],n="",r=0;for(let i of e){if(i==="("?r+=1:i===")"&&(r-=1),r===0&&/\s/.test(i)){n.trim()&&t.push(n.trim()),n="";continue}n+=i}return n.trim()&&t.push(n.trim()),t}var pEe={depends:"runtime",depopts:"optional"};function fEe(e,t){let n=new Map;for(let[r,i]of Object.entries(pEe))for(let o of gEe(e,r))for(let s of hEe(o)){let a=/^"([^"]+)"/.exec(s)?.[1];if(!a)continue;let c=/\{([\s\S]*)\}/.exec(s)?.[1]??"",l=/\bwith-test\b|\bwith-doc\b|\bdev\b/.test(c)?"dev":i;n.set(a,{version:mEe(c),kind:t?"transitive":l})}return n}function mEe(e){if(!e.trim())return null;let t=[...e.matchAll(/([<>=!]+)\s*"([^"]+)"/g)].map(r=>`${r[1]} ${r[2]}`);return t.length===0?null:/^=\s/.exec(t[0])&&t.length===1?t[0].slice(2):t.join(" & ")}function gEe(e,t){let n=[],r=new RegExp(`(?:^|\\n)\\s*${t}\\s*:\\s*\\[`,"g");for(let i of e.matchAll(r)){let o=1,s=i.index+i[0].length,a=s;for(;s0;s++){let c=e[s];if(c==='"'){for(s+=1;sr))continue;if(c")return m$(e);for(let i=n+1;i{i&&o&&t.set(i,{version:o,kind:s}),i=null,o=null,s="transitive"};for(let c of n){let l=XD(c.replace(/\r$/,""));if(!l.trim())continue;let u=l.length-l.trimStart().length;if(u===0){a(),r=/^packages\s*:/.test(l.trim());continue}if(!r)continue;if(u===2){a(),i=/^\s*"?([A-Za-z_][\w.-]*)"?\s*:/.exec(l)?.[1]??null;continue}if(!i)continue;let d=/^\s*([A-Za-z_][\w-]*)\s*:(.*)$/.exec(l);if(d){if(d[1]==="version")o=m$(d[2].trim())||null;else if(d[1]==="dependency"){let p=m$(d[2].trim());s=p.startsWith("direct dev")?"dev":p.startsWith("direct")?"runtime":"transitive"}}}return a(),t}function XD(e){let t=!1,n=!1;for(let r=0;r=!~,(\[@]/.test(r)?null:{name:i,version:r||null}}function Ng(e){return e.trim().toLowerCase().replace(/[-_.]+/g,"-")}function Wve(e){let t=new Map,n=e.split(` -`),i=Ok(e),r=n.filter(s=>{let a=s.trim();return a!==""&&!a.startsWith("#")&&!a.startsWith("-")}),o=r.filter(s=>Rg(s)!==null).length;if(r.length>=5&&o/r.length<.7)return t;for(let s=0;so.length&&n.endsWith(o))return{version:n.slice(0,-o.length),platform:r}}let i=n.split("-");for(let r=1;r/^[a-z0-9_.]+$/.test(i))}var uH={ecosystem:"rubygems",name:"bundler",handles(e){let t=me(e);return t==="gemfile"||t==="gemfile.lock"||t.endsWith(".gemspec")},isLockfile(e){return me(e)==="gemfile.lock"},parse(e,t){let n=me(t);return n==="gemfile.lock"?nwe(e):n.endsWith(".gemspec")?rwe(e):twe(e)}};function twe(e){let t=new Map,n=[];for(let i of e.split(` -`)){let r=i.split("#")[0].trim();if(!r)continue;let o=/^group\s+(.+?)\s+do$/.exec(r);if(o){n.push(o[1]);continue}if(r==="end"&&n.length){n.pop();continue}let s=/^gem\s+["']([^"']+)["'](.*)$/.exec(r);if(!s)continue;let a=s[1],c=s[2]??"",l=[...c.matchAll(/["']([~><=!]*\s*[\d][^"']*)["']/g)].map(m=>m[1].trim()),u=l.length?l.join(", "):null,d=/\bgroups?:\s*\[?\s*:?([\w,\s:]+)/.exec(c)?.[1]??"",p=`${n.join(" ")} ${d}`,f=/development|test/.test(p)?"dev":"runtime";t.set(a,{version:u,kind:f})}return t}function nwe(e){let t=new Map,n=cH(e),i=!1;for(let r of e.split(` -`)){let o=r.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(o)){i=!0;continue}if(o.trim()&&!/^\s/.test(o)){i=!1;continue}if(!i)continue;let s=/^ {4}([A-Za-z0-9_.-]+) \(([^)]+)\)$/.exec(o);if(!s)continue;let a=lH(s[2],n);t.set(s[1],{version:a.version,kind:"transitive",...a.platform?{platform:a.platform}:{}})}return t}function rwe(e){let t=new Map,n=/add_(development_|runtime_)?dependency[\s(]+["']([^"']+)["'](?:\s*,\s*["']([^"']+)["'])?/g;for(let i of e.matchAll(n))t.set(i[2],{version:i[3]??null,kind:i[1]==="development_"?"dev":"runtime"});return t}var dH={ecosystem:"maven",name:"sbt",handles(e){return me(e).endsWith(".sbt")?!0:/(^|\/)project\/[\w-]+\.scala$/.test(e.toLowerCase())},isLockfile(){return!1},parse(e){return owe(e)}};function iwe(e){let t=e.trim().split(".");return t[0]==="3"?"3":t.length>=2?`${t[0]}.${t[1]}`:e.trim()}function owe(e){let t=new Map,n=/\bscalaVersion\s*(?::=|\+=)\s*"([^"]+)"/.exec(e)?.[1],i=n?`_${iwe(n)}`:"",r=new Map;for(let s of e.matchAll(/\bval\s+([A-Za-z_]\w*)\s*=\s*"([^"]+)"/g))r.set(s[1],s[2]);let o=/"([\w.-]+)"\s*(%%%|%%|%)\s*"([\w.-]+)"\s*%\s*(?:"([^"]+)"|([A-Za-z_]\w*))((?:\s*%\s*"[A-Za-z]+")?)/g;for(let s of e.matchAll(o)){let a=s[1],c=s[2],l=s[3],u=s[4],d=s[5],p=s[6]??"",f=c==="%%"?`${a}:${l}${i}`:`${a}:${l}`,m=u??(d?r.get(d)??null:null),g=/"(test|it)"/i.test(p)||/"provided"/i.test(p)?"dev":/"optional"/i.test(p)?"optional":"runtime";t.set(f,{version:m,kind:g})}for(let s of e.matchAll(/addSbtPlugin\s*\(\s*"([\w.-]+)"\s*%\s*"([\w.-]+)"\s*%\s*"([^"]+)"/g))t.set(`${s[1]}:${s[2]}`,{version:s[3],kind:"dev"});return t}var pH={ecosystem:"swift",name:"Swift Package Manager",handles(e){let t=me(e);return t==="package.resolved"||/^package(@swift-[\d.]+)?\.swift$/.test(t)},isLockfile(e){return me(e)==="package.resolved"},parse(e,t){return me(t)==="package.resolved"?cwe(e):swe(e)}};function swe(e){let t=new Map;for(let n of e.matchAll(/\.package\s*\(([\s\S]*?)\)\s*[,\]]/g)){let i=n[1]??"",r=/\burl\s*:\s*"([^"]+)"/.exec(i)?.[1],o=/\bpath\s*:\s*"([^"]+)"/.exec(i)?.[1];if(!r&&o)continue;let s=/\bid\s*:\s*"([^"]+)"/.exec(i)?.[1],a=r?fH(r):s;a&&t.set(a,{version:awe(i),kind:"runtime"})}return t}function awe(e){let t=/\bexact\s*:\s*"([^"]+)"/.exec(e)?.[1];if(t)return t;let n=/\bfrom\s*:\s*"([^"]+)"/.exec(e)?.[1];if(n)return`^${n}`;let i=/\.upToNextMajor\s*\(\s*from\s*:\s*"([^"]+)"/.exec(e)?.[1];if(i)return`^${i}`;let r=/\.upToNextMinor\s*\(\s*from\s*:\s*"([^"]+)"/.exec(e)?.[1];if(r)return`~${r}`;let o=/"([^"]+)"\s*\.\.[.<]\s*"([^"]+)"/.exec(e);return o?`>=${o[1]} <${o[2]}`:null}function cwe(e){let t=new Map,n=Gt(e);if(!n)return t;for(let i of n.pins??n.object?.pins??[]){let r=i.location??i.repositoryURL,o=r?fH(r):i.identity??i.package;if(!o)continue;let s=i.state?.version??null;t.set(o,{version:s,kind:"transitive"})}return t}function fH(e){let t=e.trim().replace(/\.git$/,"").replace(/\/+$/,"");if(!t)return null;let n=/github\.com[/:]([\w.-]+)\/([\w.-]+)$/.exec(t);return n?`${n[1]}/${n[2]}`:t.split("/").pop()||null}var mH={ecosystem:"vcpkg",name:"vcpkg",handles(e){let t=me(e);return t==="vcpkg.json"||t==="vcpkg-configuration.json"},isLockfile(){return!1},parse(e){let t=new Map,n=Gt(e);if(!n)return t;for(let r of n.dependencies??[]){if(typeof r=="string"){t.set(r,{version:null,kind:"runtime"});continue}r.name&&t.set(r.name,{version:r["version>="]?`>=${r["version>="]}`:null,kind:r.host?"dev":"runtime"})}for(let r of n.overrides??[]){if(!r.name)continue;let o=r.version??r["version-string"]??r["version-semver"]??null,s=t.get(r.name);t.set(r.name,{version:o,kind:s?.kind??"runtime"})}let i=n["builtin-baseline"]??n.registries?.find(r=>r.baseline)?.baseline;return i&&t.set(lwe,{version:i,kind:"transitive"}),t}},lwe="vcpkg-baseline";var gH=[YW,aH,qW,jW,dH,HW,uH,tH,VW,WW,iH,pH,GW,nH,zW,mH,DW];function hH(e){return gH.some(t=>t.handles(e))}function Mk(e){return gH.find(t=>t.handles(e))}function yH(e){let t=new Map;for(let n of e){let i=Mk(n.path);if(!i)continue;let r=n.before?i.parse(n.before,n.path):new Map,o=n.after?i.parse(n.after,n.path):new Map,s=i.isLockfile(n.path);for(let a of new Set([...r.keys(),...o.keys()])){let c=r.get(a),l=o.get(a),u=c?.version??null,d=l?.version??null;if(u===d)continue;let p=Gi(i.ecosystem),f=u===null?null:p.exactVersion(u),m=d===null?null:p.exactVersion(d);if((f&&m?Eg(f,m,i.ecosystem):null)===0)continue;if(i.ecosystem==="npm"&&!f&&!m){let _=Ck(u),S=Ck(d);if(_&&_===S)continue}let h=l?.kind??c?.kind??"runtime",b=s&&h==="runtime"?"transitive":h,y={name:a,ecosystem:i.ecosystem,from:f,to:m,kind:b,bump:f&&m?ta(f,m,i.ecosystem):EW(u,d,i.ecosystem),manifestPath:n.path,rawFrom:u,rawTo:d,source:s?"lockfile":"manifest"},w=`${i.ecosystem}:${uwe(n.path)}:${a}`,k=t.get(w);if(k&&k.source!==y.source){let _=k.source==="manifest"?k:y,S=k.source==="lockfile"?k:y,x=S.from??_.from,E=S.to??_.to;t.set(w,{..._,from:x,to:E,bump:ta(x,E,i.ecosystem)})}else(!k||dwe(k,y,s))&&t.set(w,y)}}return[...t.values()].sort((n,i)=>n.ecosystem.localeCompare(i.ecosystem)||n.name.localeCompare(i.name))}function uwe(e){let t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function dwe(e,t,n){let i=e.source==="lockfile";return i&&!n?!0:!i&&n?!1:t.from!==null&&t.to!==null&&(e.from===null||e.to===null)}function bH(e,t){let n=[],i=[],r=new Set(t.ecosystems);for(let o of e){let s=pwe(o,t,r);s?i.push({change:o,reason:s}):n.push(o)}return{actionable:n,skipped:i}}function pwe(e,t,n){if(!n.has(e.ecosystem))return`ecosystem "${e.ecosystem}" is not enabled in drift.yml`;if(Yo(t.ignore,e.name))return"matched an `ignore` pattern in drift.yml";if(e.rawTo!==null&&e.rawTo!==void 0&&e.to===null)return"target manifest range has no exact resolved registry version";if(e.rawFrom!==null&&e.rawFrom!==void 0&&e.from===null)return"previous manifest range has no exact resolved registry version";if(e.to===null)return"dependency was removed; removals need no compatibility fix";if(e.kind==="dev"&&!t.triggerOn.dev)return"dev dependency (enable `triggerOn.dev` to analyse these)";if(e.kind==="transitive"&&!t.triggerOn.transitive)return"transitive dependency (enable `triggerOn.transitive` to analyse these)";if(e.from===null)return"newly added dependency; there is no prior version to break against";let i=Ig(e.from,e.to,e.ecosystem);return e.bump==="major"&&!t.triggerOn.major?"major bumps are disabled in drift.yml (enable `triggerOn.major` to include these)":e.bump==="minor"&&!t.triggerOn.minor&&!i?"minor bumps are disabled in drift.yml (enable `triggerOn.minor` to include these)":e.bump==="patch"&&!t.triggerOn.patch?"patch bumps are disabled in drift.yml (enable `triggerOn.patch` to include these)":e.bump==="prerelease"&&!t.triggerOn.patch?"prerelease moves are disabled in drift.yml (enable `triggerOn.patch`)":null}var Mg=gt(Dc(),1);var _d=require("node:crypto"),Vi=require("node:fs/promises"),yP=require("node:path");var xH=require("node:fs"),ra=require("node:os");var vH=require("node:async_hooks");var fwe=[/\bAuthorization\s*:\s*[^\n]+/gi,/\bBearer\s+\S+/gi,/\bgh[oprsu]_[A-Za-z0-9]{10,}\b/g,/\bgithub_pat_[A-Za-z0-9_]{10,}\b/g,/\bsk-[A-Za-z0-9][A-Za-z0-9_-]{9,}/g];function mwe(e){let t=e;for(let n of fwe)t=t.replace(n,"[REDACTED]");return t}function gwe(e){return mwe(e instanceof Error?e.message:String(e))}var wH=new vH.AsyncLocalStorage;function Qo(){return wH.getStore()}function Vt(){return Qo()?.state.now()??0}function Cg(){let e=Qo();return e!==void 0&&!e.state.finished}function kH(e){Qo()?.state.httpRequests.push(e)}function $H(e){Qo()?.state.httpAttempts.push(e)}function uP(e){Qo()?.state.execCommands.push(e)}function hwe(){return{hits:0,misses:0,writes:0,memoryHits:0,diskHits:0,coalescedHits:0,revalidated304:0}}function Rr(e,t,n=!1){let i=Qo()?.state;if(!i)return;let r=i.caches.get(e)??hwe();if(typeof t=="boolean"){t?r.hits+=1:r.misses+=1,n&&(r.writes+=1),i.caches.set(e,r);return}t==="memory_hit"?(r.memoryHits+=1,r.hits+=1):t==="disk_hit"?(r.diskHits+=1,r.hits+=1):t==="coalesced_hit"?(r.coalescedHits+=1,r.hits+=1):t==="revalidated_304"?r.revalidated304+=1:t==="miss"?r.misses+=1:t==="write"&&(r.writes+=1),i.caches.set(e,r)}function _H(e,t=1){let n=Qo()?.state;n&&n.counters.set(e,(n.counters.get(e)??0)+t)}var ywe=Object.freeze({end(){},fail(){}});function SH(e,t,n,i){let r=t!==null?e.spans.find(s=>s.id===t):void 0,o={id:e.nextSpanId++,parentId:t,depth:r?r.depth+1:0,name:n,startMs:e.now(),endMs:null,meta:{...i},status:"ok"};return e.spans.push(o),o}function Lk(e,t,n,i,r){e.endMs===null&&(e.endMs=t.now(),n==="error"?(e.status="error",e.error=gwe(i),Object.assign(e.meta,r)):Object.assign(e.meta,i))}function Mc(e,t){let n=Qo();if(!n||n.state.finished)return ywe;let{state:i}=n,r=SH(i,n.parentId,e,t),o=!1;return{end(s){o||(o=!0,Lk(r,i,"ok",s))},fail(s,a){o||(o=!0,Lk(r,i,"error",s,a))}}}async function Br(e,t,n){let i=Qo();if(!i||i.state.finished)return n();let{state:r}=i,o=SH(r,i.parentId,e,t);try{let s=await wH.run({state:r,parentId:o.id},n);return Lk(o,r,"ok"),s}catch(s){throw Lk(o,r,"error",s),s}}var bwe=Object.freeze({end(){}}),$d=process.env.DRIFT_PROFILE,bo=!!$d&&$d!=="0"&&$d!=="false",EH=[],pP=new Map,vwe=bo?Date.now():0,wwe=bo?performance.now():0;function fP(){return performance.now()-wwe}function Pg(){return bo}function kwe(e,t,n){return{operation:t,...new Set(["surface","surface-sources","surface-deps","evidence"]).has(e)?{package:t}:{},...n}}var dP=100,$we=50;function _we(){if(!Cg())return()=>{};let e=performance.now()+dP,t=setInterval(()=>{let n=performance.now(),i=Math.max(0,n-e);if(e=n+dP,i<$we||!Cg())return;Mc("event-loop.lag",{lagMs:Math.round(i)}).end()},dP);return t.unref(),()=>clearInterval(t)}function It(e,t,n){let i=Cg();if(!bo&&!i)return bwe;let r=bo?fP():0,o=i?Mc(`work.${e}`,kwe(e,t,n)):null,s=i&&e==="scan"&&t==="total"?_we():null,a=!1;return{end(c){a||(a=!0,bo&&EH.push({cat:e,name:t,start:r,end:fP(),...n||c?{meta:{...n,...c}}:{}}),o?.end(c),s?.())}}}async function En(e,t,n,i){let r=It(e,t,i);try{return await n()}finally{r.end()}}function nt(e,t=1){bo&&pP.set(e,(pP.get(e)??0)+t),Cg()&&_H(`profile.${e}`,t)}var mP=0;bo&&setInterval(()=>{mP=Math.max(mP,Math.round(process.memoryUsage.rss()/1048576))},250).unref();function Swe(){let e=["DRIFT_CONCURRENCY","DRIFT_NETWORK_CONCURRENCY","DRIFT_LOCAL_CONCURRENCY"];return{startedAt:new Date(vwe).toISOString(),durationMs:Math.round(fP()),spans:EH,counters:Object.fromEntries([...pP].sort(([t],[n])=>t.localeCompare(n))),machine:{platform:(0,ra.platform)(),arch:(0,ra.arch)(),cpus:(0,ra.cpus)().length,totalMemMb:Math.round((0,ra.totalmem)()/(1024*1024)),node:process.version},peakRssMb:Math.max(mP,Math.round(process.memoryUsage.rss()/(1024*1024))),env:Object.fromEntries(e.filter(t=>process.env[t]).map(t=>[t,process.env[t]]))}}function xwe(e){if(!bo)return;let t=e??($d&&$d!=="1"?$d:"drift-profile.json");try{(0,xH.writeFileSync)(t,JSON.stringify(Swe()),"utf8"),process.stderr.write(` +`))}var T3=new Set(["poetry.lock","pipfile.lock","uv.lock","requirements.lock"]),I3={ecosystem:"pypi",name:"pip/poetry/uv",handles(e){let t=ve(e);return e.includes("site-packages/")||e.includes(".venv/")?!1:t==="pyproject.toml"||t==="setup.py"||t==="pipfile"||T3.has(t)||rl(t)},isLockfile(e){return T3.has(ve(e))},parse(e,t){let n=ve(t);return n==="pyproject.toml"?kEe(e):n==="poetry.lock"||n==="uv.lock"?$Ee(e):n==="pipfile"?SEe(e):n==="setup.py"?xEe(e):wEe(e)}};function Fh(e){let t=e.trim();if(!t||t.startsWith("#")||t.startsWith("-")||/^[a-z+]+:\/\//i.test(t))return null;if(t=t.split(";")[0].trim(),t=t.replace(/\s+#.*$/,"").trim(),/\s@\s/.test(t)){let o=t.split("@")[0].trim();return o?{name:Uh(o),version:null}:null}let n=/^([A-Za-z0-9._-]+)\s*(\[[^\]]*\])?\s*(.*)$/.exec(t);if(!n)return null;let r=Uh(n[1]),i=(n[3]??"").trim();return i&&!/^[<>=!~,(\[@]/.test(i)?null:{name:r,version:i||null}}function Uh(e){return e.trim().toLowerCase().replace(/[-_.]+/g,"-")}function wEe(e){let t=new Map,n=e.split(` +`),r=g$(e),i=n.filter(s=>{let a=s.trim();return a!==""&&!a.startsWith("#")&&!a.startsWith("-")}),o=i.filter(s=>Fh(s)!==null).length;if(i.length>=5&&o/i.length<.7)return t;for(let s=0;so.length&&n.endsWith(o))return{version:n.slice(0,-o.length),platform:i}}let r=n.split("-");for(let i=1;i/^[a-z0-9_.]+$/.test(r))}var C3={ecosystem:"rubygems",name:"bundler",handles(e){let t=ve(e);return t==="gemfile"||t==="gemfile.lock"||t.endsWith(".gemspec")},isLockfile(e){return ve(e)==="gemfile.lock"},parse(e,t){let n=ve(t);return n==="gemfile.lock"?PEe(e):n.endsWith(".gemspec")?CEe(e):REe(e)}};function REe(e){let t=new Map,n=[];for(let r of e.split(` +`)){let i=r.split("#")[0].trim();if(!i)continue;let o=/^group\s+(.+?)\s+do$/.exec(i);if(o){n.push(o[1]);continue}if(i==="end"&&n.length){n.pop();continue}let s=/^gem\s+["']([^"']+)["'](.*)$/.exec(i);if(!s)continue;let a=s[1],c=s[2]??"",l=[...c.matchAll(/["']([~><=!]*\s*[\d][^"']*)["']/g)].map(m=>m[1].trim()),u=l.length?l.join(", "):null,d=/\bgroups?:\s*\[?\s*:?([\w,\s:]+)/.exec(c)?.[1]??"",p=`${n.join(" ")} ${d}`,f=/development|test/.test(p)?"dev":"runtime";t.set(a,{version:u,kind:f})}return t}function PEe(e){let t=new Map,n=R3(e),r=!1;for(let i of e.split(` +`)){let o=i.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(o)){r=!0;continue}if(o.trim()&&!/^\s/.test(o)){r=!1;continue}if(!r)continue;let s=/^ {4}([A-Za-z0-9_.-]+) \(([^)]+)\)$/.exec(o);if(!s)continue;let a=P3(s[2],n);t.set(s[1],{version:a.version,kind:"transitive",...a.platform?{platform:a.platform}:{}})}return t}function CEe(e){let t=new Map,n=/add_(development_|runtime_)?dependency[\s(]+["']([^"']+)["'](?:\s*,\s*["']([^"']+)["'])?/g;for(let r of e.matchAll(n))t.set(r[2],{version:r[3]??null,kind:r[1]==="development_"?"dev":"runtime"});return t}var N3={ecosystem:"maven",name:"sbt",handles(e){return ve(e).endsWith(".sbt")?!0:/(^|\/)project\/[\w-]+\.scala$/.test(e.toLowerCase())},isLockfile(){return!1},parse(e){return OEe(e)}};function NEe(e){let t=e.trim().split(".");return t[0]==="3"?"3":t.length>=2?`${t[0]}.${t[1]}`:e.trim()}function OEe(e){let t=new Map,n=/\bscalaVersion\s*(?::=|\+=)\s*"([^"]+)"/.exec(e)?.[1],r=n?`_${NEe(n)}`:"",i=new Map;for(let s of e.matchAll(/\bval\s+([A-Za-z_]\w*)\s*=\s*"([^"]+)"/g))i.set(s[1],s[2]);let o=/"([\w.-]+)"\s*(%%%|%%|%)\s*"([\w.-]+)"\s*%\s*(?:"([^"]+)"|([A-Za-z_]\w*))((?:\s*%\s*"[A-Za-z]+")?)/g;for(let s of e.matchAll(o)){let a=s[1],c=s[2],l=s[3],u=s[4],d=s[5],p=s[6]??"",f=c==="%%"?`${a}:${l}${r}`:`${a}:${l}`,m=u??(d?i.get(d)??null:null),g=/"(test|it)"/i.test(p)||/"provided"/i.test(p)?"dev":/"optional"/i.test(p)?"optional":"runtime";t.set(f,{version:m,kind:g})}for(let s of e.matchAll(/addSbtPlugin\s*\(\s*"([\w.-]+)"\s*%\s*"([\w.-]+)"\s*%\s*"([^"]+)"/g))t.set(`${s[1]}:${s[2]}`,{version:s[3],kind:"dev"});return t}var O3={ecosystem:"swift",name:"Swift Package Manager",handles(e){let t=ve(e);return t==="package.resolved"||/^package(@swift-[\d.]+)?\.swift$/.test(t)},isLockfile(e){return ve(e)==="package.resolved"},parse(e,t){return ve(t)==="package.resolved"?LEe(e):DEe(e)}};function DEe(e){let t=new Map;for(let n of e.matchAll(/\.package\s*\(([\s\S]*?)\)\s*[,\]]/g)){let r=n[1]??"",i=/\burl\s*:\s*"([^"]+)"/.exec(r)?.[1],o=/\bpath\s*:\s*"([^"]+)"/.exec(r)?.[1];if(!i&&o)continue;let s=/\bid\s*:\s*"([^"]+)"/.exec(r)?.[1],a=i?D3(i):s;a&&t.set(a,{version:MEe(r),kind:"runtime"})}return t}function MEe(e){let t=/\bexact\s*:\s*"([^"]+)"/.exec(e)?.[1];if(t)return t;let n=/\bfrom\s*:\s*"([^"]+)"/.exec(e)?.[1];if(n)return`^${n}`;let r=/\.upToNextMajor\s*\(\s*from\s*:\s*"([^"]+)"/.exec(e)?.[1];if(r)return`^${r}`;let i=/\.upToNextMinor\s*\(\s*from\s*:\s*"([^"]+)"/.exec(e)?.[1];if(i)return`~${i}`;let o=/"([^"]+)"\s*\.\.[.<]\s*"([^"]+)"/.exec(e);return o?`>=${o[1]} <${o[2]}`:null}function LEe(e){let t=new Map,n=Ht(e);if(!n)return t;for(let r of n.pins??n.object?.pins??[]){let i=r.location??r.repositoryURL,o=i?D3(i):r.identity??r.package;if(!o)continue;let s=r.state?.version??null;t.set(o,{version:s,kind:"transitive"})}return t}function D3(e){let t=e.trim().replace(/\.git$/,"").replace(/\/+$/,"");if(!t)return null;let n=/github\.com[/:]([\w.-]+)\/([\w.-]+)$/.exec(t);return n?`${n[1]}/${n[2]}`:t.split("/").pop()||null}var M3={ecosystem:"vcpkg",name:"vcpkg",handles(e){let t=ve(e);return t==="vcpkg.json"||t==="vcpkg-configuration.json"},isLockfile(){return!1},parse(e){let t=new Map,n=Ht(e);if(!n)return t;for(let i of n.dependencies??[]){if(typeof i=="string"){t.set(i,{version:null,kind:"runtime"});continue}i.name&&t.set(i.name,{version:i["version>="]?`>=${i["version>="]}`:null,kind:i.host?"dev":"runtime"})}for(let i of n.overrides??[]){if(!i.name)continue;let o=i.version??i["version-string"]??i["version-semver"]??null,s=t.get(i.name);t.set(i.name,{version:o,kind:s?.kind??"runtime"})}let r=n["builtin-baseline"]??n.registries?.find(i=>i.baseline)?.baseline;return r&&t.set(FEe,{version:r,kind:"transitive"}),t}},FEe="vcpkg-baseline";var L3=[v3,I3,f3,c3,N3,g3,C3,$3,d3,m3,E3,O3,u3,S3,l3,M3,n3];function F3(e){return L3.some(t=>t.handles(e))}function h$(e){return L3.find(t=>t.handles(e))}function U3(e){let t=new Map;for(let n of e){let r=h$(n.path);if(!r)continue;let i=n.before?r.parse(n.before,n.path):new Map,o=n.after?r.parse(n.after,n.path):new Map,s=r.isLockfile(n.path);for(let a of new Set([...i.keys(),...o.keys()])){let c=i.get(a),l=o.get(a),u=c?.version??null,d=l?.version??null;if(u===d)continue;let p=io(r.ecosystem),f=u===null?null:p.exactVersion(u),m=d===null?null:p.exactVersion(d);if((f&&m?Oh(f,m,r.ecosystem):null)===0)continue;if(r.ecosystem==="npm"&&!f&&!m){let k=p$(u),x=p$(d);if(k&&k===x)continue}let h=l?.kind??c?.kind??"runtime",v=s&&h==="runtime"?"transitive":h,b={name:a,ecosystem:r.ecosystem,from:f,to:m,kind:v,bump:f&&m?Aa(f,m,r.ecosystem):KZ(u,d,r.ecosystem),manifestPath:n.path,rawFrom:u,rawTo:d,source:s?"lockfile":"manifest"},_=`${r.ecosystem}:${UEe(n.path)}:${a}`,w=t.get(_);if(w&&w.source!==b.source){let k=w.source==="manifest"?w:b,x=w.source==="lockfile"?w:b,A=x.from??k.from,I=x.to??k.to;t.set(_,{...k,from:A,to:I,bump:Aa(A,I,r.ecosystem)})}else(!w||jEe(w,b,s))&&t.set(_,b)}}return[...t.values()].sort((n,r)=>n.ecosystem.localeCompare(r.ecosystem)||n.name.localeCompare(r.name))}function UEe(e){let t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function jEe(e,t,n){let r=e.source==="lockfile";return r&&!n?!0:!r&&n?!1:t.from!==null&&t.to!==null&&(e.from===null||e.to===null)}function j3(e,t){let n=[],r=[],i=new Set(t.ecosystems);for(let o of e){let s=zEe(o,t,i);s?r.push({change:o,reason:s}):n.push(o)}return{actionable:n,skipped:r}}function zEe(e,t,n){if(!n.has(e.ecosystem))return`ecosystem "${e.ecosystem}" is not enabled in drift.yml`;if(vs(t.ignore,e.name))return"matched an `ignore` pattern in drift.yml";if(e.rawTo!==null&&e.rawTo!==void 0&&e.to===null)return"target manifest range has no exact resolved registry version";if(e.rawFrom!==null&&e.rawFrom!==void 0&&e.from===null)return"previous manifest range has no exact resolved registry version";if(e.to===null)return"dependency was removed; removals need no compatibility fix";if(e.kind==="dev"&&!t.triggerOn.dev)return"dev dependency (enable `triggerOn.dev` to analyse these)";if(e.kind==="transitive"&&!t.triggerOn.transitive)return"transitive dependency (enable `triggerOn.transitive` to analyse these)";if(e.from===null)return"newly added dependency; there is no prior version to break against";let r=Mh(e.from,e.to,e.ecosystem);return e.bump==="major"&&!t.triggerOn.major?"major bumps are disabled in drift.yml (enable `triggerOn.major` to include these)":e.bump==="minor"&&!t.triggerOn.minor&&!r?"minor bumps are disabled in drift.yml (enable `triggerOn.minor` to include these)":e.bump==="patch"&&!t.triggerOn.patch?"patch bumps are disabled in drift.yml (enable `triggerOn.patch` to include these)":e.bump==="prerelease"&&!t.triggerOn.patch?"prerelease moves are disabled in drift.yml (enable `triggerOn.patch`)":null}var Vh=$t(nl(),1);var Hd=require("node:crypto"),oo=require("node:fs/promises"),cM=require("node:path");var H3=require("node:fs"),Ra=require("node:os");var z3=require("node:async_hooks");var GEe=[/\bAuthorization\s*:\s*[^\n]+/gi,/\bBearer\s+\S+/gi,/\bgh[oprsu]_[A-Za-z0-9]{10,}\b/g,/\bgithub_pat_[A-Za-z0-9_]{10,}\b/g,/\bsk-[A-Za-z0-9][A-Za-z0-9_-]{9,}/g];function BEe(e){let t=e;for(let n of GEe)t=t.replace(n,"[REDACTED]");return t}function VEe(e){return BEe(e instanceof Error?e.message:String(e))}var G3=new z3.AsyncLocalStorage;function _s(){return G3.getStore()}function Kt(){return _s()?.state.now()??0}function jh(){let e=_s();return e!==void 0&&!e.state.finished}function B3(e){_s()?.state.httpRequests.push(e)}function V3(e){_s()?.state.httpAttempts.push(e)}function tM(e){_s()?.state.execCommands.push(e)}function qEe(){return{hits:0,misses:0,writes:0,memoryHits:0,diskHits:0,coalescedHits:0,revalidated304:0}}function Ur(e,t,n=!1){let r=_s()?.state;if(!r)return;let i=r.caches.get(e)??qEe();if(typeof t=="boolean"){t?i.hits+=1:i.misses+=1,n&&(i.writes+=1),r.caches.set(e,i);return}t==="memory_hit"?(i.memoryHits+=1,i.hits+=1):t==="disk_hit"?(i.diskHits+=1,i.hits+=1):t==="coalesced_hit"?(i.coalescedHits+=1,i.hits+=1):t==="revalidated_304"?i.revalidated304+=1:t==="miss"?i.misses+=1:t==="write"&&(i.writes+=1),r.caches.set(e,i)}function q3(e,t=1){let n=_s()?.state;n&&n.counters.set(e,(n.counters.get(e)??0)+t)}var WEe=Object.freeze({end(){},fail(){}});function W3(e,t,n,r){let i=t!==null?e.spans.find(s=>s.id===t):void 0,o={id:e.nextSpanId++,parentId:t,depth:i?i.depth+1:0,name:n,startMs:e.now(),endMs:null,meta:{...r},status:"ok"};return e.spans.push(o),o}function y$(e,t,n,r,i){e.endMs===null&&(e.endMs=t.now(),n==="error"?(e.status="error",e.error=VEe(r),Object.assign(e.meta,i)):Object.assign(e.meta,r))}function il(e,t){let n=_s();if(!n||n.state.finished)return WEe;let{state:r}=n,i=W3(r,n.parentId,e,t),o=!1;return{end(s){o||(o=!0,y$(i,r,"ok",s))},fail(s,a){o||(o=!0,y$(i,r,"error",s,a))}}}async function ni(e,t,n){let r=_s();if(!r||r.state.finished)return n();let{state:i}=r,o=W3(i,r.parentId,e,t);try{let s=await G3.run({state:i,parentId:o.id},n);return y$(o,i,"ok"),s}catch(s){throw y$(o,i,"error",s),s}}var HEe=Object.freeze({end(){}}),Wd=process.env.DRIFT_PROFILE,Co=!!Wd&&Wd!=="0"&&Wd!=="false",K3=[],rM=new Map,KEe=Co?Date.now():0,JEe=Co?performance.now():0;function iM(){return performance.now()-JEe}function zh(){return Co}function ZEe(e,t,n){return{operation:t,...new Set(["surface","surface-sources","surface-deps","evidence"]).has(e)?{package:t}:{},...n}}var nM=100,YEe=50;function QEe(){if(!jh())return()=>{};let e=performance.now()+nM,t=setInterval(()=>{let n=performance.now(),r=Math.max(0,n-e);if(e=n+nM,rclearInterval(t)}function Dt(e,t,n){let r=jh();if(!Co&&!r)return HEe;let i=Co?iM():0,o=r?il(`work.${e}`,ZEe(e,t,n)):null,s=r&&e==="scan"&&t==="total"?QEe():null,a=!1;return{end(c){a||(a=!0,Co&&K3.push({cat:e,name:t,start:i,end:iM(),...n||c?{meta:{...n,...c}}:{}}),o?.end(c),s?.())}}}async function Rn(e,t,n,r){let i=Dt(e,t,r);try{return await n()}finally{i.end()}}function it(e,t=1){Co&&rM.set(e,(rM.get(e)??0)+t),jh()&&q3(`profile.${e}`,t)}var oM=0;Co&&setInterval(()=>{oM=Math.max(oM,Math.round(process.memoryUsage.rss()/1048576))},250).unref();function XEe(){let e=["DRIFT_CONCURRENCY","DRIFT_NETWORK_CONCURRENCY","DRIFT_LOCAL_CONCURRENCY"];return{startedAt:new Date(KEe).toISOString(),durationMs:Math.round(iM()),spans:K3,counters:Object.fromEntries([...rM].sort(([t],[n])=>t.localeCompare(n))),machine:{platform:(0,Ra.platform)(),arch:(0,Ra.arch)(),cpus:(0,Ra.cpus)().length,totalMemMb:Math.round((0,Ra.totalmem)()/(1024*1024)),node:process.version},peakRssMb:Math.max(oM,Math.round(process.memoryUsage.rss()/(1024*1024))),env:Object.fromEntries(e.filter(t=>process.env[t]).map(t=>[t,process.env[t]]))}}function eTe(e){if(!Co)return;let t=e??(Wd&&Wd!=="1"?Wd:"drift-profile.json");try{(0,H3.writeFileSync)(t,JSON.stringify(XEe()),"utf8"),process.stderr.write(` drift: profile written to ${t} `)}catch(n){process.stderr.write(`drift: could not write profile: ${n.message} -`)}}bo&&process.on("exit",()=>xwe());var Ewe=1e4,Twe=1440*60*1e3,Iwe=6e4,Awe=360*60*1e3,Rwe="drift-bot/0.1 (+https://github.com/trydrift/drift)",hP=new Map,ia=new Map;function bP(e,t){let n=ia.get(e);if(n)return Rr("http","coalesced_hit"),n;let i=t().finally(()=>ia.delete(e));return ia.set(e,i),i}var Xo=null;function TH(e){let t=hP.get(e);return t?Date.now()>=t.expiresAt?(hP.delete(e),{hit:!1}):{hit:!0,value:t.value}:{hit:!1}}function vo(e,t){let n=t===null?Date.now()+Iwe:1/0;hP.set(e,{value:t,expiresAt:n})}function vP(e){if(!e)return"default";let t=Object.entries(e).filter(([i])=>/auth|token/i.test(i)||i.toLowerCase()==="accept").sort(([i],[r])=>i.localeCompare(r));if(t.length===0)return"default";let n=t.map(([i,r])=>`${i.toLowerCase()}=${r}`).join("&");return(0,_d.createHash)("sha256").update(n).digest("hex").slice(0,16)}function Fk(e,t){return(0,_d.createHash)("sha256").update(`${vP(t)}:${e}`).digest("hex").slice(0,10)}function IH(e,t){return(0,_d.createHash)("sha256").update(`${e}|${t.maxBytes??""}|${t.timeoutMs??""}|${t.retries??""}`).digest("hex").slice(0,10)}function oa(e){let t=e.indexOf("://");if(t<0)return"unknown";let n=e.slice(t+3),i=n.search(/[/?#]/);return(i<0?n:n.slice(0,i)).toLowerCase()}function sa(e){let t=e.indexOf("://");if(t<0)return e.split("?")[0];let n=e.slice(t+3),i=n.indexOf("/");return(i<0?"":n.slice(i)).split("?")[0]}function wP(e){return Math.max(0,Vt()-e)}function qr(e){let t={requestKey:e.requestKey,path:e.path,timeoutMs:Math.max(0,Math.round(e.timeoutMs))};return e.abortFiredAtMs!==null?(t.abortTimerFired=!0,t.abortDelayMs=Math.max(0,Math.round(e.abortFiredAtMs-e.attemptStartOffsetMs-e.timeoutMs))):t.abortTimerFired=!1,e.headersAtMs!==void 0&&e.headersAtMs!==null&&(t.headersMs=Math.max(0,Math.round(e.headersAtMs-e.attemptStartOffsetMs))),e.headersAtMs!==void 0&&e.headersAtMs!==null&&e.bodyDoneAtMs!==void 0&&e.bodyDoneAtMs!==null&&(t.bodyMs=Math.max(0,Math.round(e.bodyDoneAtMs-e.headersAtMs))),t}function Yt(e){kH({host:oa(e.url),method:e.method,path:sa(e.url),startOffsetMs:e.startOffsetMs,durationMs:Vt()-e.startOffsetMs,status:e.status,cache:e.cache,bytes:e.bytes,retries:e.retries,backoffMs:e.backoffMs,failure:e.failure})}function Wr(e){$H({host:oa(e.url),method:e.method,path:sa(e.url),startOffsetMs:e.startOffsetMs,durationMs:Vt()-e.startOffsetMs,status:e.status})}function AH(e){Xo=e}function Lc(){return Xo}function $e(e,t={}){let n=`json:${vP(t.headers)}:${e}`,i=TH(n);if(i.hit)return nt("http.cache.memory"),Rr("http","memory_hit"),Yt({url:e,method:"GET",startOffsetMs:Vt(),status:null,cache:"memory_hit"}),Promise.resolve(i.value);Pg()&&ia.has(n)&&nt("http.cache.coalesced");let r=Vt(),o=ia.has(n),s={Accept:"application/json",...t.headers},a=Fk(e,s),c=o?It("http-coalesced-json",oa(e),{requestKey:a,path:sa(e)}):null,l=bP(n,()=>Nwe(e,n,t));return o?l.then(u=>(c?.end({waitMs:Math.round(wP(r))}),Yt({url:e,method:"GET",startOffsetMs:r,status:null,cache:"coalesced_hit"}),u)):l}async function Nwe(e,t,n){let i={Accept:"application/json",...n.headers},r=await rt(e,{...n,headers:i});if(r===null)return vo(t,null),null;let o=It("json-parse",oa(e),{requestKey:Fk(e,i),path:sa(e),bytes:r.length});try{let s=JSON.parse(r);return vo(t,s),s}catch{return vo(t,null),null}finally{o.end()}}function rt(e,t={}){let n=`text:${vP(t.headers)}:${e}`,i=TH(n);if(i.hit)return nt("http.cache.memory"),Rr("http","memory_hit"),Yt({url:e,method:"GET",startOffsetMs:Vt(),status:null,cache:"memory_hit"}),Promise.resolve(i.value);Pg()&&ia.has(n)&&nt("http.cache.coalesced");let r=Vt(),o=ia.has(n),s=Fk(e,t.headers),a=o?It("http-coalesced-text",oa(e),{requestKey:s,path:sa(e)}):null;return bP(n,()=>Cwe(e,n,t)).then(c=>(o&&(a?.end({waitMs:Math.round(wP(r))}),Yt({url:e,method:"GET",startOffsetMs:r,status:null,cache:"coalesced_hit"})),c))}async function Cwe(e,t,n){let{timeoutMs:i=Ewe,headers:r={},retries:o=2}=n,s=oa(e),a=Fk(e,r),c=sa(e),l=It("disk-cache",s,{requestKey:a,path:c}),u=await Mwe(t);l.end({hit:u!==null});let d=n.cacheTtlMs??Twe,p=Date.now();if(u&&u.body!==null&&(u.immutable||n.immutable||p-u.fetchedAt{w=Vt(),y.abort()},i),_=It("http",s,{requestKey:a,path:c,timeoutMs:i,...h>0?{attempt:h}:{}});try{let S=await fetch(e,{signal:y.signal,headers:{"User-Agent":Rwe,...f,...r},redirect:"follow"}),x=Vt();if(S.status===304&&u)return _.end({status:304,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:304}),Yt({url:e,method:"GET",startOffsetMs:m,status:304,cache:"revalidated_304",retries:h,backoffMs:g}),nt("http.notModified"),Rr("http","revalidated_304"),Rr("http","write"),await gP(t,{...u,fetchedAt:p,immutable:u.immutable||n.immutable}),vo(t,u.body),u.body;if(S.ok){let A=await S.text(),L=Vt();return _.end({status:S.status,bytes:A.length,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x,bodyDoneAtMs:L})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",bytes:A.length,retries:h,backoffMs:g}),vo(t,A),Rr("http","write"),await gP(t,{key:t,body:A,etag:S.headers.get("etag")??void 0,fetchedAt:p,immutable:n.immutable}),A}if(S.status===404)return _.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g}),vo(t,null),Rr("http","write"),await gP(t,{key:t,body:null,absent:!0,fetchedAt:p,immutable:n.immutable}),null;if(S.status===403){if(!(S.headers.get("x-ratelimit-remaining")==="0"||S.headers.has("retry-after"))||h===o){_.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g});break}_.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),n.onRetry?.(h+1,"rate-limited");let L=Dg(h,S.headers.get("retry-after"));g+=L,await Og(L);continue}if(!(S.status===429||S.status>=500)||h===o){_.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g});break}_.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),n.onRetry?.(h+1,S.status===429?"rate-limited":"server-error");let T=Dg(h,S.headers.get("retry-after"));g+=T,await Og(T)}catch(S){if(_.end({status:0,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w})}),Wr({url:e,method:"GET",startOffsetMs:b,status:null}),h===o){Yt({url:e,method:"GET",startOffsetMs:m,status:null,cache:"miss",retries:h,backoffMs:g,failure:S instanceof Error?S.name:"network-error"}),nt("http.error");break}nt("http.error"),n.onRetry?.(h+1,"network-error");let x=Dg(h,null);g+=x,await Og(x)}finally{clearTimeout(k)}}return vo(t,null),u?.body!==void 0?(vo(t,u.body),u.body):null}function Bt(e,t={}){let n=`archive:${e}`,i=`${n}|maxBytes=${t.maxBytes??""}|timeoutMs=${t.timeoutMs??""}|retries=${t.retries??""}`,r=Vt(),o=ia.has(i),s=IH(e,t),a=o?It("http-coalesced-archive",oa(e),{requestKey:s,path:sa(e)}):null;return bP(i,()=>Pwe(e,n,t)).then(c=>(o&&(a?.end({waitMs:Math.round(wP(r))}),Yt({url:e,method:"GET",startOffsetMs:r,status:c.ok?200:c.status,cache:"coalesced_hit"})),c))}async function Pwe(e,t,n){let i=oa(e),r=sa(e),o=IH(e,n),s=Owe(t),{retries:a=2,maxBytes:c}=n;if(s)try{let m=await(0,Vi.readFile)(s);if(c===void 0||m.length<=c)return nt("http.cache.archive"),Rr("http","disk_hit"),Yt({url:e,method:"GET",startOffsetMs:Vt(),status:200,cache:"disk_hit"}),{ok:!0,bytes:m}}catch{}Rr("http","miss");let l=n.timeoutMs??6e4,u=Date.now()+l,d=()=>u-Date.now();nt("http.archive");let p=Vt(),f=0;for(let m=0;m<=a;m++){let g=d();if(g<=0)return Yt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:"timeout"}),{ok:!1,status:0,error:"Timed out before this attempt could start."};let h=Vt(),b=It("archive",i,{requestKey:o,path:r,timeoutMs:Math.max(0,Math.round(g)),...m>0?{attempt:m}:{}}),y=new AbortController,w=null,k=setTimeout(()=>{w=Vt(),y.abort()},g);try{let _=await fetch(e,{signal:y.signal}),S=Vt();if(!_.ok){b.end({status:_.status,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S})}),Wr({url:e,method:"GET",startOffsetMs:h,status:_.status});let A=_.status===429||_.status>=500,L=Math.min(Dg(m,_.headers.get("retry-after")),d());if(!A||m===a||L<=0)return Yt({url:e,method:"GET",startOffsetMs:p,status:_.status,cache:"miss",retries:m,backoffMs:f}),{ok:!1,status:_.status};f+=L,await Og(L);continue}let x=Number(_.headers.get("content-length"));if(c!==void 0&&Number.isFinite(x)&&x>c)return b.end({status:_.status,bytes:x,oversized:!0,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S})}),Wr({url:e,method:"GET",startOffsetMs:h,status:_.status}),Yt({url:e,method:"GET",startOffsetMs:p,status:_.status,cache:"miss",retries:m,backoffMs:f,failure:"oversized"}),{ok:!1,status:_.status,error:`Response of ${x} bytes exceeds the ${c}-byte limit for this archive.`};let E=await Dwe(_,c,y),T=Vt();if(E==="oversized")return b.end({status:_.status,oversized:!0,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S,bodyDoneAtMs:T})}),Wr({url:e,method:"GET",startOffsetMs:h,status:_.status}),Yt({url:e,method:"GET",startOffsetMs:p,status:_.status,cache:"miss",retries:m,backoffMs:f,failure:"oversized"}),{ok:!1,status:_.status,error:`Response exceeds the ${c}-byte limit for this archive.`};if(b.end({status:_.status,bytes:E.length,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S,bodyDoneAtMs:T})}),Wr({url:e,method:"GET",startOffsetMs:h,status:_.status}),Yt({url:e,method:"GET",startOffsetMs:p,status:_.status,cache:"miss",bytes:E.length,retries:m,backoffMs:f}),s)try{await(0,Vi.mkdir)(Xo,{recursive:!0});let A=`${s}.${process.pid}.partial`;await(0,Vi.writeFile)(A,E),await(0,Vi.rename)(A,s),Rr("http","write")}catch{}return{ok:!0,bytes:E}}catch(_){if(b.end({status:0,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w})}),Wr({url:e,method:"GET",startOffsetMs:h,status:null}),m===a)return Yt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:_ instanceof Error?_.name:"network-error"}),{ok:!1,status:0,error:_.message};let S=Math.min(Dg(m,null),d());if(S<=0)return Yt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:_ instanceof Error?_.name:"network-error"}),{ok:!1,status:0,error:_.message};f+=S,await Og(S)}finally{clearTimeout(k)}}return{ok:!1,status:0}}async function Dwe(e,t,n){if(t===void 0||!e.body)return Buffer.from(await e.arrayBuffer());let i=e.body.getReader(),r=[],o=0;for(;;){let{done:s,value:a}=await i.read();if(s)break;if(o+=a.byteLength,o>t)return n.abort(),"oversized";r.push(a)}return Buffer.concat(r)}function Owe(e){return Xo?(0,yP.join)(Xo,`${(0,_d.createHash)("sha256").update(e).digest("hex")}.bin`):null}async function Mwe(e){if(!Xo)return null;try{let t=await(0,Vi.readFile)(RH(e),"utf8"),n=JSON.parse(t);return n.key===e?n:null}catch{return null}}async function gP(e,t){if(Xo)try{await(0,Vi.mkdir)(Xo,{recursive:!0}),await(0,Vi.writeFile)(RH(e),JSON.stringify(t),"utf8")}catch{}}function RH(e){let t=(0,_d.createHash)("sha256").update(e).digest("hex");return(0,yP.join)(Xo,`${t}.json`)}function Dg(e,t){if(t){let i=Number(t);if(Number.isFinite(i)&&i>0)return Math.min(i*1e3,3e4)}return 400*2**e+Math.random()*200}function Og(e){return new Promise(t=>setTimeout(t,e))}async function qn(e,t,n){let i=new Array(e.length),r=0,o=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let s=r++;if(s>=e.length)return;i[s]=await n(e[s],s)}});return await Promise.all(o),i}var PH=require("node:crypto"),DH=require("node:zlib"),Sd=require("node:fs/promises"),$P=require("node:path");var OH="https://downloads.arduino.cc/libraries/library_index.json.gz",Lwe=1440*60*1e3,Fwe=12e4,NH=null;async function Uwe(){return NH??=jwe(),NH}async function Uk(e){return(await Uwe())?.get(e.toLowerCase())??null}async function jwe(){let e=await CH();if(e)return kP(e);let t=await zwe();if(!t){let i=await CH({ignoreAge:!0});return i?kP(i):null}let n=Gwe(t);return await Bwe(n),kP(n)}async function zwe(){try{let e=await fetch(OH,{signal:AbortSignal.timeout(Fwe),headers:{"User-Agent":"drift-bot/0.1 (+https://github.com/trydrift/drift)"}});if(!e.ok)return null;let t=Buffer.from(await e.arrayBuffer()),n=t[0]===31&&t[1]===139?(0,DH.gunzipSync)(t):t;return JSON.parse(n.toString("utf8"))}catch{return null}}function Gwe(e){let t=new Map;for(let n of e.libraries??[]){if(!n.name||!n.version)continue;let i=n.name.toLowerCase(),r=t.get(i);r||(r={name:n.name,versions:[],githubRepo:null,website:null,description:null,archives:{}},t.set(i,r)),r.versions.includes(n.version)||r.versions.push(n.version),n.url&&(r.archives[n.version]=n.url),r.githubRepo=Vwe(n.repository)??r.githubRepo,r.website=n.website??r.website,r.description=n.sentence??r.description}return[...t.values()]}function Vwe(e){if(!e)return null;let t=/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/.exec(e);return t?`${t[1]}/${t[2]}`:null}function kP(e){return new Map(e.map(t=>[t.name.toLowerCase(),t]))}function MH(){let e=Lc();if(!e)return null;let t=(0,PH.createHash)("sha256").update(OH).digest("hex");return(0,$P.join)(e,`arduino-index-${t.slice(0,16)}.json`)}async function CH(e={}){let t=MH();if(!t)return null;try{let n=JSON.parse(await(0,Sd.readFile)(t,"utf8"));return!Array.isArray(n.libraries)||!e.ignoreAge&&Date.now()-n.fetchedAt>=Lwe?null:n.libraries}catch{return null}}async function Bwe(e){let t=MH();if(t)try{await(0,Sd.mkdir)((0,$P.join)(t,".."),{recursive:!0});let n={fetchedAt:Date.now(),libraries:[...e]};await(0,Sd.writeFile)(t,JSON.stringify(n),"utf8")}catch{}}var jH=require("node:crypto");var qwe=new Set(["sponsors","apps","marketplace","settings","about","pricing","features"]),LH=/^[A-Za-z0-9._-]+$/;function FH(e,t){let n=t.replace(/\.git$/i,"");return!e||!n||!LH.test(e)||!LH.test(n)||e==="."||e===".."||n==="."||n===".."||qwe.has(e.toLowerCase())?null:`${e}/${n}`}function UH(e){let t=e.toLowerCase();return t==="github.com"||t==="www.github.com"}function aa(e){if(!e)return null;let t=e.trim();if(!t)return null;t=t.replace(/^git\+/i,"");let n=/^(?:ssh:\/\/)?(?:[^@/\s]+@)?github\.com:(?[^/\s:]+)\/(?[^\s?#]+?)\/?$/i.exec(t);if(n?.groups)return UH("github.com")?FH(n.groups.owner,n.groups.repo):null;let i;try{i=new URL(t)}catch{return null}if(!["http:","https:","ssh:","git:"].includes(i.protocol)||!UH(i.hostname))return null;let r=i.pathname.split("/").filter(Boolean);return r.length<2?null:FH(r[0],r[1])}var _P=new Map;function Wwe(e,t){let n=(0,jH.createHash)("md5").update(e).digest("hex"),i=`${n[0]}/${n[1]}/${n[2]}`,r=encodeURIComponent(e);return`https://cdn.cocoapods.org/Specs/${i}/${r}/${encodeURIComponent(t)}/${r}.podspec.json`}function jk(e,t,n={}){let i=`${e}@${t}`,r=_P.get(i);if(r)return r;let o=Hwe(e,t,n).catch(()=>null);return _P.set(i,o),o.then(s=>{s||_P.delete(i)}),o}async function Hwe(e,t,n){let i=await $e(Wwe(e,t),{immutable:!0,...n.timeoutMs?{timeoutMs:n.timeoutMs}:{}});if(!i)return null;let r=i.source&&typeof i.source=="object"?Kwe(i.source):null;return{name:i.name??e,version:i.version??t,moduleName:typeof i.module_name=="string"&&i.module_name?i.module_name:null,source:r,homepage:SP(i.homepage),summary:SP(i.summary),description:SP(i.description)}}function Kwe(e){let t=n=>{let i=e[n];return typeof i=="string"&&i?i:void 0};return{git:t("git"),tag:t("tag"),http:t("http"),svn:t("svn")}}function SP(e){return typeof e=="string"&&e.trim()?e.trim():null}function zH(e){return aa(e.source?.git)??aa(e.homepage)}var Jwe=e=>`https://api.github.com/repos/ocaml/opam-repository/contents/packages/${encodeURIComponent(e)}`,Zwe="https://api.github.com/repos/ocaml/opam-repository/branches/master",GH=(e,t,n)=>`https://raw.githubusercontent.com/ocaml/opam-repository/${n}/packages/${encodeURIComponent(e)}/${encodeURIComponent(`${e}.${t}`)}/opam`;async function Ywe(e){let n=(await $e(Zwe,{...e?{headers:e}:{}}).catch(()=>null))?.commit?.sha;return typeof n=="string"&&/^[0-9a-f]{40}$/.test(n)?n:null}function BH(e){return/^[\w.+-]+$/.test(e)}async function zk(e,t={}){if(!BH(e))return null;let n=await $e(Jwe(e),{...t.headers?{headers:t.headers}:{}}).catch(()=>null);if(!Array.isArray(n))return null;let i=`${e}.`;return n.filter(r=>r.type==="dir"&&r.name?.startsWith(i)).map(r=>r.name.slice(i.length))}async function qH(e,t){if(!BH(e))return null;let n=await Ywe(),i=n?await rt(GH(e,t,n),{immutable:!0}).catch(()=>null):await rt(GH(e,t,"master")).catch(()=>null);return i?Qwe(i,e,t):null}function Qwe(e,t,n){let i=a=>{let c=new RegExp(`(?:^|\\n)\\s*${a}\\s*:\\s*"([^"\\n]*)"`).exec(e);return c?VH(c[1]):null},r=a=>{let l=new RegExp(`(?:^|\\n)\\s*${a}\\s*:\\s*"([^"\\n]*)"`).exec(e)?.[1]?.trim();return l||null},o=(()=>{let a=/(?:^|\n)\s*description\s*:\s*"""([\s\S]*?)"""/.exec(e);return a?a[1].trim()||null:r("description")})(),s=(()=>{let a=/(?:^|\n)\s*url\s*\{([\s\S]*?)\n[ \t]*\}/.exec(e),c=a?a[1]:e,l=/(?:^|\n)\s*src\s*:\s*"([^"\n]+)"/.exec(c)??/(?:^|\n)\s*archive\s*:\s*"([^"\n]+)"/.exec(c);return l?VH(l[1]):null})();return{name:t,version:n,devRepo:i("dev-repo"),homepage:i("homepage"),bugReports:i("bug-reports"),doc:i("doc"),synopsis:r("synopsis"),description:o,sourceUrl:s}}function VH(e){let t=e.trim();return!t||/%\{[^}]*\}%?/.test(t)?null:t}function WH(e){return aa(e.devRepo)??aa(e.sourceUrl)??aa(e.homepage)??aa(e.bugReports)}function Gk(e){let t={};return e.map(n=>{let i={...t,...n};return t=i,i})}function Vk(e,t){return e.find(n=>n.version===t)}async function Wn(e,t,n){switch(t){case"npm":return bke(e,n);case"pypi":return vke(e,n);case"cargo":return wke(e);case"go":return kke(e);case"maven":return Ske(e);case"rubygems":return xke(e);case"nuget":return eke(e);case"packagist":return tke(e,n);case"hex":return nke(e);case"pub":return rke(e);case"swift":return ike(e);case"cocoapods":return oke(e,n);case"conan":return ske(e);case"vcpkg":return lke(e);case"arduino":return uke(e);case"opam":return Xwe(e,n);default:return null}}async function Xwe(e,t){let[n,i]=await Promise.all([zk(e),t?qH(e,t):Promise.resolve(null)]);return!n&&!i?null:{name:e,ecosystem:"opam",githubRepo:i?WH(i):null,homepage:i?.homepage??i?.devRepo??null,versions:n??[],deprecated:null,description:i?.description??i?.synopsis??null}}async function eke(e){let t=e.toLowerCase(),[n,i]=await Promise.all([$e(`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(t)}/index.json`),$e(`https://api.nuget.org/v3/registration5-gz-semver2/${encodeURIComponent(t)}/index.json`)]);if(!n&&!i)return null;let r=(i?.items??[]).flatMap(s=>s.items??[]),o=r[r.length-1]?.catalogEntry;return{name:e,ecosystem:"nuget",githubRepo:Lt(o?.repository?.url??null)??Lt(o?.projectUrl??null),homepage:o?.projectUrl??`https://www.nuget.org/packages/${e}`,versions:n?.versions??[],deprecated:o?.deprecation?.message??null,description:o?.description??null}}async function tke(e,t){let i=(await $e(`https://repo.packagist.org/p2/${e}.json`))?.packages?.[e];if(!i||i.length===0)return null;let r=Gk(i),o=t?Vk(r,t):r[0];if(!o)return null;let s=o.abandoned,a=s===void 0||s===!1?null:typeof s=="string"?`This package is abandoned; the author suggests using ${s} instead.`:"This package is abandoned and is no longer maintained.";return{name:e,ecosystem:"packagist",githubRepo:Lt(o.source?.url??null)??Lt(o.homepage??null),homepage:o.homepage??`https://packagist.org/packages/${e}`,versions:r.map(c=>c.version).filter(c=>!!c),deprecated:a,description:o.description??null}}async function nke(e){let t=await $e(`https://hex.pm/api/packages/${encodeURIComponent(e)}`);if(!t)return null;let n=t.meta?.links??{},i=Object.entries(n).map(([s,a])=>({key:s.toLowerCase(),value:a})),r=i.find(s=>s.key==="github")?.value??i.find(s=>s.key==="source")?.value,o=Object.values(t.retirements??{})[0];return{name:e,ecosystem:"hex",githubRepo:Lt(r??null)??i.map(s=>Lt(s.value)).find(Boolean)??null,homepage:t.html_url??`https://hex.pm/packages/${e}`,versions:(t.releases??[]).map(s=>s.version).filter(s=>!!s),deprecated:o?o.message??o.reason??"This release is retired.":null,description:t.meta?.description??null}}async function rke(e){let t=await $e(`https://pub.dev/api/packages/${encodeURIComponent(e)}`);if(!t)return null;let n=t.latest?.pubspec,i=n?.repository??n?.homepage??n?.issue_tracker;return{name:e,ecosystem:"pub",githubRepo:Lt(i??null),homepage:n?.homepage??`https://pub.dev/packages/${e}`,versions:(t.versions??[]).map(r=>r.version).filter(r=>!!r),deprecated:t.latest?.retracted?"The latest version of this package has been retracted.":null,description:n?.description??null}}function ike(e){return/^[\w.-]+\/[\w.-]+$/.test(e)?{name:e,ecosystem:"swift",githubRepo:e,homepage:`https://github.com/${e}`,versions:[],deprecated:null,description:null}:null}async function oke(e,t){let[n,i]=await Promise.all([$e(`https://trunk.cocoapods.org/api/v1/pods/${encodeURIComponent(e)}`),t?jk(e,t):Promise.resolve(null)]);return n?{name:e,ecosystem:"cocoapods",githubRepo:i?zH(i):null,homepage:i?.homepage??`https://cocoapods.org/pods/${e}`,versions:(n.versions??[]).map(r=>r.name).filter(r=>!!r),deprecated:null,description:i?.description??i?.summary??null}:null}async function ske(e){let t=`https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/${encodeURIComponent(e)}`,n=await rt(`${t}/config.yml`);if(!n)return null;let{versions:i,folders:r}=ake(n);if(i.length===0)return null;let o=r[i[i.length-1]]??r[i[0]]??"all",s=await rt(`${t}/${o}/conandata.yml`);return{name:e,ecosystem:"conan",githubRepo:s?cke(s):null,homepage:`https://conan.io/center/recipes/${e}`,versions:i,deprecated:null,description:null}}function ake(e){let t=[],n={},i=!1,r=null;for(let o of e.split(` -`)){let s=o.split("#")[0].replace(/\s+$/,"");if(!s.trim())continue;if(/^versions\s*:/.test(s)){i=!0;continue}if(!/^\s/.test(s)){i=!1;continue}if(!i)continue;let a=/^\s{2,}["']?([^"':\s]+)["']?\s*:\s*$/.exec(s);if(a){r=a[1].trim(),r&&!t.includes(r)&&t.push(r);continue}let c=/^\s{4,}folder\s*:\s*["']?([^"'\s]+)["']?/.exec(s);c&&r&&(n[r]=c[1])}return{versions:t,folders:n}}function cke(e){for(let t of e.matchAll(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+/g)){let n=Lt(t[0]);if(n)return n}return null}async function lke(e){let t=e[0]?.toLowerCase();if(!t||!/[a-z0-9]/.test(t))return null;let[n,i]=await Promise.all([$e(`https://raw.githubusercontent.com/microsoft/vcpkg/master/versions/${t}-/${encodeURIComponent(e)}.json`),$e(`https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/${encodeURIComponent(e)}/vcpkg.json`)]);if(!n)return null;let r=[];for(let s of n.versions??[]){let a=s.version??s["version-semver"]??s["version-string"]??s["version-date"];a&&!r.includes(a)&&r.push(a)}if(r.length===0)return null;let o=Array.isArray(i?.description)?i.description.join(" "):i?.description??null;return{name:e,ecosystem:"vcpkg",githubRepo:Lt(i?.homepage??null),homepage:i?.homepage??`https://vcpkg.io/en/package/${e}`,versions:r,deprecated:null,description:o}}async function uke(e){let t=await Uk(e);if(t)return{name:t.name,ecosystem:"arduino",githubRepo:t.githubRepo,homepage:t.website??`https://www.arduino.cc/reference/en/libraries/${pke(e)}/`,versions:t.versions,deprecated:null,description:t.description};let n=await dke(e);return n?{name:n.name??e,ecosystem:"arduino",githubRepo:Lt(n.repository_url??null),homepage:n.homepage??null,versions:n.version?.name?[n.version.name]:[],deprecated:null,description:n.description??null}:null}async function dke(e){let n=((await $e(`https://api.registry.platformio.org/v3/search?query=${encodeURIComponent(e)}`))?.items??[]).find(i=>i.name?.toLowerCase()===e.toLowerCase()&&i.owner?.username);return n?$e(`https://api.registry.platformio.org/v3/packages/${encodeURIComponent(n.owner.username)}/library/${encodeURIComponent(n.name)}`):null}function pke(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}async function ca(e,t,n){switch(t){case"npm":return fke(e,n);case"pypi":return mke(e,n);case"go":return gke(e,n);case"cargo":return yke(e,n);default:return null}}function Bk(e){return{version:e,license:null,releasedAt:null,runtime:null,dependencies:[],withdrawn:null}}async function fke(e,t){let n=await $e(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`),i=n?.versions?.[t];if(!i)return null;let r=i.engines?.node;return{...Bk(t),license:typeof i.license=="string"?i.license:i.license?.type??null,releasedAt:n?.time?.[t]??null,runtime:r?{name:"Node.js",requirement:r}:null,dependencies:Object.keys(i.dependencies??{}),withdrawn:i.deprecated??null}}async function mke(e,t){let n=await $e(`https://pypi.org/pypi/${encodeURIComponent(e)}/${encodeURIComponent(t)}/json`,{immutable:!0});if(!n?.info)return null;let i=n.info.requires_python;return{...Bk(t),license:n.info.license||null,releasedAt:n.urls?.[0]?.upload_time_iso_8601??null,runtime:i?{name:"Python",requirement:i}:null,dependencies:(n.info.requires_dist??[]).map(r=>/^\s*([A-Za-z0-9._-]+)/.exec(r)?.[1]).filter(r=>!!r),withdrawn:n.info.yanked?`Release yanked: ${n.info.yanked_reason??"no reason given"}`:null}}async function gke(e,t){let n=t.startsWith("v")?t:`v${t}`,i=`https://proxy.golang.org/${encodeURI(e.toLowerCase())}/@v/${encodeURIComponent(n)}`,[r,o]=await Promise.all([rt(`${i}.mod`,{immutable:!0}),$e(`${i}.info`,{immutable:!0})]);if(!r&&!o)return null;let s=r?/^\s*go\s+(\d+\.\d+(?:\.\d+)?)/m.exec(r)?.[1]:null;return{...Bk(n),releasedAt:o?.Time??null,runtime:s?{name:"Go",requirement:`>=${s}`}:null,withdrawn:r?hke(r,n):null}}function hke(e,t){let n=t.replace(/^v/,"");for(let r of e.matchAll(/^\s*retract\s+(.+)$/gm)){let o=r[1].trim(),s=/\/\/\s*(.+)$/.exec(o)?.[1]?.trim(),a=s?`Retracted by the maintainer: ${s}`:"Retracted by the maintainer.",c=/^v?([\w.+-]+)/.exec(o.replace(/\/\/.*$/,"").trim())?.[1];if(c&&c===n)return a;let l=/\[\s*v?([\w.+-]+)\s*,\s*v?([\w.+-]+)\s*\]/.exec(o);if(l&&HH(n,l[1],l[2]))return a}let i=/^\s*retract\s*\(([\s\S]*?)^\s*\)/m.exec(e)?.[1];if(i)for(let r of i.split(` -`)){let o=r.replace(/\/\/.*$/,"").trim();if(!o)continue;let s=/\/\/\s*(.+)$/.exec(r)?.[1]?.trim(),a=s?`Retracted by the maintainer: ${s}`:"Retracted by the maintainer.";if(/^v?([\w.+-]+)$/.exec(o)?.[1]===n)return a;let c=/\[\s*v?([\w.+-]+)\s*,\s*v?([\w.+-]+)\s*\]/.exec(o);if(c&&HH(n,c[1],c[2]))return a}return null}function HH(e,t,n){return KH(e,t)>=0&&KH(e,n)<=0}function KH(e,t){let n=e.split(/[.+-]/).map(r=>Number.parseInt(r,10)),i=t.split(/[.+-]/).map(r=>Number.parseInt(r,10));for(let r=0;r=${i}`}:null,withdrawn:n.version.yanked?"This release was yanked from crates.io.":null}}async function YH(e,t,n){let i={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};t&&(i.Authorization=`Bearer ${t}`);let r=await $e(`https://api.github.com/repos/${e}`,{headers:i,...n?{onRetry:n}:{}});if(!r)return null;let o=r.license?.spdx_id;return{archived:r.archived===!0,pushedAt:r.pushed_at??null,license:o&&o!=="NOASSERTION"?o:null,url:r.html_url??`https://github.com/${e}`}}async function bke(e,t){let n=await $e(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`);if(!n)return null;let i=Object.keys(n.versions??{}),r=t?n.versions?.[t]:void 0;return{name:e,ecosystem:"npm",githubRepo:Lt(JH(n.repository))??Lt(JH(r?.repository))??Lt(n.homepage),homepage:n.homepage??null,versions:i,deprecated:r?.deprecated??null,description:n.description??null}}async function vke(e,t){let n=await $e(`https://pypi.org/pypi/${encodeURIComponent(e)}/json`);if(!n)return null;let o=[...Object.values(n.info?.project_urls??{}),n.info?.home_page??""].map(Lt).find(c=>c!==null)??null,a=(t?n.releases?.[t]??[]:[]).find(c=>c.yanked);return{name:e,ecosystem:"pypi",githubRepo:o,homepage:n.info?.home_page??null,versions:Object.keys(n.releases??{}),deprecated:a?`Release yanked: ${a.yanked_reason??"no reason given"}`:null,description:n.info?.summary??null}}async function wke(e){let t=await $e(`https://crates.io/api/v1/crates/${encodeURIComponent(e)}`);return t?{name:e,ecosystem:"cargo",githubRepo:Lt(t.crate?.repository)??Lt(t.crate?.homepage),homepage:t.crate?.homepage??null,versions:(t.versions??[]).map(n=>n.num),deprecated:null,description:t.crate?.description??null}:null}async function kke(e){let t=await rt(`https://proxy.golang.org/${encodeURI(e.toLowerCase())}/@v/list`);return{name:e,ecosystem:"go",githubRepo:_ke(e),homepage:`https://pkg.go.dev/${e}`,versions:t?t.split(` -`).map(n=>n.trim()).filter(Boolean):[],deprecated:null,description:null}}var $ke={grpc:"grpc/grpc-go",protobuf:"protocolbuffers/protobuf-go",api:"googleapis/google-api-go-client",genproto:"googleapis/go-genproto",appengine:"golang/appengine"};function _ke(e){let t=e.replace(/\/v[2-9]\d*$/,""),n=[[/^golang\.org\/x\/([\w.-]+)/,i=>`golang/${i[1]}`],[/^google\.golang\.org\/(\w+)/,i=>$ke[i[1]]??`googleapis/go-${i[1]}`],[/^go\.uber\.org\/([\w.-]+)/,i=>`uber-go/${i[1]}`],[/^sigs\.k8s\.io\/([\w.-]+)/,i=>`kubernetes-sigs/${i[1]}`],[/^k8s\.io\/([\w.-]+)/,i=>`kubernetes/${i[1]}`],[/^gopkg\.in\/([\w.-]+)\/([\w.-]+?)\.v\d+$/,i=>`${i[1]}/${i[2]}`],[/^gopkg\.in\/([\w.-]+?)\.v\d+$/,i=>`go-${i[1]}/${i[1]}`]];for(let[i,r]of n){let o=i.exec(t);if(o)return r(o)}return Lt(`https://${t}`)}async function Ske(e){let[t,n]=e.split(":");if(!t||!n)return null;let i=await $e(`https://search.maven.org/solrsearch/select?q=g:%22${encodeURIComponent(t)}%22+AND+a:%22${encodeURIComponent(n)}%22&core=gav&rows=100&wt=json`);return{name:e,ecosystem:"maven",githubRepo:null,homepage:`https://central.sonatype.com/artifact/${t}/${n}`,versions:(i?.response?.docs??[]).map(r=>r.v),deprecated:null,description:null}}async function xke(e){let t=await $e(`https://rubygems.org/api/v1/gems/${encodeURIComponent(e)}.json`);if(!t)return null;let n=await $e(`https://rubygems.org/api/v1/versions/${encodeURIComponent(e)}.json`);return{name:e,ecosystem:"rubygems",githubRepo:Lt(t.source_code_uri)??Lt(t.homepage_uri)??Lt(t.changelog_uri),homepage:t.homepage_uri??null,versions:(n??[]).map(i=>i.number),deprecated:null,description:t.info??null,changelogUrl:t.changelog_uri??null,documentationUrl:t.documentation_uri??null}}function JH(e){if(e)return typeof e=="string"?e:e.url}function Lt(e){if(!e)return null;let t=/^github:([\w.-]+)\/([\w.-]+)$/.exec(e.trim());if(t)return`${t[1]}/${ZH(t[2])}`;let n=/github\.com[/:]([\w.-]+)\/([\w.-]+)/.exec(e);if(!n)return null;let i=n[1],r=ZH(n[2]);return!i||!r||i==="sponsors"?null:`${i}/${r}`}function ZH(e){return e.replace(/\.git$/,"")}async function XH(e,t={}){let n=t.lookup??((i,r)=>Wn(i,r,null));return Promise.all(e.map(async i=>{let r=i.rawFrom!=null&&i.from===null,o=i.rawTo!=null&&i.to===null;if(!r&&!o||i.source==="lockfile"||!Eke.has(i.ecosystem))return i;let a=(await n(i.name,i.ecosystem).catch(p=>(t.logger?.debug?.(`range resolution: registry lookup for ${i.name} failed: ${String(p)}`),null)))?.versions??[];if(a.length===0)return i;let c=r?QH(a,i.rawFrom):i.from,l=o?QH(a,i.rawTo):i.to;if(r&&!c||o&&!l)return i;let u=c??i.from,d=l??i.to;return t.logger?.debug?.(`range resolution: ${i.name} ${i.rawFrom} \u2192 ${i.rawTo} resolves to ${u} \u2192 ${d}`),{...i,from:u,to:d,bump:u&&d?ta(u,d,i.ecosystem):i.bump}}))}var Eke=new Set(["npm"]);function QH(e,t){let n=t.trim().replace(/^v(?=\d)/,"");return Mg.default.valid(n)?e.includes(n)?n:Mg.default.valid(n):Mg.default.validRange(n)?Mg.default.maxSatisfying([...e],n,{includePrerelease:!1}):null}var xd=require("node:fs"),tK=gt(gc(),1);function Hn(){return{async readFile(e){try{return(0,xd.readFileSync)(e,"utf8")}catch{return null}},async readDirectory(e){try{return(0,xd.readdirSync)(e)}catch{return[]}},async isDirectory(e){try{return(0,xd.statSync)(e).isDirectory()}catch{return!1}}}}async function Ed(e,t){let i=(await Promise.all([Tke(e,t),Ike(e,t),Ake(e,t),Rke(e,t),Nke(e,t),Cke(e,t)])).filter(o=>o!==null);return i.find(o=>o.kind==="pnpm-workspace")?i.filter(o=>o.kind!=="npm-workspaces"):i}function Td(e){let t=new Set;for(let n of e)for(let i of n.members)t.add(i.dir);return t.size===0?[""]:[...t].sort()}function Fc(e,t){let n=null;for(let i of t){if(i===""){n===null&&(n="");continue}(e===i||e.startsWith(`${i}/`))&&(n===null||i.length>n.length)&&(n=i)}return n}function xP(e,t){return t===""||e===t||e.startsWith(`${t}/`)}function nK(e,t){if(t.length===0)return[...e];let n=Td(t),i=new Map;for(let r of t)for(let o of r.members)o.name&&i.set(o.dir,o.name);return e.map(r=>{let o=Fc(r.manifestPath,n);if(o===null)return r;let s=i.get(o);return{...r,workspace:o,...s?{workspaceName:s}:{}}})}function qk(e){return e.workspace===void 0?null:e.workspaceName??(e.workspace===""?"the repository root":e.workspace)}async function Tke(e,t){let n=await t.readFile(Hr(e,"package.json"));if(!n)return null;let i=Gt(n),r=Array.isArray(i?.workspaces)?i.workspaces:i?.workspaces?.packages;return!r||r.length===0?null:{kind:"npm-workspaces",ecosystem:"npm",declaredIn:"package.json",members:await Id(e,t,r,"npm","package.json",i?.name??null)}}async function Ike(e,t){let n=await t.readFile(Hr(e,"pnpm-workspace.yaml"));if(!n)return null;let i=[];try{let o=(0,tK.parse)(n);Array.isArray(o?.packages)&&(i=o.packages.filter(s=>typeof s=="string"))}catch{return null}if(i.length===0)return null;let r=Gt(await t.readFile(Hr(e,"package.json"))??"")?.name??null;return{kind:"pnpm-workspace",ecosystem:"npm",declaredIn:"pnpm-workspace.yaml",members:await Id(e,t,i,"npm","package.json",r)}}async function Ake(e,t){let n=await t.readFile(Hr(e,"Cargo.toml"));if(!n)return null;let i=pi(n),r=i.find(c=>c.header==="workspace");if(!r)return null;let o=Ag(r.entries.get("members")??""),s=i.some(c=>c.header==="package"),a=s?rK(i.find(c=>c.header==="package")?.entries.get("name")??""):null;return{kind:"cargo-workspace",ecosystem:"cargo",declaredIn:"Cargo.toml",members:await Id(e,t,o,"cargo","Cargo.toml",a,!s)}}async function Rke(e,t){let n=await t.readFile(Hr(e,"go.work"));if(!n)return null;let i=[],r=!1;for(let o of n.split(` -`)){let s=o.split("//")[0].trim();if(!s)continue;if(/^use\s*\($/.test(s)){r=!0;continue}if(r&&s===")"){r=!1;continue}let a=/^use\s+(\S+)$/.exec(s);a?i.push(a[1]):r&&i.push(s)}return{kind:"go-work",ecosystem:"go",declaredIn:"go.work",members:await Id(e,t,i,"go","go.mod",null,!0)}}async function Nke(e,t){let n=await t.readFile(Hr(e,"pom.xml"));if(!n)return null;let i=/([\s\S]*?)<\/modules>/.exec(n);if(!i)return null;let r=[...i[1].matchAll(/\s*([^<]+?)\s*<\/module>/g)].map(s=>s[1]);if(r.length===0)return null;let o=/\s*([^<]+?)\s*<\/artifactId>/.exec(n)?.[1]??null;return{kind:"maven-modules",ecosystem:"maven",declaredIn:"pom.xml",members:await Id(e,t,r,"maven","pom.xml",o)}}async function Cke(e,t){let n=await t.readFile(Hr(e,"settings.gradle.kts"))?"settings.gradle.kts":await t.readFile(Hr(e,"settings.gradle"))?"settings.gradle":null;if(!n)return null;let r=[...(await t.readFile(Hr(e,n))??"").matchAll(/include\s*\(?\s*((?:['"][^'"]+['"]\s*,?\s*)+)/g)].flatMap(o=>[...o[1].matchAll(/['"]([^'"]+)['"]/g)].map(s=>s[1])).map(o=>o.replace(/^:/,"").replace(/:/g,"/"));return r.length===0?null:{kind:"gradle-settings",ecosystem:"maven",declaredIn:n,members:await Id(e,t,r,"maven","build.gradle",null,!0)}}async function Id(e,t,n,i,r,o,s=!1){let a=new Set,c=new Set;for(let u of n){let d=u.trim();if(d.startsWith("!"))for(let p of await eK(e,t,d.slice(1),r))c.add(p);else for(let p of await eK(e,t,d,r))a.add(p)}for(let u of c)a.delete(u);let l=[];s||l.push({dir:"",name:o,ecosystem:i});for(let u of[...a].sort())u!==""&&l.push({dir:u,name:await Lg(e,t,u,r,i),ecosystem:i});return l}async function eK(e,t,n,i){let r=n.replace(/^\.\//,"").replace(/\/+$/,"");if(r.startsWith("!"))return[];if(!r.includes("*"))return[r];let o=r.split("/"),s=o.findIndex(p=>p.includes("*")),a=o.slice(0,s).join("/"),c=o[s]==="**",l=o.slice(s+1).join("/"),u=[],d=async(p,f)=>{if(!(f>4))for(let m of await t.readDirectory(Hr(e,p))){if(m.startsWith(".")||m==="node_modules"||m==="target")continue;let g=p?`${p}/${m}`:m;if(!await t.isDirectory(Hr(e,g)))continue;let h=l?`${g}/${l}`:g;(!i||await t.readFile(Hr(e,h,i))!==null)&&u.push(h),c&&await d(g,f+1)}};return await d(a,0),u}async function Lg(e,t,n,i,r){let o=await t.readFile(Hr(e,n,i));if(!o)return null;switch(r){case"npm":return Gt(o)?.name??null;case"cargo":{let s=pi(o).find(a=>a.header==="package");return rK(s?.entries.get("name")??"")||null}case"go":return/^\s*module\s+(\S+)/m.exec(o)?.[1]??null;case"maven":return/\s*([^<]+?)\s*<\/artifactId>/.exec(o)?.[1]??null;default:return null}}function rK(e){return e.trim().replace(/^["']|["']$/g,"")}function Hr(...e){return e.filter(Boolean).join("/")}var Wk=(e,t,n,i)=>e==="dev"?[t]:e==="optional"?[n]:e==="peer"&&i?[i]:[],Pke=e=>e?[...e.section==="dev-dependencies"?["--dev"]:[],...e.section==="build-dependencies"?["--build"]:[],...e.target?["--target",e.target]:[]]:[],EP=[{id:"npm",batchable:!0,ecosystem:"npm",label:"npm",manifests:["package.json"],lockfiles:["package-lock.json","npm-shrinkwrap.json"],outdated:{command:"npm",args:["outdated","--json"]},install:{command:"npm",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"npm",args:["install",`${e}@${t}`,...Wk(n,"--save-dev","--save-optional","--save-peer")]})},{id:"pnpm",batchable:!0,ecosystem:"npm",label:"pnpm",manifests:["package.json"],lockfiles:["pnpm-lock.yaml"],outdated:{command:"pnpm",args:["outdated"]},install:{command:"pnpm",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"pnpm",args:["add",`${e}@${t}`,...Wk(n,"--save-dev","--save-optional","--save-peer")]})},{id:"yarn-berry",batchable:!0,ecosystem:"npm",label:"Yarn (berry)",manifests:["package.json"],lockfiles:["yarn.lock"],outdated:null,install:{command:"yarn",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"yarn",args:["add",`${e}@${t}`,...Wk(n,"--dev","--optional","--peer")]})},{id:"yarn",batchable:!0,ecosystem:"npm",label:"Yarn (classic)",manifests:["package.json"],lockfiles:["yarn.lock"],outdated:{command:"yarn",args:["outdated","--json"]},install:{command:"yarn",args:["install"]},upgrade:({name:e,version:t})=>({command:"yarn",args:["upgrade",`${e}@${t}`]})},{id:"bun",batchable:!0,ecosystem:"npm",label:"Bun",manifests:["package.json"],lockfiles:["bun.lock","bun.lockb"],outdated:{command:"bun",args:["outdated"]},install:{command:"bun",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"bun",args:["add",`${e}@${t}`,...Wk(n,"--dev","--optional","--peer")]})},{id:"uv",batchable:!0,ecosystem:"pypi",label:"uv",manifests:["pyproject.toml"],lockfiles:["uv.lock"],outdated:{command:"uv",args:["pip","list","--outdated","--format","json"]},install:{command:"uv",args:["sync"]},upgrade:({name:e,version:t,kind:n})=>({command:"uv",args:["add",`${e}==${t}`,...n==="dev"?["--dev"]:[]]})},{id:"poetry",batchable:!0,ecosystem:"pypi",label:"Poetry",manifests:["pyproject.toml"],lockfiles:["poetry.lock"],outdated:{command:"poetry",args:["show","--outdated"]},install:{command:"poetry",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"poetry",args:["add",`${e}==${t}`,...n==="dev"?["--group","dev"]:[]]})},{id:"pip",batchable:!0,ecosystem:"pypi",label:"pip",manifests:["requirements.in","requirements.txt","pyproject.toml","setup.py"],manifestPattern:/^(?:requirements|constraints)[\w.-]*\.(?:in|txt)$/i,lockfiles:[],outdated:{command:"pip",args:["list","--outdated","--format=json"]},upgrade:({name:e,version:t})=>({command:"pip",args:["install","--upgrade",`${e}==${t}`]}),rewriteManifest:(e,{name:t,version:n},i)=>Oc(i)?Dke(e,t,n):Oke(e,t,n)},{id:"go",batchable:!0,ecosystem:"go",label:"Go modules",manifests:["go.mod"],lockfiles:["go.sum"],outdated:{command:"go",args:["list","-u","-m","all"]},upgrade:({name:e,version:t})=>({command:"go",args:["get",`${e}@${t.startsWith("v")?t:`v${t}`}`]})},{id:"cargo",batchable:!0,ecosystem:"cargo",label:"Cargo",manifests:["Cargo.toml"],lockfiles:["Cargo.lock"],outdated:{command:"cargo",args:["update","--dry-run"]},upgrade:({name:e,version:t,cargo:n})=>({command:"cargo",args:["add",`${e}@=${t}`,...Pke(n)]})},{id:"bundler",batchable:!0,ecosystem:"rubygems",label:"Bundler",manifests:["Gemfile"],lockfiles:["Gemfile.lock"],outdated:{command:"bundle",args:["outdated"]},install:{command:"bundle",args:["install"]},upgrade:({name:e})=>({command:"bundle",args:["update",e,"--conservative"]}),rewriteManifest:(e,{name:t,version:n})=>Mke(e,t,n)},{id:"maven",ecosystem:"maven",label:"Maven",manifests:["pom.xml"],lockfiles:[],outdated:{command:"mvn",args:["versions:display-dependency-updates"]},upgrade:({name:e,version:t})=>({command:"mvn",args:["versions:use-dep-version",`-Dincludes=${e}`,`-DdepVersion=${t}`,"-DforceVersion=true"]})},{id:"gradle",ecosystem:"maven",label:"Gradle",manifests:["gradle/libs.versions.toml","build.gradle","build.gradle.kts"],lockfiles:["gradle.lockfile"],outdated:{command:"gradle",args:["dependencyUpdates"]},upgrade:()=>null},{id:"sbt",ecosystem:"maven",label:"sbt",manifests:["build.sbt"],lockfiles:[],outdated:{command:"sbt",args:["dependencyUpdates"]},upgrade:()=>null},{id:"dotnet",ecosystem:"nuget",label:"NuGet",manifests:["Directory.Packages.props"],manifestPattern:/\.(cs|fs|vb)proj$/i,lockfiles:["packages.lock.json"],outdated:{command:"dotnet",args:["list","package","--outdated"]},install:{command:"dotnet",args:["restore"]},upgrade:({name:e,version:t})=>({command:"dotnet",args:["add","package",e,"--version",t]})},{id:"composer",batchable:!0,ecosystem:"packagist",label:"Composer",manifests:["composer.json"],lockfiles:["composer.lock"],outdated:{command:"composer",args:["outdated","--format=json"]},install:{command:"composer",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"composer",args:["require",`${e}:${t}`,...n==="dev"?["--dev"]:[]]})},{id:"mix",batchable:!0,ecosystem:"hex",label:"Mix",manifests:["mix.exs"],lockfiles:["mix.lock"],outdated:{command:"mix",args:["hex.outdated"]},install:{command:"mix",args:["deps.get"]},upgrade:({name:e})=>({command:"mix",args:["deps.update",e]}),rewriteManifest:(e,{name:t,version:n})=>Lke(e,t,n)},{id:"rebar",ecosystem:"hex",label:"Rebar3",manifests:["rebar.config"],lockfiles:["rebar.lock"],outdated:null,install:{command:"rebar3",args:["get-deps"]},upgrade:({name:e})=>({command:"rebar3",args:["upgrade",e]}),rewriteManifest:(e,{name:t,version:n})=>Fke(e,t,n)},{id:"flutter",ecosystem:"pub",label:"Flutter",manifests:["pubspec.yaml"],lockfiles:["pubspec.lock"],outdated:{command:"flutter",args:["pub","outdated"]},install:{command:"flutter",args:["pub","get"]},upgrade:({name:e,version:t})=>({command:"flutter",args:["pub","add",`${e}:${t}`]})},{id:"dart",ecosystem:"pub",label:"Dart pub",manifests:["pubspec.yaml"],lockfiles:["pubspec.lock"],outdated:{command:"dart",args:["pub","outdated"]},install:{command:"dart",args:["pub","get"]},upgrade:({name:e,version:t,kind:n})=>({command:"dart",args:["pub","add",...n==="dev"?["dev:"]:[],`${e}:${t}`]})},{id:"swiftpm",ecosystem:"swift",label:"Swift Package Manager",manifests:["Package.swift"],lockfiles:["Package.resolved"],outdated:null,upgrade:()=>null},{id:"cocoapods",batchable:!0,ecosystem:"cocoapods",label:"CocoaPods",manifests:["Podfile"],lockfiles:["Podfile.lock"],outdated:{command:"pod",args:["outdated"]},install:{command:"pod",args:["install"]},upgrade:({name:e})=>({command:"pod",args:["update",e]}),rewriteManifest:(e,{name:t,version:n})=>Uke(e,t,n)},{id:"opam",batchable:!0,ecosystem:"opam",label:"opam",manifests:["dune-project"],manifestPattern:/\.opam$/,lockfiles:[],outdated:null,upgrade:({name:e,version:t})=>({command:"opam",args:["install",`${e}.${t}`,"--yes"]})},{id:"conan",batchable:!0,ecosystem:"conan",label:"Conan",manifests:["conanfile.txt","conanfile.py"],lockfiles:["conan.lock"],outdated:null,upgrade:()=>({command:"conan",args:["install",".","--build=missing"]}),rewriteManifest:(e,{name:t,version:n})=>jke(e,t,n)},{id:"vcpkg",batchable:!0,ecosystem:"vcpkg",label:"vcpkg",manifests:["vcpkg.json"],lockfiles:[],outdated:null,upgrade:()=>({command:"vcpkg",args:["install"]}),rewriteManifest:(e,{name:t,version:n})=>zke(e,t,n)},{id:"arduino-cli",batchable:!0,ecosystem:"arduino",label:"Arduino CLI",manifests:["library.properties"],lockfiles:[],outdated:{command:"arduino-cli",args:["lib","upgrade","--dry-run"]},upgrade:({name:e,version:t})=>({command:"arduino-cli",args:["lib","install",`${e}@${t}`]}),rewriteManifest:(e,{name:t,version:n})=>Gke(e,t,n)},{id:"platformio",ecosystem:"arduino",label:"PlatformIO",manifests:["platformio.ini"],lockfiles:[],outdated:{command:"pio",args:["pkg","outdated"]},upgrade:({name:e,version:t})=>({command:"pio",args:["pkg","install","--library",`${e}@${t}`]}),rewriteManifest:(e,{name:t,version:n})=>Vke(e,t,n)}];function la(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Dke(e,t,n){let i=la(t).replace(/[-_.]/g,"[-_.]"),r=new RegExp(`^([ \\t]*${i})(\\[[^\\]]*\\])?[ \\t]*(?:[=<>!~]=?\\s*[^\\s;#,]+(?:\\s*,\\s*[=<>!~]=?\\s*[^\\s;#,]+)*)?`,"im");return r.test(e)?e.replace(r,(o,s,a)=>`${s}${a??""}==${n}`):e}function Oke(e,t,n){let i=la(t).replace(/[-_.]/g,"[-_.]"),r=new RegExp(`(["'])${i}(\\[[^\\]]*\\])?(?:\\s*[=<>!~]=?\\s*[^"',;]+(?:\\s*,\\s*[=<>!~]=?\\s*[^"',;]+)*)?\\1`,"i");return r.test(e)?e.replace(r,(o,s,a)=>`${s}${t}${a??""}==${n}${s}`):e}function Mke(e,t,n){let i=la(t),r=new RegExp(`(gem\\s+["']${i}["'])\\s*,\\s*["'][^"']*["']`);if(r.test(e))return e.replace(r,`$1, '${n}'`);let o=new RegExp(`(gem\\s+["']${i}["'])(?!\\s*,\\s*["'])`);return e.replace(o,`$1, '${n}'`)}function Lke(e,t,n){let i=la(t),r=new RegExp(`(\\{\\s*:${i}\\s*,\\s*)"[^"]*"`);return r.test(e)?e.replace(r,`$1"== ${n}"`):e}function Fke(e,t,n){let i=la(t),r=new RegExp(`(\\{\\s*${i}\\s*,\\s*)"[^"]*"`);return r.test(e)?e.replace(r,`$1"${n}"`):e}function Uke(e,t,n){let i=la(t),r=new RegExp(`(pod\\s+["']${i}["'])\\s*,\\s*["'][^"']*["']`);if(r.test(e))return e.replace(r,`$1, '${n}'`);let o=new RegExp(`(pod\\s+["']${i}["'])(?!\\s*,\\s*["'])`);return e.replace(o,`$1, '${n}'`)}function jke(e,t,n){let i=la(t),r=new RegExp(`\\b${i}/[^\\s"'#@]+`,"g");return e.replace(r,`${t}/${n}`)}function zke(e,t,n){let i;try{i=JSON.parse(e)}catch{return e}let r=Array.isArray(i.overrides)?i.overrides:[],o=r.find(s=>s.name===t);return o?o.version=n:r.push({name:t,version:n}),i.overrides=r,`${JSON.stringify(i,null,2)} -`}function Gke(e,t,n){return e.split(` -`).map(i=>{let r=/^(\s*depends\s*=\s*)(.*)$/i.exec(i);if(!r)return i;let o=r[2].split(",").map(s=>s.replace(/\s*\([^)]*\)\s*$/,"").trim()!==t?s:` ${t} (${n})`);return`${r[1]}${o.join(",").replace(/^\s+/,"")}`}).join(` -`)}function Vke(e,t,n){let i=la(t),r=new RegExp(`^(\\s*)((?:[\\w.-]+/)?${i})(@[^\\s;#]*)?\\s*$`,"gm");return e.replace(r,(o,s,a)=>/^\s+/.test(s)?`${s}${a}@${n}`:o)}function Uc(e){return EP.find(t=>t.id===e)}var ua=EP;function iK(e,t){if(!e.batchable||t.length===0)return null;let n=new Map;for(let i of t){let r=e.upgrade(i);if(!r)return null;let o=Bke(e,i,r);if(o===void 0)return null;let s=o===null?r.args:r.args.filter((l,u)=>u!==o),a=`${r.command}\0${o}\0${s.join("\0")}`,c=n.get(a);if(c){o!==null&&c.specs.push(r.args[o]);continue}n.set(a,{command:r,at:o,specs:o===null?[]:[r.args[o]]})}return[...n.values()].map(({command:i,at:r,specs:o})=>r===null?i:{command:i.command,args:[...i.args.slice(0,r),...o,...i.args.slice(r+1)]})}function Bke(e,t,n){let i=e.upgrade({...t,name:qke,version:Wke});if(!i||i.command!==n.command||i.args.length!==n.args.length)return;let r=n.args.reduce((o,s,a)=>s===i.args[a]?o:[...o,a],[]);return r.length===0?null:r.length===1?r[0]:void 0}var qke="\0drift-probe",Wke="\0drift-probe-version";function da(e){let t=new Set(e.entries),n=[];for(let r of EP){let o=r.lockfiles.filter(a=>t.has(a)),s=[...r.manifests.filter(a=>t.has(a)),...r.manifestPattern?e.entries.filter(a=>r.manifestPattern.test(a)):[]];o.length===0&&s.length===0||Hke(r,e,t)&&n.push({manager:r,evidence:[...o,...s],fromLockfile:o.length>0})}let i=new Set(n.filter(r=>r.fromLockfile).map(r=>r.manager.ecosystem));return n.filter(r=>r.fromLockfile||!i.has(r.manager.ecosystem))}function Hke(e,t,n){if(e.id==="yarn"||e.id==="yarn-berry"){let i=n.has(".yarnrc.yml")||(t.read?.("yarn.lock")??"").includes("__metadata");return e.id==="yarn-berry"?i:!i}if(e.id==="dart"||e.id==="flutter"){let i=t.read?.("pubspec.yaml")??"",r=/^\s*(flutter|flutter_test)\s*:/m.test(i)||/sdk:\s*flutter/.test(i);return e.id==="flutter"?r:!r}return!0}function oK(e){let t=new Map;for(let n of e){let i=t.get(n.manager.ecosystem)??[];i.push(n),t.set(n.manager.ecosystem,i)}return[...t.entries()].filter(([,n])=>n.length>1).map(([n,i])=>({ecosystem:n,candidates:i}))}function sK(e){return[e.command,...e.args].join(" ")}var pa=require("node:fs/promises"),jc=require("node:path");var IP=new Set([".git",".hg",".svn","node_modules","vendor","bower_components",".venv","venv","env","__pycache__",".tox","site-packages","target","build","dist","out",".next",".nuxt",".svelte-kit","coverage",".pytest_cache",".mypy_cache",".gradle",".idea",".vscode",".terraform","Pods","DerivedData",".pio","third_party","thirdparty","cmake-build-debug","cmake-build-release"]),Kke=new Set(["package.json",".nvmrc",".node-version",".ruby-version",".python-version",".tool-versions","dockerfile","containerfile","go.mod","gemfile","pom.xml","build.gradle","build.gradle.kts","cargo.toml","rust-toolchain","rust-toolchain.toml","pyproject.toml","setup.py","setup.cfg","runtime.txt",".ruby-gemset"]);function AP(e){let t=(e.split("/").pop()??"").toLowerCase();return Kke.has(t)||t.startsWith("dockerfile")||t.startsWith("containerfile")||t.endsWith(".gemspec")?!0:/^\.github\/workflows\/.+\.ya?ml$/.test(e)||/^\.(gitlab-ci|circleci)/.test(e)}var Jke={".ts":"typescript",".tsx":"typescript",".mts":"typescript",".cts":"typescript",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".go":"go",".rs":"rust",".c":"c",".h":"c",".cpp":"cpp",".cc":"cpp",".cxx":"cpp",".c++":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".h++":"cpp",".inl":"cpp",".tpp":"cpp",".ino":"cpp",".pde":"cpp",".java":"java",".kt":"java",".kts":"java",".scala":"java",".rb":"ruby",".rake":"ruby",".cs":"dotnet",".fs":"dotnet",".vb":"dotnet",".php":"php",".ex":"elixir",".exs":"elixir",".erl":"erlang",".dart":"dart",".swift":"swift",".ml":"ocaml",".mli":"ocaml"},aK=64*1024,Zke=2e3,Yke=["@generated","do not edit","do not modify","auto-generated","autogenerated","generated by","webpackbootstrap","sourcemappingurl"];async function Qke(e){let t;try{let r=await(0,pa.open)(e,"r");try{let o=Buffer.alloc(aK),{bytesRead:s}=await r.read(o,0,aK,0);t=o.subarray(0,s).toString("utf8")}finally{await r.close()}}catch{return!1}let n=t.slice(0,4e3).toLowerCase();if(Yke.some(r=>n.includes(r)))return!0;let i=t.split(` -`);return i.length===1?!0:i.slice(0,-1).some(r=>r.length>Zke)}function cK(e){let t=e.lastIndexOf(".");return t===-1?"other":Jke[e.slice(t).toLowerCase()]??"other"}async function Ad(e,t={}){let{maxFileBytes:n=512*1024,maxFiles:i=5e3,extraIgnores:r=[],members:o}=t,s=new Set([...IP,...r]),a=async _=>{let S;try{S=await Xke.run(()=>(0,pa.readdir)(_,{withFileTypes:!0}))}catch{return[]}let x=[];for(let E of S){let T=(0,jc.join)(_,E.name);if(E.isDirectory()){if(s.has(E.name)||E.name.startsWith(".")&&E.name!==".github"&&E.name!==".circleci")continue;x.push(a(T));continue}if(!E.isFile())continue;let A=t$e((0,jc.relative)(e,T)),L=AP(A)?"config":cK(E.name);L!=="other"&&(/\.min\.(js|ts)$/.test(E.name)||/\.d\.ts\.map$/.test(E.name)||x.push([{full:T,repoPath:A,language:L}]))}return(await Promise.all(x)).flat()},c=await a(e),l=c.filter(_=>_.language==="config"),u=c.filter(_=>_.language!=="config"),d=[],p=0,f=0,m=0,g=async _=>{let S=await qn(_,e$e,async x=>{try{return(await(0,pa.stat)(x.full)).size>n?(await Qke(x.full)?f+=1:m+=1,null):await(0,pa.readFile)(x.full,"utf8")}catch{return null}});for(let[x,E]of S.entries()){if(E===null)continue;let T=_[x];d.push({path:T.repoPath,language:T.language,content:E,lineCount:n$e(E),...o?{member:Fc(T.repoPath,o)}:{}})}};await g(l);let h=0;for(;h_.path.localeCompare(S.path)),y=h+f===u.length,w=d.filter(_=>_.language==="config").length,k={localizationRan:!0,localizationComplete:y,sourceFilesDiscovered:u.length,sourceFilesIndexed:h,sourceTruncated:!y,generatedFilesSkipped:f,oversizedSourceSkipped:m,runtimeConfigsDiscovered:l.length,runtimeConfigsIndexed:w,runtimeConfigComplete:l.length===w};return Object.defineProperty(b,"coverage",{value:k,enumerable:!1}),b}var TP=class{constructor(t){this.limit=t}limit;active=0;waiting=[];async run(t){this.active>=this.limit&&await new Promise(n=>this.waiting.push(n)),this.active+=1;try{return await t()}finally{this.active-=1,this.waiting.shift()?.()}}},Xke=new TP(64),e$e=16;function t$e(e){return jc.sep==="/"?e:e.split(jc.sep).join("/")}function n$e(e){let t=1;for(let n=0;ne.manifests)),RP=new Map;for(let e of ua)for(let t of e.manifests)RP.has(t)||RP.set(t,e.ecosystem);function lK(e){let t=RP.get(e);if(t)return t;for(let n of ua){let i=n.manifestPattern;if(i&&(i.lastIndex=0,i.test(e)))return n.ecosystem}return null}async function Kk(e,t,n=[],i=8){let r=new Set(n),o=[],s=async(a,c)=>{if(c>i)return;let l=await t.readDirectory(Hk(e,a));if(l.length===0)return;let u=!1;if(a!==""&&!r.has(a)){u=l.includes(".git");let d=l.find(f=>r$e.has(f))??l.find(f=>lK(f)),p=d?lK(d):null;d&&p&&(u||!o$e(a))&&o.push({dir:a,ecosystem:p,manifestPath:Hk(a,d),hasOwnGit:u})}if(!u)for(let d of l){if(IP.has(d)||d.startsWith(".")&&d!==".github")continue;let p=Hk(a,d);r.has(p)||await t.isDirectory(Hk(e,p))&&await s(p,c+1)}};return await s("",0),o}var i$e=new Set(["fixtures","__fixtures__","testdata","registry"]);function o$e(e){let t=e.split("/").filter(Boolean).map(i=>i.toLowerCase()),n=t.findIndex(i=>i==="test"||i==="tests");return n===-1?!1:t.slice(n+1).some(i=>i$e.has(i))}function Hk(...e){return e.filter(Boolean).join("/")}var dK=require("node:crypto");function St(e,...t){let n=(0,dK.createHash)("sha256").update(t.map(i=>String(i??"")).join(" ")).digest("hex");return`${e}_${n.slice(0,10)}`}function zc(e){return e.workspace===void 0?e.name:`${e.workspace} ${e.name}`}function cn(e){return`${e.ecosystem} ${zc(e)}`}function NP(e){return JSON.stringify([e.ecosystem,e.name,e.from??null,e.to??null])}function uK(e){let t=0,n=e.length;for(;tt&&e.charCodeAt(n-1)===45;)n--;return e.slice(t,n)}function pK(e,t=40){let n=uK(e.toLowerCase().replace(/[^a-z0-9]+/g,"-"));return uK(n.slice(0,t))||"change"}var s$e=["CHANGELOG.md","CHANGELOG.markdown","CHANGELOG","CHANGES.md","Changes.md","HISTORY.md","NEWS.md","RELEASES.md","RELEASE-NOTES.md","RELEASE_NOTES.md","CHANGELOG.rst","CHANGES.rst","CHANGELOG.txt","docs/CHANGELOG.md","docs/changelog.md","changelog.md"],a$e=["MIGRATING.md","MIGRATION.md","UPGRADING.md","UPGRADE.md","docs/migration.md","docs/migrating.md","docs/upgrading.md","docs/MIGRATION.md","docs/UPGRADE.md"];async function hK(e,t=["main","master"]){return yK(e,s$e,t)}async function c$e(e,t=["main","master"]){return yK(e,a$e,t)}var fK=1,mK=16;function*l$e(e){if(e.length!==0){yield e.slice(0,fK);for(let t=fK;tt.map(o=>({branch:r,filename:o})));for(let r of l$e(i)){let o=await Promise.all(r.map(({branch:l,filename:u})=>rt(`https://raw.githubusercontent.com/${e}/${l}/${u}`,{retries:0}))),s=o.findIndex(l=>l!==null&&l.trim()!=="");if(s<0)continue;let{branch:a,filename:c}=r[s];return{path:c,url:`https://github.com/${e}/blob/${a}/${c}`,content:o[s],branch:a}}return null}function u$e(e,t="npm"){let n=[],i=new Set;for(let r of e.matchAll(/\[([^\]]+)\]\(([^)\s]+)\)/g)){let o=r[1],s=r[2];if(/^[a-z]+:/i.test(s)||s.startsWith("#")||!/\.(md|markdown|rst|txt)$/i.test(s))continue;let a=CP(o,t)??CP(s.replace(/[/\\]/g," "),t);if(!a)continue;let c=s.replace(/^\.?\//,"").split("#")[0];i.has(c)||(i.add(c),n.push({path:c,version:a}))}return n}async function bK(e,t,n,i="npm",r={}){let{branches:o=["main","master"],maxDocuments:s=12}=r,a=await hK(e,o);return a?wK(a,e,t,n,i,s):[]}async function vK(e,t,n,i,r="npm",o=12){let s=/^https?:\/\/github\.com\/([^/]+\/[^/]+)\/blob\/([^/]+)\/(.+)$/i.exec(e),a=s?`https://raw.githubusercontent.com/${s[1]}/${s[2]}/${s[3]}`:e,c=await rt(a,{retries:0});if(!c||!c.trim())return[];let l=decodeURIComponent(new URL(e).pathname.split("/").pop()||"changelog"),u=s?.[2]??"main",d=s?.[1]??t;s?.[3]&&(l=s[3]);let p={path:l,url:e,content:c,branch:u};return d?wK(p,d,n,i,r,o):[p]}async function wK(e,t,n,i,r,o){if(DP(PP(e.content,r),n,i,r).length>0)return[e];let s=u$e(e.content,r).filter(l=>d$e(l.version,n,i,r));if(s.length===0)return[e];let c=(await Promise.all([...s].sort((l,u)=>$K(u.version,l.version,r)).slice(0,o).map(async l=>{let u=await rt(`https://raw.githubusercontent.com/${t}/${e.branch}/${l.path}`,{retries:0});return!u||!u.trim()?null:{path:l.path,url:`https://github.com/${t}/blob/${e.branch}/${l.path}`,content:u,branch:e.branch}}))).filter(l=>l!==null);return c.length>0?c:[e]}async function kK(e,t=["main","master"]){let[n,i]=await Promise.all([c$e(e,t),hK(e,t)]),r=n?[n]:[];if(!i)return r;let o=[...i.content.matchAll(/\[([^\]]+)\]\(([^)\s]+)\)/g)].filter(([,s,a])=>gK.test(s)||gK.test(a)).map(([,,s])=>s.replace(/^\.?\//,"").split("#")[0]).filter(s=>/\.(md|markdown|rst|txt)$/i.test(s)&&!/^[a-z]+:/i.test(s));for(let s of[...new Set(o)].slice(0,4)){if(r.some(c=>c.path===s))continue;let a=await rt(`https://raw.githubusercontent.com/${e}/${i.branch}/${s}`,{retries:0});!a||!a.trim()||r.push({path:s,url:`https://github.com/${e}/blob/${i.branch}/${s}`,content:a,branch:i.branch})}return r}var gK=/migrat|upgrad/i;function d$e(e,t,n,i){let r=Te(t,i),o=Te(n,i),s=Te(e,i);if(!r||!o||!s)return!1;let a=Qe(o,r);if(a===null)return!1;let[c,l]=a>0?[r,o]:[o,r],u=Qe(s,c),d=Qe(s,l);return u!==null&&d!==null&&u>0&&d<=0}function PP(e,t="npm"){let n=[],i=e.split(` -`),r=null;for(let o=0;o0?[r,o]:[o,r];return e.filter(l=>{let u=Te(l.version,i);if(!u)return!1;let d=Qe(u,a),p=Qe(u,c);return d!==null&&p!==null&&d>0&&p<=0}).sort((l,u)=>$K(u.version,l.version,i))}function $K(e,t,n){let i=Te(e,n),r=Te(t,n);return i&&r?Qe(i,r)??0:0}function Fg(e){let t=[],n=e.split(` -`),i=!1,r=0;for(let o of n){let s=/^(#{1,6})\s(.*)$/.exec(o);if(s){let c=s[1].length,l=s[2].trimStart();if(f$e.test(l)){i=!0,r=c,t.push(o.trim());continue}i&&c<=r&&(i=!1)}let a=o.trim();if(a){if(i){t.push(a);continue}g$e(a)&&t.push(a)}}return h$e(t)}var p$e=/\b(?:this|the)\s+(?:package|project|library|module)\s+(?:is\s+)?now\s+(?:pure\s+ESM|ESM[\s-]only|an?\s+ESM\s+package)\b|\b(?:migrated|converted|switched)\s+(?:this|the)\s+(?:package|project|library|module)\s+to\s+ESM\b|\b(?:dropped|removed)\s+CommonJS\s+support\b|\b(?:dropped|removed|no longer (?:supports|provides))\s+CommonJS\b|\bCommonJS\s+(?:is\s+)?no\s+longer\s+supported\b|\brequire\(\)\s+(?:is\s+)?no\s+longer\s+supported\b/i,f$e=/breaking|incompatib|removed|migration|upgrade\s+guide|deprecat|commonjs/i,m$e=/\b(BREAKING(\s+CHANGE)?|breaking change|no longer|has been removed|have been removed|was removed|were removed|is removed|renamed to|renamed from|replaced by|replaced with|now requires?|required\s+node|must now|dropped support|drop support|removed support|is now required|are now required|moved to|deprecated in favou?r of|minimum\s+(?:supported\s+)?(?:node|python|go|ruby|java|rust))\b/i;function g$e(e){return m$e.test(e)||p$e.test(e)}function h$e(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}async function _K(e,t,n,i,r={}){let{token:o,maxReleases:s=25}=r,a={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};o&&(a.Authorization=`Bearer ${o}`);let c=Te(t,i),l=Te(n,i);if(!c||!l)return[];let u=Qe(l,c);if(u===null)return[];let[d,p]=u>0?[c,l]:[l,c],f=[],m=100,g=5;for(let h=1;h<=g;h++){let b=await $e(`https://api.github.com/repos/${e}/releases?per_page=${m}&page=${h}`,{headers:a});if(!b||b.length===0)break;let y=!1;for(let w of b){if(w.draft)continue;let k=b$e(w.tag_name,i);if(!k)continue;let _=Qe(k,d),S=Qe(k,p);if(!(_===null||S===null)){if(_<=0){y=!0;continue}S>0||f.push({tag:w.tag_name,version:k.raw,name:w.name,body:w.body??"",url:w.html_url,publishedAt:w.published_at})}}if(y||b.lengthTe(a.version,n),r=[...e].sort((a,c)=>{let l=i(a),u=i(c);return l&&u?-(Qe(l,u)??0):0});if(r.length<=t)return r;let o=r.filter(a=>{let c=i(a);return!!(c?.release&&(c.release[2]??0)===0&&!c.prerelease)}).sort((a,c)=>{let l=i(a),u=i(c);return l&&u?Qe(l,u)??0:0}),s=new Map;for(let a of o){if(s.size>=t)break;s.set(a.version,a)}for(let a of r){if(s.size>=t)break;s.set(a.version,a)}return[...s.values()].sort((a,c)=>{let l=i(a),u=i(c);return l&&u?-(Qe(l,u)??0):0})}function b$e(e,t){let n=Te(e,t);if(n)return n;let i=e.match(/v?\d[0-9A-Za-z.!+_-]*(?:\.[0-9A-Za-z!+_-]+)*/g)??[];for(let r of i){let o=Te(r,t)??(r.startsWith("v")?Te(r.slice(1),t):null);if(o)return o}return null}var z$=require("node:fs/promises"),c8=require("node:os"),l8=require("node:path");var SK=require("node:child_process");var v$e=18e4,w$e=32*1024*1024;function k$e(e,t){let n=e.slice(e.lastIndexOf("/")+1),i=t[0];return i&&!i.startsWith("-")?`${n} ${i}`:n}var Xe=(e,t,n={})=>new Promise(i=>{let r=k$e(e,t),o=Pg()?It("exec",r):null;o&&nt("exec.spawned");let s=Date.now(),a=(0,SK.execFile)(e,[...t],{cwd:n.cwd,timeout:n.timeoutMs??v$e,maxBuffer:n.maxBuffer??w$e,env:n.env??process.env,windowsHide:!0,encoding:"utf8",...n.signal?{signal:n.signal}:{}},(c,l,u)=>{if(o?.end({code:c?1:0}),!c){uP({label:r,durationMs:Date.now()-s,exitCode:0,stdoutBytes:l.length,stderrBytes:u.length}),i({code:0,stdout:l,stderr:u});return}let d=c,p=d.code==="ENOENT"?"not-found":d.killed||d.name==="AbortError"||d.code==="ABORT_ERR"?"timeout":"error";uP({label:r,durationMs:Date.now()-s,exitCode:typeof d.code=="number"?d.code:null,failure:p,stdoutBytes:(l??"").length,stderrBytes:(u??"").length}),i({code:typeof d.code=="number"?d.code:1,stdout:l??"",stderr:u??String(c.message??""),failure:p})});if(n.onOutput){let c=l=>{try{n.onOutput(String(l))}catch{}};a.stdout?.on("data",c),a.stderr?.on("data",c)}a.stdin?.end()});async function Jk(e,t,n=["--version"]){let i=await e(t,n,{timeoutMs:2e4});return i.failure!=="not-found"&&i.code===0}var AK=gt(gc(),1),OP="openapi-diff",LP={id:"openapi",source:"openapi-diff",tool:OP,weight:1,originClass:"computed-artifact",config:{enabled:"openapi",paths:"openapiSpecs"},handles(e,t){return Rd(t)!==null},async compute(e){return!Rd(e.before)||!Rd(e.after)?{available:!1,reason:"parse-failed",detail:`${e.path} is not a document Drift could read as an OpenAPI or Swagger spec on both sides of this change.`,tool:OP}:{available:!0,changes:RK(e.before,e.after).map(t=>({code:t.kind,location:t.location,pointer:t.pointer,detail:t.detail})),tool:OP,weight:1,locator:e.path}},codes:{"path-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"module",visibility:["unknown"]},remediation:({symbol:e})=>`The endpoint \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement endpoint. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"operation-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The endpoint \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement endpoint. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"response-status-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer returns this success status. Update response handling so the removed status is no longer treated as a success path.`},"parameter-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`A required parameter was removed from \`${e}\`. Remove it from client calls; sending it may now be rejected as an unexpected parameter.`},"parameter-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The request type for \`${e}\` changed. Update serialisation at each call site so the value sent matches the new type.`},"parameter-now-required":{kind:"required-field-added",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires this field. Add it to every request built in this repo, using a value consistent with the surrounding code's intent.`},"request-field-now-required":{kind:"required-field-added",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires this field. Add it to every request built in this repo, using a value consistent with the surrounding code's intent.`},"request-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The request type for \`${e}\` changed. Update serialisation at each call site so the value sent matches the new type.`},"request-enum-narrowed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer accepts some previously-valid values. Find code that sends the removed values and map them onto still-supported ones.`},"response-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer returns this field. Update every reader of that field. If the value is genuinely no longer available, propagate the absence properly rather than substituting a placeholder that could be mistaken for real data.`},"response-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The response type for \`${e}\` changed. Update parsing and any downstream type declarations.`},"response-enum-widened":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` can now return values this code has never seen. Add explicit handling; make sure exhaustive switches and mapping tables have a safe default rather than falling through silently.`},"security-added":{kind:"config-change",taxonomy:{nature:"configuration",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires authentication. Ensure the client attaches credentials for this call, reusing the repo's existing auth mechanism \u2014 never introduce a new credential source or hard-code a token.`}}},$$e=["get","put","post","delete","options","head","patch","trace"];function Rd(e){let t;try{t=e.trim().startsWith("{")?JSON.parse(e):(0,AK.parse)(e)}catch{return null}if(!t||typeof t!="object")return null;let n=t;return!n.openapi&&!n.swagger?null:n}function RK(e,t){let n=Rd(e),i=Rd(t);if(!n||!i)return[];let r=[],o=n.paths??{},s=i.paths??{};for(let[a,c]of Object.entries(o)){let l=s[a];if(!l){r.push({kind:"path-removed",location:a,pointer:`#/paths/${IK(a)}`,detail:`Path \`${a}\` no longer exists. Every request to it will 404.`});continue}for(let u of $$e){let d=c[u];if(!d)continue;let p=l[u],f=`${u.toUpperCase()} ${a}`,m=`#/paths/${IK(a)}/${u}`;if(!p){r.push({kind:"operation-removed",location:f,pointer:m,detail:`Operation \`${f}\` was removed.`});continue}_$e(d,p,n,i,f,m,r),S$e(d,p,n,i,f,m,r),x$e(d,p,n,i,f,m,r),E$e(d,p,f,m,r)}}return r}function _$e(e,t,n,i,r,o,s){let a=xK(e.parameters,n),c=xK(t.parameters,i);for(let[l,u]of a){let d=c.get(l);if(!d){u.required&&s.push({kind:"parameter-removed",location:r,pointer:`${o}/parameters/${l}`,detail:`Required parameter \`${u.name}\` (in: ${u.in}) was removed.`});continue}!u.required&&d.required&&s.push({kind:"parameter-now-required",location:r,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` (in: ${d.in}) is now required. Calls omitting it will be rejected.`});let p=Yk(u.schema??{type:u.type}),f=Yk(d.schema??{type:d.type});p&&f&&p!==f&&s.push({kind:"parameter-type-changed",location:r,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` changed type from \`${p}\` to \`${f}\`.`});let m=Qk(u.schema),g=Qk(d.schema),h=m.filter(b=>!g.includes(b));m.length&&g.length&&h.length&&s.push({kind:"request-enum-narrowed",location:r,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` no longer accepts: ${h.map(b=>`\`${b}\``).join(", ")}.`})}}function S$e(e,t,n,i,r,o,s){let a=fa(EK(e),n),c=fa(EK(t),i);if(!a||!c)return;let l=new Set(TK(a)),u=TK(c);for(let d of u)l.has(d)||s.push({kind:"request-field-now-required",location:r,pointer:`${o}/requestBody/${d}`,detail:`Request body field \`${d}\` is now required.`});for(let[d,p,f]of NK(a,c,n,i))s.push({kind:"request-field-type-changed",location:r,pointer:`${o}/requestBody/${d}`,detail:`Request body field \`${d}\` changed type from \`${p}\` to \`${f}\`.`})}function x$e(e,t,n,i,r,o,s){let a=e.responses??{},c=t.responses??{};for(let[l,u]of Object.entries(a)){if(!/^2\d\d$/.test(l))continue;let d=c[l];if(!d){s.push({kind:"response-status-removed",location:r,pointer:`${o}/responses/${l}`,detail:`Success response \`${l}\` was removed from \`${r}\`.`});continue}let p=fa(MP(u),n),f=fa(MP(d),i);if(!p||!f)continue;let m=Zk(p),g=Zk(f);for(let h of Object.keys(m))h in g||s.push({kind:"response-field-removed",location:r,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` is no longer returned by \`${r}\`.`});for(let[h,b,y]of NK(p,f,n,i))s.push({kind:"response-field-type-changed",location:r,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` changed type from \`${b}\` to \`${y}\`.`});for(let[h,b]of Object.entries(m)){let y=g[h];if(!y)continue;let w=Qk(b),_=Qk(y).filter(S=>!w.includes(S));w.length&&_.length&&s.push({kind:"response-enum-widened",location:r,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` can now return new values: ${_.map(S=>`\`${S}\``).join(", ")}. Exhaustive handling of this field must be updated.`})}}}function E$e(e,t,n,i,r){let o=e.security??[],s=t.security??[],a=o.length===0||o.some(l=>Object.keys(l).length===0),c=s.length===0||s.some(l=>Object.keys(l).length===0);if(a&&!c&&s.length>0){let l=[...new Set(s.flatMap(u=>Object.keys(u)))];r.push({kind:"security-added",location:n,pointer:`${i}/security`,detail:`\`${n}\` now requires authentication (${l.join(", ")}).`})}}function xK(e,t){let n=new Map;if(!Array.isArray(e))return n;for(let i of e){let r=fa(i,t);r?.name&&n.set(`${r.in??"query"}:${r.name}`,r)}return n}function EK(e){let t=e.requestBody;return t?MP(t):null}function MP(e){let t=e.content;if(!t)return e.schema??null;let n=Object.keys(t).find(i=>i.includes("json"))??Object.keys(t)[0];return n?t[n]?.schema??null:null}function fa(e,t,n=0){if(!e)return null;if(n>10)return e;let i=e.$ref;if(typeof i!="string")return e;if(!i.startsWith("#/"))return null;let r=i.slice(2).split("/").map(T$e),o=t;for(let s of r){if(!o||typeof o!="object")return null;o=o[s]}return!o||typeof o!="object"?null:fa(o,t,n+1)}function Zk(e){let t=e.properties??{},n=e.allOf;if(!Array.isArray(n))return t;let i={...t};for(let r of n)r&&typeof r=="object"&&Object.assign(i,r.properties??{});return i}function TK(e){let t=Array.isArray(e.required)?e.required:[],i=(Array.isArray(e.allOf)?e.allOf:[]).flatMap(r=>{let o=r?.required;return Array.isArray(o)?o:[]});return[...new Set([...t,...i])]}function NK(e,t,n,i){let r=[],o=Zk(e),s=Zk(t);for(let[a,c]of Object.entries(o)){let l=s[a];if(!l)continue;let u=Yk(fa(c,n)),d=Yk(fa(l,i));u&&d&&u!==d&&r.push([a,u,d])}return r}function Yk(e){if(!e)return null;let t=e.type;if(typeof t=="string"){if(t==="array"){let n=e.items;return`array<${typeof n?.type=="string"?n.type:"unknown"}>`}return t}return Array.isArray(t)?t.join("|"):null}function Qk(e){let t=e?.enum;return Array.isArray(t)?t.map(n=>String(n)):[]}function IK(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function T$e(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}var e$=require("node:fs/promises"),es=require("node:path");function ma(e,t,n,i){return{available:!1,reason:t,detail:n,...i?{remedy:i}:{},tool:e}}var Nd="buf breaking",I$e="Install the Buf CLI (https://buf.build/docs/installation) so Drift can compare `.proto` revisions against the protobuf compatibility rules.",CK="Add the imported `.proto` files to `evidence.protobufSpecs` \u2014 Drift compiles every configured `.proto` together, so an import it was told about resolves. A pattern such as `proto/**/*.proto` covers a whole directory of them.",A$e=100,FP={id:"protobuf",source:"protobuf-diff",tool:Nd,weight:1,originClass:"computed-artifact",config:{enabled:"protobuf",paths:"protobufSpecs"},handles(e,t){return e.endsWith(".proto")?/^\s*(syntax\s*=|package\s+|message\s+|service\s+|enum\s+)/m.test(t):!1},async compute(e){let t=await e.exec("buf",["--version"],{timeoutMs:2e4,...e.env?{env:e.env}:{}});if(t.failure==="not-found"||t.code!==0)return ma(Nd,"tool-missing",`The Buf CLI is not installed or is not on PATH, so ${e.path} could not be checked against the protobuf compatibility rules.`,I$e);let n=(0,es.join)(e.workdir,"after"),i=(0,es.join)(e.workdir,"before");await Xk((0,es.join)(n,e.path),e.after),await Xk((0,es.join)(i,e.path),e.before);for(let a of e.siblings)a.path!==e.path&&(await Xk((0,es.join)(n,a.path),a.after),await Xk((0,es.join)(i,a.path),a.before));let r=await e.exec("buf",["breaking",n,"--against",i,"--error-format=json"],{cwd:e.workdir,timeoutMs:e.timeoutMs,...e.env?{env:e.env}:{}});if(r.code!==0&&r.code!==A$e){let a=(r.stderr||r.stdout||"no output").trim().split(` -`)[0]??"";return ma(Nd,"toolchain-failed",`\`buf breaking\` could not compare ${e.path}: ${a}`,CK)}let o;try{o=PK(r.stdout)}catch(a){return ma(Nd,"unexpected-output",`Drift could not read \`buf breaking\` output for ${e.path}: ${a.message}`)}let s=o.find(R$e);return s?ma(Nd,"toolchain-failed",`\`buf breaking\` could not compare ${e.path}: ${s.message}`,C$e(s)):{available:!0,changes:o.filter(a=>P$e(a,e.path)).map(a=>D$e(a,e.path)),tool:Nd,weight:1,locator:`${e.path} (buf breaking)`}},codes:{"proto-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf field \`${e}\` was deleted. Regenerate this repository's stubs and update every reader and writer of that field. Do not reuse its field number for anything else \u2014 reserve it \u2014 and if the value is genuinely gone, propagate the absence rather than substituting a placeholder that could be mistaken for real data.`},"proto-field-renamed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf field \`${e}\` changed name. The wire encoding is unaffected \u2014 field numbers carry it \u2014 but generated accessors and any JSON representation are not. Regenerate the stubs and rename every use; check JSON payloads persisted or exchanged under the old name.`},"proto-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The type or cardinality of the protobuf field \`${e}\` changed. Regenerate the stubs and update every construction and read of that field. A value already persisted or in flight was encoded under the old type \u2014 check that decoding it still means what the code assumes.`},"proto-field-encoding-changed":{kind:"behaviour-change",taxonomy:{nature:"behaviour",detectability:["runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`An encoding option on the protobuf field \`${e}\` changed. Nothing about the schema's shape moved, so this compiles either way \u2014 what changes is the generated representation or the validation applied to the value. Review code that depends on that field's concrete representation.`},"proto-oneof-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf oneof \`${e}\` was deleted. Regenerate the stubs and rewrite every switch over its cases; a oneof's generated API has no drop-in replacement, so restructure the calling code rather than stubbing the accessor.`},"proto-message-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf message \`${e}\` no longer exists. Regenerate the stubs and migrate every use to the replacement message. If there is no replacement, leave the call site intact with a clearly-marked TODO and explain it in the PR description rather than inventing a local copy of the type.`},"proto-enum-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum \`${e}\` no longer exists. Regenerate the stubs and migrate every use to whatever now carries those values.`},"proto-enum-value-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum value \`${e}\` was deleted. Regenerate the stubs and map every use onto a still-supported value. A peer that still sends the removed number will decode as the unknown/unrecognised case \u2014 make sure that path is handled rather than falling through silently.`},"proto-enum-value-renamed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum value \`${e}\` changed name. The number is unchanged, so the wire encoding is safe; generated constants and JSON names are not. Regenerate the stubs and rename every use.`},"proto-rpc-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The RPC \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement RPC. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"proto-rpc-signature-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The signature of the RPC \`${e}\` changed \u2014 its request type, response type, or streaming shape. Regenerate the stubs and update every call site; a streaming change in particular rewrites the call's control flow, not just its types.`},"proto-service-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"module",visibility:["generated"]},remediation:({symbol:e})=>`The service \`${e}\` no longer exists. Every client of it must be migrated to the replacement service; if there is none, leave the client intact with a clearly-marked TODO rather than deleting the feature.`},"proto-package-changed":{kind:"moved-export",taxonomy:{nature:"packaging",detectability:["compile-time"],scope:"package",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf package or a generated-code package option changed for \`${e}\`. The definitions still exist \u2014 their generated home moved. Regenerate the stubs and update the import paths; do not re-implement or stub the individual messages.`},"proto-file-removed":{kind:"removed-endpoint",taxonomy:{nature:"packaging",detectability:["compile-time"],scope:"module",visibility:["generated"]},remediation:({symbol:e})=>`The \`.proto\` file \`${e}\` was deleted, taking everything it declared with it. Find where those definitions moved to and update the imports and generated-code references; if they were removed outright, say so in the PR description rather than recreating the file locally.`},"proto-contract-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e,detail:t})=>`\`buf\` reports a compatibility break at \`${e}\`: ${t} Regenerate this repository's stubs and update the code around that definition to match the new contract.`}}};async function Xk(e,t){await(0,e$.mkdir)((0,es.dirname)(e),{recursive:!0}),await(0,e$.writeFile)(e,t,"utf8")}function PK(e){let t=[];for(let n of e.split(` -`)){let i=n.trim();if(!i.startsWith("{"))continue;let r;try{r=JSON.parse(i)}catch{continue}if(!r||typeof r!="object")continue;let o=r;typeof o.type!="string"||typeof o.message!="string"||t.push({path:typeof o.path=="string"?o.path:"",type:o.type,message:o.message,...typeof o.start_line=="number"?{start_line:o.start_line}:{},...typeof o.start_column=="number"?{start_column:o.start_column}:{}})}return t}function R$e(e){return N$e.has(e.type)}var N$e=new Set(["COMPILE","PLUGIN_FAILURE","CONFIGURATION"]);function C$e(e){return e.type==="COMPILE"?CK:"Check the `buf` configuration and plugins in this repository, then re-run."}function P$e(e,t){return e.path===t||e.path.endsWith(`/${t}`)}function D$e(e,t){let n=e.start_line??0;return{code:DK(e.type),location:OK(e.message)??`${t}:${n}`,pointer:n>0?`${t}:${n}`:t,detail:e.message}}function DK(e){switch(e){case"FIELD_SAME_NAME":case"FIELD_SAME_JSON_NAME":return"proto-field-renamed";case"ENUM_VALUE_SAME_NAME":return"proto-enum-value-renamed";case"FIELD_SAME_TYPE":case"FIELD_SAME_LABEL":case"FIELD_SAME_CARDINALITY":case"FIELD_SAME_ONEOF":case"FIELD_WIRE_COMPATIBLE_TYPE":case"FIELD_WIRE_COMPATIBLE_CARDINALITY":case"FIELD_WIRE_JSON_COMPATIBLE_TYPE":case"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY":return"proto-field-type-changed";case"FIELD_SAME_CTYPE":case"FIELD_SAME_JSTYPE":case"FIELD_SAME_CPP_STRING_TYPE":case"FIELD_SAME_UTF8_VALIDATION":case"FIELD_SAME_JAVA_UTF8_VALIDATION":case"FIELD_SAME_DEFAULT":return"proto-field-encoding-changed";case"RPC_SAME_REQUEST_TYPE":case"RPC_SAME_RESPONSE_TYPE":case"RPC_SAME_CLIENT_STREAMING":case"RPC_SAME_SERVER_STREAMING":case"RPC_SAME_IDEMPOTENCY_LEVEL":return"proto-rpc-signature-changed";default:break}if(/^FILE_SAME_(GO|JAVA|PHP|RUBY|CSHARP|OBJC|SWIFT)_/.test(e)||e==="FILE_SAME_PACKAGE"||e==="PACKAGE_NO_DELETE")return"proto-package-changed";if(e==="FILE_NO_DELETE")return"proto-file-removed";if(e.endsWith("_NO_DELETE")||e.includes("_NO_DELETE_UNLESS_")){if(e.startsWith("FIELD_"))return"proto-field-removed";if(e.startsWith("ENUM_VALUE_"))return"proto-enum-value-removed";if(e.startsWith("ENUM_")||e.startsWith("PACKAGE_ENUM_"))return"proto-enum-removed";if(e.startsWith("ONEOF_"))return"proto-oneof-removed";if(e.startsWith("RPC_"))return"proto-rpc-removed";if(e.startsWith("SERVICE_")||e.startsWith("PACKAGE_SERVICE_"))return"proto-service-removed";if(e.startsWith("MESSAGE_")||e.startsWith("PACKAGE_MESSAGE_"))return"proto-message-removed"}return"proto-contract-changed"}function OK(e){let t=/\bon (?:message|service|enum|oneof|extension) "([^"]+)"/.exec(e)?.[1]??/\b(?:message|service|enum) "([^"]+)"/.exec(e)?.[1]??null,n=/\bwith name "([^"]+)"/.exec(e)?.[1]??/\bchanged name from "[^"]+" to "([^"]+)"/.exec(e)?.[1]??/\b(?:RPC|field|value|oneof) "([^"]+)"/i.exec(e)?.[1]??null,i=n&&!/^\d+$/.test(n)?n:null;return t&&i?`${t}.${i}`:t??i}function ce(e){return t$(e,[])}function t$(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return O$e(e,t);default:return String(e)}}function O$e(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(M$e(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:t$(i,n)}else if(Array.isArray(e))return F$e(e,n);return L$e(e,n)}function M$e(e){return typeof e.toJSON=="function"}function L$e(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+U$e(e)+"]":"{ "+n.map(([r,o])=>r+": "+t$(o,t)).join(", ")+" }"}function F$e(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let o=0;o1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function U$e(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}function j$e(e,t){return e?.__kind===t}var Nr=j$e;function MK(e){return e instanceof Error?e:new UP(e)}var UP=class extends Error{constructor(t){super("Unexpected error value: "+ce(t)),this.name="NonErrorThrown",this.thrownValue=t}};function Kn(e){return typeof e=="object"&&e!==null}function it(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}var z$e=/\r\n|[\n\r]/g;function Cd(e,t){let n=0,i=1;for(let r of e.body.matchAll(z$e)){if(typeof r.index!="number"&&it(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function jP(e){return n$(e.source,Cd(e.source,e.start))}function n$(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?n:0,c=t.column+a,l=`${e.name}:${s}:${c} -`,u=i.split(/\r\n|[\n\r]/g),d=u[r];if(d.length>120){let p=Math.floor(c/80),f=c%80,m=[];for(let g=0;g["|",g]),["|","^".padStart(f)],["|",m[p+1]]])}return l+LK([[`${s-1} |`,u[r-1]],[`${s} |`,d],["|","^".padStart(c)],[`${s+1} |`,u[r+1]]])}function LK(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(` -`)}var O=class e extends Error{constructor(t,n={}){let{nodes:i,source:r,positions:o,path:s,originalError:a,cause:c,extensions:l}=n,u="cause"in n,d=u?c:a,p=u||a!=null?{cause:d}:void 0;super(t,p),this.name="GraphQLError",this.path=s??void 0;let f=a??(c instanceof Error?c:void 0);this.originalError=f,this.nodes=FK(Array.isArray(i)?i:i?[i]:void 0);let m=FK(this.nodes?.map(h=>h.loc).filter(h=>h!=null));this.source=r??m?.[0]?.source,this.positions=o??m?.map(h=>h.start),this.locations=o&&r?o.map(h=>Cd(r,h)):m?.map(h=>Cd(h.source,h.start));let g=Kn(f?.extensions)?f.extensions:void 0;this.extensions=l??g??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),a?.stack!=null?Object.defineProperty(this,"stack",{value:a.stack,writable:!0,configurable:!0}):Error.captureStackTrace!=null?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` - -`+jP(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` - -`+n$(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function FK(e){return e===void 0||e.length===0?void 0:e}function Ug(e){if(e instanceof O)return e;let t=MK(e);return new O(t.message,{originalError:t})}var Cr=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let i=this.get(t);i===void 0?this.set(t,[n]):i.push(n)}};function UK(e){return G$e("or",e)}function G$e(e,t){switch(t.length===0&&it(!1),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}let n=t.slice(0,-1),i=t.at(-1);return n.join(", ")+", "+e+" "+i}function ts(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}function r$(e,t){let n=Object.create(null);for(let i of e)n[t(i)]=i;return n}function ga(e,t){let n=Object.create(null);for(let i of Object.keys(e))n[i]=t(e[i],i);return n}function zP(e){return e.length===0?"":` at ${e.map(t=>typeof t=="number"?`[${t}]`:`.${t}`).join("")}`}var jg=class{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Pd=class{constructor(t,n,i,r,o,s){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=o,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},zg={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},V$e=new Set(Object.keys(zg));function GP(e){let t=e?.kind;return typeof t=="string"&&V$e.has(t)}var Jn={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"};var $={};_r($,{ARGUMENT:()=>Z$e,ARGUMENT_COORDINATE:()=>L_e,BOOLEAN:()=>o_e,DIRECTIVE:()=>d_e,DIRECTIVE_ARGUMENT_COORDINATE:()=>U_e,DIRECTIVE_COORDINATE:()=>F_e,DIRECTIVE_DEFINITION:()=>E_e,DIRECTIVE_EXTENSION:()=>I_e,DOCUMENT:()=>q$e,ENUM:()=>a_e,ENUM_TYPE_DEFINITION:()=>__e,ENUM_TYPE_EXTENSION:()=>P_e,ENUM_VALUE_DEFINITION:()=>S_e,FIELD:()=>J$e,FIELD_DEFINITION:()=>v_e,FLOAT:()=>r_e,FRAGMENT_ARGUMENT:()=>Y$e,FRAGMENT_DEFINITION:()=>e_e,FRAGMENT_SPREAD:()=>Q$e,INLINE_FRAGMENT:()=>X$e,INPUT_OBJECT_TYPE_DEFINITION:()=>x_e,INPUT_OBJECT_TYPE_EXTENSION:()=>D_e,INPUT_VALUE_DEFINITION:()=>w_e,INT:()=>n_e,INTERFACE_TYPE_DEFINITION:()=>k_e,INTERFACE_TYPE_EXTENSION:()=>N_e,LIST:()=>c_e,LIST_TYPE:()=>f_e,MEMBER_COORDINATE:()=>M_e,NAME:()=>B$e,NAMED_TYPE:()=>p_e,NON_NULL_TYPE:()=>m_e,NULL:()=>s_e,OBJECT:()=>l_e,OBJECT_FIELD:()=>u_e,OBJECT_TYPE_DEFINITION:()=>b_e,OBJECT_TYPE_EXTENSION:()=>R_e,OPERATION_DEFINITION:()=>W$e,OPERATION_TYPE_DEFINITION:()=>h_e,SCALAR_TYPE_DEFINITION:()=>y_e,SCALAR_TYPE_EXTENSION:()=>A_e,SCHEMA_DEFINITION:()=>g_e,SCHEMA_EXTENSION:()=>T_e,SELECTION_SET:()=>K$e,STRING:()=>i_e,TYPE_COORDINATE:()=>O_e,UNION_TYPE_DEFINITION:()=>$_e,UNION_TYPE_EXTENSION:()=>C_e,VARIABLE:()=>t_e,VARIABLE_DEFINITION:()=>H$e});var B$e="Name",q$e="Document",W$e="OperationDefinition",H$e="VariableDefinition",K$e="SelectionSet",J$e="Field",Z$e="Argument",Y$e="FragmentArgument",Q$e="FragmentSpread",X$e="InlineFragment",e_e="FragmentDefinition",t_e="Variable",n_e="IntValue",r_e="FloatValue",i_e="StringValue",o_e="BooleanValue",s_e="NullValue",a_e="EnumValue",c_e="ListValue",l_e="ObjectValue",u_e="ObjectField",d_e="Directive",p_e="NamedType",f_e="ListType",m_e="NonNullType",g_e="SchemaDefinition",h_e="OperationTypeDefinition",y_e="ScalarTypeDefinition",b_e="ObjectTypeDefinition",v_e="FieldDefinition",w_e="InputValueDefinition",k_e="InterfaceTypeDefinition",$_e="UnionTypeDefinition",__e="EnumTypeDefinition",S_e="EnumValueDefinition",x_e="InputObjectTypeDefinition",E_e="DirectiveDefinition",T_e="SchemaExtension",I_e="DirectiveExtension",A_e="ScalarTypeExtension",R_e="ObjectTypeExtension",N_e="InterfaceTypeExtension",C_e="UnionTypeExtension",P_e="EnumTypeExtension",D_e="InputObjectTypeExtension",O_e="TypeCoordinate",M_e="MemberCoordinate",L_e="ArgumentCoordinate",F_e="DirectiveCoordinate",U_e="DirectiveArgumentCoordinate";function fi(e,t){if(!e)throw new Error(t)}var j_e=5;function Zn(e,t){let[n,i]=t?[e,t]:[void 0,e];if(i.length===0)return"";let r=" Did you mean ";n!=null&&(r+=n+" ");let o=UK(i.slice(0,j_e).map(s=>`"${s}"`));return r+o+"?"}function VP(e){return e}function Gc(e,t,n){let i=Object.create(null);for(let r of e)i[t(r)]=n(r);return i}function Dd(e,t){let n=0,i=0;for(;n0);let a=0;do++i,a=a*10+o-BP,o=t.charCodeAt(i);while(i$(o)&&a>0);if(sa)return 1}else{if(ro)return 1;++n,++i}}return e.length-t.length}var BP=48,z_e=57;function i$(e){return!isNaN(e)&&BP<=e&&e<=z_e}function lr(e,t){let n=Object.create(null),i=new qP(e),r=Math.floor(e.length*.4)+1;for(let o of t){let s=i.measure(o,r);s!==void 0&&(n[o]=s)}return Object.keys(n).sort((o,s)=>{let a=n[o]-n[s];return a!==0?a:Dd(o,s)})}var qP=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=jK(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let i=t.toLowerCase();if(this._inputLowerCase===i)return 1;let r=jK(i),o=this._inputArray;if(r.lengthn)return;let c=this._rows;for(let u=0;u<=a;u++)c[0][u]=u;for(let u=1;u<=s;u++){let d=c[(u-1)%3],p=c[u%3],f=p[0]=u;for(let m=1;m<=a;m++){let g=r[u-1]===o[m-1]?0:1,h=Math.min(d[m]+1,p[m-1]+1,d[m-1]+g);if(u>1&&m>1&&r[u-1]===o[m-2]&&r[u-2]===o[m-1]){let b=c[(u-2)%3][m-2];h=Math.min(h,b+1)}hn)return}let l=c[s%3][a];return l<=n?l:void 0}};function jK(e){let t=e.length,n=new Array(t);for(let i=0;i=48&&e<=57}function zK(e){return e>=97&&e<=122||e>=65&&e<=90}function Gg(e){return zK(e)||e===95}function s$(e){return zK(e)||Vc(e)||e===95}function GK(e){let t=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let r=0;ro===0?r:r.slice(t)).slice(n??0,i+1)}function G_e(e){let t=0;for(;t1&&i.slice(1).every(f=>f.length===0||o$(f.charCodeAt(0))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),l=a||c,u=!t?.minimize&&(!r||e.length>70||l||o||s),d="",p=r&&o$(e.charCodeAt(0));return(u&&!p||o)&&(d+=` +`)}}Co&&process.on("exit",()=>eTe());var tTe=1e4,nTe=1440*60*1e3,rTe=6e4,iTe=360*60*1e3,oTe="drift-bot/0.1 (+https://github.com/trydrift/drift)",aM=new Map,Pa=new Map;function lM(e,t){let n=Pa.get(e);if(n)return Ur("http","coalesced_hit"),n;let r=t().finally(()=>Pa.delete(e));return Pa.set(e,r),r}var ws=null;function J3(e){let t=aM.get(e);return t?Date.now()>=t.expiresAt?(aM.delete(e),{hit:!1}):{hit:!0,value:t.value}:{hit:!1}}function No(e,t){let n=t===null?Date.now()+rTe:1/0;aM.set(e,{value:t,expiresAt:n})}function uM(e){if(!e)return"default";let t=Object.entries(e).filter(([r])=>/auth|token/i.test(r)||r.toLowerCase()==="accept").sort(([r],[i])=>r.localeCompare(i));if(t.length===0)return"default";let n=t.map(([r,i])=>`${r.toLowerCase()}=${i}`).join("&");return(0,Hd.createHash)("sha256").update(n).digest("hex").slice(0,16)}function b$(e,t){return(0,Hd.createHash)("sha256").update(`${uM(t)}:${e}`).digest("hex").slice(0,10)}function Z3(e,t){return(0,Hd.createHash)("sha256").update(`${e}|${t.maxBytes??""}|${t.timeoutMs??""}|${t.retries??""}`).digest("hex").slice(0,10)}function Ca(e){let t=e.indexOf("://");if(t<0)return"unknown";let n=e.slice(t+3),r=n.search(/[/?#]/);return(r<0?n:n.slice(0,r)).toLowerCase()}function Na(e){let t=e.indexOf("://");if(t<0)return e.split("?")[0];let n=e.slice(t+3),r=n.indexOf("/");return(r<0?"":n.slice(r)).split("?")[0]}function dM(e){return Math.max(0,Kt()-e)}function ri(e){let t={requestKey:e.requestKey,path:e.path,timeoutMs:Math.max(0,Math.round(e.timeoutMs))};return e.abortFiredAtMs!==null?(t.abortTimerFired=!0,t.abortDelayMs=Math.max(0,Math.round(e.abortFiredAtMs-e.attemptStartOffsetMs-e.timeoutMs))):t.abortTimerFired=!1,e.headersAtMs!==void 0&&e.headersAtMs!==null&&(t.headersMs=Math.max(0,Math.round(e.headersAtMs-e.attemptStartOffsetMs))),e.headersAtMs!==void 0&&e.headersAtMs!==null&&e.bodyDoneAtMs!==void 0&&e.bodyDoneAtMs!==null&&(t.bodyMs=Math.max(0,Math.round(e.bodyDoneAtMs-e.headersAtMs))),t}function tn(e){B3({host:Ca(e.url),method:e.method,path:Na(e.url),startOffsetMs:e.startOffsetMs,durationMs:Kt()-e.startOffsetMs,status:e.status,cache:e.cache,bytes:e.bytes,retries:e.retries,backoffMs:e.backoffMs,failure:e.failure})}function ii(e){V3({host:Ca(e.url),method:e.method,path:Na(e.url),startOffsetMs:e.startOffsetMs,durationMs:Kt()-e.startOffsetMs,status:e.status})}function Y3(e){ws=e}function ol(){return ws}function Ie(e,t={}){let n=`json:${uM(t.headers)}:${e}`,r=J3(n);if(r.hit)return it("http.cache.memory"),Ur("http","memory_hit"),tn({url:e,method:"GET",startOffsetMs:Kt(),status:null,cache:"memory_hit"}),Promise.resolve(r.value);zh()&&Pa.has(n)&&it("http.cache.coalesced");let i=Kt(),o=Pa.has(n),s={Accept:"application/json",...t.headers},a=b$(e,s),c=o?Dt("http-coalesced-json",Ca(e),{requestKey:a,path:Na(e)}):null,l=lM(n,()=>sTe(e,n,t));return o?l.then(u=>(c?.end({waitMs:Math.round(dM(i))}),tn({url:e,method:"GET",startOffsetMs:i,status:null,cache:"coalesced_hit"}),u)):l}async function sTe(e,t,n){let r={Accept:"application/json",...n.headers},i=await ot(e,{...n,headers:r});if(i===null)return No(t,null),null;let o=Dt("json-parse",Ca(e),{requestKey:b$(e,r),path:Na(e),bytes:i.length});try{let s=JSON.parse(i);return No(t,s),s}catch{return No(t,null),null}finally{o.end()}}function ot(e,t={}){let n=`text:${uM(t.headers)}:${e}`,r=J3(n);if(r.hit)return it("http.cache.memory"),Ur("http","memory_hit"),tn({url:e,method:"GET",startOffsetMs:Kt(),status:null,cache:"memory_hit"}),Promise.resolve(r.value);zh()&&Pa.has(n)&&it("http.cache.coalesced");let i=Kt(),o=Pa.has(n),s=b$(e,t.headers),a=o?Dt("http-coalesced-text",Ca(e),{requestKey:s,path:Na(e)}):null;return lM(n,()=>aTe(e,n,t)).then(c=>(o&&(a?.end({waitMs:Math.round(dM(i))}),tn({url:e,method:"GET",startOffsetMs:i,status:null,cache:"coalesced_hit"})),c))}async function aTe(e,t,n){let{timeoutMs:r=tTe,headers:i={},retries:o=2}=n,s=Ca(e),a=b$(e,i),c=Na(e),l=Dt("disk-cache",s,{requestKey:a,path:c}),u=await dTe(t);l.end({hit:u!==null});let d=n.cacheTtlMs??nTe,p=Date.now();if(u&&u.body!==null&&(u.immutable||n.immutable||p-u.fetchedAt{_=Kt(),b.abort()},r),k=Dt("http",s,{requestKey:a,path:c,timeoutMs:r,...h>0?{attempt:h}:{}});try{let x=await fetch(e,{signal:b.signal,headers:{"User-Agent":oTe,...f,...i},redirect:"follow"}),A=Kt();if(x.status===304&&u)return k.end({status:304,...ri({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:_,headersAtMs:A})}),ii({url:e,method:"GET",startOffsetMs:v,status:304}),tn({url:e,method:"GET",startOffsetMs:m,status:304,cache:"revalidated_304",retries:h,backoffMs:g}),it("http.notModified"),Ur("http","revalidated_304"),Ur("http","write"),await sM(t,{...u,fetchedAt:p,immutable:u.immutable||n.immutable}),No(t,u.body),u.body;if(x.ok){let C=await x.text(),j=Kt();return k.end({status:x.status,bytes:C.length,...ri({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:_,headersAtMs:A,bodyDoneAtMs:j})}),ii({url:e,method:"GET",startOffsetMs:v,status:x.status}),tn({url:e,method:"GET",startOffsetMs:m,status:x.status,cache:"miss",bytes:C.length,retries:h,backoffMs:g}),No(t,C),Ur("http","write"),await sM(t,{key:t,body:C,etag:x.headers.get("etag")??void 0,fetchedAt:p,immutable:n.immutable}),C}if(x.status===404)return k.end({status:x.status,...ri({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:_,headersAtMs:A})}),ii({url:e,method:"GET",startOffsetMs:v,status:x.status}),tn({url:e,method:"GET",startOffsetMs:m,status:x.status,cache:"miss",retries:h,backoffMs:g}),No(t,null),Ur("http","write"),await sM(t,{key:t,body:null,absent:!0,fetchedAt:p,immutable:n.immutable}),null;if(x.status===403){if(!(x.headers.get("x-ratelimit-remaining")==="0"||x.headers.has("retry-after"))||h===o){k.end({status:x.status,...ri({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:_,headersAtMs:A})}),ii({url:e,method:"GET",startOffsetMs:v,status:x.status}),tn({url:e,method:"GET",startOffsetMs:m,status:x.status,cache:"miss",retries:h,backoffMs:g});break}k.end({status:x.status,...ri({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:_,headersAtMs:A})}),ii({url:e,method:"GET",startOffsetMs:v,status:x.status}),n.onRetry?.(h+1,"rate-limited");let j=Gh(h,x.headers.get("retry-after"));g+=j,await Bh(j);continue}if(!(x.status===429||x.status>=500)||h===o){k.end({status:x.status,...ri({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:_,headersAtMs:A})}),ii({url:e,method:"GET",startOffsetMs:v,status:x.status}),tn({url:e,method:"GET",startOffsetMs:m,status:x.status,cache:"miss",retries:h,backoffMs:g});break}k.end({status:x.status,...ri({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:_,headersAtMs:A})}),ii({url:e,method:"GET",startOffsetMs:v,status:x.status}),n.onRetry?.(h+1,x.status===429?"rate-limited":"server-error");let R=Gh(h,x.headers.get("retry-after"));g+=R,await Bh(R)}catch(x){if(k.end({status:0,...ri({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:_})}),ii({url:e,method:"GET",startOffsetMs:v,status:null}),h===o){tn({url:e,method:"GET",startOffsetMs:m,status:null,cache:"miss",retries:h,backoffMs:g,failure:x instanceof Error?x.name:"network-error"}),it("http.error");break}it("http.error"),n.onRetry?.(h+1,"network-error");let A=Gh(h,null);g+=A,await Bh(A)}finally{clearTimeout(w)}}return No(t,null),u?.body!==void 0?(No(t,u.body),u.body):null}function Jt(e,t={}){let n=`archive:${e}`,r=`${n}|maxBytes=${t.maxBytes??""}|timeoutMs=${t.timeoutMs??""}|retries=${t.retries??""}`,i=Kt(),o=Pa.has(r),s=Z3(e,t),a=o?Dt("http-coalesced-archive",Ca(e),{requestKey:s,path:Na(e)}):null;return lM(r,()=>cTe(e,n,t)).then(c=>(o&&(a?.end({waitMs:Math.round(dM(i))}),tn({url:e,method:"GET",startOffsetMs:i,status:c.ok?200:c.status,cache:"coalesced_hit"})),c))}async function cTe(e,t,n){let r=Ca(e),i=Na(e),o=Z3(e,n),s=uTe(t),{retries:a=2,maxBytes:c}=n;if(s)try{let m=await(0,oo.readFile)(s);if(c===void 0||m.length<=c)return it("http.cache.archive"),Ur("http","disk_hit"),tn({url:e,method:"GET",startOffsetMs:Kt(),status:200,cache:"disk_hit"}),{ok:!0,bytes:m}}catch{}Ur("http","miss");let l=n.timeoutMs??6e4,u=Date.now()+l,d=()=>u-Date.now();it("http.archive");let p=Kt(),f=0;for(let m=0;m<=a;m++){let g=d();if(g<=0)return tn({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:"timeout"}),{ok:!1,status:0,error:"Timed out before this attempt could start."};let h=Kt(),v=Dt("archive",r,{requestKey:o,path:i,timeoutMs:Math.max(0,Math.round(g)),...m>0?{attempt:m}:{}}),b=new AbortController,_=null,w=setTimeout(()=>{_=Kt(),b.abort()},g);try{let k=await fetch(e,{signal:b.signal}),x=Kt();if(!k.ok){v.end({status:k.status,...ri({requestKey:o,path:i,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:_,headersAtMs:x})}),ii({url:e,method:"GET",startOffsetMs:h,status:k.status});let C=k.status===429||k.status>=500,j=Math.min(Gh(m,k.headers.get("retry-after")),d());if(!C||m===a||j<=0)return tn({url:e,method:"GET",startOffsetMs:p,status:k.status,cache:"miss",retries:m,backoffMs:f}),{ok:!1,status:k.status};f+=j,await Bh(j);continue}let A=Number(k.headers.get("content-length"));if(c!==void 0&&Number.isFinite(A)&&A>c)return v.end({status:k.status,bytes:A,oversized:!0,...ri({requestKey:o,path:i,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:_,headersAtMs:x})}),ii({url:e,method:"GET",startOffsetMs:h,status:k.status}),tn({url:e,method:"GET",startOffsetMs:p,status:k.status,cache:"miss",retries:m,backoffMs:f,failure:"oversized"}),{ok:!1,status:k.status,error:`Response of ${A} bytes exceeds the ${c}-byte limit for this archive.`};let I=await lTe(k,c,b),R=Kt();if(I==="oversized")return v.end({status:k.status,oversized:!0,...ri({requestKey:o,path:i,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:_,headersAtMs:x,bodyDoneAtMs:R})}),ii({url:e,method:"GET",startOffsetMs:h,status:k.status}),tn({url:e,method:"GET",startOffsetMs:p,status:k.status,cache:"miss",retries:m,backoffMs:f,failure:"oversized"}),{ok:!1,status:k.status,error:`Response exceeds the ${c}-byte limit for this archive.`};if(v.end({status:k.status,bytes:I.length,...ri({requestKey:o,path:i,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:_,headersAtMs:x,bodyDoneAtMs:R})}),ii({url:e,method:"GET",startOffsetMs:h,status:k.status}),tn({url:e,method:"GET",startOffsetMs:p,status:k.status,cache:"miss",bytes:I.length,retries:m,backoffMs:f}),s)try{await(0,oo.mkdir)(ws,{recursive:!0});let C=`${s}.${process.pid}.partial`;await(0,oo.writeFile)(C,I),await(0,oo.rename)(C,s),Ur("http","write")}catch{}return{ok:!0,bytes:I}}catch(k){if(v.end({status:0,...ri({requestKey:o,path:i,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:_})}),ii({url:e,method:"GET",startOffsetMs:h,status:null}),m===a)return tn({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:k instanceof Error?k.name:"network-error"}),{ok:!1,status:0,error:k.message};let x=Math.min(Gh(m,null),d());if(x<=0)return tn({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:k instanceof Error?k.name:"network-error"}),{ok:!1,status:0,error:k.message};f+=x,await Bh(x)}finally{clearTimeout(w)}}return{ok:!1,status:0}}async function lTe(e,t,n){if(t===void 0||!e.body)return Buffer.from(await e.arrayBuffer());let r=e.body.getReader(),i=[],o=0;for(;;){let{done:s,value:a}=await r.read();if(s)break;if(o+=a.byteLength,o>t)return n.abort(),"oversized";i.push(a)}return Buffer.concat(i)}function uTe(e){return ws?(0,cM.join)(ws,`${(0,Hd.createHash)("sha256").update(e).digest("hex")}.bin`):null}async function dTe(e){if(!ws)return null;try{let t=await(0,oo.readFile)(Q3(e),"utf8"),n=JSON.parse(t);return n.key===e?n:null}catch{return null}}async function sM(e,t){if(ws)try{await(0,oo.mkdir)(ws,{recursive:!0}),await(0,oo.writeFile)(Q3(e),JSON.stringify(t),"utf8")}catch{}}function Q3(e){let t=(0,Hd.createHash)("sha256").update(e).digest("hex");return(0,cM.join)(ws,`${t}.json`)}function Gh(e,t){if(t){let r=Number(t);if(Number.isFinite(r)&&r>0)return Math.min(r*1e3,3e4)}return 400*2**e+Math.random()*200}function Bh(e){return new Promise(t=>setTimeout(t,e))}async function Yn(e,t,n){let r=new Array(e.length),i=0,o=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let s=i++;if(s>=e.length)return;r[s]=await n(e[s],s)}});return await Promise.all(o),r}var t8=require("node:crypto"),n8=require("node:zlib"),Kd=require("node:fs/promises"),fM=require("node:path");var r8="https://downloads.arduino.cc/libraries/library_index.json.gz",pTe=1440*60*1e3,fTe=12e4,X3=null;async function mTe(){return X3??=gTe(),X3}async function v$(e){return(await mTe())?.get(e.toLowerCase())??null}async function gTe(){let e=await e8();if(e)return pM(e);let t=await hTe();if(!t){let r=await e8({ignoreAge:!0});return r?pM(r):null}let n=yTe(t);return await vTe(n),pM(n)}async function hTe(){try{let e=await fetch(r8,{signal:AbortSignal.timeout(fTe),headers:{"User-Agent":"drift-bot/0.1 (+https://github.com/trydrift/drift)"}});if(!e.ok)return null;let t=Buffer.from(await e.arrayBuffer()),n=t[0]===31&&t[1]===139?(0,n8.gunzipSync)(t):t;return JSON.parse(n.toString("utf8"))}catch{return null}}function yTe(e){let t=new Map;for(let n of e.libraries??[]){if(!n.name||!n.version)continue;let r=n.name.toLowerCase(),i=t.get(r);i||(i={name:n.name,versions:[],githubRepo:null,website:null,description:null,archives:{}},t.set(r,i)),i.versions.includes(n.version)||i.versions.push(n.version),n.url&&(i.archives[n.version]=n.url),i.githubRepo=bTe(n.repository)??i.githubRepo,i.website=n.website??i.website,i.description=n.sentence??i.description}return[...t.values()]}function bTe(e){if(!e)return null;let t=/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/.exec(e);return t?`${t[1]}/${t[2]}`:null}function pM(e){return new Map(e.map(t=>[t.name.toLowerCase(),t]))}function i8(){let e=ol();if(!e)return null;let t=(0,t8.createHash)("sha256").update(r8).digest("hex");return(0,fM.join)(e,`arduino-index-${t.slice(0,16)}.json`)}async function e8(e={}){let t=i8();if(!t)return null;try{let n=JSON.parse(await(0,Kd.readFile)(t,"utf8"));return!Array.isArray(n.libraries)||!e.ignoreAge&&Date.now()-n.fetchedAt>=pTe?null:n.libraries}catch{return null}}async function vTe(e){let t=i8();if(t)try{await(0,Kd.mkdir)((0,fM.join)(t,".."),{recursive:!0});let n={fetchedAt:Date.now(),libraries:[...e]};await(0,Kd.writeFile)(t,JSON.stringify(n),"utf8")}catch{}}var c8=require("node:crypto");var _Te=new Set(["sponsors","apps","marketplace","settings","about","pricing","features"]),o8=/^[A-Za-z0-9._-]+$/;function s8(e,t){let n=t.replace(/\.git$/i,"");return!e||!n||!o8.test(e)||!o8.test(n)||e==="."||e===".."||n==="."||n===".."||_Te.has(e.toLowerCase())?null:`${e}/${n}`}function a8(e){let t=e.toLowerCase();return t==="github.com"||t==="www.github.com"}function Oa(e){if(!e)return null;let t=e.trim();if(!t)return null;t=t.replace(/^git\+/i,"");let n=/^(?:ssh:\/\/)?(?:[^@/\s]+@)?github\.com:(?[^/\s:]+)\/(?[^\s?#]+?)\/?$/i.exec(t);if(n?.groups)return a8("github.com")?s8(n.groups.owner,n.groups.repo):null;let r;try{r=new URL(t)}catch{return null}if(!["http:","https:","ssh:","git:"].includes(r.protocol)||!a8(r.hostname))return null;let i=r.pathname.split("/").filter(Boolean);return i.length<2?null:s8(i[0],i[1])}var mM=new Map;function wTe(e,t){let n=(0,c8.createHash)("md5").update(e).digest("hex"),r=`${n[0]}/${n[1]}/${n[2]}`,i=encodeURIComponent(e);return`https://cdn.cocoapods.org/Specs/${r}/${i}/${encodeURIComponent(t)}/${i}.podspec.json`}function _$(e,t,n={}){let r=`${e}@${t}`,i=mM.get(r);if(i)return i;let o=kTe(e,t,n).catch(()=>null);return mM.set(r,o),o.then(s=>{s||mM.delete(r)}),o}async function kTe(e,t,n){let r=await Ie(wTe(e,t),{immutable:!0,...n.timeoutMs?{timeoutMs:n.timeoutMs}:{}});if(!r)return null;let i=r.source&&typeof r.source=="object"?$Te(r.source):null;return{name:r.name??e,version:r.version??t,moduleName:typeof r.module_name=="string"&&r.module_name?r.module_name:null,source:i,homepage:gM(r.homepage),summary:gM(r.summary),description:gM(r.description)}}function $Te(e){let t=n=>{let r=e[n];return typeof r=="string"&&r?r:void 0};return{git:t("git"),tag:t("tag"),http:t("http"),svn:t("svn")}}function gM(e){return typeof e=="string"&&e.trim()?e.trim():null}function l8(e){return Oa(e.source?.git)??Oa(e.homepage)}var STe=e=>`https://api.github.com/repos/ocaml/opam-repository/contents/packages/${encodeURIComponent(e)}`,xTe="https://api.github.com/repos/ocaml/opam-repository/branches/master",u8=(e,t,n)=>`https://raw.githubusercontent.com/ocaml/opam-repository/${n}/packages/${encodeURIComponent(e)}/${encodeURIComponent(`${e}.${t}`)}/opam`;async function ETe(e){let n=(await Ie(xTe,{...e?{headers:e}:{}}).catch(()=>null))?.commit?.sha;return typeof n=="string"&&/^[0-9a-f]{40}$/.test(n)?n:null}function p8(e){return/^[\w.+-]+$/.test(e)}async function w$(e,t={}){if(!p8(e))return null;let n=await Ie(STe(e),{...t.headers?{headers:t.headers}:{}}).catch(()=>null);if(!Array.isArray(n))return null;let r=`${e}.`;return n.filter(i=>i.type==="dir"&&i.name?.startsWith(r)).map(i=>i.name.slice(r.length))}async function f8(e,t){if(!p8(e))return null;let n=await ETe(),r=n?await ot(u8(e,t,n),{immutable:!0}).catch(()=>null):await ot(u8(e,t,"master")).catch(()=>null);return r?TTe(r,e,t):null}function TTe(e,t,n){let r=a=>{let c=new RegExp(`(?:^|\\n)\\s*${a}\\s*:\\s*"([^"\\n]*)"`).exec(e);return c?d8(c[1]):null},i=a=>{let l=new RegExp(`(?:^|\\n)\\s*${a}\\s*:\\s*"([^"\\n]*)"`).exec(e)?.[1]?.trim();return l||null},o=(()=>{let a=/(?:^|\n)\s*description\s*:\s*"""([\s\S]*?)"""/.exec(e);return a?a[1].trim()||null:i("description")})(),s=(()=>{let a=/(?:^|\n)\s*url\s*\{([\s\S]*?)\n[ \t]*\}/.exec(e),c=a?a[1]:e,l=/(?:^|\n)\s*src\s*:\s*"([^"\n]+)"/.exec(c)??/(?:^|\n)\s*archive\s*:\s*"([^"\n]+)"/.exec(c);return l?d8(l[1]):null})();return{name:t,version:n,devRepo:r("dev-repo"),homepage:r("homepage"),bugReports:r("bug-reports"),doc:r("doc"),synopsis:i("synopsis"),description:o,sourceUrl:s}}function d8(e){let t=e.trim();return!t||/%\{[^}]*\}%?/.test(t)?null:t}function m8(e){return Oa(e.devRepo)??Oa(e.sourceUrl)??Oa(e.homepage)??Oa(e.bugReports)}function k$(e){let t={};return e.map(n=>{let r={...t,...n};return t=r,r})}function $$(e,t){return e.find(n=>n.version===t)}async function Qn(e,t,n){switch(t){case"npm":return HTe(e,n);case"pypi":return KTe(e,n);case"cargo":return JTe(e);case"go":return ZTe(e);case"maven":return XTe(e);case"rubygems":return eAe(e);case"nuget":return ITe(e);case"packagist":return RTe(e,n);case"hex":return PTe(e);case"pub":return CTe(e);case"swift":return NTe(e);case"cocoapods":return OTe(e,n);case"conan":return DTe(e);case"vcpkg":return FTe(e);case"arduino":return UTe(e);case"opam":return ATe(e,n);default:return null}}async function ATe(e,t){let[n,r]=await Promise.all([w$(e),t?f8(e,t):Promise.resolve(null)]);return!n&&!r?null:{name:e,ecosystem:"opam",githubRepo:r?m8(r):null,homepage:r?.homepage??r?.devRepo??null,versions:n??[],deprecated:null,description:r?.description??r?.synopsis??null}}async function ITe(e){let t=e.toLowerCase(),[n,r]=await Promise.all([Ie(`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(t)}/index.json`),Ie(`https://api.nuget.org/v3/registration5-gz-semver2/${encodeURIComponent(t)}/index.json`)]);if(!n&&!r)return null;let i=(r?.items??[]).flatMap(s=>s.items??[]),o=i[i.length-1]?.catalogEntry;return{name:e,ecosystem:"nuget",githubRepo:Bt(o?.repository?.url??null)??Bt(o?.projectUrl??null),homepage:o?.projectUrl??`https://www.nuget.org/packages/${e}`,versions:n?.versions??[],deprecated:o?.deprecation?.message??null,description:o?.description??null}}async function RTe(e,t){let r=(await Ie(`https://repo.packagist.org/p2/${e}.json`))?.packages?.[e];if(!r||r.length===0)return null;let i=k$(r),o=t?$$(i,t):i[0];if(!o)return null;let s=o.abandoned,a=s===void 0||s===!1?null:typeof s=="string"?`This package is abandoned; the author suggests using ${s} instead.`:"This package is abandoned and is no longer maintained.";return{name:e,ecosystem:"packagist",githubRepo:Bt(o.source?.url??null)??Bt(o.homepage??null),homepage:o.homepage??`https://packagist.org/packages/${e}`,versions:i.map(c=>c.version).filter(c=>!!c),deprecated:a,description:o.description??null}}async function PTe(e){let t=await Ie(`https://hex.pm/api/packages/${encodeURIComponent(e)}`);if(!t)return null;let n=t.meta?.links??{},r=Object.entries(n).map(([s,a])=>({key:s.toLowerCase(),value:a})),i=r.find(s=>s.key==="github")?.value??r.find(s=>s.key==="source")?.value,o=Object.values(t.retirements??{})[0];return{name:e,ecosystem:"hex",githubRepo:Bt(i??null)??r.map(s=>Bt(s.value)).find(Boolean)??null,homepage:t.html_url??`https://hex.pm/packages/${e}`,versions:(t.releases??[]).map(s=>s.version).filter(s=>!!s),deprecated:o?o.message??o.reason??"This release is retired.":null,description:t.meta?.description??null}}async function CTe(e){let t=await Ie(`https://pub.dev/api/packages/${encodeURIComponent(e)}`);if(!t)return null;let n=t.latest?.pubspec,r=n?.repository??n?.homepage??n?.issue_tracker;return{name:e,ecosystem:"pub",githubRepo:Bt(r??null),homepage:n?.homepage??`https://pub.dev/packages/${e}`,versions:(t.versions??[]).map(i=>i.version).filter(i=>!!i),deprecated:t.latest?.retracted?"The latest version of this package has been retracted.":null,description:n?.description??null}}function NTe(e){return/^[\w.-]+\/[\w.-]+$/.test(e)?{name:e,ecosystem:"swift",githubRepo:e,homepage:`https://github.com/${e}`,versions:[],deprecated:null,description:null}:null}async function OTe(e,t){let[n,r]=await Promise.all([Ie(`https://trunk.cocoapods.org/api/v1/pods/${encodeURIComponent(e)}`),t?_$(e,t):Promise.resolve(null)]);return n?{name:e,ecosystem:"cocoapods",githubRepo:r?l8(r):null,homepage:r?.homepage??`https://cocoapods.org/pods/${e}`,versions:(n.versions??[]).map(i=>i.name).filter(i=>!!i),deprecated:null,description:r?.description??r?.summary??null}:null}async function DTe(e){let t=`https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/${encodeURIComponent(e)}`,n=await ot(`${t}/config.yml`);if(!n)return null;let{versions:r,folders:i}=MTe(n);if(r.length===0)return null;let o=i[r[r.length-1]]??i[r[0]]??"all",s=await ot(`${t}/${o}/conandata.yml`);return{name:e,ecosystem:"conan",githubRepo:s?LTe(s):null,homepage:`https://conan.io/center/recipes/${e}`,versions:r,deprecated:null,description:null}}function MTe(e){let t=[],n={},r=!1,i=null;for(let o of e.split(` +`)){let s=o.split("#")[0].replace(/\s+$/,"");if(!s.trim())continue;if(/^versions\s*:/.test(s)){r=!0;continue}if(!/^\s/.test(s)){r=!1;continue}if(!r)continue;let a=/^\s{2,}["']?([^"':\s]+)["']?\s*:\s*$/.exec(s);if(a){i=a[1].trim(),i&&!t.includes(i)&&t.push(i);continue}let c=/^\s{4,}folder\s*:\s*["']?([^"'\s]+)["']?/.exec(s);c&&i&&(n[i]=c[1])}return{versions:t,folders:n}}function LTe(e){for(let t of e.matchAll(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+/g)){let n=Bt(t[0]);if(n)return n}return null}async function FTe(e){let t=e[0]?.toLowerCase();if(!t||!/[a-z0-9]/.test(t))return null;let[n,r]=await Promise.all([Ie(`https://raw.githubusercontent.com/microsoft/vcpkg/master/versions/${t}-/${encodeURIComponent(e)}.json`),Ie(`https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/${encodeURIComponent(e)}/vcpkg.json`)]);if(!n)return null;let i=[];for(let s of n.versions??[]){let a=s.version??s["version-semver"]??s["version-string"]??s["version-date"];a&&!i.includes(a)&&i.push(a)}if(i.length===0)return null;let o=Array.isArray(r?.description)?r.description.join(" "):r?.description??null;return{name:e,ecosystem:"vcpkg",githubRepo:Bt(r?.homepage??null),homepage:r?.homepage??`https://vcpkg.io/en/package/${e}`,versions:i,deprecated:null,description:o}}async function UTe(e){let t=await v$(e);if(t)return{name:t.name,ecosystem:"arduino",githubRepo:t.githubRepo,homepage:t.website??`https://www.arduino.cc/reference/en/libraries/${zTe(e)}/`,versions:t.versions,deprecated:null,description:t.description};let n=await jTe(e);return n?{name:n.name??e,ecosystem:"arduino",githubRepo:Bt(n.repository_url??null),homepage:n.homepage??null,versions:n.version?.name?[n.version.name]:[],deprecated:null,description:n.description??null}:null}async function jTe(e){let n=((await Ie(`https://api.registry.platformio.org/v3/search?query=${encodeURIComponent(e)}`))?.items??[]).find(r=>r.name?.toLowerCase()===e.toLowerCase()&&r.owner?.username);return n?Ie(`https://api.registry.platformio.org/v3/packages/${encodeURIComponent(n.owner.username)}/library/${encodeURIComponent(n.name)}`):null}function zTe(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}async function Da(e,t,n){switch(t){case"npm":return GTe(e,n);case"pypi":return BTe(e,n);case"go":return VTe(e,n);case"cargo":return WTe(e,n);default:return null}}function S$(e){return{version:e,license:null,releasedAt:null,runtime:null,dependencies:[],withdrawn:null}}async function GTe(e,t){let n=await Ie(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`),r=n?.versions?.[t];if(!r)return null;let i=r.engines?.node;return{...S$(t),license:typeof r.license=="string"?r.license:r.license?.type??null,releasedAt:n?.time?.[t]??null,runtime:i?{name:"Node.js",requirement:i}:null,dependencies:Object.keys(r.dependencies??{}),withdrawn:r.deprecated??null}}async function BTe(e,t){let n=await Ie(`https://pypi.org/pypi/${encodeURIComponent(e)}/${encodeURIComponent(t)}/json`,{immutable:!0});if(!n?.info)return null;let r=n.info.requires_python;return{...S$(t),license:n.info.license||null,releasedAt:n.urls?.[0]?.upload_time_iso_8601??null,runtime:r?{name:"Python",requirement:r}:null,dependencies:(n.info.requires_dist??[]).map(i=>/^\s*([A-Za-z0-9._-]+)/.exec(i)?.[1]).filter(i=>!!i),withdrawn:n.info.yanked?`Release yanked: ${n.info.yanked_reason??"no reason given"}`:null}}async function VTe(e,t){let n=t.startsWith("v")?t:`v${t}`,r=`https://proxy.golang.org/${encodeURI(e.toLowerCase())}/@v/${encodeURIComponent(n)}`,[i,o]=await Promise.all([ot(`${r}.mod`,{immutable:!0}),Ie(`${r}.info`,{immutable:!0})]);if(!i&&!o)return null;let s=i?/^\s*go\s+(\d+\.\d+(?:\.\d+)?)/m.exec(i)?.[1]:null;return{...S$(n),releasedAt:o?.Time??null,runtime:s?{name:"Go",requirement:`>=${s}`}:null,withdrawn:i?qTe(i,n):null}}function qTe(e,t){let n=t.replace(/^v/,"");for(let i of e.matchAll(/^\s*retract\s+(.+)$/gm)){let o=i[1].trim(),s=/\/\/\s*(.+)$/.exec(o)?.[1]?.trim(),a=s?`Retracted by the maintainer: ${s}`:"Retracted by the maintainer.",c=/^v?([\w.+-]+)/.exec(o.replace(/\/\/.*$/,"").trim())?.[1];if(c&&c===n)return a;let l=/\[\s*v?([\w.+-]+)\s*,\s*v?([\w.+-]+)\s*\]/.exec(o);if(l&&g8(n,l[1],l[2]))return a}let r=/^\s*retract\s*\(([\s\S]*?)^\s*\)/m.exec(e)?.[1];if(r)for(let i of r.split(` +`)){let o=i.replace(/\/\/.*$/,"").trim();if(!o)continue;let s=/\/\/\s*(.+)$/.exec(i)?.[1]?.trim(),a=s?`Retracted by the maintainer: ${s}`:"Retracted by the maintainer.";if(/^v?([\w.+-]+)$/.exec(o)?.[1]===n)return a;let c=/\[\s*v?([\w.+-]+)\s*,\s*v?([\w.+-]+)\s*\]/.exec(o);if(c&&g8(n,c[1],c[2]))return a}return null}function g8(e,t,n){return h8(e,t)>=0&&h8(e,n)<=0}function h8(e,t){let n=e.split(/[.+-]/).map(i=>Number.parseInt(i,10)),r=t.split(/[.+-]/).map(i=>Number.parseInt(i,10));for(let i=0;i=${r}`}:null,withdrawn:n.version.yanked?"This release was yanked from crates.io.":null}}async function v8(e,t,n){let r={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};t&&(r.Authorization=`Bearer ${t}`);let i=await Ie(`https://api.github.com/repos/${e}`,{headers:r,...n?{onRetry:n}:{}});if(!i)return null;let o=i.license?.spdx_id;return{archived:i.archived===!0,pushedAt:i.pushed_at??null,license:o&&o!=="NOASSERTION"?o:null,url:i.html_url??`https://github.com/${e}`}}async function HTe(e,t){let n=await Ie(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`);if(!n)return null;let r=Object.keys(n.versions??{}),i=t?n.versions?.[t]:void 0;return{name:e,ecosystem:"npm",githubRepo:Bt(y8(n.repository))??Bt(y8(i?.repository))??Bt(n.homepage),homepage:n.homepage??null,versions:r,deprecated:i?.deprecated??null,description:n.description??null}}async function KTe(e,t){let n=await Ie(`https://pypi.org/pypi/${encodeURIComponent(e)}/json`);if(!n)return null;let o=[...Object.values(n.info?.project_urls??{}),n.info?.home_page??""].map(Bt).find(c=>c!==null)??null,a=(t?n.releases?.[t]??[]:[]).find(c=>c.yanked);return{name:e,ecosystem:"pypi",githubRepo:o,homepage:n.info?.home_page??null,versions:Object.keys(n.releases??{}),deprecated:a?`Release yanked: ${a.yanked_reason??"no reason given"}`:null,description:n.info?.summary??null}}async function JTe(e){let t=await Ie(`https://crates.io/api/v1/crates/${encodeURIComponent(e)}`);return t?{name:e,ecosystem:"cargo",githubRepo:Bt(t.crate?.repository)??Bt(t.crate?.homepage),homepage:t.crate?.homepage??null,versions:(t.versions??[]).map(n=>n.num),deprecated:null,description:t.crate?.description??null}:null}async function ZTe(e){let t=await ot(`https://proxy.golang.org/${encodeURI(e.toLowerCase())}/@v/list`);return{name:e,ecosystem:"go",githubRepo:QTe(e),homepage:`https://pkg.go.dev/${e}`,versions:t?t.split(` +`).map(n=>n.trim()).filter(Boolean):[],deprecated:null,description:null}}var YTe={grpc:"grpc/grpc-go",protobuf:"protocolbuffers/protobuf-go",api:"googleapis/google-api-go-client",genproto:"googleapis/go-genproto",appengine:"golang/appengine"};function QTe(e){let t=e.replace(/\/v[2-9]\d*$/,""),n=[[/^golang\.org\/x\/([\w.-]+)/,r=>`golang/${r[1]}`],[/^google\.golang\.org\/(\w+)/,r=>YTe[r[1]]??`googleapis/go-${r[1]}`],[/^go\.uber\.org\/([\w.-]+)/,r=>`uber-go/${r[1]}`],[/^sigs\.k8s\.io\/([\w.-]+)/,r=>`kubernetes-sigs/${r[1]}`],[/^k8s\.io\/([\w.-]+)/,r=>`kubernetes/${r[1]}`],[/^gopkg\.in\/([\w.-]+)\/([\w.-]+?)\.v\d+$/,r=>`${r[1]}/${r[2]}`],[/^gopkg\.in\/([\w.-]+?)\.v\d+$/,r=>`go-${r[1]}/${r[1]}`]];for(let[r,i]of n){let o=r.exec(t);if(o)return i(o)}return Bt(`https://${t}`)}async function XTe(e){let[t,n]=e.split(":");if(!t||!n)return null;let r=await Ie(`https://search.maven.org/solrsearch/select?q=g:%22${encodeURIComponent(t)}%22+AND+a:%22${encodeURIComponent(n)}%22&core=gav&rows=100&wt=json`);return{name:e,ecosystem:"maven",githubRepo:null,homepage:`https://central.sonatype.com/artifact/${t}/${n}`,versions:(r?.response?.docs??[]).map(i=>i.v),deprecated:null,description:null}}async function eAe(e){let t=await Ie(`https://rubygems.org/api/v1/gems/${encodeURIComponent(e)}.json`);if(!t)return null;let n=await Ie(`https://rubygems.org/api/v1/versions/${encodeURIComponent(e)}.json`);return{name:e,ecosystem:"rubygems",githubRepo:Bt(t.source_code_uri)??Bt(t.homepage_uri)??Bt(t.changelog_uri),homepage:t.homepage_uri??null,versions:(n??[]).map(r=>r.number),deprecated:null,description:t.info??null,changelogUrl:t.changelog_uri??null,documentationUrl:t.documentation_uri??null}}function y8(e){if(e)return typeof e=="string"?e:e.url}function Bt(e){if(!e)return null;let t=/^github:([\w.-]+)\/([\w.-]+)$/.exec(e.trim());if(t)return`${t[1]}/${b8(t[2])}`;let n=/github\.com[/:]([\w.-]+)\/([\w.-]+)/.exec(e);if(!n)return null;let r=n[1],i=b8(n[2]);return!r||!i||r==="sponsors"?null:`${r}/${i}`}function b8(e){return e.replace(/\.git$/,"")}async function w8(e,t={}){let n=t.lookup??((r,i)=>Qn(r,i,null));return Promise.all(e.map(async r=>{let i=r.rawFrom!=null&&r.from===null,o=r.rawTo!=null&&r.to===null;if(!i&&!o||r.source==="lockfile"||!tAe.has(r.ecosystem))return r;let a=(await n(r.name,r.ecosystem).catch(p=>(t.logger?.debug?.(`range resolution: registry lookup for ${r.name} failed: ${String(p)}`),null)))?.versions??[];if(a.length===0)return r;let c=i?_8(a,r.rawFrom):r.from,l=o?_8(a,r.rawTo):r.to;if(i&&!c||o&&!l)return r;let u=c??r.from,d=l??r.to;return t.logger?.debug?.(`range resolution: ${r.name} ${r.rawFrom} \u2192 ${r.rawTo} resolves to ${u} \u2192 ${d}`),{...r,from:u,to:d,bump:u&&d?Aa(u,d,r.ecosystem):r.bump}}))}var tAe=new Set(["npm"]);function _8(e,t){let n=t.trim().replace(/^v(?=\d)/,"");return Vh.default.valid(n)?e.includes(n)?n:Vh.default.valid(n):Vh.default.validRange(n)?Vh.default.maxSatisfying([...e],n,{includePrerelease:!1}):null}var Jd=require("node:fs"),$8=$t(Lc(),1);function Xn(){return{async readFile(e){try{return(0,Jd.readFileSync)(e,"utf8")}catch{return null}},async readDirectory(e){try{return(0,Jd.readdirSync)(e)}catch{return[]}},async isDirectory(e){try{return(0,Jd.statSync)(e).isDirectory()}catch{return!1}}}}async function Zd(e,t){let r=(await Promise.all([nAe(e,t),rAe(e,t),iAe(e,t),oAe(e,t),sAe(e,t),aAe(e,t)])).filter(o=>o!==null);return r.find(o=>o.kind==="pnpm-workspace")?r.filter(o=>o.kind!=="npm-workspaces"):r}function Yd(e){let t=new Set;for(let n of e)for(let r of n.members)t.add(r.dir);return t.size===0?[""]:[...t].sort()}function sl(e,t){let n=null;for(let r of t){if(r===""){n===null&&(n="");continue}(e===r||e.startsWith(`${r}/`))&&(n===null||r.length>n.length)&&(n=r)}return n}function hM(e,t){return t===""||e===t||e.startsWith(`${t}/`)}function S8(e,t){if(t.length===0)return[...e];let n=Yd(t),r=new Map;for(let i of t)for(let o of i.members)o.name&&r.set(o.dir,o.name);return e.map(i=>{let o=sl(i.manifestPath,n);if(o===null)return i;let s=r.get(o);return{...i,workspace:o,...s?{workspaceName:s}:{}}})}function x$(e){return e.workspace===void 0?null:e.workspaceName??(e.workspace===""?"the repository root":e.workspace)}async function nAe(e,t){let n=await t.readFile(oi(e,"package.json"));if(!n)return null;let r=Ht(n),i=Array.isArray(r?.workspaces)?r.workspaces:r?.workspaces?.packages;return!i||i.length===0?null:{kind:"npm-workspaces",ecosystem:"npm",declaredIn:"package.json",members:await Qd(e,t,i,"npm","package.json",r?.name??null)}}async function rAe(e,t){let n=await t.readFile(oi(e,"pnpm-workspace.yaml"));if(!n)return null;let r=[];try{let o=(0,$8.parse)(n);Array.isArray(o?.packages)&&(r=o.packages.filter(s=>typeof s=="string"))}catch{return null}if(r.length===0)return null;let i=Ht(await t.readFile(oi(e,"package.json"))??"")?.name??null;return{kind:"pnpm-workspace",ecosystem:"npm",declaredIn:"pnpm-workspace.yaml",members:await Qd(e,t,r,"npm","package.json",i)}}async function iAe(e,t){let n=await t.readFile(oi(e,"Cargo.toml"));if(!n)return null;let r=Ri(n),i=r.find(c=>c.header==="workspace");if(!i)return null;let o=Lh(i.entries.get("members")??""),s=r.some(c=>c.header==="package"),a=s?x8(r.find(c=>c.header==="package")?.entries.get("name")??""):null;return{kind:"cargo-workspace",ecosystem:"cargo",declaredIn:"Cargo.toml",members:await Qd(e,t,o,"cargo","Cargo.toml",a,!s)}}async function oAe(e,t){let n=await t.readFile(oi(e,"go.work"));if(!n)return null;let r=[],i=!1;for(let o of n.split(` +`)){let s=o.split("//")[0].trim();if(!s)continue;if(/^use\s*\($/.test(s)){i=!0;continue}if(i&&s===")"){i=!1;continue}let a=/^use\s+(\S+)$/.exec(s);a?r.push(a[1]):i&&r.push(s)}return{kind:"go-work",ecosystem:"go",declaredIn:"go.work",members:await Qd(e,t,r,"go","go.mod",null,!0)}}async function sAe(e,t){let n=await t.readFile(oi(e,"pom.xml"));if(!n)return null;let r=/([\s\S]*?)<\/modules>/.exec(n);if(!r)return null;let i=[...r[1].matchAll(/\s*([^<]+?)\s*<\/module>/g)].map(s=>s[1]);if(i.length===0)return null;let o=/\s*([^<]+?)\s*<\/artifactId>/.exec(n)?.[1]??null;return{kind:"maven-modules",ecosystem:"maven",declaredIn:"pom.xml",members:await Qd(e,t,i,"maven","pom.xml",o)}}async function aAe(e,t){let n=await t.readFile(oi(e,"settings.gradle.kts"))?"settings.gradle.kts":await t.readFile(oi(e,"settings.gradle"))?"settings.gradle":null;if(!n)return null;let i=[...(await t.readFile(oi(e,n))??"").matchAll(/include\s*\(?\s*((?:['"][^'"]+['"]\s*,?\s*)+)/g)].flatMap(o=>[...o[1].matchAll(/['"]([^'"]+)['"]/g)].map(s=>s[1])).map(o=>o.replace(/^:/,"").replace(/:/g,"/"));return i.length===0?null:{kind:"gradle-settings",ecosystem:"maven",declaredIn:n,members:await Qd(e,t,i,"maven","build.gradle",null,!0)}}async function Qd(e,t,n,r,i,o,s=!1){let a=new Set,c=new Set;for(let u of n){let d=u.trim();if(d.startsWith("!"))for(let p of await k8(e,t,d.slice(1),i))c.add(p);else for(let p of await k8(e,t,d,i))a.add(p)}for(let u of c)a.delete(u);let l=[];s||l.push({dir:"",name:o,ecosystem:r});for(let u of[...a].sort())u!==""&&l.push({dir:u,name:await qh(e,t,u,i,r),ecosystem:r});return l}async function k8(e,t,n,r){let i=n.replace(/^\.\//,"").replace(/\/+$/,"");if(i.startsWith("!"))return[];if(!i.includes("*"))return[i];let o=i.split("/"),s=o.findIndex(p=>p.includes("*")),a=o.slice(0,s).join("/"),c=o[s]==="**",l=o.slice(s+1).join("/"),u=[],d=async(p,f)=>{if(!(f>4))for(let m of await t.readDirectory(oi(e,p))){if(m.startsWith(".")||m==="node_modules"||m==="target")continue;let g=p?`${p}/${m}`:m;if(!await t.isDirectory(oi(e,g)))continue;let h=l?`${g}/${l}`:g;(!r||await t.readFile(oi(e,h,r))!==null)&&u.push(h),c&&await d(g,f+1)}};return await d(a,0),u}async function qh(e,t,n,r,i){let o=await t.readFile(oi(e,n,r));if(!o)return null;switch(i){case"npm":return Ht(o)?.name??null;case"cargo":{let s=Ri(o).find(a=>a.header==="package");return x8(s?.entries.get("name")??"")||null}case"go":return/^\s*module\s+(\S+)/m.exec(o)?.[1]??null;case"maven":return/\s*([^<]+?)\s*<\/artifactId>/.exec(o)?.[1]??null;default:return null}}function x8(e){return e.trim().replace(/^["']|["']$/g,"")}function oi(...e){return e.filter(Boolean).join("/")}var E$=(e,t,n,r)=>e==="dev"?[t]:e==="optional"?[n]:e==="peer"&&r?[r]:[],cAe=e=>e?[...e.section==="dev-dependencies"?["--dev"]:[],...e.section==="build-dependencies"?["--build"]:[],...e.target?["--target",e.target]:[]]:[],yM=[{id:"npm",batchable:!0,ecosystem:"npm",label:"npm",manifests:["package.json"],lockfiles:["package-lock.json","npm-shrinkwrap.json"],outdated:{command:"npm",args:["outdated","--json"]},install:{command:"npm",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"npm",args:["install",`${e}@${t}`,...E$(n,"--save-dev","--save-optional","--save-peer")]})},{id:"pnpm",batchable:!0,ecosystem:"npm",label:"pnpm",manifests:["package.json"],lockfiles:["pnpm-lock.yaml"],outdated:{command:"pnpm",args:["outdated"]},install:{command:"pnpm",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"pnpm",args:["add",`${e}@${t}`,...E$(n,"--save-dev","--save-optional","--save-peer")]})},{id:"yarn-berry",batchable:!0,ecosystem:"npm",label:"Yarn (berry)",manifests:["package.json"],lockfiles:["yarn.lock"],outdated:null,install:{command:"yarn",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"yarn",args:["add",`${e}@${t}`,...E$(n,"--dev","--optional","--peer")]})},{id:"yarn",batchable:!0,ecosystem:"npm",label:"Yarn (classic)",manifests:["package.json"],lockfiles:["yarn.lock"],outdated:{command:"yarn",args:["outdated","--json"]},install:{command:"yarn",args:["install"]},upgrade:({name:e,version:t})=>({command:"yarn",args:["upgrade",`${e}@${t}`]})},{id:"bun",batchable:!0,ecosystem:"npm",label:"Bun",manifests:["package.json"],lockfiles:["bun.lock","bun.lockb"],outdated:{command:"bun",args:["outdated"]},install:{command:"bun",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"bun",args:["add",`${e}@${t}`,...E$(n,"--dev","--optional","--peer")]})},{id:"uv",batchable:!0,ecosystem:"pypi",label:"uv",manifests:["pyproject.toml"],lockfiles:["uv.lock"],outdated:{command:"uv",args:["pip","list","--outdated","--format","json"]},install:{command:"uv",args:["sync"]},upgrade:({name:e,version:t,kind:n})=>({command:"uv",args:["add",`${e}==${t}`,...n==="dev"?["--dev"]:[]]})},{id:"poetry",batchable:!0,ecosystem:"pypi",label:"Poetry",manifests:["pyproject.toml"],lockfiles:["poetry.lock"],outdated:{command:"poetry",args:["show","--outdated"]},install:{command:"poetry",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"poetry",args:["add",`${e}==${t}`,...n==="dev"?["--group","dev"]:[]]})},{id:"pip",batchable:!0,ecosystem:"pypi",label:"pip",manifests:["requirements.in","requirements.txt","pyproject.toml","setup.py"],manifestPattern:/^(?:requirements|constraints)[\w.-]*\.(?:in|txt)$/i,lockfiles:[],outdated:{command:"pip",args:["list","--outdated","--format=json"]},upgrade:({name:e,version:t})=>({command:"pip",args:["install","--upgrade",`${e}==${t}`]}),rewriteManifest:(e,{name:t,version:n},r)=>rl(r)?lAe(e,t,n):uAe(e,t,n)},{id:"go",batchable:!0,ecosystem:"go",label:"Go modules",manifests:["go.mod"],lockfiles:["go.sum"],outdated:{command:"go",args:["list","-u","-m","all"]},upgrade:({name:e,version:t})=>({command:"go",args:["get",`${e}@${t.startsWith("v")?t:`v${t}`}`]})},{id:"cargo",batchable:!0,ecosystem:"cargo",label:"Cargo",manifests:["Cargo.toml"],lockfiles:["Cargo.lock"],outdated:{command:"cargo",args:["update","--dry-run"]},upgrade:({name:e,version:t,cargo:n})=>({command:"cargo",args:["add",`${e}@=${t}`,...cAe(n)]})},{id:"bundler",batchable:!0,ecosystem:"rubygems",label:"Bundler",manifests:["Gemfile"],lockfiles:["Gemfile.lock"],outdated:{command:"bundle",args:["outdated"]},install:{command:"bundle",args:["install"]},upgrade:({name:e})=>({command:"bundle",args:["update",e,"--conservative"]}),rewriteManifest:(e,{name:t,version:n})=>dAe(e,t,n)},{id:"maven",ecosystem:"maven",label:"Maven",manifests:["pom.xml"],lockfiles:[],outdated:{command:"mvn",args:["versions:display-dependency-updates"]},upgrade:({name:e,version:t})=>({command:"mvn",args:["versions:use-dep-version",`-Dincludes=${e}`,`-DdepVersion=${t}`,"-DforceVersion=true"]})},{id:"gradle",ecosystem:"maven",label:"Gradle",manifests:["gradle/libs.versions.toml","build.gradle","build.gradle.kts"],lockfiles:["gradle.lockfile"],outdated:{command:"gradle",args:["dependencyUpdates"]},upgrade:()=>null},{id:"sbt",ecosystem:"maven",label:"sbt",manifests:["build.sbt"],lockfiles:[],outdated:{command:"sbt",args:["dependencyUpdates"]},upgrade:()=>null},{id:"dotnet",ecosystem:"nuget",label:"NuGet",manifests:["Directory.Packages.props"],manifestPattern:/\.(cs|fs|vb)proj$/i,lockfiles:["packages.lock.json"],outdated:{command:"dotnet",args:["list","package","--outdated"]},install:{command:"dotnet",args:["restore"]},upgrade:({name:e,version:t})=>({command:"dotnet",args:["add","package",e,"--version",t]})},{id:"composer",batchable:!0,ecosystem:"packagist",label:"Composer",manifests:["composer.json"],lockfiles:["composer.lock"],outdated:{command:"composer",args:["outdated","--format=json"]},install:{command:"composer",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"composer",args:["require",`${e}:${t}`,...n==="dev"?["--dev"]:[]]})},{id:"mix",batchable:!0,ecosystem:"hex",label:"Mix",manifests:["mix.exs"],lockfiles:["mix.lock"],outdated:{command:"mix",args:["hex.outdated"]},install:{command:"mix",args:["deps.get"]},upgrade:({name:e})=>({command:"mix",args:["deps.update",e]}),rewriteManifest:(e,{name:t,version:n})=>pAe(e,t,n)},{id:"rebar",ecosystem:"hex",label:"Rebar3",manifests:["rebar.config"],lockfiles:["rebar.lock"],outdated:null,install:{command:"rebar3",args:["get-deps"]},upgrade:({name:e})=>({command:"rebar3",args:["upgrade",e]}),rewriteManifest:(e,{name:t,version:n})=>fAe(e,t,n)},{id:"flutter",ecosystem:"pub",label:"Flutter",manifests:["pubspec.yaml"],lockfiles:["pubspec.lock"],outdated:{command:"flutter",args:["pub","outdated"]},install:{command:"flutter",args:["pub","get"]},upgrade:({name:e,version:t})=>({command:"flutter",args:["pub","add",`${e}:${t}`]})},{id:"dart",ecosystem:"pub",label:"Dart pub",manifests:["pubspec.yaml"],lockfiles:["pubspec.lock"],outdated:{command:"dart",args:["pub","outdated"]},install:{command:"dart",args:["pub","get"]},upgrade:({name:e,version:t,kind:n})=>({command:"dart",args:["pub","add",...n==="dev"?["dev:"]:[],`${e}:${t}`]})},{id:"swiftpm",ecosystem:"swift",label:"Swift Package Manager",manifests:["Package.swift"],lockfiles:["Package.resolved"],outdated:null,upgrade:()=>null},{id:"cocoapods",batchable:!0,ecosystem:"cocoapods",label:"CocoaPods",manifests:["Podfile"],lockfiles:["Podfile.lock"],outdated:{command:"pod",args:["outdated"]},install:{command:"pod",args:["install"]},upgrade:({name:e})=>({command:"pod",args:["update",e]}),rewriteManifest:(e,{name:t,version:n})=>mAe(e,t,n)},{id:"opam",batchable:!0,ecosystem:"opam",label:"opam",manifests:["dune-project"],manifestPattern:/\.opam$/,lockfiles:[],outdated:null,upgrade:({name:e,version:t})=>({command:"opam",args:["install",`${e}.${t}`,"--yes"]})},{id:"conan",batchable:!0,ecosystem:"conan",label:"Conan",manifests:["conanfile.txt","conanfile.py"],lockfiles:["conan.lock"],outdated:null,upgrade:()=>({command:"conan",args:["install",".","--build=missing"]}),rewriteManifest:(e,{name:t,version:n})=>gAe(e,t,n)},{id:"vcpkg",batchable:!0,ecosystem:"vcpkg",label:"vcpkg",manifests:["vcpkg.json"],lockfiles:[],outdated:null,upgrade:()=>({command:"vcpkg",args:["install"]}),rewriteManifest:(e,{name:t,version:n})=>hAe(e,t,n)},{id:"arduino-cli",batchable:!0,ecosystem:"arduino",label:"Arduino CLI",manifests:["library.properties"],lockfiles:[],outdated:{command:"arduino-cli",args:["lib","upgrade","--dry-run"]},upgrade:({name:e,version:t})=>({command:"arduino-cli",args:["lib","install",`${e}@${t}`]}),rewriteManifest:(e,{name:t,version:n})=>yAe(e,t,n)},{id:"platformio",ecosystem:"arduino",label:"PlatformIO",manifests:["platformio.ini"],lockfiles:[],outdated:{command:"pio",args:["pkg","outdated"]},upgrade:({name:e,version:t})=>({command:"pio",args:["pkg","install","--library",`${e}@${t}`]}),rewriteManifest:(e,{name:t,version:n})=>bAe(e,t,n)}];function Ma(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function lAe(e,t,n){let r=Ma(t).replace(/[-_.]/g,"[-_.]"),i=new RegExp(`^([ \\t]*${r})(\\[[^\\]]*\\])?[ \\t]*(?:[=<>!~]=?\\s*[^\\s;#,]+(?:\\s*,\\s*[=<>!~]=?\\s*[^\\s;#,]+)*)?`,"im");return i.test(e)?e.replace(i,(o,s,a)=>`${s}${a??""}==${n}`):e}function uAe(e,t,n){let r=Ma(t).replace(/[-_.]/g,"[-_.]"),i=new RegExp(`(["'])${r}(\\[[^\\]]*\\])?(?:\\s*[=<>!~]=?\\s*[^"',;]+(?:\\s*,\\s*[=<>!~]=?\\s*[^"',;]+)*)?\\1`,"i");return i.test(e)?e.replace(i,(o,s,a)=>`${s}${t}${a??""}==${n}${s}`):e}function dAe(e,t,n){let r=Ma(t),i=new RegExp(`(gem\\s+["']${r}["'])\\s*,\\s*["'][^"']*["']`);if(i.test(e))return e.replace(i,`$1, '${n}'`);let o=new RegExp(`(gem\\s+["']${r}["'])(?!\\s*,\\s*["'])`);return e.replace(o,`$1, '${n}'`)}function pAe(e,t,n){let r=Ma(t),i=new RegExp(`(\\{\\s*:${r}\\s*,\\s*)"[^"]*"`);return i.test(e)?e.replace(i,`$1"== ${n}"`):e}function fAe(e,t,n){let r=Ma(t),i=new RegExp(`(\\{\\s*${r}\\s*,\\s*)"[^"]*"`);return i.test(e)?e.replace(i,`$1"${n}"`):e}function mAe(e,t,n){let r=Ma(t),i=new RegExp(`(pod\\s+["']${r}["'])\\s*,\\s*["'][^"']*["']`);if(i.test(e))return e.replace(i,`$1, '${n}'`);let o=new RegExp(`(pod\\s+["']${r}["'])(?!\\s*,\\s*["'])`);return e.replace(o,`$1, '${n}'`)}function gAe(e,t,n){let r=Ma(t),i=new RegExp(`\\b${r}/[^\\s"'#@]+`,"g");return e.replace(i,`${t}/${n}`)}function hAe(e,t,n){let r;try{r=JSON.parse(e)}catch{return e}let i=Array.isArray(r.overrides)?r.overrides:[],o=i.find(s=>s.name===t);return o?o.version=n:i.push({name:t,version:n}),r.overrides=i,`${JSON.stringify(r,null,2)} +`}function yAe(e,t,n){return e.split(` +`).map(r=>{let i=/^(\s*depends\s*=\s*)(.*)$/i.exec(r);if(!i)return r;let o=i[2].split(",").map(s=>s.replace(/\s*\([^)]*\)\s*$/,"").trim()!==t?s:` ${t} (${n})`);return`${i[1]}${o.join(",").replace(/^\s+/,"")}`}).join(` +`)}function bAe(e,t,n){let r=Ma(t),i=new RegExp(`^(\\s*)((?:[\\w.-]+/)?${r})(@[^\\s;#]*)?\\s*$`,"gm");return e.replace(i,(o,s,a)=>/^\s+/.test(s)?`${s}${a}@${n}`:o)}function al(e){return yM.find(t=>t.id===e)}var La=yM;function E8(e,t){if(!e.batchable||t.length===0)return null;let n=new Map;for(let r of t){let i=e.upgrade(r);if(!i)return null;let o=vAe(e,r,i);if(o===void 0)return null;let s=o===null?i.args:i.args.filter((l,u)=>u!==o),a=`${i.command}\0${o}\0${s.join("\0")}`,c=n.get(a);if(c){o!==null&&c.specs.push(i.args[o]);continue}n.set(a,{command:i,at:o,specs:o===null?[]:[i.args[o]]})}return[...n.values()].map(({command:r,at:i,specs:o})=>i===null?r:{command:r.command,args:[...r.args.slice(0,i),...o,...r.args.slice(i+1)]})}function vAe(e,t,n){let r=e.upgrade({...t,name:_Ae,version:wAe});if(!r||r.command!==n.command||r.args.length!==n.args.length)return;let i=n.args.reduce((o,s,a)=>s===r.args[a]?o:[...o,a],[]);return i.length===0?null:i.length===1?i[0]:void 0}var _Ae="\0drift-probe",wAe="\0drift-probe-version";function Fa(e){let t=new Set(e.entries),n=[];for(let i of yM){let o=i.lockfiles.filter(a=>t.has(a)),s=[...i.manifests.filter(a=>t.has(a)),...i.manifestPattern?e.entries.filter(a=>i.manifestPattern.test(a)):[]];o.length===0&&s.length===0||kAe(i,e,t)&&n.push({manager:i,evidence:[...o,...s],fromLockfile:o.length>0})}let r=new Set(n.filter(i=>i.fromLockfile).map(i=>i.manager.ecosystem));return n.filter(i=>i.fromLockfile||!r.has(i.manager.ecosystem))}function kAe(e,t,n){if(e.id==="yarn"||e.id==="yarn-berry"){let r=n.has(".yarnrc.yml")||(t.read?.("yarn.lock")??"").includes("__metadata");return e.id==="yarn-berry"?r:!r}if(e.id==="dart"||e.id==="flutter"){let r=t.read?.("pubspec.yaml")??"",i=/^\s*(flutter|flutter_test)\s*:/m.test(r)||/sdk:\s*flutter/.test(r);return e.id==="flutter"?i:!i}return!0}function T8(e){let t=new Map;for(let n of e){let r=t.get(n.manager.ecosystem)??[];r.push(n),t.set(n.manager.ecosystem,r)}return[...t.entries()].filter(([,n])=>n.length>1).map(([n,r])=>({ecosystem:n,candidates:r}))}function A8(e){return[e.command,...e.args].join(" ")}var Ua=require("node:fs/promises"),cl=require("node:path");var vM=new Set([".git",".hg",".svn","node_modules","vendor","bower_components",".venv","venv","env","__pycache__",".tox","site-packages","target","build","dist","out",".next",".nuxt",".svelte-kit","coverage",".pytest_cache",".mypy_cache",".gradle",".idea",".vscode",".terraform","Pods","DerivedData",".pio","third_party","thirdparty","cmake-build-debug","cmake-build-release"]),$Ae=new Set(["package.json",".nvmrc",".node-version",".ruby-version",".python-version",".tool-versions","dockerfile","containerfile","go.mod","gemfile","pom.xml","build.gradle","build.gradle.kts","cargo.toml","rust-toolchain","rust-toolchain.toml","pyproject.toml","setup.py","setup.cfg","runtime.txt",".ruby-gemset"]);function _M(e){let t=(e.split("/").pop()??"").toLowerCase();return $Ae.has(t)||t.startsWith("dockerfile")||t.startsWith("containerfile")||t.endsWith(".gemspec")?!0:/^\.github\/workflows\/.+\.ya?ml$/.test(e)||/^\.(gitlab-ci|circleci)/.test(e)}var SAe={".ts":"typescript",".tsx":"typescript",".mts":"typescript",".cts":"typescript",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".go":"go",".rs":"rust",".c":"c",".h":"c",".cpp":"cpp",".cc":"cpp",".cxx":"cpp",".c++":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".h++":"cpp",".inl":"cpp",".tpp":"cpp",".ino":"cpp",".pde":"cpp",".java":"java",".kt":"java",".kts":"java",".scala":"java",".rb":"ruby",".rake":"ruby",".cs":"dotnet",".fs":"dotnet",".vb":"dotnet",".php":"php",".ex":"elixir",".exs":"elixir",".erl":"erlang",".dart":"dart",".swift":"swift",".ml":"ocaml",".mli":"ocaml"},I8=64*1024,xAe=2e3,EAe=["@generated","do not edit","do not modify","auto-generated","autogenerated","generated by","webpackbootstrap","sourcemappingurl"];async function TAe(e){let t;try{let i=await(0,Ua.open)(e,"r");try{let o=Buffer.alloc(I8),{bytesRead:s}=await i.read(o,0,I8,0);t=o.subarray(0,s).toString("utf8")}finally{await i.close()}}catch{return!1}let n=t.slice(0,4e3).toLowerCase();if(EAe.some(i=>n.includes(i)))return!0;let r=t.split(` +`);return r.length===1?!0:r.slice(0,-1).some(i=>i.length>xAe)}function R8(e){let t=e.lastIndexOf(".");return t===-1?"other":SAe[e.slice(t).toLowerCase()]??"other"}async function Xd(e,t={}){let{maxFileBytes:n=512*1024,maxFiles:r=5e3,extraIgnores:i=[],members:o}=t,s=new Set([...vM,...i]),a=async k=>{let x;try{x=await AAe.run(()=>(0,Ua.readdir)(k,{withFileTypes:!0}))}catch{return[]}let A=[];for(let I of x){let R=(0,cl.join)(k,I.name);if(I.isDirectory()){if(s.has(I.name)||I.name.startsWith(".")&&I.name!==".github"&&I.name!==".circleci")continue;A.push(a(R));continue}if(!I.isFile())continue;let C=RAe((0,cl.relative)(e,R)),j=_M(C)?"config":R8(I.name);j!=="other"&&(/\.min\.(js|ts)$/.test(I.name)||/\.d\.ts\.map$/.test(I.name)||A.push([{full:R,repoPath:C,language:j}]))}return(await Promise.all(A)).flat()},c=await a(e),l=c.filter(k=>k.language==="config"),u=c.filter(k=>k.language!=="config"),d=[],p=0,f=0,m=0,g=async k=>{let x=await Yn(k,IAe,async A=>{try{return(await(0,Ua.stat)(A.full)).size>n?(await TAe(A.full)?f+=1:m+=1,null):await(0,Ua.readFile)(A.full,"utf8")}catch{return null}});for(let[A,I]of x.entries()){if(I===null)continue;let R=k[A];d.push({path:R.repoPath,language:R.language,content:I,lineCount:PAe(I),...o?{member:sl(R.repoPath,o)}:{}})}};await g(l);let h=0;for(;hk.path.localeCompare(x.path)),b=h+f===u.length,_=d.filter(k=>k.language==="config").length,w={localizationRan:!0,localizationComplete:b,sourceFilesDiscovered:u.length,sourceFilesIndexed:h,sourceTruncated:!b,generatedFilesSkipped:f,oversizedSourceSkipped:m,runtimeConfigsDiscovered:l.length,runtimeConfigsIndexed:_,runtimeConfigComplete:l.length===_};return Object.defineProperty(v,"coverage",{value:w,enumerable:!1}),v}var bM=class{constructor(t){this.limit=t}limit;active=0;waiting=[];async run(t){this.active>=this.limit&&await new Promise(n=>this.waiting.push(n)),this.active+=1;try{return await t()}finally{this.active-=1,this.waiting.shift()?.()}}},AAe=new bM(64),IAe=16;function RAe(e){return cl.sep==="/"?e:e.split(cl.sep).join("/")}function PAe(e){let t=1;for(let n=0;ne.manifests)),wM=new Map;for(let e of La)for(let t of e.manifests)wM.has(t)||wM.set(t,e.ecosystem);function P8(e){let t=wM.get(e);if(t)return t;for(let n of La){let r=n.manifestPattern;if(r&&(r.lastIndex=0,r.test(e)))return n.ecosystem}return null}async function A$(e,t,n=[],r=8){let i=new Set(n),o=[],s=async(a,c)=>{if(c>r)return;let l=await t.readDirectory(T$(e,a));if(l.length===0)return;let u=!1;if(a!==""&&!i.has(a)){u=l.includes(".git");let d=l.find(f=>CAe.has(f))??l.find(f=>P8(f)),p=d?P8(d):null;d&&p&&(u||!OAe(a))&&o.push({dir:a,ecosystem:p,manifestPath:T$(a,d),hasOwnGit:u})}if(!u)for(let d of l){if(vM.has(d)||d.startsWith(".")&&d!==".github")continue;let p=T$(a,d);i.has(p)||await t.isDirectory(T$(e,p))&&await s(p,c+1)}};return await s("",0),o}var NAe=new Set(["fixtures","__fixtures__","testdata","registry"]);function OAe(e){let t=e.split("/").filter(Boolean).map(r=>r.toLowerCase()),n=t.findIndex(r=>r==="test"||r==="tests");return n===-1?!1:t.slice(n+1).some(r=>NAe.has(r))}function T$(...e){return e.filter(Boolean).join("/")}var N8=require("node:crypto");function Pt(e,...t){let n=(0,N8.createHash)("sha256").update(t.map(r=>String(r??"")).join(" ")).digest("hex");return`${e}_${n.slice(0,10)}`}function ll(e){return e.workspace===void 0?e.name:`${e.workspace} ${e.name}`}function fn(e){return`${e.ecosystem} ${ll(e)}`}function kM(e){return JSON.stringify([e.ecosystem,e.name,e.from??null,e.to??null])}function C8(e){let t=0,n=e.length;for(;tt&&e.charCodeAt(n-1)===45;)n--;return e.slice(t,n)}function O8(e,t=40){let n=C8(e.toLowerCase().replace(/[^a-z0-9]+/g,"-"));return C8(n.slice(0,t))||"change"}var DAe=["CHANGELOG.md","CHANGELOG.markdown","CHANGELOG","CHANGES.md","Changes.md","HISTORY.md","NEWS.md","RELEASES.md","RELEASE-NOTES.md","RELEASE_NOTES.md","CHANGELOG.rst","CHANGES.rst","CHANGELOG.txt","docs/CHANGELOG.md","docs/changelog.md","changelog.md"],MAe=["MIGRATING.md","MIGRATION.md","UPGRADING.md","UPGRADE.md","docs/migration.md","docs/migrating.md","docs/upgrading.md","docs/MIGRATION.md","docs/UPGRADE.md"];async function F8(e,t=["main","master"]){return U8(e,DAe,t)}async function LAe(e,t=["main","master"]){return U8(e,MAe,t)}var D8=1,M8=16;function*FAe(e){if(e.length!==0){yield e.slice(0,D8);for(let t=D8;tt.map(o=>({branch:i,filename:o})));for(let i of FAe(r)){let o=await Promise.all(i.map(({branch:l,filename:u})=>ot(`https://raw.githubusercontent.com/${e}/${l}/${u}`,{retries:0}))),s=o.findIndex(l=>l!==null&&l.trim()!=="");if(s<0)continue;let{branch:a,filename:c}=i[s];return{path:c,url:`https://github.com/${e}/blob/${a}/${c}`,content:o[s],branch:a}}return null}function UAe(e,t="npm"){let n=[],r=new Set;for(let i of e.matchAll(/\[([^\]]+)\]\(([^)\s]+)\)/g)){let o=i[1],s=i[2];if(/^[a-z]+:/i.test(s)||s.startsWith("#")||!/\.(md|markdown|rst|txt)$/i.test(s))continue;let a=$M(o,t)??$M(s.replace(/[/\\]/g," "),t);if(!a)continue;let c=s.replace(/^\.?\//,"").split("#")[0];r.has(c)||(r.add(c),n.push({path:c,version:a}))}return n}async function j8(e,t,n,r="npm",i={}){let{branches:o=["main","master"],maxDocuments:s=12}=i,a=await F8(e,o);return a?G8(a,e,t,n,r,s):[]}async function z8(e,t,n,r,i="npm",o=12){let s=/^https?:\/\/github\.com\/([^/]+\/[^/]+)\/blob\/([^/]+)\/(.+)$/i.exec(e),a=s?`https://raw.githubusercontent.com/${s[1]}/${s[2]}/${s[3]}`:e,c=await ot(a,{retries:0});if(!c||!c.trim())return[];let l=decodeURIComponent(new URL(e).pathname.split("/").pop()||"changelog"),u=s?.[2]??"main",d=s?.[1]??t;s?.[3]&&(l=s[3]);let p={path:l,url:e,content:c,branch:u};return d?G8(p,d,n,r,i,o):[p]}async function G8(e,t,n,r,i,o){if(xM(SM(e.content,i),n,r,i).length>0)return[e];let s=UAe(e.content,i).filter(l=>jAe(l.version,n,r,i));if(s.length===0)return[e];let c=(await Promise.all([...s].sort((l,u)=>V8(u.version,l.version,i)).slice(0,o).map(async l=>{let u=await ot(`https://raw.githubusercontent.com/${t}/${e.branch}/${l.path}`,{retries:0});return!u||!u.trim()?null:{path:l.path,url:`https://github.com/${t}/blob/${e.branch}/${l.path}`,content:u,branch:e.branch}}))).filter(l=>l!==null);return c.length>0?c:[e]}async function B8(e,t=["main","master"]){let[n,r]=await Promise.all([LAe(e,t),F8(e,t)]),i=n?[n]:[];if(!r)return i;let o=[...r.content.matchAll(/\[([^\]]+)\]\(([^)\s]+)\)/g)].filter(([,s,a])=>L8.test(s)||L8.test(a)).map(([,,s])=>s.replace(/^\.?\//,"").split("#")[0]).filter(s=>/\.(md|markdown|rst|txt)$/i.test(s)&&!/^[a-z]+:/i.test(s));for(let s of[...new Set(o)].slice(0,4)){if(i.some(c=>c.path===s))continue;let a=await ot(`https://raw.githubusercontent.com/${e}/${r.branch}/${s}`,{retries:0});!a||!a.trim()||i.push({path:s,url:`https://github.com/${e}/blob/${r.branch}/${s}`,content:a,branch:r.branch})}return i}var L8=/migrat|upgrad/i;function jAe(e,t,n,r){let i=Ne(t,r),o=Ne(n,r),s=Ne(e,r);if(!i||!o||!s)return!1;let a=Xe(o,i);if(a===null)return!1;let[c,l]=a>0?[i,o]:[o,i],u=Xe(s,c),d=Xe(s,l);return u!==null&&d!==null&&u>0&&d<=0}function SM(e,t="npm"){let n=[],r=e.split(` +`),i=null;for(let o=0;o0?[i,o]:[o,i];return e.filter(l=>{let u=Ne(l.version,r);if(!u)return!1;let d=Xe(u,a),p=Xe(u,c);return d!==null&&p!==null&&d>0&&p<=0}).sort((l,u)=>V8(u.version,l.version,r))}function V8(e,t,n){let r=Ne(e,n),i=Ne(t,n);return r&&i?Xe(r,i)??0:0}function Wh(e){let t=[],n=e.split(` +`),r=!1,i=0;for(let o of n){let s=/^(#{1,6})\s(.*)$/.exec(o);if(s){let c=s[1].length,l=s[2].trimStart();if(GAe.test(l)){r=!0,i=c,t.push(o.trim());continue}r&&c<=i&&(r=!1)}let a=o.trim();if(a){if(r){t.push(a);continue}VAe(a)&&t.push(a)}}return qAe(t)}var zAe=/\b(?:this|the)\s+(?:package|project|library|module)\s+(?:is\s+)?now\s+(?:pure\s+ESM|ESM[\s-]only|an?\s+ESM\s+package)\b|\b(?:migrated|converted|switched)\s+(?:this|the)\s+(?:package|project|library|module)\s+to\s+ESM\b|\b(?:dropped|removed)\s+CommonJS\s+support\b|\b(?:dropped|removed|no longer (?:supports|provides))\s+CommonJS\b|\bCommonJS\s+(?:is\s+)?no\s+longer\s+supported\b|\brequire\(\)\s+(?:is\s+)?no\s+longer\s+supported\b/i,GAe=/breaking|incompatib|removed|migration|upgrade\s+guide|deprecat|commonjs/i,BAe=/\b(BREAKING(\s+CHANGE)?|breaking change|no longer|has been removed|have been removed|was removed|were removed|is removed|renamed to|renamed from|replaced by|replaced with|now requires?|required\s+node|must now|dropped support|drop support|removed support|is now required|are now required|moved to|deprecated in favou?r of|minimum\s+(?:supported\s+)?(?:node|python|go|ruby|java|rust))\b/i;function VAe(e){return BAe.test(e)||zAe.test(e)}function qAe(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}async function q8(e,t,n,r,i={}){let{token:o,maxReleases:s=25}=i,a={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};o&&(a.Authorization=`Bearer ${o}`);let c=Ne(t,r),l=Ne(n,r);if(!c||!l)return[];let u=Xe(l,c);if(u===null)return[];let[d,p]=u>0?[c,l]:[l,c],f=[],m=100,g=5;for(let h=1;h<=g;h++){let v=await Ie(`https://api.github.com/repos/${e}/releases?per_page=${m}&page=${h}`,{headers:a});if(!v||v.length===0)break;let b=!1;for(let _ of v){if(_.draft)continue;let w=HAe(_.tag_name,r);if(!w)continue;let k=Xe(w,d),x=Xe(w,p);if(!(k===null||x===null)){if(k<=0){b=!0;continue}x>0||f.push({tag:_.tag_name,version:w.raw,name:_.name,body:_.body??"",url:_.html_url,publishedAt:_.published_at})}}if(b||v.lengthNe(a.version,n),i=[...e].sort((a,c)=>{let l=r(a),u=r(c);return l&&u?-(Xe(l,u)??0):0});if(i.length<=t)return i;let o=i.filter(a=>{let c=r(a);return!!(c?.release&&(c.release[2]??0)===0&&!c.prerelease)}).sort((a,c)=>{let l=r(a),u=r(c);return l&&u?Xe(l,u)??0:0}),s=new Map;for(let a of o){if(s.size>=t)break;s.set(a.version,a)}for(let a of i){if(s.size>=t)break;s.set(a.version,a)}return[...s.values()].sort((a,c)=>{let l=r(a),u=r(c);return l&&u?-(Xe(l,u)??0):0})}function HAe(e,t){let n=Ne(e,t);if(n)return n;let r=e.match(/v?\d[0-9A-Za-z.!+_-]*(?:\.[0-9A-Za-z!+_-]+)*/g)??[];for(let i of r){let o=Ne(i,t)??(i.startsWith("v")?Ne(i.slice(1),t):null);if(o)return o}return null}var wS=require("node:fs/promises"),RQ=require("node:os"),PQ=require("node:path");var W8=require("node:child_process");var KAe=18e4,JAe=32*1024*1024;function ZAe(e,t){let n=e.slice(e.lastIndexOf("/")+1),r=t[0];return r&&!r.startsWith("-")?`${n} ${r}`:n}var et=(e,t,n={})=>new Promise(r=>{let i=ZAe(e,t),o=zh()?Dt("exec",i):null;o&&it("exec.spawned");let s=Date.now(),a=(0,W8.execFile)(e,[...t],{cwd:n.cwd,timeout:n.timeoutMs??KAe,maxBuffer:n.maxBuffer??JAe,env:n.env??process.env,windowsHide:!0,encoding:"utf8",...n.signal?{signal:n.signal}:{}},(c,l,u)=>{if(o?.end({code:c?1:0}),!c){tM({label:i,durationMs:Date.now()-s,exitCode:0,stdoutBytes:l.length,stderrBytes:u.length}),r({code:0,stdout:l,stderr:u});return}let d=c,p=d.code==="ENOENT"?"not-found":d.killed||d.name==="AbortError"||d.code==="ABORT_ERR"?"timeout":"error";tM({label:i,durationMs:Date.now()-s,exitCode:typeof d.code=="number"?d.code:null,failure:p,stdoutBytes:(l??"").length,stderrBytes:(u??"").length}),r({code:typeof d.code=="number"?d.code:1,stdout:l??"",stderr:u??String(c.message??""),failure:p})});if(n.onOutput){let c=l=>{try{n.onOutput(String(l))}catch{}};a.stdout?.on("data",c),a.stderr?.on("data",c)}a.stdin?.end()});async function I$(e,t,n=["--version"]){let r=await e(t,n,{timeoutMs:2e4});return r.failure!=="not-found"&&r.code===0}var Y8=$t(Lc(),1),EM="openapi-diff",AM={id:"openapi",source:"openapi-diff",tool:EM,weight:1,originClass:"computed-artifact",config:{enabled:"openapi",paths:"openapiSpecs"},handles(e,t){return ep(t)!==null},async compute(e){return!ep(e.before)||!ep(e.after)?{available:!1,reason:"parse-failed",detail:`${e.path} is not a document Drift could read as an OpenAPI or Swagger spec on both sides of this change.`,tool:EM}:{available:!0,changes:Q8(e.before,e.after).map(t=>({code:t.kind,location:t.location,pointer:t.pointer,detail:t.detail})),tool:EM,weight:1,locator:e.path}},codes:{"path-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"module",visibility:["unknown"]},remediation:({symbol:e})=>`The endpoint \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement endpoint. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"operation-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The endpoint \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement endpoint. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"response-status-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer returns this success status. Update response handling so the removed status is no longer treated as a success path.`},"parameter-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`A required parameter was removed from \`${e}\`. Remove it from client calls; sending it may now be rejected as an unexpected parameter.`},"parameter-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The request type for \`${e}\` changed. Update serialisation at each call site so the value sent matches the new type.`},"parameter-now-required":{kind:"required-field-added",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires this field. Add it to every request built in this repo, using a value consistent with the surrounding code's intent.`},"request-field-now-required":{kind:"required-field-added",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires this field. Add it to every request built in this repo, using a value consistent with the surrounding code's intent.`},"request-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The request type for \`${e}\` changed. Update serialisation at each call site so the value sent matches the new type.`},"request-enum-narrowed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer accepts some previously-valid values. Find code that sends the removed values and map them onto still-supported ones.`},"response-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer returns this field. Update every reader of that field. If the value is genuinely no longer available, propagate the absence properly rather than substituting a placeholder that could be mistaken for real data.`},"response-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The response type for \`${e}\` changed. Update parsing and any downstream type declarations.`},"response-enum-widened":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` can now return values this code has never seen. Add explicit handling; make sure exhaustive switches and mapping tables have a safe default rather than falling through silently.`},"security-added":{kind:"config-change",taxonomy:{nature:"configuration",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires authentication. Ensure the client attaches credentials for this call, reusing the repo's existing auth mechanism \u2014 never introduce a new credential source or hard-code a token.`}}},YAe=["get","put","post","delete","options","head","patch","trace"];function ep(e){let t;try{t=e.trim().startsWith("{")?JSON.parse(e):(0,Y8.parse)(e)}catch{return null}if(!t||typeof t!="object")return null;let n=t;return!n.openapi&&!n.swagger?null:n}function Q8(e,t){let n=ep(e),r=ep(t);if(!n||!r)return[];let i=[],o=n.paths??{},s=r.paths??{};for(let[a,c]of Object.entries(o)){let l=s[a];if(!l){i.push({kind:"path-removed",location:a,pointer:`#/paths/${Z8(a)}`,detail:`Path \`${a}\` no longer exists. Every request to it will 404.`});continue}for(let u of YAe){let d=c[u];if(!d)continue;let p=l[u],f=`${u.toUpperCase()} ${a}`,m=`#/paths/${Z8(a)}/${u}`;if(!p){i.push({kind:"operation-removed",location:f,pointer:m,detail:`Operation \`${f}\` was removed.`});continue}QAe(d,p,n,r,f,m,i),XAe(d,p,n,r,f,m,i),eIe(d,p,n,r,f,m,i),tIe(d,p,f,m,i)}}return i}function QAe(e,t,n,r,i,o,s){let a=H8(e.parameters,n),c=H8(t.parameters,r);for(let[l,u]of a){let d=c.get(l);if(!d){u.required&&s.push({kind:"parameter-removed",location:i,pointer:`${o}/parameters/${l}`,detail:`Required parameter \`${u.name}\` (in: ${u.in}) was removed.`});continue}!u.required&&d.required&&s.push({kind:"parameter-now-required",location:i,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` (in: ${d.in}) is now required. Calls omitting it will be rejected.`});let p=P$(u.schema??{type:u.type}),f=P$(d.schema??{type:d.type});p&&f&&p!==f&&s.push({kind:"parameter-type-changed",location:i,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` changed type from \`${p}\` to \`${f}\`.`});let m=C$(u.schema),g=C$(d.schema),h=m.filter(v=>!g.includes(v));m.length&&g.length&&h.length&&s.push({kind:"request-enum-narrowed",location:i,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` no longer accepts: ${h.map(v=>`\`${v}\``).join(", ")}.`})}}function XAe(e,t,n,r,i,o,s){let a=ja(K8(e),n),c=ja(K8(t),r);if(!a||!c)return;let l=new Set(J8(a)),u=J8(c);for(let d of u)l.has(d)||s.push({kind:"request-field-now-required",location:i,pointer:`${o}/requestBody/${d}`,detail:`Request body field \`${d}\` is now required.`});for(let[d,p,f]of X8(a,c,n,r))s.push({kind:"request-field-type-changed",location:i,pointer:`${o}/requestBody/${d}`,detail:`Request body field \`${d}\` changed type from \`${p}\` to \`${f}\`.`})}function eIe(e,t,n,r,i,o,s){let a=e.responses??{},c=t.responses??{};for(let[l,u]of Object.entries(a)){if(!/^2\d\d$/.test(l))continue;let d=c[l];if(!d){s.push({kind:"response-status-removed",location:i,pointer:`${o}/responses/${l}`,detail:`Success response \`${l}\` was removed from \`${i}\`.`});continue}let p=ja(TM(u),n),f=ja(TM(d),r);if(!p||!f)continue;let m=R$(p),g=R$(f);for(let h of Object.keys(m))h in g||s.push({kind:"response-field-removed",location:i,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` is no longer returned by \`${i}\`.`});for(let[h,v,b]of X8(p,f,n,r))s.push({kind:"response-field-type-changed",location:i,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` changed type from \`${v}\` to \`${b}\`.`});for(let[h,v]of Object.entries(m)){let b=g[h];if(!b)continue;let _=C$(v),k=C$(b).filter(x=>!_.includes(x));_.length&&k.length&&s.push({kind:"response-enum-widened",location:i,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` can now return new values: ${k.map(x=>`\`${x}\``).join(", ")}. Exhaustive handling of this field must be updated.`})}}}function tIe(e,t,n,r,i){let o=e.security??[],s=t.security??[],a=o.length===0||o.some(l=>Object.keys(l).length===0),c=s.length===0||s.some(l=>Object.keys(l).length===0);if(a&&!c&&s.length>0){let l=[...new Set(s.flatMap(u=>Object.keys(u)))];i.push({kind:"security-added",location:n,pointer:`${r}/security`,detail:`\`${n}\` now requires authentication (${l.join(", ")}).`})}}function H8(e,t){let n=new Map;if(!Array.isArray(e))return n;for(let r of e){let i=ja(r,t);i?.name&&n.set(`${i.in??"query"}:${i.name}`,i)}return n}function K8(e){let t=e.requestBody;return t?TM(t):null}function TM(e){let t=e.content;if(!t)return e.schema??null;let n=Object.keys(t).find(r=>r.includes("json"))??Object.keys(t)[0];return n?t[n]?.schema??null:null}function ja(e,t,n=0){if(!e)return null;if(n>10)return e;let r=e.$ref;if(typeof r!="string")return e;if(!r.startsWith("#/"))return null;let i=r.slice(2).split("/").map(nIe),o=t;for(let s of i){if(!o||typeof o!="object")return null;o=o[s]}return!o||typeof o!="object"?null:ja(o,t,n+1)}function R$(e){let t=e.properties??{},n=e.allOf;if(!Array.isArray(n))return t;let r={...t};for(let i of n)i&&typeof i=="object"&&Object.assign(r,i.properties??{});return r}function J8(e){let t=Array.isArray(e.required)?e.required:[],r=(Array.isArray(e.allOf)?e.allOf:[]).flatMap(i=>{let o=i?.required;return Array.isArray(o)?o:[]});return[...new Set([...t,...r])]}function X8(e,t,n,r){let i=[],o=R$(e),s=R$(t);for(let[a,c]of Object.entries(o)){let l=s[a];if(!l)continue;let u=P$(ja(c,n)),d=P$(ja(l,r));u&&d&&u!==d&&i.push([a,u,d])}return i}function P$(e){if(!e)return null;let t=e.type;if(typeof t=="string"){if(t==="array"){let n=e.items;return`array<${typeof n?.type=="string"?n.type:"unknown"}>`}return t}return Array.isArray(t)?t.join("|"):null}function C$(e){let t=e?.enum;return Array.isArray(t)?t.map(n=>String(n)):[]}function Z8(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function nIe(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}var O$=require("node:fs/promises"),ks=require("node:path");function za(e,t,n,r){return{available:!1,reason:t,detail:n,...r?{remedy:r}:{},tool:e}}var tp="buf breaking",rIe="Install the Buf CLI (https://buf.build/docs/installation) so Drift can compare `.proto` revisions against the protobuf compatibility rules.",eY="Add the imported `.proto` files to `evidence.protobufSpecs` \u2014 Drift compiles every configured `.proto` together, so an import it was told about resolves. A pattern such as `proto/**/*.proto` covers a whole directory of them.",iIe=100,IM={id:"protobuf",source:"protobuf-diff",tool:tp,weight:1,originClass:"computed-artifact",config:{enabled:"protobuf",paths:"protobufSpecs"},handles(e,t){return e.endsWith(".proto")?/^\s*(syntax\s*=|package\s+|message\s+|service\s+|enum\s+)/m.test(t):!1},async compute(e){let t=await e.exec("buf",["--version"],{timeoutMs:2e4,...e.env?{env:e.env}:{}});if(t.failure==="not-found"||t.code!==0)return za(tp,"tool-missing",`The Buf CLI is not installed or is not on PATH, so ${e.path} could not be checked against the protobuf compatibility rules.`,rIe);let n=(0,ks.join)(e.workdir,"after"),r=(0,ks.join)(e.workdir,"before");await N$((0,ks.join)(n,e.path),e.after),await N$((0,ks.join)(r,e.path),e.before);for(let a of e.siblings)a.path!==e.path&&(await N$((0,ks.join)(n,a.path),a.after),await N$((0,ks.join)(r,a.path),a.before));let i=await e.exec("buf",["breaking",n,"--against",r,"--error-format=json"],{cwd:e.workdir,timeoutMs:e.timeoutMs,...e.env?{env:e.env}:{}});if(i.code!==0&&i.code!==iIe){let a=(i.stderr||i.stdout||"no output").trim().split(` +`)[0]??"";return za(tp,"toolchain-failed",`\`buf breaking\` could not compare ${e.path}: ${a}`,eY)}let o;try{o=tY(i.stdout)}catch(a){return za(tp,"unexpected-output",`Drift could not read \`buf breaking\` output for ${e.path}: ${a.message}`)}let s=o.find(oIe);return s?za(tp,"toolchain-failed",`\`buf breaking\` could not compare ${e.path}: ${s.message}`,aIe(s)):{available:!0,changes:o.filter(a=>cIe(a,e.path)).map(a=>lIe(a,e.path)),tool:tp,weight:1,locator:`${e.path} (buf breaking)`}},codes:{"proto-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf field \`${e}\` was deleted. Regenerate this repository's stubs and update every reader and writer of that field. Do not reuse its field number for anything else \u2014 reserve it \u2014 and if the value is genuinely gone, propagate the absence rather than substituting a placeholder that could be mistaken for real data.`},"proto-field-renamed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf field \`${e}\` changed name. The wire encoding is unaffected \u2014 field numbers carry it \u2014 but generated accessors and any JSON representation are not. Regenerate the stubs and rename every use; check JSON payloads persisted or exchanged under the old name.`},"proto-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The type or cardinality of the protobuf field \`${e}\` changed. Regenerate the stubs and update every construction and read of that field. A value already persisted or in flight was encoded under the old type \u2014 check that decoding it still means what the code assumes.`},"proto-field-encoding-changed":{kind:"behaviour-change",taxonomy:{nature:"behaviour",detectability:["runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`An encoding option on the protobuf field \`${e}\` changed. Nothing about the schema's shape moved, so this compiles either way \u2014 what changes is the generated representation or the validation applied to the value. Review code that depends on that field's concrete representation.`},"proto-oneof-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf oneof \`${e}\` was deleted. Regenerate the stubs and rewrite every switch over its cases; a oneof's generated API has no drop-in replacement, so restructure the calling code rather than stubbing the accessor.`},"proto-message-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf message \`${e}\` no longer exists. Regenerate the stubs and migrate every use to the replacement message. If there is no replacement, leave the call site intact with a clearly-marked TODO and explain it in the PR description rather than inventing a local copy of the type.`},"proto-enum-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum \`${e}\` no longer exists. Regenerate the stubs and migrate every use to whatever now carries those values.`},"proto-enum-value-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum value \`${e}\` was deleted. Regenerate the stubs and map every use onto a still-supported value. A peer that still sends the removed number will decode as the unknown/unrecognised case \u2014 make sure that path is handled rather than falling through silently.`},"proto-enum-value-renamed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum value \`${e}\` changed name. The number is unchanged, so the wire encoding is safe; generated constants and JSON names are not. Regenerate the stubs and rename every use.`},"proto-rpc-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The RPC \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement RPC. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"proto-rpc-signature-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The signature of the RPC \`${e}\` changed \u2014 its request type, response type, or streaming shape. Regenerate the stubs and update every call site; a streaming change in particular rewrites the call's control flow, not just its types.`},"proto-service-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"module",visibility:["generated"]},remediation:({symbol:e})=>`The service \`${e}\` no longer exists. Every client of it must be migrated to the replacement service; if there is none, leave the client intact with a clearly-marked TODO rather than deleting the feature.`},"proto-package-changed":{kind:"moved-export",taxonomy:{nature:"packaging",detectability:["compile-time"],scope:"package",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf package or a generated-code package option changed for \`${e}\`. The definitions still exist \u2014 their generated home moved. Regenerate the stubs and update the import paths; do not re-implement or stub the individual messages.`},"proto-file-removed":{kind:"removed-endpoint",taxonomy:{nature:"packaging",detectability:["compile-time"],scope:"module",visibility:["generated"]},remediation:({symbol:e})=>`The \`.proto\` file \`${e}\` was deleted, taking everything it declared with it. Find where those definitions moved to and update the imports and generated-code references; if they were removed outright, say so in the PR description rather than recreating the file locally.`},"proto-contract-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e,detail:t})=>`\`buf\` reports a compatibility break at \`${e}\`: ${t} Regenerate this repository's stubs and update the code around that definition to match the new contract.`}}};async function N$(e,t){await(0,O$.mkdir)((0,ks.dirname)(e),{recursive:!0}),await(0,O$.writeFile)(e,t,"utf8")}function tY(e){let t=[];for(let n of e.split(` +`)){let r=n.trim();if(!r.startsWith("{"))continue;let i;try{i=JSON.parse(r)}catch{continue}if(!i||typeof i!="object")continue;let o=i;typeof o.type!="string"||typeof o.message!="string"||t.push({path:typeof o.path=="string"?o.path:"",type:o.type,message:o.message,...typeof o.start_line=="number"?{start_line:o.start_line}:{},...typeof o.start_column=="number"?{start_column:o.start_column}:{}})}return t}function oIe(e){return sIe.has(e.type)}var sIe=new Set(["COMPILE","PLUGIN_FAILURE","CONFIGURATION"]);function aIe(e){return e.type==="COMPILE"?eY:"Check the `buf` configuration and plugins in this repository, then re-run."}function cIe(e,t){return e.path===t||e.path.endsWith(`/${t}`)}function lIe(e,t){let n=e.start_line??0;return{code:nY(e.type),location:rY(e.message)??`${t}:${n}`,pointer:n>0?`${t}:${n}`:t,detail:e.message}}function nY(e){switch(e){case"FIELD_SAME_NAME":case"FIELD_SAME_JSON_NAME":return"proto-field-renamed";case"ENUM_VALUE_SAME_NAME":return"proto-enum-value-renamed";case"FIELD_SAME_TYPE":case"FIELD_SAME_LABEL":case"FIELD_SAME_CARDINALITY":case"FIELD_SAME_ONEOF":case"FIELD_WIRE_COMPATIBLE_TYPE":case"FIELD_WIRE_COMPATIBLE_CARDINALITY":case"FIELD_WIRE_JSON_COMPATIBLE_TYPE":case"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY":return"proto-field-type-changed";case"FIELD_SAME_CTYPE":case"FIELD_SAME_JSTYPE":case"FIELD_SAME_CPP_STRING_TYPE":case"FIELD_SAME_UTF8_VALIDATION":case"FIELD_SAME_JAVA_UTF8_VALIDATION":case"FIELD_SAME_DEFAULT":return"proto-field-encoding-changed";case"RPC_SAME_REQUEST_TYPE":case"RPC_SAME_RESPONSE_TYPE":case"RPC_SAME_CLIENT_STREAMING":case"RPC_SAME_SERVER_STREAMING":case"RPC_SAME_IDEMPOTENCY_LEVEL":return"proto-rpc-signature-changed";default:break}if(/^FILE_SAME_(GO|JAVA|PHP|RUBY|CSHARP|OBJC|SWIFT)_/.test(e)||e==="FILE_SAME_PACKAGE"||e==="PACKAGE_NO_DELETE")return"proto-package-changed";if(e==="FILE_NO_DELETE")return"proto-file-removed";if(e.endsWith("_NO_DELETE")||e.includes("_NO_DELETE_UNLESS_")){if(e.startsWith("FIELD_"))return"proto-field-removed";if(e.startsWith("ENUM_VALUE_"))return"proto-enum-value-removed";if(e.startsWith("ENUM_")||e.startsWith("PACKAGE_ENUM_"))return"proto-enum-removed";if(e.startsWith("ONEOF_"))return"proto-oneof-removed";if(e.startsWith("RPC_"))return"proto-rpc-removed";if(e.startsWith("SERVICE_")||e.startsWith("PACKAGE_SERVICE_"))return"proto-service-removed";if(e.startsWith("MESSAGE_")||e.startsWith("PACKAGE_MESSAGE_"))return"proto-message-removed"}return"proto-contract-changed"}function rY(e){let t=/\bon (?:message|service|enum|oneof|extension) "([^"]+)"/.exec(e)?.[1]??/\b(?:message|service|enum) "([^"]+)"/.exec(e)?.[1]??null,n=/\bwith name "([^"]+)"/.exec(e)?.[1]??/\bchanged name from "[^"]+" to "([^"]+)"/.exec(e)?.[1]??/\b(?:RPC|field|value|oneof) "([^"]+)"/i.exec(e)?.[1]??null,r=n&&!/^\d+$/.test(n)?n:null;return t&&r?`${t}.${r}`:t??r}function fe(e){return D$(e,[])}function D$(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return uIe(e,t);default:return String(e)}}function uIe(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(dIe(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:D$(r,n)}else if(Array.isArray(e))return fIe(e,n);return pIe(e,n)}function dIe(e){return typeof e.toJSON=="function"}function pIe(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+mIe(e)+"]":"{ "+n.map(([i,o])=>i+": "+D$(o,t)).join(", ")+" }"}function fIe(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),r=e.length-n,i=[];for(let o=0;o1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function mIe(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}function gIe(e,t){return e?.__kind===t}var jr=gIe;function iY(e){return e instanceof Error?e:new RM(e)}var RM=class extends Error{constructor(t){super("Unexpected error value: "+fe(t)),this.name="NonErrorThrown",this.thrownValue=t}};function er(e){return typeof e=="object"&&e!==null}function st(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}var hIe=/\r\n|[\n\r]/g;function np(e,t){let n=0,r=1;for(let i of e.body.matchAll(hIe)){if(typeof i.index!="number"&&st(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function PM(e){return M$(e.source,np(e.source,e.start))}function M$(e,t){let n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?n:0,c=t.column+a,l=`${e.name}:${s}:${c} +`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){let p=Math.floor(c/80),f=c%80,m=[];for(let g=0;g["|",g]),["|","^".padStart(f)],["|",m[p+1]]])}return l+oY([[`${s-1} |`,u[i-1]],[`${s} |`,d],["|","^".padStart(c)],[`${s+1} |`,u[i+1]]])}function oY(e){let t=e.filter(([r,i])=>i!==void 0),n=Math.max(...t.map(([r])=>r.length));return t.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(` +`)}var U=class e extends Error{constructor(t,n={}){let{nodes:r,source:i,positions:o,path:s,originalError:a,cause:c,extensions:l}=n,u="cause"in n,d=u?c:a,p=u||a!=null?{cause:d}:void 0;super(t,p),this.name="GraphQLError",this.path=s??void 0;let f=a??(c instanceof Error?c:void 0);this.originalError=f,this.nodes=sY(Array.isArray(r)?r:r?[r]:void 0);let m=sY(this.nodes?.map(h=>h.loc).filter(h=>h!=null));this.source=i??m?.[0]?.source,this.positions=o??m?.map(h=>h.start),this.locations=o&&i?o.map(h=>np(i,h)):m?.map(h=>np(h.source,h.start));let g=er(f?.extensions)?f.extensions:void 0;this.extensions=l??g??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),a?.stack!=null?Object.defineProperty(this,"stack",{value:a.stack,writable:!0,configurable:!0}):Error.captureStackTrace!=null?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` + +`+PM(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` + +`+M$(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function sY(e){return e===void 0||e.length===0?void 0:e}function Hh(e){if(e instanceof U)return e;let t=iY(e);return new U(t.message,{originalError:t})}var zr=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let r=this.get(t);r===void 0?this.set(t,[n]):r.push(n)}};function aY(e){return yIe("or",e)}function yIe(e,t){switch(t.length===0&&st(!1),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}let n=t.slice(0,-1),r=t.at(-1);return n.join(", ")+", "+e+" "+r}function $s(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}function L$(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}function Ga(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}function CM(e){return e.length===0?"":` at ${e.map(t=>typeof t=="number"?`[${t}]`:`.${t}`).join("")}`}var Kh=class{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},rp=class{constructor(t,n,r,i,o,s){this.kind=t,this.start=n,this.end=r,this.line=i,this.column=o,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},Jh={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},bIe=new Set(Object.keys(Jh));function NM(e){let t=e?.kind;return typeof t=="string"&&bIe.has(t)}var tr={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"};var S={};Cr(S,{ARGUMENT:()=>xIe,ARGUMENT_COORDINATE:()=>pRe,BOOLEAN:()=>OIe,DIRECTIVE:()=>jIe,DIRECTIVE_ARGUMENT_COORDINATE:()=>mRe,DIRECTIVE_COORDINATE:()=>fRe,DIRECTIVE_DEFINITION:()=>tRe,DIRECTIVE_EXTENSION:()=>rRe,DOCUMENT:()=>_Ie,ENUM:()=>MIe,ENUM_TYPE_DEFINITION:()=>QIe,ENUM_TYPE_EXTENSION:()=>cRe,ENUM_VALUE_DEFINITION:()=>XIe,FIELD:()=>SIe,FIELD_DEFINITION:()=>KIe,FLOAT:()=>CIe,FRAGMENT_ARGUMENT:()=>EIe,FRAGMENT_DEFINITION:()=>IIe,FRAGMENT_SPREAD:()=>TIe,INLINE_FRAGMENT:()=>AIe,INPUT_OBJECT_TYPE_DEFINITION:()=>eRe,INPUT_OBJECT_TYPE_EXTENSION:()=>lRe,INPUT_VALUE_DEFINITION:()=>JIe,INT:()=>PIe,INTERFACE_TYPE_DEFINITION:()=>ZIe,INTERFACE_TYPE_EXTENSION:()=>sRe,LIST:()=>LIe,LIST_TYPE:()=>GIe,MEMBER_COORDINATE:()=>dRe,NAME:()=>vIe,NAMED_TYPE:()=>zIe,NON_NULL_TYPE:()=>BIe,NULL:()=>DIe,OBJECT:()=>FIe,OBJECT_FIELD:()=>UIe,OBJECT_TYPE_DEFINITION:()=>HIe,OBJECT_TYPE_EXTENSION:()=>oRe,OPERATION_DEFINITION:()=>wIe,OPERATION_TYPE_DEFINITION:()=>qIe,SCALAR_TYPE_DEFINITION:()=>WIe,SCALAR_TYPE_EXTENSION:()=>iRe,SCHEMA_DEFINITION:()=>VIe,SCHEMA_EXTENSION:()=>nRe,SELECTION_SET:()=>$Ie,STRING:()=>NIe,TYPE_COORDINATE:()=>uRe,UNION_TYPE_DEFINITION:()=>YIe,UNION_TYPE_EXTENSION:()=>aRe,VARIABLE:()=>RIe,VARIABLE_DEFINITION:()=>kIe});var vIe="Name",_Ie="Document",wIe="OperationDefinition",kIe="VariableDefinition",$Ie="SelectionSet",SIe="Field",xIe="Argument",EIe="FragmentArgument",TIe="FragmentSpread",AIe="InlineFragment",IIe="FragmentDefinition",RIe="Variable",PIe="IntValue",CIe="FloatValue",NIe="StringValue",OIe="BooleanValue",DIe="NullValue",MIe="EnumValue",LIe="ListValue",FIe="ObjectValue",UIe="ObjectField",jIe="Directive",zIe="NamedType",GIe="ListType",BIe="NonNullType",VIe="SchemaDefinition",qIe="OperationTypeDefinition",WIe="ScalarTypeDefinition",HIe="ObjectTypeDefinition",KIe="FieldDefinition",JIe="InputValueDefinition",ZIe="InterfaceTypeDefinition",YIe="UnionTypeDefinition",QIe="EnumTypeDefinition",XIe="EnumValueDefinition",eRe="InputObjectTypeDefinition",tRe="DirectiveDefinition",nRe="SchemaExtension",rRe="DirectiveExtension",iRe="ScalarTypeExtension",oRe="ObjectTypeExtension",sRe="InterfaceTypeExtension",aRe="UnionTypeExtension",cRe="EnumTypeExtension",lRe="InputObjectTypeExtension",uRe="TypeCoordinate",dRe="MemberCoordinate",pRe="ArgumentCoordinate",fRe="DirectiveCoordinate",mRe="DirectiveArgumentCoordinate";function Pi(e,t){if(!e)throw new Error(t)}var gRe=5;function nr(e,t){let[n,r]=t?[e,t]:[void 0,e];if(r.length===0)return"";let i=" Did you mean ";n!=null&&(i+=n+" ");let o=aY(r.slice(0,gRe).map(s=>`"${s}"`));return i+o+"?"}function OM(e){return e}function ul(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}function ip(e,t){let n=0,r=0;for(;n0);let a=0;do++r,a=a*10+o-DM,o=t.charCodeAt(r);while(F$(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}var DM=48,hRe=57;function F$(e){return!isNaN(e)&&DM<=e&&e<=hRe}function yr(e,t){let n=Object.create(null),r=new MM(e),i=Math.floor(e.length*.4)+1;for(let o of t){let s=r.measure(o,i);s!==void 0&&(n[o]=s)}return Object.keys(n).sort((o,s)=>{let a=n[o]-n[s];return a!==0?a:ip(o,s)})}var MM=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=cY(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let r=t.toLowerCase();if(this._inputLowerCase===r)return 1;let i=cY(r),o=this._inputArray;if(i.lengthn)return;let c=this._rows;for(let u=0;u<=a;u++)c[0][u]=u;for(let u=1;u<=s;u++){let d=c[(u-1)%3],p=c[u%3],f=p[0]=u;for(let m=1;m<=a;m++){let g=i[u-1]===o[m-1]?0:1,h=Math.min(d[m]+1,p[m-1]+1,d[m-1]+g);if(u>1&&m>1&&i[u-1]===o[m-2]&&i[u-2]===o[m-1]){let v=c[(u-2)%3][m-2];h=Math.min(h,v+1)}hn)return}let l=c[s%3][a];return l<=n?l:void 0}};function cY(e){let t=e.length,n=new Array(t);for(let r=0;r=48&&e<=57}function lY(e){return e>=97&&e<=122||e>=65&&e<=90}function Zh(e){return lY(e)||e===95}function j$(e){return lY(e)||dl(e)||e===95}function uY(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;io===0?i:i.slice(t)).slice(n??0,r+1)}function yRe(e){let t=0;for(;t1&&r.slice(1).every(f=>f.length===0||U$(f.charCodeAt(0))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),l=a||c,u=!t?.minimize&&(!i||e.length>70||l||o||s),d="",p=i&&U$(e.charCodeAt(0));return(u&&!p||o)&&(d+=` `),d+=n,(u||l)&&(d+=` -`),'"""'+d+'"""'}function BK(e){return`"${e.replace(V_e,B_e)}"`}var V_e=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function B_e(e){return q_e[e.charCodeAt(0)]}var q_e=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var Od=Object.freeze({});function Md(e,t,n=zg){let i=new Map;for(let m of Object.values($))i.set(m,HP(t,m));let r,o=Array.isArray(e),s=[e],a=-1,c=[],l=e,u,d,p=[],f=[];do{a++;let m=a===s.length,g=m&&c.length!==0;if(m){if(u=f.length===0?void 0:p[p.length-1],l=d,d=f.pop(),g)if(o){l=l.slice();let b=0;for(let[y,w]of c){let k=y-b;w===null?(l.splice(k,1),b++):l[k]=w}}else{l={...l};for(let[b,y]of c)l[b]=y}a=r.index,s=r.keys,c=r.edits,o=r.inArray,r=r.prev}else if(d!=null){if(u=o?a:s[a],l=d[u],l==null)continue;p.push(u)}let h;if(!Array.isArray(l)){if(GP(l)||fi(!1,`Invalid AST Node: ${ce(l)}.`),h=(m?i.get(l.kind)?.leave:i.get(l.kind)?.enter)?.call(t,l,u,d,p,f),h===Od)break;if(h===!1){if(!m){p.pop();continue}}else if(h!==void 0&&(c.push([u,h]),!m))if(GP(h))l=h;else{p.pop();continue}}h===void 0&&g&&c.push([u,l]),m?p.pop():(r={inArray:o,index:a,keys:s,edits:c,prev:r},o=Array.isArray(l),s=o?l:n[l.kind]??[],a=-1,c=[],d!=null&&f.push(d),d=l)}while(r!==void 0);return c.length!==0?c.at(-1)[1]:e}function WP(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let i of Object.values($)){let r=!1,o=new Array(e.length).fill(void 0),s=new Array(e.length).fill(void 0);for(let c=0;ce.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>se(e.definitions,` +`),'"""'+d+'"""'}function pY(e){return`"${e.replace(bRe,vRe)}"`}var bRe=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function vRe(e){return _Re[e.charCodeAt(0)]}var _Re=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var op=Object.freeze({});function sp(e,t,n=Jh){let r=new Map;for(let m of Object.values(S))r.set(m,FM(t,m));let i,o=Array.isArray(e),s=[e],a=-1,c=[],l=e,u,d,p=[],f=[];do{a++;let m=a===s.length,g=m&&c.length!==0;if(m){if(u=f.length===0?void 0:p[p.length-1],l=d,d=f.pop(),g)if(o){l=l.slice();let v=0;for(let[b,_]of c){let w=b-v;_===null?(l.splice(w,1),v++):l[w]=_}}else{l={...l};for(let[v,b]of c)l[v]=b}a=i.index,s=i.keys,c=i.edits,o=i.inArray,i=i.prev}else if(d!=null){if(u=o?a:s[a],l=d[u],l==null)continue;p.push(u)}let h;if(!Array.isArray(l)){if(NM(l)||Pi(!1,`Invalid AST Node: ${fe(l)}.`),h=(m?r.get(l.kind)?.leave:r.get(l.kind)?.enter)?.call(t,l,u,d,p,f),h===op)break;if(h===!1){if(!m){p.pop();continue}}else if(h!==void 0&&(c.push([u,h]),!m))if(NM(h))l=h;else{p.pop();continue}}h===void 0&&g&&c.push([u,l]),m?p.pop():(i={inArray:o,index:a,keys:s,edits:c,prev:i},o=Array.isArray(l),s=o?l:n[l.kind]??[],a=-1,c=[],d!=null&&f.push(d),d=l)}while(i!==void 0);return c.length!==0?c.at(-1)[1]:e}function LM(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(S)){let i=!1,o=new Array(e.length).fill(void 0),s=new Array(e.length).fill(void 0);for(let c=0;ce.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>de(e.definitions,` -`)},OperationDefinition:{leave(e){let t=KP(e.variableDefinitions)?Pe(`( -`,se(e.variableDefinitions,` +`)},OperationDefinition:{leave(e){let t=UM(e.variableDefinitions)?Le(`( +`,de(e.variableDefinitions,` `),` -)`):Pe("(",se(e.variableDefinitions,", "),")"),n=Pe("",e.description,` -`)+se([e.operation,se([e.name,t]),se(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i,description:r})=>Pe("",r,` -`)+e+": "+t+Pe(" = ",n)+Pe(" ",se(i," "))},SelectionSet:{leave:({selections:e})=>mi(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){let o=se([Pe("",e,": "),t],"");return se([qK(o,n),Pe(" ",se(i," ")),Pe(" ",r)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>{let i="..."+e;return qK(i,t)+Pe(" ",se(n," "))}},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>se(["...",Pe("on ",e),se(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r,description:o})=>Pe("",o,` -`)+`fragment ${e}${Pe("(",se(n,", "),")")} on ${t} ${Pe("",se(i," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t===!0?VK(e):BK(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{let t="["+se(e,", ")+"]";return t.length>JP?`[ -`+Vg(se(e,` +)`):Le("(",de(e.variableDefinitions,", "),")"),n=Le("",e.description,` +`)+de([e.operation,de([e.name,t]),de(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>Le("",i,` +`)+e+": "+t+Le(" = ",n)+Le(" ",de(r," "))},SelectionSet:{leave:({selections:e})=>Ci(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let o=de([Le("",e,": "),t],"");return de([fY(o,n),Le(" ",de(r," ")),Le(" ",i)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>{let r="..."+e;return fY(r,t)+Le(" ",de(n," "))}},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>de(["...",Le("on ",e),de(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:o})=>Le("",o,` +`)+`fragment ${e}${Le("(",de(n,", "),")")} on ${t} ${Le("",de(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t===!0?dY(e):pY(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{let t="["+de(e,", ")+"]";return t.length>jM?`[ +`+Yh(de(e,` `))+` -]`:t}},ObjectValue:{leave:({fields:e})=>{let t="{ "+se(e,", ")+" }";return t.length>JP?mi(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Pe("(",se(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Pe("",e,` -`)+se(["schema",se(t," "),mi(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Pe("",e,` -`)+se(["scalar",t,se(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>Pe("",e,` -`)+se(["type",t,Pe("implements ",se(n," & ")),se(i," "),mi(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:r})=>Pe("",e,` -`)+t+(KP(n)?Pe(`( -`,Vg(se(n,` +]`:t}},ObjectValue:{leave:({fields:e})=>{let t="{ "+de(e,", ")+" }";return t.length>jM?Ci(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Le("(",de(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Le("",e,` +`)+de(["schema",de(t," "),Ci(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Le("",e,` +`)+de(["scalar",t,de(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Le("",e,` +`)+de(["type",t,Le("implements ",de(n," & ")),de(r," "),Ci(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Le("",e,` +`)+t+(UM(n)?Le(`( +`,Yh(de(n,` `)),` -)`):Pe("(",se(n,", "),")"))+": "+i+Pe(" ",se(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:i,directives:r})=>Pe("",e,` -`)+se([t+": "+n,Pe("= ",i),se(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>Pe("",e,` -`)+se(["interface",t,Pe("implements ",se(n," & ")),se(i," "),mi(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:i})=>Pe("",e,` -`)+se(["union",t,se(n," "),Pe("= ",se(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:i})=>Pe("",e,` -`)+se(["enum",t,se(n," "),mi(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Pe("",e,` -`)+se([t,se(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:i})=>Pe("",e,` -`)+se(["input",t,se(n," "),mi(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:i,repeatable:r,locations:o})=>Pe("",e,` -`)+"directive @"+t+(KP(n)?Pe(`( -`,Vg(se(n,` +)`):Le("(",de(n,", "),")"))+": "+r+Le(" ",de(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Le("",e,` +`)+de([t+": "+n,Le("= ",r),de(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Le("",e,` +`)+de(["interface",t,Le("implements ",de(n," & ")),de(r," "),Ci(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Le("",e,` +`)+de(["union",t,de(n," "),Le("= ",de(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Le("",e,` +`)+de(["enum",t,de(n," "),Ci(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Le("",e,` +`)+de([t,de(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Le("",e,` +`)+de(["input",t,de(n," "),Ci(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:o})=>Le("",e,` +`)+"directive @"+t+(UM(n)?Le(`( +`,Yh(de(n,` `)),` -)`):Pe("(",se(n,", "),")"))+Pe(" ",se(i," "))+(r?" repeatable":"")+" on "+se(o," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>se(["extend schema",se(e," "),mi(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>se(["extend scalar",e,se(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>se(["extend type",e,Pe("implements ",se(t," & ")),se(n," "),mi(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>se(["extend interface",e,Pe("implements ",se(t," & ")),se(n," "),mi(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>se(["extend union",e,se(t," "),Pe("= ",se(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>se(["extend enum",e,se(t," "),mi(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>se(["extend input",e,se(t," "),mi(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>se(["extend directive @"+e,se(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>se([e,Pe(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>se([e,Pe(".",t),Pe("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>se(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>se(["@",e,Pe("(",t,":)")])}};function se(e,t=""){return e?.filter(n=>n!==void 0&&n!=="").join(t)??""}function mi(e){return Pe(`{ -`,Vg(se(e,` +)`):Le("(",de(n,", "),")"))+Le(" ",de(r," "))+(i?" repeatable":"")+" on "+de(o," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>de(["extend schema",de(e," "),Ci(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>de(["extend scalar",e,de(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>de(["extend type",e,Le("implements ",de(t," & ")),de(n," "),Ci(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>de(["extend interface",e,Le("implements ",de(t," & ")),de(n," "),Ci(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>de(["extend union",e,de(t," "),Le("= ",de(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>de(["extend enum",e,de(t," "),Ci(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>de(["extend input",e,de(t," "),Ci(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>de(["extend directive @"+e,de(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>de([e,Le(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>de([e,Le(".",t),Le("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>de(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>de(["@",e,Le("(",t,":)")])}};function de(e,t=""){return e?.filter(n=>n!==void 0&&n!=="").join(t)??""}function Ci(e){return Le(`{ +`,Yh(de(e,` `)),` -}`)}function Pe(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function Vg(e){return Pe(" ",e.replaceAll(` +}`)}function Le(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function Yh(e){return Le(" ",e.replaceAll(` `,` - `))}function KP(e){return e?.some(t=>t.includes(` -`))??!1}function qK(e,t){let n=e+Pe("(",se(t,", "),")");return n.length>JP&&(n=e+Pe(`( -`,Vg(se(t,` + `))}function UM(e){return e?.some(t=>t.includes(` +`))??!1}function fY(e,t){let n=e+Le("(",de(t,", "),")");return n.length>jM&&(n=e+Le(`( +`,Yh(de(t,` `)),` -)`)),n}function Bg(e,t){switch(e.kind){case $.NULL:return null;case $.INT:return parseInt(e.value,10);case $.FLOAT:return parseFloat(e.value);case $.STRING:case $.ENUM:case $.BOOLEAN:return e.value;case $.LIST:return e.values.map(n=>Bg(n,t));case $.OBJECT:return Gc(e.fields,n=>n.name.value,n=>Bg(n.value,t));case $.VARIABLE:return t?.[e.name.value]}}function Pr(e){if(e.length===0)throw new O("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(Bg(n,i))),this.coerceOutputValue=t.coerceOutputValue??this.serialize,this.coerceInputValue=t.coerceInputValue??this.parseValue,this.coerceInputLiteral=t.coerceInputLiteral,this.valueToLiteral=t.valueToLiteral,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||fi(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),t.coerceInputLiteral&&(typeof t.coerceInputValue=="function"&&typeof t.coerceInputLiteral=="function"||fi(!1,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},Yn=class{constructor(t){this.__kind=YP,this.__kind=YP,this.name=Pr(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._fields=tJ.bind(void 0,this,t.fields),this._interfaces=eJ.bind(void 0,t.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ga(this.getFields(),t=>t.toConfig()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function eJ(e){return u$(e??[])}function tJ(e,t){let n=Hg(t);return ga(n,(i,r)=>new Bc(e,r,i))}var Bc=class{constructor(t,n,i){this.__kind=H_e,this.parentType=t,this.name=Pr(n),this.description=i.description,this.type=i.type;let r=i.args;this.args=r?Object.entries(r).map(([o,s])=>new Ld(this,o,s)):[],this.resolve=i.resolve,this.subscribe=i.subscribe,this.deprecationReason=i.deprecationReason,this.extensions=ur(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:Gc(this.args,t=>t.name,t=>t.toConfig()),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}},Ld=class{constructor(t,n,i){this.__kind=HK,this.parent=t,this.name=Pr(n),this.description=i.description,this.type=i.type,this.defaultValue=i.defaultValue,this.default=i.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=i.deprecationReason,this.extensions=ur(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}};function ha(e){return _e(e.type)&&e.default===void 0&&e.defaultValue===void 0}var ns=class{constructor(t){this.__kind=KK,this.name=Pr(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._fields=tJ.bind(void 0,this,t.fields),this._interfaces=eJ.bind(void 0,t.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ga(this.getFields(),t=>t.toConfig()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},rs=class{constructor(t){this.__kind=JK,this.name=Pr(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._types=Z_e.bind(void 0,t.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function Z_e(e){return u$(e)}var gi=class{constructor(t){this.__kind=ZK,this.name=Pr(t.name),this.description=t.description,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._values=Y_e.bind(void 0,this,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=this._values()),this._values}getValue(t){return this._nameLookup??=r$(this.getValues(),n=>n.name),this._nameLookup[t]}serialize(t){return this.coerceOutputValue(t)}coerceOutputValue(t){this._valueLookup??=new Map(this.getValues().map(i=>[i.value,i]));let n=this._valueLookup.get(t);if(n===void 0)throw new O(`Enum "${this.name}" cannot represent value: ${ce(t)}`);return n.name}parseValue(t,n){return this.coerceInputValue(t,n)}coerceInputValue(t,n){if(typeof t!="string"){let r=ce(t);throw new O(`Enum "${this.name}" cannot represent non-string value: ${r}.`+(n?"":a$(this,r)))}let i=this.getValue(t);if(i==null)throw new O(`Value "${t}" does not exist in "${this.name}" enum.`+(n?"":a$(this,t)));return i.value}parseLiteral(t,n,i){return this.coerceInputLiteral(t,i)}coerceInputLiteral(t,n){if(t.kind!==$.ENUM){let r=Ye(t);throw new O(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+(n?"":a$(this,r)),{nodes:t})}let i=this.getValue(t.value);if(i==null){let r=Ye(t);throw new O(`Value "${r}" does not exist in "${this.name}" enum.`+(n?"":a$(this,r)),{nodes:t})}return i.value}valueToLiteral(t){if(typeof t=="string"&&this.getValue(t))return{kind:$.ENUM,value:t}}toConfig(){return{name:this.name,description:this.description,values:Gc(this.getValues(),t=>t.name,t=>t.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function Y_e(e,t){let n=Hg(t);return Object.entries(n).map(([i,r])=>new QP(e,i,r))}function a$(e,t){let n=e.getValues().map(r=>r.name),i=lr(t,n);return Zn("the enum value",i)}var QP=class{constructor(t,n,i){this.__kind=K_e,this.parentEnum=t,this.name=ZP(n),this.description=i.description,this.value=i.value!==void 0?i.value:n,this.deprecationReason=i.deprecationReason,this.extensions=ur(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}},is=class{constructor(t){this.__kind=YK,this.name=Pr(t.name),this.description=t.description,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this.isOneOf=t.isOneOf??!1,this._fields=Q_e.bind(void 0,this,t.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:ga(this.getFields(),t=>t.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function Q_e(e,t){let n=Hg(t);return ga(n,(i,r)=>new XP(e,r,i))}var XP=class{constructor(t,n,i){"resolve"in i&&fi(!1,`${t}.${n} field has a resolve property, but Input Types cannot define resolvers.`),this.__kind=J_e,this.parentType=t,this.name=Pr(n),this.description=i.description,this.type=i.type,this.defaultValue=i.defaultValue,this.default=i.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=i.deprecationReason,this.extensions=ur(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}};function qi(e){return _e(e.type)&&e.defaultValue===void 0&&e.default===void 0}function qc(e,t,n){return t===n?!0:_e(n)?_e(t)?qc(e,t.ofType,n.ofType):!1:_e(t)?qc(e,t.ofType,n):Ke(n)?Ke(t)?qc(e,t.ofType,n.ofType):!1:Ke(t)?!1:Kr(n)&&(Be(t)||at(t))&&e.isSubType(n,t)}function d$(e,t,n){return t===n?!0:Kr(t)?Kr(n)?e.getPossibleTypes(t).some(i=>e.isSubType(n,i)):e.isSubType(t,n):Kr(n)?e.isSubType(n,t):!1}function Wc(e,t,n){return{prev:e,key:t,typename:n}}function Kg(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function ss(e,t){if(_e(t))return e==null?void 0:ss(e,t.ofType);if(e==null)return{kind:$.NULL};if(Ke(t)){if(!ts(e))return ss(e,t.ofType);let i=[];for(let r of e){let o=ss(r,t.ofType);if(!o)return;i.push(o)}return{kind:$.LIST,values:i}}if(He(t)){if(!Kn(e))return;let i=[],r=t.getFields();if(Object.keys(e).some(s=>e[s]!==void 0&&!Object.hasOwn(r,s)))return;for(let s of Object.values(t.getFields()))if(e[s.name]===void 0){if(qi(s))return}else{let c=ss(e[s.name],s.type);if(!c)return;i.push({kind:$.OBJECT_FIELD,name:{kind:$.NAME,value:s.name},value:c})}return{kind:$.OBJECT,fields:i}}let n=wo(t);if(n.valueToLiteral)try{return n.valueToLiteral(e)}catch{return}return Hc(e)}function Hc(e){if(e==null)return{kind:$.NULL};switch(typeof e){case"boolean":return{kind:$.BOOLEAN,value:e};case"string":return{kind:$.STRING,value:e,block:!1};case"bigint":return{kind:$.INT,value:e.toString()};case"number":{if(!Number.isFinite(e))return{kind:$.NULL};let t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:$.INT,value:t}:{kind:$.FLOAT,value:t}}case"object":{if(ts(e))return{kind:$.LIST,values:Array.from(e,Hc)};let t=e,n=[];for(let i of Object.keys(t)){let r=t[i];r!==void 0&&n.push({kind:$.OBJECT_FIELD,name:{kind:$.NAME,value:i},value:Hc(r)})}return{kind:$.OBJECT,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${ce(e)}.`)}function ya(e,t,n){switch(e.kind){case $.VARIABLE:{let i=e.name.value,r=n?.sources[i];if(r){let s=r.value;if(s===void 0){let a=r.signature.default;return a!==void 0?a.literal:{kind:$.NULL}}return ya(s,t,r.fragmentVariableValues)}let o=t?.sources[i];if(o==null)return{kind:$.NULL};if(o.value===void 0){let s=o.signature.default;if(s!==void 0)return s.literal}return ss(o.value,o.signature.type)}case $.OBJECT:{let i=[];for(let r of e.fields){if(r.value.kind===$.VARIABLE){let s=n?.sources[r.value.name.value]??t?.sources[r.value.name.value];if(s?.value===void 0&&s?.signature.default===void 0)continue}let o=ya(r.value,t,n);i.push({...r,value:o})}return{...e,fields:i}}case $.LIST:{let i=[];for(let r of e.values){let o=ya(r,t,n);i.push(o)}return{...e,values:i}}default:return e}}function f$(e,t,n,i){return Jg(e,t,n,i,void 0)}function Jg(e,t,n,i,r){if(_e(t)){if(e===void 0){ba(n,`Expected a value of non-null type "${t}" to be provided.`,r);return}if(e===null){ba(n,`Expected value of non-null type "${t}" not to be null.`,r);return}return Jg(e,t.ofType,n,i,r)}if(e!=null)if(Ke(t))if(!ts(e))Jg(e,t.ofType,n,i,r);else{let o=0;for(let s of e)Jg(s,t.ofType,n,i,Wc(r,o++,void 0))}else if(He(t)){if(!Kn(e)||Array.isArray(e)){ba(n,`Expected value of type "${t}" to be an object, found: ${ce(e)}.`,r);return}let o=t.getFields();for(let a of Object.values(o)){let c=e[a.name];c===void 0?qi(a)&&ba(n,`Expected value of type "${t}" to include required field "${a.name}", found: ${ce(e)}.`,r):Jg(c,a.type,n,i,Wc(r,a.name,t.name))}let s=[];for(let a of Object.keys(e))if(e[a]!==void 0){if(!Object.hasOwn(o,a)){let c=i?"":Zn(lr(a,Object.keys(o)));ba(n,`Expected value of type "${t}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${ce(e)}.`,r);continue}s.push(a)}if(t.isOneOf){s.length!==1&&ba(n,p$(t),r);let a=s[0];e[a]===null&&ba(n,p$(t),Wc(r,a,t.name))}}else{wo(t);let o,s;try{o=t.coerceInputValue(e,i)}catch(a){if(a instanceof O){n(a,Kg(r));return}s=a}o===void 0&&ba(n,`Expected value of type "${t}"${s!=null?`, but encountered error "${rJ(s)}"; found`:", found"}: ${ce(e)}.`,r,Ug(s))}}function ba(e,t,n,i){e(new O(t,{originalError:i}),Kg(n))}function Kc(e,t,n,i,r,o){return Zg({static:!i&&!r,onError:n,variables:i,fragmentVariableValues:r},e,t,o,void 0)}function Zg(e,t,n,i,r){if(t.kind===$.VARIABLE){if(e.static)return;let s=nJ(e,t)?.coerced[t.name.value];_e(n)&&(s===void 0?Wi(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,r):s===null&&Wi(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,r));return}if(_e(n)){if(t.kind===$.NULL){Wi(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,r);return}return Zg(e,t,n.ofType,i,r)}if(t.kind!==$.NULL)if(Ke(n))if(t.kind!==$.LIST)Zg(e,t,n.ofType,i,r);else{let o=0;for(let s of t.values)Zg(e,s,n.ofType,i,Wc(r,o++,void 0))}else if(He(n)){if(t.kind!==$.OBJECT){Wi(e.onError,`Expected value of type "${n}" to be an object, found: ${Ye(t)}.`,t,r);return}let o=n.getFields(),s=r$(t.fields,l=>l.name.value);for(let l of Object.values(o)){let u=s[l.name];if(u===void 0)qi(l)&&Wi(e.onError,`Expected value of type "${n}" to include required field "${l.name}", found: ${Ye(t)}.`,t,r);else{let d=u.value;if(d.kind===$.VARIABLE&&!e.static){let p=nJ(e,d),f=d.name.value,m=p?.coerced[f];if(n.isOneOf)m===void 0?Wi(e.onError,`Expected variable "$${f}" provided to field "${l.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,r):m===null&&Wi(e.onError,`Expected variable "$${f}" provided to field "${l.name}" for OneOf Input Object type "${n}" not to be null.`,t,r);else if(m===void 0&&!qi(l))continue}Zg(e,d,l.type,i,Wc(r,l.name,n.name))}}let a=t.fields,c=[];for(let l of a){let u=l.name.value;if(Object.hasOwn(o,u))c.push(l);else{let d=i?"":Zn(lr(u,Object.keys(o)));Wi(e.onError,`Expected value of type "${n}" not to include unknown field "${u}"${d?`.${d} Found`:", found"}: ${Ye(t)}.`,l,r)}}if(n.isOneOf){if(c.length!==1){Wi(e.onError,p$(n),t,r);return}if(c[0].value.kind===$.NULL){let d=c[0].name.value;Wi(e.onError,p$(n),t,Wc(r,d,void 0))}}}else{wo(n);let o,s;try{o=n.coerceInputLiteral?n.coerceInputLiteral(ya(t,e.variables,e.fragmentVariableValues),i):n.parseLiteral(t,void 0,i)}catch(a){if(a instanceof O){e.onError(a,Kg(r));return}s=a}o===void 0&&Wi(e.onError,`Expected value of type "${n}"${s!=null?`, but encountered error "${rJ(s)}"; found`:", found"}: ${Ye(t)}.`,t,r,Ug(s))}}function nJ(e,t){let n=t.name.value,{fragmentVariableValues:i,variables:r}=e;return i?.sources[n]?i:r}function Wi(e,t,n,i,r){e(new O(t,{nodes:n,originalError:r}),Kg(i))}function rJ(e){if(Kn(e)){let t=e.message;if(typeof t=="string"&&t!=="")return t}return String(e)}function p$(e){return`Within OneOf Input Object type "${e}", exactly one field must be specified, and the value for that field must be non-null.`}var pe={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",DIRECTIVE_DEFINITION:"DIRECTIVE_DEFINITION"};var Fd=2147483647,Ud=-2147483648,m$=new dr({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){let t=Yg(e);if(typeof t=="number")return iJ(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string")return X_e(t);if(typeof t=="bigint")return oJ(t);throw new O(`Int cannot represent non-integer value: ${ce(t)}`)},coerceInputValue(e){if(typeof e=="number")return iJ(e);if(typeof e=="bigint")return oJ(e);throw new O(`Int cannot represent non-integer value: ${ce(e)}`)},coerceInputLiteral(e){if(e.kind!==$.INT)throw new O(`Int cannot represent non-integer value: ${Ye(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>Fd||t=Ud)return{kind:$.INT,value:String(e)}}}),cJ=new dr({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){let t=Yg(e);if(typeof t=="number")return sJ(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string")return eSe(t);if(typeof t=="bigint")return aJ(t);throw new O(`Float cannot represent non numeric value: ${ce(t)}`)},coerceInputValue(e){if(typeof e=="number")return sJ(e);if(typeof e=="bigint")return aJ(e);throw new O(`Float cannot represent non numeric value: ${ce(e)}`)},coerceInputLiteral(e){if(e.kind!==$.FLOAT&&e.kind!==$.INT)throw new O(`Float cannot represent non numeric value: ${Ye(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){let t=Hc(e);if(t.kind===$.FLOAT||t.kind===$.INT)return t}}),wt=new dr({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){let t=Yg(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number")return tSe(t);if(typeof t=="bigint")return String(t);throw new O(`String cannot represent value: ${ce(e)}`)},coerceInputValue(e){if(typeof e!="string")throw new O(`String cannot represent a non string value: ${ce(e)}`);return e},coerceInputLiteral(e){if(e.kind!==$.STRING)throw new O(`String cannot represent a non string value: ${Ye(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Hc(e);if(t.kind===$.STRING)return t}}),ln=new dr({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){let t=Yg(e);if(typeof t=="boolean")return t;if(typeof t=="number")return nSe(t);if(typeof t=="bigint")return t!==0n;throw new O(`Boolean cannot represent a non boolean value: ${ce(t)}`)},coerceInputValue(e){if(typeof e!="boolean")throw new O(`Boolean cannot represent a non boolean value: ${ce(e)}`);return e},coerceInputLiteral(e){if(e.kind!==$.BOOLEAN)throw new O(`Boolean cannot represent a non boolean value: ${Ye(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Hc(e);if(t.kind===$.BOOLEAN)return t}}),g$=new dr({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){let t=Yg(e);if(typeof t=="string")return t;if(typeof t=="number")return eD(t);if(typeof t=="bigint")return String(t);throw new O(`ID cannot represent value: ${ce(e)}`)},coerceInputValue(e){if(typeof e=="string")return e;if(typeof e=="number")return eD(e);if(typeof e=="bigint")return String(e);throw new O(`ID cannot represent value: ${ce(e)}`)},coerceInputLiteral(e){if(e.kind!==$.STRING&&e.kind!==$.INT)throw new O("ID cannot represent a non-string and non-integer value: "+Ye(e),{nodes:e});return e.value},valueToLiteral(e){if(typeof e=="string")return/^-?(?:0|[1-9][0-9]*)$/.test(e)?{kind:$.INT,value:e}:{kind:$.STRING,value:e,block:!1};if(typeof e=="number")return{kind:$.INT,value:eD(e)};if(typeof e=="bigint")return{kind:$.INT,value:String(e)}}}),va=Object.freeze([wt,m$,cJ,ln,g$]);function tD(e){return va.some(({name:t})=>e.name===t)}function Yg(e){if(Kn(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!Kn(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function iJ(e){if(!Number.isInteger(e))throw new O(`Int cannot represent non-integer value: ${ce(e)}`);if(e>Fd||eFd||tFd||enew Ld(this,i,r))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Gc(this.args,t=>t.name,t=>t.toConfig()),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return"@"+this.name}toJSON(){return this.toString()}},wa=new Tn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[pe.FIELD,pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new ve(ln),description:"Included when true."}}}),ka=new Tn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[pe.FIELD,pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new ve(ln),description:"Skipped when true."}}}),$o=new Tn({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new ve(ln),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:wt,description:"Unique name"}}}),_o=new Tn({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[pe.FIELD],args:{initialCount:{default:{value:0},type:new ve(m$),description:"Number of items to return immediately"},if:{type:new ve(ln),description:"Stream when true or undefined.",default:{value:!0}},label:{type:wt,description:"Unique name"}}}),nD="No longer supported",Jr=new Tn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[pe.FIELD_DEFINITION,pe.ARGUMENT_DEFINITION,pe.INPUT_FIELD_DEFINITION,pe.ENUM_VALUE,pe.DIRECTIVE_DEFINITION],args:{reason:{type:new ve(wt),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:nD}}}}),Qg=new Tn({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[pe.SCALAR],args:{url:{type:new ve(wt),description:"The URL that specifies the behavior of this scalar."}}}),Xg=new Tn({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[pe.INPUT_OBJECT],args:{}}),AYe=new Tn({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[pe.QUERY,pe.MUTATION,pe.SUBSCRIPTION]}),fr=Object.freeze([wa,ka,Jr,Qg,Xg]);function Jc(e){return fr.some(({name:t})=>t===e.name)}function Zc(e,t){if(_e(t)){let n=Zc(e,t.ofType);return n?.kind===$.NULL?null:n}if(e===null)return{kind:$.NULL};if(e===void 0)return null;if(Ke(t)){let n=t.ofType;if(ts(e)){let i=[];for(let r of e){let o=Zc(r,n);o!=null&&i.push(o)}return{kind:$.LIST,values:i}}return Zc(e,n)}if(He(t)){if(!Kn(e))return null;let n=[];for(let i of Object.values(t.getFields())){let r=Zc(e[i.name],i.type);r&&n.push({kind:$.OBJECT_FIELD,name:{kind:$.NAME,value:i.name},value:r})}return{kind:$.OBJECT,fields:n}}if(hi(t)){let n=t.coerceOutputValue(e);if(n==null)return null;if(typeof n=="boolean")return{kind:$.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let i=String(n);return uJ.test(i)?{kind:$.INT,value:i}:{kind:$.FLOAT,value:i}}if(typeof n=="bigint")return{kind:$.INT,value:String(n)};if(typeof n=="string")return Xt(t)?{kind:$.ENUM,value:n}:t===g$&&uJ.test(n)?{kind:$.INT,value:n}:{kind:$.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${ce(n)}.`)}it(!1,"Unexpected input type: "+ce(t))}var uJ=/^-?(?:0|[1-9][0-9]*)$/;function dJ(e){let t=e.type,n=e.default;if(n){let r=n.literal??ss(n.value,t);return r==null&&it(!1,"Invalid default value"),r}let i=e.defaultValue;if(i!==void 0){let r=Zc(i,t);return r==null&&it(!1,"Invalid default value"),r}}var eh=new Yn({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:wt,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new ve(new qt(new ve(yi))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new ve(yi),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:yi,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:yi,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new ve(new qt(new ve(rD))),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>t===!0?e.getDirectives():e.getDirectives().filter(n=>n.deprecationReason==null)}})}),rD=new Yn({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. +)`)),n}function Qh(e,t){switch(e.kind){case S.NULL:return null;case S.INT:return parseInt(e.value,10);case S.FLOAT:return parseFloat(e.value);case S.STRING:case S.ENUM:case S.BOOLEAN:return e.value;case S.LIST:return e.values.map(n=>Qh(n,t));case S.OBJECT:return ul(e.fields,n=>n.name.value,n=>Qh(n.value,t));case S.VARIABLE:return t?.[e.name.value]}}function Gr(e){if(e.length===0)throw new U("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(Qh(n,r))),this.coerceOutputValue=t.coerceOutputValue??this.serialize,this.coerceInputValue=t.coerceInputValue??this.parseValue,this.coerceInputLiteral=t.coerceInputLiteral,this.valueToLiteral=t.valueToLiteral,this.extensions=br(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||Pi(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),t.coerceInputLiteral&&(typeof t.coerceInputValue=="function"&&typeof t.coerceInputLiteral=="function"||Pi(!1,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},rr=class{constructor(t){this.__kind=GM,this.__kind=GM,this.name=Gr(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=br(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._fields=$Y.bind(void 0,this,t.fields),this._interfaces=kY.bind(void 0,t.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ga(this.getFields(),t=>t.toConfig()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function kY(e){return V$(e??[])}function $Y(e,t){let n=ty(t);return Ga(n,(r,i)=>new pl(e,i,r))}var pl=class{constructor(t,n,r){this.__kind=kRe,this.parentType=t,this.name=Gr(n),this.description=r.description,this.type=r.type;let i=r.args;this.args=i?Object.entries(i).map(([o,s])=>new ap(this,o,s)):[],this.resolve=r.resolve,this.subscribe=r.subscribe,this.deprecationReason=r.deprecationReason,this.extensions=br(r.extensions),this.astNode=r.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:ul(this.args,t=>t.name,t=>t.toConfig()),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}},ap=class{constructor(t,n,r){this.__kind=gY,this.parent=t,this.name=Gr(n),this.description=r.description,this.type=r.type,this.defaultValue=r.defaultValue,this.default=r.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=r.deprecationReason,this.extensions=br(r.extensions),this.astNode=r.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}};function Ba(e){return Re(e.type)&&e.default===void 0&&e.defaultValue===void 0}var Ss=class{constructor(t){this.__kind=hY,this.name=Gr(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=br(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._fields=$Y.bind(void 0,this,t.fields),this._interfaces=kY.bind(void 0,t.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ga(this.getFields(),t=>t.toConfig()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},xs=class{constructor(t){this.__kind=yY,this.name=Gr(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=br(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._types=xRe.bind(void 0,t.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function xRe(e){return V$(e)}var Ni=class{constructor(t){this.__kind=bY,this.name=Gr(t.name),this.description=t.description,this.extensions=br(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._values=ERe.bind(void 0,this,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=this._values()),this._values}getValue(t){return this._nameLookup??=L$(this.getValues(),n=>n.name),this._nameLookup[t]}serialize(t){return this.coerceOutputValue(t)}coerceOutputValue(t){this._valueLookup??=new Map(this.getValues().map(r=>[r.value,r]));let n=this._valueLookup.get(t);if(n===void 0)throw new U(`Enum "${this.name}" cannot represent value: ${fe(t)}`);return n.name}parseValue(t,n){return this.coerceInputValue(t,n)}coerceInputValue(t,n){if(typeof t!="string"){let i=fe(t);throw new U(`Enum "${this.name}" cannot represent non-string value: ${i}.`+(n?"":z$(this,i)))}let r=this.getValue(t);if(r==null)throw new U(`Value "${t}" does not exist in "${this.name}" enum.`+(n?"":z$(this,t)));return r.value}parseLiteral(t,n,r){return this.coerceInputLiteral(t,r)}coerceInputLiteral(t,n){if(t.kind!==S.ENUM){let i=Qe(t);throw new U(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+(n?"":z$(this,i)),{nodes:t})}let r=this.getValue(t.value);if(r==null){let i=Qe(t);throw new U(`Value "${i}" does not exist in "${this.name}" enum.`+(n?"":z$(this,i)),{nodes:t})}return r.value}valueToLiteral(t){if(typeof t=="string"&&this.getValue(t))return{kind:S.ENUM,value:t}}toConfig(){return{name:this.name,description:this.description,values:ul(this.getValues(),t=>t.name,t=>t.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function ERe(e,t){let n=ty(t);return Object.entries(n).map(([r,i])=>new BM(e,r,i))}function z$(e,t){let n=e.getValues().map(i=>i.name),r=yr(t,n);return nr("the enum value",r)}var BM=class{constructor(t,n,r){this.__kind=$Re,this.parentEnum=t,this.name=zM(n),this.description=r.description,this.value=r.value!==void 0?r.value:n,this.deprecationReason=r.deprecationReason,this.extensions=br(r.extensions),this.astNode=r.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}},Es=class{constructor(t){this.__kind=vY,this.name=Gr(t.name),this.description=t.description,this.extensions=br(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this.isOneOf=t.isOneOf??!1,this._fields=TRe.bind(void 0,this,t.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:Ga(this.getFields(),t=>t.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function TRe(e,t){let n=ty(t);return Ga(n,(r,i)=>new VM(e,i,r))}var VM=class{constructor(t,n,r){"resolve"in r&&Pi(!1,`${t}.${n} field has a resolve property, but Input Types cannot define resolvers.`),this.__kind=SRe,this.parentType=t,this.name=Gr(n),this.description=r.description,this.type=r.type,this.defaultValue=r.defaultValue,this.default=r.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=r.deprecationReason,this.extensions=br(r.extensions),this.astNode=r.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}};function ao(e){return Re(e.type)&&e.defaultValue===void 0&&e.default===void 0}function fl(e,t,n){return t===n?!0:Re(n)?Re(t)?fl(e,t.ofType,n.ofType):!1:Re(t)?fl(e,t.ofType,n):Ze(n)?Ze(t)?fl(e,t.ofType,n.ofType):!1:Ze(t)?!1:si(n)&&(He(t)||ut(t))&&e.isSubType(n,t)}function q$(e,t,n){return t===n?!0:si(t)?si(n)?e.getPossibleTypes(t).some(r=>e.isSubType(n,r)):e.isSubType(t,n):si(n)?e.isSubType(n,t):!1}function ml(e,t,n){return{prev:e,key:t,typename:n}}function ny(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function As(e,t){if(Re(t))return e==null?void 0:As(e,t.ofType);if(e==null)return{kind:S.NULL};if(Ze(t)){if(!$s(e))return As(e,t.ofType);let r=[];for(let i of e){let o=As(i,t.ofType);if(!o)return;r.push(o)}return{kind:S.LIST,values:r}}if(Je(t)){if(!er(e))return;let r=[],i=t.getFields();if(Object.keys(e).some(s=>e[s]!==void 0&&!Object.hasOwn(i,s)))return;for(let s of Object.values(t.getFields()))if(e[s.name]===void 0){if(ao(s))return}else{let c=As(e[s.name],s.type);if(!c)return;r.push({kind:S.OBJECT_FIELD,name:{kind:S.NAME,value:s.name},value:c})}return{kind:S.OBJECT,fields:r}}let n=Oo(t);if(n.valueToLiteral)try{return n.valueToLiteral(e)}catch{return}return gl(e)}function gl(e){if(e==null)return{kind:S.NULL};switch(typeof e){case"boolean":return{kind:S.BOOLEAN,value:e};case"string":return{kind:S.STRING,value:e,block:!1};case"bigint":return{kind:S.INT,value:e.toString()};case"number":{if(!Number.isFinite(e))return{kind:S.NULL};let t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:S.INT,value:t}:{kind:S.FLOAT,value:t}}case"object":{if($s(e))return{kind:S.LIST,values:Array.from(e,gl)};let t=e,n=[];for(let r of Object.keys(t)){let i=t[r];i!==void 0&&n.push({kind:S.OBJECT_FIELD,name:{kind:S.NAME,value:r},value:gl(i)})}return{kind:S.OBJECT,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${fe(e)}.`)}function Va(e,t,n){switch(e.kind){case S.VARIABLE:{let r=e.name.value,i=n?.sources[r];if(i){let s=i.value;if(s===void 0){let a=i.signature.default;return a!==void 0?a.literal:{kind:S.NULL}}return Va(s,t,i.fragmentVariableValues)}let o=t?.sources[r];if(o==null)return{kind:S.NULL};if(o.value===void 0){let s=o.signature.default;if(s!==void 0)return s.literal}return As(o.value,o.signature.type)}case S.OBJECT:{let r=[];for(let i of e.fields){if(i.value.kind===S.VARIABLE){let s=n?.sources[i.value.name.value]??t?.sources[i.value.name.value];if(s?.value===void 0&&s?.signature.default===void 0)continue}let o=Va(i.value,t,n);r.push({...i,value:o})}return{...e,fields:r}}case S.LIST:{let r=[];for(let i of e.values){let o=Va(i,t,n);r.push(o)}return{...e,values:r}}default:return e}}function H$(e,t,n,r){return ry(e,t,n,r,void 0)}function ry(e,t,n,r,i){if(Re(t)){if(e===void 0){qa(n,`Expected a value of non-null type "${t}" to be provided.`,i);return}if(e===null){qa(n,`Expected value of non-null type "${t}" not to be null.`,i);return}return ry(e,t.ofType,n,r,i)}if(e!=null)if(Ze(t))if(!$s(e))ry(e,t.ofType,n,r,i);else{let o=0;for(let s of e)ry(s,t.ofType,n,r,ml(i,o++,void 0))}else if(Je(t)){if(!er(e)||Array.isArray(e)){qa(n,`Expected value of type "${t}" to be an object, found: ${fe(e)}.`,i);return}let o=t.getFields();for(let a of Object.values(o)){let c=e[a.name];c===void 0?ao(a)&&qa(n,`Expected value of type "${t}" to include required field "${a.name}", found: ${fe(e)}.`,i):ry(c,a.type,n,r,ml(i,a.name,t.name))}let s=[];for(let a of Object.keys(e))if(e[a]!==void 0){if(!Object.hasOwn(o,a)){let c=r?"":nr(yr(a,Object.keys(o)));qa(n,`Expected value of type "${t}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${fe(e)}.`,i);continue}s.push(a)}if(t.isOneOf){s.length!==1&&qa(n,W$(t),i);let a=s[0];e[a]===null&&qa(n,W$(t),ml(i,a,t.name))}}else{Oo(t);let o,s;try{o=t.coerceInputValue(e,r)}catch(a){if(a instanceof U){n(a,ny(i));return}s=a}o===void 0&&qa(n,`Expected value of type "${t}"${s!=null?`, but encountered error "${xY(s)}"; found`:", found"}: ${fe(e)}.`,i,Hh(s))}}function qa(e,t,n,r){e(new U(t,{originalError:r}),ny(n))}function hl(e,t,n,r,i,o){return iy({static:!r&&!i,onError:n,variables:r,fragmentVariableValues:i},e,t,o,void 0)}function iy(e,t,n,r,i){if(t.kind===S.VARIABLE){if(e.static)return;let s=SY(e,t)?.coerced[t.name.value];Re(n)&&(s===void 0?co(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,i):s===null&&co(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,i));return}if(Re(n)){if(t.kind===S.NULL){co(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,i);return}return iy(e,t,n.ofType,r,i)}if(t.kind!==S.NULL)if(Ze(n))if(t.kind!==S.LIST)iy(e,t,n.ofType,r,i);else{let o=0;for(let s of t.values)iy(e,s,n.ofType,r,ml(i,o++,void 0))}else if(Je(n)){if(t.kind!==S.OBJECT){co(e.onError,`Expected value of type "${n}" to be an object, found: ${Qe(t)}.`,t,i);return}let o=n.getFields(),s=L$(t.fields,l=>l.name.value);for(let l of Object.values(o)){let u=s[l.name];if(u===void 0)ao(l)&&co(e.onError,`Expected value of type "${n}" to include required field "${l.name}", found: ${Qe(t)}.`,t,i);else{let d=u.value;if(d.kind===S.VARIABLE&&!e.static){let p=SY(e,d),f=d.name.value,m=p?.coerced[f];if(n.isOneOf)m===void 0?co(e.onError,`Expected variable "$${f}" provided to field "${l.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,i):m===null&&co(e.onError,`Expected variable "$${f}" provided to field "${l.name}" for OneOf Input Object type "${n}" not to be null.`,t,i);else if(m===void 0&&!ao(l))continue}iy(e,d,l.type,r,ml(i,l.name,n.name))}}let a=t.fields,c=[];for(let l of a){let u=l.name.value;if(Object.hasOwn(o,u))c.push(l);else{let d=r?"":nr(yr(u,Object.keys(o)));co(e.onError,`Expected value of type "${n}" not to include unknown field "${u}"${d?`.${d} Found`:", found"}: ${Qe(t)}.`,l,i)}}if(n.isOneOf){if(c.length!==1){co(e.onError,W$(n),t,i);return}if(c[0].value.kind===S.NULL){let d=c[0].name.value;co(e.onError,W$(n),t,ml(i,d,void 0))}}}else{Oo(n);let o,s;try{o=n.coerceInputLiteral?n.coerceInputLiteral(Va(t,e.variables,e.fragmentVariableValues),r):n.parseLiteral(t,void 0,r)}catch(a){if(a instanceof U){e.onError(a,ny(i));return}s=a}o===void 0&&co(e.onError,`Expected value of type "${n}"${s!=null?`, but encountered error "${xY(s)}"; found`:", found"}: ${Qe(t)}.`,t,i,Hh(s))}}function SY(e,t){let n=t.name.value,{fragmentVariableValues:r,variables:i}=e;return r?.sources[n]?r:i}function co(e,t,n,r,i){e(new U(t,{nodes:n,originalError:i}),ny(r))}function xY(e){if(er(e)){let t=e.message;if(typeof t=="string"&&t!=="")return t}return String(e)}function W$(e){return`Within OneOf Input Object type "${e}", exactly one field must be specified, and the value for that field must be non-null.`}var ye={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",DIRECTIVE_DEFINITION:"DIRECTIVE_DEFINITION"};var cp=2147483647,lp=-2147483648,K$=new vr({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){let t=oy(e);if(typeof t=="number")return EY(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string")return ARe(t);if(typeof t=="bigint")return TY(t);throw new U(`Int cannot represent non-integer value: ${fe(t)}`)},coerceInputValue(e){if(typeof e=="number")return EY(e);if(typeof e=="bigint")return TY(e);throw new U(`Int cannot represent non-integer value: ${fe(e)}`)},coerceInputLiteral(e){if(e.kind!==S.INT)throw new U(`Int cannot represent non-integer value: ${Qe(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>cp||t=lp)return{kind:S.INT,value:String(e)}}}),RY=new vr({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){let t=oy(e);if(typeof t=="number")return AY(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string")return IRe(t);if(typeof t=="bigint")return IY(t);throw new U(`Float cannot represent non numeric value: ${fe(t)}`)},coerceInputValue(e){if(typeof e=="number")return AY(e);if(typeof e=="bigint")return IY(e);throw new U(`Float cannot represent non numeric value: ${fe(e)}`)},coerceInputLiteral(e){if(e.kind!==S.FLOAT&&e.kind!==S.INT)throw new U(`Float cannot represent non numeric value: ${Qe(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){let t=gl(e);if(t.kind===S.FLOAT||t.kind===S.INT)return t}}),It=new vr({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){let t=oy(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number")return RRe(t);if(typeof t=="bigint")return String(t);throw new U(`String cannot represent value: ${fe(e)}`)},coerceInputValue(e){if(typeof e!="string")throw new U(`String cannot represent a non string value: ${fe(e)}`);return e},coerceInputLiteral(e){if(e.kind!==S.STRING)throw new U(`String cannot represent a non string value: ${Qe(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=gl(e);if(t.kind===S.STRING)return t}}),mn=new vr({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){let t=oy(e);if(typeof t=="boolean")return t;if(typeof t=="number")return PRe(t);if(typeof t=="bigint")return t!==0n;throw new U(`Boolean cannot represent a non boolean value: ${fe(t)}`)},coerceInputValue(e){if(typeof e!="boolean")throw new U(`Boolean cannot represent a non boolean value: ${fe(e)}`);return e},coerceInputLiteral(e){if(e.kind!==S.BOOLEAN)throw new U(`Boolean cannot represent a non boolean value: ${Qe(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=gl(e);if(t.kind===S.BOOLEAN)return t}}),J$=new vr({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){let t=oy(e);if(typeof t=="string")return t;if(typeof t=="number")return qM(t);if(typeof t=="bigint")return String(t);throw new U(`ID cannot represent value: ${fe(e)}`)},coerceInputValue(e){if(typeof e=="string")return e;if(typeof e=="number")return qM(e);if(typeof e=="bigint")return String(e);throw new U(`ID cannot represent value: ${fe(e)}`)},coerceInputLiteral(e){if(e.kind!==S.STRING&&e.kind!==S.INT)throw new U("ID cannot represent a non-string and non-integer value: "+Qe(e),{nodes:e});return e.value},valueToLiteral(e){if(typeof e=="string")return/^-?(?:0|[1-9][0-9]*)$/.test(e)?{kind:S.INT,value:e}:{kind:S.STRING,value:e,block:!1};if(typeof e=="number")return{kind:S.INT,value:qM(e)};if(typeof e=="bigint")return{kind:S.INT,value:String(e)}}}),Wa=Object.freeze([It,K$,RY,mn,J$]);function WM(e){return Wa.some(({name:t})=>e.name===t)}function oy(e){if(er(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!er(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function EY(e){if(!Number.isInteger(e))throw new U(`Int cannot represent non-integer value: ${fe(e)}`);if(e>cp||ecp||tcp||enew ap(this,r,i))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:ul(this.args,t=>t.name,t=>t.toConfig()),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return"@"+this.name}toJSON(){return this.toString()}},Ha=new Pn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[ye.FIELD,ye.FRAGMENT_SPREAD,ye.INLINE_FRAGMENT],args:{if:{type:new xe(mn),description:"Included when true."}}}),Ka=new Pn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[ye.FIELD,ye.FRAGMENT_SPREAD,ye.INLINE_FRAGMENT],args:{if:{type:new xe(mn),description:"Skipped when true."}}}),Mo=new Pn({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[ye.FRAGMENT_SPREAD,ye.INLINE_FRAGMENT],args:{if:{type:new xe(mn),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:It,description:"Unique name"}}}),Lo=new Pn({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[ye.FIELD],args:{initialCount:{default:{value:0},type:new xe(K$),description:"Number of items to return immediately"},if:{type:new xe(mn),description:"Stream when true or undefined.",default:{value:!0}},label:{type:It,description:"Unique name"}}}),HM="No longer supported",ai=new Pn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[ye.FIELD_DEFINITION,ye.ARGUMENT_DEFINITION,ye.INPUT_FIELD_DEFINITION,ye.ENUM_VALUE,ye.DIRECTIVE_DEFINITION],args:{reason:{type:new xe(It),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:HM}}}}),sy=new Pn({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[ye.SCALAR],args:{url:{type:new xe(It),description:"The URL that specifies the behavior of this scalar."}}}),ay=new Pn({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[ye.INPUT_OBJECT],args:{}}),Qnt=new Pn({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[ye.QUERY,ye.MUTATION,ye.SUBSCRIPTION]}),wr=Object.freeze([Ha,Ka,ai,sy,ay]);function yl(e){return wr.some(({name:t})=>t===e.name)}function bl(e,t){if(Re(t)){let n=bl(e,t.ofType);return n?.kind===S.NULL?null:n}if(e===null)return{kind:S.NULL};if(e===void 0)return null;if(Ze(t)){let n=t.ofType;if($s(e)){let r=[];for(let i of e){let o=bl(i,n);o!=null&&r.push(o)}return{kind:S.LIST,values:r}}return bl(e,n)}if(Je(t)){if(!er(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=bl(e[r.name],r.type);i&&n.push({kind:S.OBJECT_FIELD,name:{kind:S.NAME,value:r.name},value:i})}return{kind:S.OBJECT,fields:n}}if(Oi(t)){let n=t.coerceOutputValue(e);if(n==null)return null;if(typeof n=="boolean")return{kind:S.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let r=String(n);return CY.test(r)?{kind:S.INT,value:r}:{kind:S.FLOAT,value:r}}if(typeof n=="bigint")return{kind:S.INT,value:String(n)};if(typeof n=="string")return rn(t)?{kind:S.ENUM,value:n}:t===J$&&CY.test(n)?{kind:S.INT,value:n}:{kind:S.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${fe(n)}.`)}st(!1,"Unexpected input type: "+fe(t))}var CY=/^-?(?:0|[1-9][0-9]*)$/;function NY(e){let t=e.type,n=e.default;if(n){let i=n.literal??As(n.value,t);return i==null&&st(!1,"Invalid default value"),i}let r=e.defaultValue;if(r!==void 0){let i=bl(r,t);return i==null&&st(!1,"Invalid default value"),i}}var cy=new rr({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:It,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new xe(new Zt(new xe(Di))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new xe(Di),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Di,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Di,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new xe(new Zt(new xe(KM))),args:{includeDeprecated:{type:new xe(mn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>t===!0?e.getDirectives():e.getDirectives().filter(n=>n.deprecationReason==null)}})}),KM=new rr({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. -In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},isRepeatable:{type:new ve(ln),resolve:e=>e.isRepeatable},locations:{type:new ve(new qt(new ve(iD))),resolve:e=>e.locations},args:{type:new ve(new qt(new ve(th))),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(n=>n.deprecationReason==null)}},isDeprecated:{type:new ve(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),iD=new gi({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:pe.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:pe.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:pe.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:pe.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:pe.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:pe.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:pe.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:pe.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:pe.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:pe.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:pe.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:pe.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:pe.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:pe.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:pe.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:pe.UNION,description:"Location adjacent to a union definition."},ENUM:{value:pe.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:pe.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:pe.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:pe.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."},DIRECTIVE_DEFINITION:{value:pe.DIRECTIVE_DEFINITION,description:"Location adjacent to a directive definition."}}}),yi=new Yn({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new ve(aD),resolve(e){if(pr(e))return Ln.SCALAR;if(at(e))return Ln.OBJECT;if(Be(e))return Ln.INTERFACE;if(Qt(e))return Ln.UNION;if(Xt(e))return Ln.ENUM;if(He(e))return Ln.INPUT_OBJECT;if(Ke(e))return Ln.LIST;if(_e(e))return Ln.NON_NULL;it(!1,`Unexpected type: "${ce(e)}".`)}},name:{type:wt,resolve:e=>"name"in e?e.name:void 0},description:{type:wt,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:wt,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new qt(new ve(oD)),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(at(e)||Be(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(i=>i.deprecationReason==null)}}},interfaces:{type:new qt(new ve(yi)),resolve(e){if(at(e)||Be(e))return e.getInterfaces()}},possibleTypes:{type:new qt(new ve(yi)),resolve(e,t,n,{schema:i}){if(Kr(e))return i.getPossibleTypes(e)}},enumValues:{type:new qt(new ve(sD)),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Xt(e)){let n=e.getValues();return t===!0?n:n.filter(i=>i.deprecationReason==null)}}},inputFields:{type:new qt(new ve(th)),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(He(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(i=>i.deprecationReason==null)}}},ofType:{type:yi,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:ln,resolve:e=>{if(He(e))return e.isOneOf}}})}),oD=new Yn({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},args:{type:new ve(new qt(new ve(th))),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new ve(yi),resolve:e=>e.type},isDeprecated:{type:new ve(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),th=new Yn({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},type:{type:new ve(yi),resolve:e=>e.type},defaultValue:{type:wt,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let t=dJ(e);return t?Ye(t):null}},isDeprecated:{type:new ve(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),sD=new Yn({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},isDeprecated:{type:new ve(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),Ln={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},aD=new gi({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Ln.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Ln.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Ln.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Ln.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Ln.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Ln.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Ln.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Ln.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),y$=new Bc(void 0,"__schema",{type:new ve(eh),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:i})=>i}),b$=new Bc(void 0,"__type",{type:yi,description:"Request the type information of a single type.",args:{name:{type:new ve(wt)}},resolve:(e,{name:t},n,{schema:i})=>i.getType(t)}),v$=new Bc(void 0,"__typename",{type:new ve(wt),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:i})=>i.name}),$a=Object.freeze([eh,rD,iD,yi,oD,th,sD,aD]);function cD(e){return $a.some(({name:t})=>e.name===t)}var rSe=Symbol("Schema"),nh=class{constructor(t){this.__kind=rSe,this.assumeValid=t.assumeValid??!1,this.__validationErrors=t.assumeValid===!0?[]:void 0,this.description=t.description,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=t.directives??fr;let n=new Set(t.types);if(t.types!=null)for(let i of t.types)n.delete(i),Hi(i,n);this._queryType!=null&&Hi(this._queryType,n),this._mutationType!=null&&Hi(this._mutationType,n),this._subscriptionType!=null&&Hi(this._subscriptionType,n);for(let i of this._directives)if(h$(i))for(let r of i.args)Hi(r.type,n);Hi(eh,n),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(let i of n){if(i==null)continue;let r=i.name;if(this._typeMap[r]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${r}".`);if(this._typeMap[r]=i,Be(i)){for(let o of i.getInterfaces())if(Be(o)){let s=this._implementationsMap[o.name];s??=this._implementationsMap[o.name]={objects:[],interfaces:[]},s.interfaces.push(i)}}else if(at(i)){for(let o of i.getInterfaces())if(Be(o)){let s=this._implementationsMap[o.name];s??=this._implementationsMap[o.name]={objects:[],interfaces:[]},s.objects.push(i)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case Jn.QUERY:return this.getQueryType();case Jn.MUTATION:return this.getMutationType();case Jn.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return Qt(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){return this._implementationsMap[t.name]??{objects:[],interfaces:[]}}isSubType(t,n){let i=this._subTypeMap.get(t);if(i===void 0){if(Qt(t))i=new Set(t.getTypes());else{let r=this.getImplementations(t);i=new Set([...r.objects,...r.interfaces])}this._subTypeMap.set(t,i)}return i.has(n)}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}getField(t,n){switch(n){case y$.name:return this.getQueryType()===t?y$:void 0;case b$.name:return this.getQueryType()===t?b$:void 0;case v$.name:return v$}if("getFields"in t)return t.getFields()[n]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}};function Hi(e,t){let n=ko(e);if(!t.has(n)){if(t.add(n),Qt(n))for(let i of n.getTypes())Hi(i,t);else if(at(n)||Be(n)){for(let i of n.getInterfaces())Hi(i,t);for(let i of Object.values(n.getFields())){Hi(i.type,t);for(let r of i.args)Hi(r.type,t)}}else if(He(n))for(let i of Object.values(n.getFields()))Hi(i.type,t)}return t}function pJ(e,t,n,i){if(e.literal){Kc(e.literal,t,n,void 0,void 0,i);return}f$(e.value,t,n,i)}function Ft(e,t,n){return new O(`Syntax Error: ${n}`,{source:e,positions:[t]})}function iSe(){let e;try{let t=globalThis.process;typeof t?.getBuiltinModule=="function"&&(e=t.getBuiltinModule("node:diagnostics_channel"))}catch{}return e}var Yc=iSe(),lD=Yc?.tracingChannel("graphql:parse"),a9e=Yc?.tracingChannel("graphql:validate"),c9e=Yc?.tracingChannel("graphql:execute"),l9e=Yc?.tracingChannel("graphql:execute:variableCoercion"),u9e=Yc?.tracingChannel("graphql:execute:rootSelectionSet"),d9e=Yc?.tracingChannel("graphql:subscribe"),p9e=Yc?.tracingChannel("graphql:resolve"),oSe=["start","end","asyncStart","asyncEnd","error"];function fJ(e){if(e==null)return!1;let t=e.hasSubscribers;if(t!==void 0)return t;for(let n of oSe)if(e[n].hasSubscribers)return!0;return!1}var B={SOF:"",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",DOT:".",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};var ih=class{constructor(t){let n=new Pd(B.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==B.EOF)do if(t.next)t=t.next;else{let n=sSe(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===B.COMMENT);return t}};function gJ(e){return e===B.BANG||e===B.DOLLAR||e===B.AMP||e===B.PAREN_L||e===B.PAREN_R||e===B.DOT||e===B.SPREAD||e===B.COLON||e===B.EQUALS||e===B.AT||e===B.BRACKET_L||e===B.BRACKET_R||e===B.BRACE_L||e===B.PIPE||e===B.BRACE_R}function jd(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function k$(e,t){return hJ(e.charCodeAt(t))&&yJ(e.charCodeAt(t+1))}function hJ(e){return e>=55296&&e<=56319}function yJ(e){return e>=56320&&e<=57343}function Qc(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return B.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function un(e,t,n,i,r){let o=e.line,s=1+n-e.lineStart;return new Pd(t,n,i,o,s,r)}function sSe(e,t){let n=e.source.body,i=n.length,r=t;for(;r=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function pSe(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` -`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Ft(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function fSe(e,t){let n=e.source.body,i=n.length,r=e.lineStart,o=t+3,s=o,a="",c=[];for(;o0||fi(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||fi(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function vJ(e){return Nr(e,bJ,zd)}function dD(e,t){return fJ(lD)?lD.traceSync(()=>wJ(e,t),{source:e}):wJ(e,t)}function wJ(e,t){let n=new uD(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}var uD=class{constructor(t,n={}){let{lexer:i,...r}=n;if(i)this._lexer=i;else{let o=vJ(t)?t:new zd(t);this._lexer=new ih(o)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(B.NAME);return this.node(t,{kind:$.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:$.DOCUMENT,definitions:this.many(B.SOF,this.parseDefinition,B.EOF)})}parseDefinition(){if(this.peek(B.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===B.BRACE_L)throw Ft(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===B.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw Ft(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if(n.value==="extend")return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(B.BRACE_L))return this.node(t,{kind:$.OPERATION_DEFINITION,operation:Jn.QUERY,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});let n=this.parseDescription(),i=this.parseOperationType(),r;return this.peek(B.NAME)&&(r=this.parseName()),this.node(t,{kind:$.OPERATION_DEFINITION,operation:i,description:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(B.NAME);switch(t.value){case"query":return Jn.QUERY;case"mutation":return Jn.MUTATION;case"subscription":return Jn.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(B.PAREN_L,this.parseVariableDefinition,B.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:$.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(B.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(B.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(B.DOLLAR),this.node(t,{kind:$.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:$.SELECTION_SET,selections:this.many(B.BRACE_L,this.parseSelection,B.BRACE_R)})}parseSelection(){return this.peek(B.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(B.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:$.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(B.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(B.PAREN_L,n,B.PAREN_R)}parseFragmentArguments(){let t=this.parseFragmentArgument;return this.optionalMany(B.PAREN_L,t,B.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(B.COLON),this.node(n,{kind:$.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){let t=this._lexer.token,n=this.parseName();return this.expectToken(B.COLON),this.node(t,{kind:$.FRAGMENT_ARGUMENT,name:n,value:this.parseValueLiteral(!1)})}parseFragment(){let t=this._lexer.token;this.expectToken(B.SPREAD);let n=this.expectOptionalKeyword("on");if(!n&&this.peek(B.NAME)){let i=this.parseFragmentName();return this.peek(B.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(t,{kind:$.FRAGMENT_SPREAD,name:i,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(t,{kind:$.FRAGMENT_SPREAD,name:i,directives:this.parseDirectives(!1)})}return this.node(t,{kind:$.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.experimentalFragmentArguments===!0?this.node(t,{kind:$.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:$.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case B.BRACKET_L:return this.parseList(t);case B.BRACE_L:return this.parseObject(t);case B.INT:return this.advanceLexer(),this.node(n,{kind:$.INT,value:n.value});case B.FLOAT:return this.advanceLexer(),this.node(n,{kind:$.FLOAT,value:n.value});case B.STRING:case B.BLOCK_STRING:return this.parseStringLiteral();case B.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:$.BOOLEAN,value:!0});case"false":return this.node(n,{kind:$.BOOLEAN,value:!1});case"null":return this.node(n,{kind:$.NULL});default:return this.node(n,{kind:$.ENUM,value:n.value})}case B.DOLLAR:if(t)if(this.expectToken(B.DOLLAR),this._lexer.token.kind===B.NAME){let i=this._lexer.token.value;throw Ft(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:$.STRING,value:t.value,block:t.kind===B.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:$.LIST,values:this.any(B.BRACKET_L,n,B.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:$.OBJECT,fields:this.any(B.BRACE_L,n,B.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(B.COLON),this.node(n,{kind:$.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(B.AT);)n.push(this.parseDirective(t));if(n.length)return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(B.AT),this.node(n,{kind:$.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(B.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(B.BRACKET_R),n=this.node(t,{kind:$.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(B.BANG)?this.node(t,{kind:$.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:$.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(B.STRING)||this.peek(B.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(B.BRACE_L,this.parseOperationTypeDefinition,B.BRACE_R);return this.node(t,{kind:$.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(B.COLON);let i=this.parseNamedType();return this.node(t,{kind:$.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:$.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:$.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(B.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(B.BRACE_L,this.parseFieldDefinition,B.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(B.COLON);let o=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(t,{kind:$.FIELD_DEFINITION,description:n,name:i,arguments:r,type:o,directives:s})}parseArgumentDefs(){return this.optionalMany(B.PAREN_L,this.parseInputValueDef,B.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(B.COLON);let r=this.parseTypeReference(),o;this.expectOptionalToken(B.EQUALS)&&(o=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(t,{kind:$.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:o,directives:s})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:$.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:s})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:$.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(B.EQUALS)?this.delimitedMany(B.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:$.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:o})}parseEnumValuesDefinition(){return this.optionalMany(B.BRACE_L,this.parseEnumValueDefinition,B.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:$.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Ft(this._lexer.source,this._lexer.token.start,`${$$(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:$.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(B.BRACE_L,this.parseInputValueDef,B.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===B.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":return this.parseDirectiveExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(B.BRACE_L,this.parseOperationTypeDefinition,B.BRACE_R);if(n===void 0&&i===void 0)throw this.unexpected();return this.node(t,{kind:$.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i===void 0)throw this.unexpected();return this.node(t,{kind:$.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i===void 0&&r===void 0&&o===void 0)throw this.unexpected();return this.node(t,{kind:$.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i===void 0&&r===void 0&&o===void 0)throw this.unexpected();return this.node(t,{kind:$.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:$.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:$.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:$.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(B.AT);let n=this.parseName(),i=this.parseConstDirectives();if(i===void 0)throw this.unexpected();return this.node(t,{kind:$.DIRECTIVE_EXTENSION,name:n,directives:i})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(B.AT);let i=this.parseName(),r=this.parseArgumentDefs(),o=this.parseConstDirectives(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:$.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,directives:o,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(B.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.hasOwn(pe,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){let t=this._lexer.token,n=this.expectOptionalToken(B.AT),i=this.parseName(),r;!n&&this.expectOptionalToken(B.DOT)&&(r=this.parseName());let o;return(n||r)&&this.expectOptionalToken(B.PAREN_L)&&(o=this.parseName(),this.expectToken(B.COLON),this.expectToken(B.PAREN_R)),n?o?this.node(t,{kind:$.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:o}):this.node(t,{kind:$.DIRECTIVE_COORDINATE,name:i}):r?o?this.node(t,{kind:$.ARGUMENT_COORDINATE,name:i,fieldName:r,argumentName:o}):this.node(t,{kind:$.MEMBER_COORDINATE,name:i,memberName:r}):this.node(t,{kind:$.TYPE_COORDINATE,name:i})}node(t,n){return this._options.noLocation!==!0&&(n.loc=new jg(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw Ft(this._lexer.source,n.start,`Expected ${kJ(t)}, found ${$$(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===B.NAME&&n.value===t)this.advanceLexer();else throw Ft(this._lexer.source,n.start,`Expected "${t}", found ${$$(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===B.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return Ft(this._lexer.source,n.start,`Unexpected ${$$(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==B.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw Ft(this._lexer.source,n.start,`Document contains more than ${t} tokens. Parsing aborted.`)}};function $$(e){let t=e.value;return kJ(e.kind)+(t!=null?` "${t}"`:"")}function kJ(e){return gJ(e)?`"${e}"`:e}function vn(e,t){switch(t.kind){case $.LIST_TYPE:{let n=vn(e,t.type);return n&&new qt(n)}case $.NON_NULL_TYPE:{let n=vn(e,t.type);return n&&new ve(n)}case $.NAMED_TYPE:return e.getType(t.name.value)}}function $J(e){let t=new Map;return{Directive(n){if(n.name.value===$o.name||n.name.value===_o.name){let r=n.arguments?.find(s=>s.name.value==="label")?.value;if(!r||r.kind===$.NULL)return;if(r.kind!==$.STRING){e.reportError(new O(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));return}let o=t.get(r.value);o!=null?e.reportError(new O('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(r.value,n)}}}}function SJ(e){return{OperationDefinition(t){let n=e.getDocument(),i=new Map;for(let s of n.definitions)s.kind===$.FRAGMENT_DEFINITION&&i.set(s.name.value,s);if(t.operation!=="subscription"&&t.operation!=="mutation")return;let o=e.getSchema().getRootType(t.operation);o&&pD({context:e,operationType:t.operation,rootType:o,fragments:i,selectionSet:t.selectionSet,visitedFragments:new Set})}}}function pD({context:e,operationType:t,rootType:n,fragments:i,selectionSet:r,visitedFragments:o}){for(let s of r.selections)if(s.kind==="Field"){let a=s.directives?.find(c=>c.name.value===_o.name);a&&e.reportError(new O(`Stream directive cannot be used on root ${t} type "${n}".`,{nodes:a}))}else if(s.kind==="FragmentSpread"){let a=s.name.value;if(o.has(a))continue;let c=i.get(a);if(c){let l=_J(s);l!==void 0&&e.reportError(new O(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:l})),pD({context:e,operationType:t,rootType:n,fragments:i,selectionSet:c.selectionSet,visitedFragments:o})}o.add(a)}else if(s.kind==="InlineFragment"){let a=_J(s);a!==void 0&&e.reportError(new O(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:a})),pD({context:e,operationType:t,rootType:n,fragments:i,selectionSet:s.selectionSet,visitedFragments:o})}}function _J(e){return e.directives?.find(t=>t.name.value===$o.name)}function xJ(e){let t=e.arguments?.find(n=>n.name.value==="if");if(!t)return!1;if(t.value.kind===$.BOOLEAN){if(t.value.value)return!1}else if(t.value.kind!==$.VARIABLE)return!1;return!0}function gSe(e){let t=e.arguments?.find(n=>n.name.value==="if");return t&&t.value.kind===$.BOOLEAN?!!t.value.value:!0}function hSe(e){let t=e.arguments?.find(n=>n.name.value==="if");return t?t?.value.kind===$.BOOLEAN?!t.value.value:!0:!1}function EJ(e){return{OperationDefinition(t){if(t.operation!==Jn.SUBSCRIPTION)return;let n=e.getDocument(),i=new Map;for(let o of n.definitions)o.kind===$.FRAGMENT_DEFINITION&&i.set(o.name.value,o);let r=new Set;fD({context:e,fragments:i,selectionSet:t.selectionSet,parentNodes:[],visitedFragments:r})}}}function fD({context:e,fragments:t,selectionSet:n,parentNodes:i,visitedFragments:r}){for(let o of n.selections){let s=o.directives?.find(c=>c.name.value===ka.name);if(s&&gSe(s))continue;let a=o.directives?.find(c=>c.name.value===wa.name);if(!(a&&hSe(a))){for(let c of o.directives??[])c.name.value===$o.name?xJ(c)||e.reportError(new O("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:[c,...i]})):c.name.value===_o.name&&(xJ(c)||e.reportError(new O("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:[c,...i]})));if(o.kind==="FragmentSpread"){let c=o.name.value;if(r.has(c))continue;r.add(c);let l=t.get(c);l&&fD({context:e,fragments:t,parentNodes:[o,...i],selectionSet:l?.selectionSet,visitedFragments:r})}else o.selectionSet&&fD({context:e,fragments:t,selectionSet:o.selectionSet,parentNodes:i,visitedFragments:r})}}}function mD(e){return e.kind===$.OPERATION_DEFINITION||e.kind===$.FRAGMENT_DEFINITION}function gD(e){return e.kind===$.SCHEMA_DEFINITION||_a(e)||e.kind===$.DIRECTIVE_DEFINITION}function _a(e){return e.kind===$.SCALAR_TYPE_DEFINITION||e.kind===$.OBJECT_TYPE_DEFINITION||e.kind===$.INTERFACE_TYPE_DEFINITION||e.kind===$.UNION_TYPE_DEFINITION||e.kind===$.ENUM_TYPE_DEFINITION||e.kind===$.INPUT_OBJECT_TYPE_DEFINITION}function hD(e){return e.kind===$.SCHEMA_EXTENSION||e.kind===$.DIRECTIVE_EXTENSION||_$(e)}function _$(e){return e.kind===$.SCALAR_TYPE_EXTENSION||e.kind===$.OBJECT_TYPE_EXTENSION||e.kind===$.INTERFACE_TYPE_EXTENSION||e.kind===$.UNION_TYPE_EXTENSION||e.kind===$.ENUM_TYPE_EXTENSION||e.kind===$.INPUT_OBJECT_TYPE_EXTENSION}function TJ(e){return{Document(t){for(let n of t.definitions)if(!mD(n)){let i=n.kind===$.SCHEMA_DEFINITION||n.kind===$.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new O(`The ${i} definition is not executable.`,{nodes:n}))}return!1}}}function IJ(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let r=e.getSchema(),o=t.name.value,s=Zn("to use an inline fragment on",e.hideSuggestions?[]:ySe(r,n,o));s===""&&(s=Zn(e.hideSuggestions?[]:bSe(n,o))),e.reportError(new O(`Cannot query field "${o}" on type "${n}".`+s,{nodes:t}))}}}}function ySe(e,t,n){if(!Kr(t))return[];let i=new Set,r=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[n]!=null){i.add(o),r[o.name]=1;for(let s of o.getInterfaces())s.getFields()[n]!=null&&(i.add(s),r[s.name]=(r[s.name]??0)+1)}return[...i].sort((o,s)=>{let a=r[s.name]-r[o.name];return a!==0?a:Be(o)&&e.isSubType(o,s)?-1:Be(s)&&e.isSubType(s,o)?1:Dd(o.name,s.name)}).map(o=>o.name)}function bSe(e,t){if(at(e)||Be(e)){let n=Object.keys(e.getFields());return lr(t,n)}return[]}function AJ(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let i=vn(e.getSchema(),n);if(i&&!os(i)){let r=Ye(n);e.reportError(new O(`Fragment cannot condition on non composite type "${r}".`,{nodes:n}))}}},FragmentDefinition(t){let n=vn(e.getSchema(),t.typeCondition);if(n&&!os(n)){let i=Ye(t.typeCondition);e.reportError(new O(`Fragment "${t.name.value}" cannot condition on non composite type "${i}".`,{nodes:t.typeCondition}))}}}}function RJ(e){return{...yD(e),FragmentArgument(t){let n=e.getFragmentSignature();if(n&&!n.variableDefinitions.get(t.name.value)){let r=t.name.value,o=e.hideSuggestions?[]:lr(r,Array.from(n.variableDefinitions.values()).map(s=>s.variable.name.value));e.reportError(new O(`Unknown argument "${r}" on fragment "${n.definition.name.value}".`+Zn(o),{nodes:t}))}},Argument(t){let n=e.getArgument(),i=e.getFieldDef();if(!n&&i){let r=t.name.value,o=e.hideSuggestions?[]:lr(r,i.args.map(s=>s.name));e.reportError(new O(`Unknown argument "${r}" on field "${i}".`+Zn(o),{nodes:t}))}}}}function yD(e){let t=new Map,n=e.getSchema(),i=n?n.getDirectives():fr;for(let o of i)t.set(o.name,o.args.map(s=>s.name));let r=e.getDocument().definitions;for(let o of r)if(o.kind===$.DIRECTIVE_DEFINITION){let s=o.arguments??[];t.set(o.name.value,s.map(a=>a.name.value))}return{Directive(o){let s=o.name.value,a=t.get(s);if(o.arguments!=null&&a!=null)for(let c of o.arguments){let l=c.name.value;if(!a.includes(l)){let u=lr(l,a);e.reportError(new O(`Unknown argument "${l}" on directive "@${s}".`+(e.hideSuggestions?"":Zn(u)),{nodes:c}))}}return!1}}}function bD(e){let t=new Map,n=e.getSchema(),i=n?n.getDirectives():fr;for(let o of i)t.set(o.name,o.locations);let r=e.getDocument().definitions;for(let o of r)o.kind===$.DIRECTIVE_DEFINITION&&t.set(o.name.value,o.locations.map(s=>s.value));return{Directive(o,s,a,c,l){let u=o.name.value,d=t.get(u);if(d==null){e.reportError(new O(`Unknown directive "@${u}".`,{nodes:o}));return}let p=vSe(l);p!=null&&!d.includes(p)&&e.reportError(new O(`Directive "@${u}" may not be used on ${p}.`,{nodes:o}))}}}function vSe(e){let t=e.at(-1);switch(t!=null&&"kind"in t||it(!1),t.kind){case $.OPERATION_DEFINITION:return wSe(t.operation);case $.FIELD:return pe.FIELD;case $.FRAGMENT_SPREAD:return pe.FRAGMENT_SPREAD;case $.INLINE_FRAGMENT:return pe.INLINE_FRAGMENT;case $.FRAGMENT_DEFINITION:return pe.FRAGMENT_DEFINITION;case $.VARIABLE_DEFINITION:{let n=e[e.length-3];return"kind"in n||it(!1),n.kind===$.OPERATION_DEFINITION?pe.VARIABLE_DEFINITION:pe.FRAGMENT_VARIABLE_DEFINITION}case $.SCHEMA_DEFINITION:case $.SCHEMA_EXTENSION:return pe.SCHEMA;case $.SCALAR_TYPE_DEFINITION:case $.SCALAR_TYPE_EXTENSION:return pe.SCALAR;case $.OBJECT_TYPE_DEFINITION:case $.OBJECT_TYPE_EXTENSION:return pe.OBJECT;case $.FIELD_DEFINITION:return pe.FIELD_DEFINITION;case $.INTERFACE_TYPE_DEFINITION:case $.INTERFACE_TYPE_EXTENSION:return pe.INTERFACE;case $.UNION_TYPE_DEFINITION:case $.UNION_TYPE_EXTENSION:return pe.UNION;case $.ENUM_TYPE_DEFINITION:case $.ENUM_TYPE_EXTENSION:return pe.ENUM;case $.ENUM_VALUE_DEFINITION:return pe.ENUM_VALUE;case $.INPUT_OBJECT_TYPE_DEFINITION:case $.INPUT_OBJECT_TYPE_EXTENSION:return pe.INPUT_OBJECT;case $.INPUT_VALUE_DEFINITION:{let n=e.at(-3);return n!=null&&"kind"in n||it(!1),n.kind===$.INPUT_OBJECT_TYPE_DEFINITION||n.kind===$.INPUT_OBJECT_TYPE_EXTENSION?pe.INPUT_FIELD_DEFINITION:pe.ARGUMENT_DEFINITION}case $.DIRECTIVE_DEFINITION:case $.DIRECTIVE_EXTENSION:return pe.DIRECTIVE_DEFINITION;default:it(!1,"Unexpected kind: "+ce(t.kind))}}function wSe(e){switch(e){case Jn.QUERY:return pe.QUERY;case Jn.MUTATION:return pe.MUTATION;case Jn.SUBSCRIPTION:return pe.SUBSCRIPTION}}function NJ(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new O(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function CJ(e){let t=e.getSchema();return{OperationDefinition(n){let i=n.operation;t.getRootType(i)||e.reportError(new O(`The ${i} operation is not supported by the schema.`,{nodes:n}))}}}function vD(e){let{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},i=new Set([...Object.keys(n),...t.filter(_a).map(r=>r.name.value)]);return{NamedType(r,o,s,a,c){let l=r.name.value;if(!i.has(l)){let u=c[2]??s,d=u!=null&&kSe(u);if(d&&PJ.has(l))return;let p=e.hideSuggestions?[]:lr(l,d?[...PJ,...i]:[...i]);e.reportError(new O(`Unknown type "${l}".`+Zn(p),{nodes:r}))}}}}var PJ=new Set([...va,...$a].map(e=>e.name));function kSe(e){return"kind"in e&&(gD(e)||hD(e))}function DJ(e){let t=0;return{Document(n){t=n.definitions.filter(i=>i.kind===$.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new O("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function OJ(e){let t=e.getSchema(),n=t?.astNode??t?.getQueryType()??t?.getMutationType()??t?.getSubscriptionType(),i=0;return{SchemaDefinition(r){if(n){e.reportError(new O("Cannot define a new schema within a schema extension.",{nodes:r}));return}i>0&&e.reportError(new O("Must provide only one schema definition.",{nodes:r})),++i}}}var $Se=3;function MJ(e){function t(n,i=Object.create(null),r=0){if(n.kind===$.FRAGMENT_SPREAD){let o=n.name.value;if(i[o]===!0)return!1;let s=e.getFragment(o);if(!s)return!1;try{return i[o]=!0,t(s,i,r)}finally{i[o]=void 0}}if(n.kind===$.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(r++,r>=$Se))return!0;if("selectionSet"in n&&n.selectionSet){for(let o of n.selectionSet.selections)if(t(o,i,r))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new O("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function LJ(e){let t=new Set,n=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(o){return r(o),!1}};function r(o){if(t.has(o.name.value))return;let s=o.name.value;t.add(s);let a=e.getFragmentSpreads(o.selectionSet);if(a.length!==0){i[s]=n.length;for(let c of a){let l=c.name.value,u=i[l];if(n.push(c),u===void 0){let d=e.getFragment(l);d&&r(d)}else{let d=n.slice(u),p=d.slice(0,-1).map(f=>'"'+f.name.value+'"').join(", ");e.reportError(new O(`Cannot spread fragment "${l}" within itself`+(p!==""?` via ${p}.`:"."),{nodes:d}))}n.pop()}i[s]=void 0}}}function FJ(e){return{OperationDefinition(t){let n=new Set(t.variableDefinitions?.map(r=>r.variable.name.value)),i=e.getRecursiveVariableUsages(t);for(let{node:r,fragmentVariableDefinition:o}of i){if(o)continue;let s=r.name.value;n.has(s)||e.reportError(new O(t.name?`Variable "$${s}" is not defined by operation "${t.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[r,t]}))}}}}function UJ(e){let t=new Set,n=[];return{OperationDefinition(i){for(let r of e.getRecursivelyReferencedFragments(i))t.add(r.name.value);return!1},FragmentDefinition(i){return n.push(i),!1},Document:{leave(){for(let i of n){let r=i.name.value;t.has(r)||e.reportError(new O(`Fragment "${r}" is never used.`,{nodes:i}))}}}}}function jJ(e){return{FragmentDefinition(t){let n=e.getVariableUsages(t),i=new Set(n.map(({node:o})=>o.name.value)),r=t.variableDefinitions??[];for(let o of r){let s=o.variable.name.value;i.has(s)||e.reportError(new O(`Variable "$${s}" is never used in fragment "${t.name.value}".`,{nodes:o}))}},OperationDefinition(t){let n=e.getRecursiveVariableUsages(t),i=new Set;for(let{node:o,fragmentVariableDefinition:s}of n){let a=o.name.value;s||i.add(a)}let r=t.variableDefinitions??[];for(let o of r){let s=o.variable.name.value;i.has(s)||e.reportError(new O(t.name?`Variable "$${s}" is never used in operation "${t.name.value}".`:`Variable "$${s}" is never used.`,{nodes:o}))}}}}function oh(e){switch(e.kind){case $.OBJECT:return{...e,fields:_Se(e.fields)};case $.LIST:return{...e,values:e.values.map(oh)};case $.INT:case $.FLOAT:case $.STRING:case $.BOOLEAN:case $.NULL:case $.ENUM:case $.VARIABLE:return e}}function _Se(e){return e.map(t=>({...t,value:oh(t.value)})).sort((t,n)=>Dd(t.name.value,n.name.value))}function VJ(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+VJ(n)).join(" and "):e}function BJ(e){let t=new T$,n=new $D,i=new Map;return{SelectionSet(r){let o=SSe(e,i,t,n,e.getParentType(),r);for(let[[s,a],c,l]of o){let u=VJ(a);e.reportError(new O(`Fields "${s}" conflict because ${u}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:c.concat(l)}))}}}}function SSe(e,t,n,i,r,o){let s=[],[a,c]=E$(e,t,r,o,void 0);if(ESe(e,s,t,n,i,a),c.length!==0)for(let l=0;l1)for(let c=0;c[o.value,i===void 0?s:sh(s,i)]));return e.every(o=>{let s=o.value;t&&(s=sh(s,t));let a=r.get(o.name.value);return a===void 0?!1:zJ(s)===zJ(a)})}function sh(e,t){switch(e.kind){case $.VARIABLE:return t.get(e.name.value)??e;case $.LIST:return{...e,values:e.values.map(n=>sh(n,t))};case $.OBJECT:return{...e,fields:e.fields.map(n=>({...n,value:sh(n.value,t)}))};default:return e}}function zJ(e){return Ye(oh(e))}function GJ(e){return e?.find(t=>t.name.value==="stream")}function TSe(e,t,n,i){let r=GJ(e),o=GJ(n);if(!(!r&&!o))return r&&o&&SD(r.arguments,t,o.arguments,i)?"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100":"they have overlapping stream directives"}function wD(e,t){return Ke(e)?Ke(t)?wD(e.ofType,t.ofType):!0:Ke(t)?!0:_e(e)?_e(t)?wD(e.ofType,t.ofType):!0:_e(t)?!0:hi(e)||hi(t)?e!==t:!1}function E$(e,t,n,i,r){let o=t.get(i);if(o)return o;let s=new Map,a=new Map;WJ(e,n,i,s,a,r);let c=[s,Array.from(a.values())];return t.set(i,c),c}function kD(e,t,n,i){let r=t.get(n.selectionSet);if(r)return r;let o=vn(e.getSchema(),n.typeCondition);return E$(e,t,o,n.selectionSet,i)}function WJ(e,t,n,i,r,o){for(let s of n.selections)switch(s.kind){case $.FIELD:{let a=s.name.value,c;(at(t)||Be(t))&&(c=t.getFields()[a]);let l=s.alias?s.alias.value:a,u=i.get(l);u==null&&(u=[],i.set(l,u)),u.push([t,s,c]);break}case $.FRAGMENT_SPREAD:{let a=ISe(e,s,o);r.set(a.key,a);break}case $.INLINE_FRAGMENT:{let a=s.typeCondition,c=a?vn(e.getSchema(),a):t;WJ(e,c,s.selectionSet,i,r,o);break}}}function ISe(e,t,n){let i="",r=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(let a of t.arguments)s.set(a.name.value,a.value);if(o?.variableDefinitions){i+=t.name.value+"(";for(let[a,c]of o.variableDefinitions){let l=s.get(a);l&&(i+=a+": "+Ye(oh(l)));let u=s.get(a);u!==void 0?r.set(a,n!==void 0?sh(u,n):u):c.defaultValue&&r.set(a,c.defaultValue)}i+=")"}return{key:i,node:t,varMap:r.size>0?r:void 0}}function ASe(e,t,n,i){if(e.length>0)return[[t,e.map(([r])=>r)],[n,...e.map(([,r])=>r).flat()],[i,...e.map(([,,r])=>r).flat()]]}var T$=class{constructor(){this._data=new Map}has(t,n,i){let r=this._data.get(t)?.get(n);return r===void 0?!1:i?!0:i===r}add(t,n,i){let r=this._data.get(t);r===void 0?this._data.set(t,new Map([[n,i]])):r.set(n,i)}},$D=class{constructor(){this._orderedPairSet=new T$}has(t,n,i){return tr.name.value));for(let r of n.args)!i.has(r.name)&&ha(r)&&e.reportError(new O(`Argument "${r}" of type "${r.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){let n=e.getFragmentSignature();if(!n)return!1;let i=new Set(t.arguments?.map(r=>r.name.value));for(let[r,o]of n.variableDefinitions)if(!i.has(r)&&ZJ(o)){let s=vn(e.getSchema(),o.type),a=ce(s);e.reportError(new O(`Fragment "${t.name.value}" argument "${r}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}function xD(e){let t=new Map,i=e.getSchema()?.getDirectives()??fr;for(let o of i)t.set(o.name,new Map(o.args.filter(ha).map(s=>[s.name,s])));let r=e.getDocument().definitions;for(let o of r)if(o.kind===$.DIRECTIVE_DEFINITION){let s=o.arguments??[];t.set(o.name.value,new Map(s.filter(ZJ).map(a=>[a.name.value,a])))}return{Directive:{leave(o){let s=o.name.value,a=t.get(s);if(a!=null){let c=o.arguments??[],l=new Set(c.map(u=>u.name.value));for(let[u,d]of a.entries())if(!l.has(u)){let p=qg(d.type)?ce(d.type):Ye(d.type);e.reportError(new O(`Argument "@${s}(${u}:)" of type "${p}" is required, but it was not provided.`,{nodes:o}))}}}}}}function ZJ(e){return e.type.kind===$.NON_NULL_TYPE&&e.defaultValue==null}function YJ(e){return{Field(t){let n=e.getType(),i=t.selectionSet;if(n)if(hi(ko(n))){if(i){let r=t.name.value,o=ce(n);e.reportError(new O(`Field "${r}" must not have a selection since type "${o}" has no subfields.`,{nodes:i}))}}else if(i){if(i.selections.length===0){let r=t.name.value,o=ce(n);e.reportError(new O(`Field "${r}" of type "${o}" must have at least one field selected.`,{nodes:t}))}}else{let r=t.name.value,o=ce(n);e.reportError(new O(`Field "${r}" of type "${o}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}}function So(e,t){if(_e(t))return e==null?void 0:So(e,t.ofType);if(e==null)return null;if(Ke(t)){if(!ts(e)){let r=So(e,t.ofType);return r===void 0?void 0:[r]}let i=[];for(let r of e){let o=So(r,t.ofType);if(o===void 0)return;i.push(o)}return i}if(He(t)){if(!Kn(e)||Array.isArray(e))return;let i=Object.create(null),r=t.getFields(),o=0;for(let s of Object.keys(e))if(e[s]!==void 0&&(o++,!Object.hasOwn(r,s)))return;for(let s of Object.values(r)){let a=e[s.name];if(a===void 0){if(qi(s))return;let c=I$(s);c!==void 0&&(i[s.name]=c)}else{let c=So(a,s.type);if(c===void 0)return;i[s.name]=c}}if(t.isOneOf){let s=Object.keys(i);if(o!==1||s.length!==1)return;let a=s[0];if(i[a]===null)return}return i}let n=wo(t);try{return n.coerceInputValue(e)}catch{}}function as(e,t,n,i){if(e.kind===$.VARIABLE){let o=QJ(e,n,i);return o==null&&_e(t)?void 0:o}if(_e(t))return e.kind===$.NULL?void 0:as(e,t.ofType,n,i);if(e.kind===$.NULL)return null;if(Ke(t)){if(e.kind!==$.LIST){let s=as(e,t.ofType,n,i);return s===void 0?void 0:[s]}let o=[];for(let s of e.values){let a=as(s,t.ofType,n,i);if(a===void 0)if(s.kind===$.VARIABLE&&QJ(s,n,i)==null&&!_e(t.ofType))a=null;else return;o.push(a)}return o}if(He(t)){if(e.kind!==$.OBJECT)return;let o=Object.create(null),s=t.getFields();if(e.fields.some(l=>!Object.hasOwn(s,l.name.value)))return;let c=new Map(e.fields.map(l=>[l.name.value,l]));for(let l of Object.values(s)){let u=c.get(l.name);if(!u||u.value.kind===$.VARIABLE&&DSe(u.value,n,i)){if(qi(l))return;let d=I$(l);d!==void 0&&(o[l.name]=d)}else{let d=as(u.value,l.type,n,i);if(d===void 0)return;o[l.name]=d}}if(t.isOneOf){let l=Object.keys(o);if(c.size!==1||l.length!==1)return;for(let[u,d]of c)if(d.value.kind===$.NULL||o[u]===null)return}return o}let r=wo(t);try{return r.coerceInputLiteral?r.coerceInputLiteral(ya(e,n,i)):r.parseLiteral(e,n?.coerced)}catch{}}function QJ(e,t,n){let i=e.name.value;return n?.sources[i]!==void 0?n.coerced[i]:t?.coerced[i]}function DSe(e,t,n){let i=e.name.value;return(n?.sources[i]!==void 0?n.coerced:t?.coerced)?.[i]===void 0}function I$(e){let t=e._memoizedCoercedDefaultValue;if(t!==void 0)return t;let n=e.default;if(n!==void 0)return t=n.literal?as(n.literal,e.type):So(n.value,e.type),t===void 0&&it(!1,`Expected value of type "${e.type}" to be valid, found: ${ce(n.literal??n.value)}.`),e._memoizedCoercedDefaultValue=t,t;let i=e.defaultValue;return i!==void 0&&(e._memoizedCoercedDefaultValue=i),i}function XJ(e,t,n,i,r){try{let o=I$(n);o!==void 0&&(e[t]=o)}catch(o){let s=n.default;if(s===void 0)throw o;let a=!1;pJ(s,n.type,(c,l)=>{a=!0,i(c,l)},r),a||i(Ug(o),[])}}function eZ(e,t,n,i,r){let o=e.arguments??[],s=new Map(o.map(l=>[l.name.value,l])),a=Object.create(null),c=Object.create(null);for(let[l,u]of Object.entries(t)){let d=s.get(l);d!==void 0?a[l]=i==null?{signature:u,value:d.value}:{signature:u,value:d.value,fragmentVariableValues:i}:a[l]={signature:u},tZ(c,e,l,u,d,n,i,r)}return{sources:a,coerced:c}}function A$(e,t,n,i,r){let o=Object.create(null),s=t.arguments??[],a=new Map(s.map(c=>[c.name.value,c]));for(let c of e.args){let l=c.name;tZ(o,t,l,c,a.get(c.name),n,i,r)}return o}function tZ(e,t,n,i,r,o,s,a){let c=i.type,l=(p,f)=>{throw new O(`${ED(i,t)} has invalid default value${zP(f)}: ${p.message}`,{nodes:t})};if(!r){if(ha(i))throw new O(`${ED(i,t)} of required type "${c}" was not provided.`,{nodes:t});XJ(e,n,i,l,a);return}let u=r.value;if(u.kind===$.VARIABLE){let p=u.name.value,f=s?.sources[p]?s:o;if((f==null||!Object.hasOwn(f.coerced,p))&&!ha(i)){XJ(e,n,i,l,a);return}}let d=as(u,c,o,s);d===void 0&&(Kc(u,c,(p,f)=>{throw p.message=`${ED(i,t)} has invalid value${zP(f)}: ${p.message}`,p},o,s,a),it(!1,"Invalid argument")),e[n]=d}function ED(e,t){return c$(e)?`Argument "${e}"`:`Variable "$${e.name}" defined by fragment "${t.name.value}"`}function Gd(e,t,n,i,r){let o=t.directives?.find(s=>s.name.value===e.name);if(o)return A$(e,o,n,i,r)}function iZ(e,t,n,i,r,o,s=!1){let a=new Cr,c=[],l={schema:e,fragments:t,variableValues:n,runtimeType:i,visitedFragmentNames:new Map,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return R$(l,r,a,c),{groupedFieldSet:a,newDeferUsages:c,forbiddenDirectiveInstances:l.forbiddenDirectiveInstances}}function R$(e,t,n,i,r,o){let{schema:s,fragments:a,variableValues:c,runtimeType:l,visitedFragmentNames:u,hideSuggestions:d}=e;for(let p of t.selections)switch(p.kind){case $.FIELD:{if(!TD(e,p,c,o))continue;n.add(OSe(p),{node:p,deferUsage:r,fragmentVariableValues:o});break}case $.INLINE_FRAGMENT:{if(!TD(e,p,c,o)||!rZ(s,p,l))continue;let f=nZ(c,o,p,r);f?(i.push(f),R$(e,p.selectionSet,n,i,f,o)):R$(e,p.selectionSet,n,i,r,o);break}case $.FRAGMENT_SPREAD:{let f=p.name.value;if(!TD(e,p,c,o))continue;let m=a[f];if(m==null||!rZ(s,m.definition,l))continue;let g=nZ(c,o,p,r),h=u.get(f),b;if(g){if(h!==void 0)continue;u.set(f,!0),i.push(g),b=g}else{if(h===!1)continue;u.set(f,!1),b=r}let y=m.variableSignatures,w;y&&(w=eZ(p,y,c,o,d)),R$(e,m.definition.selectionSet,n,i,b,w);break}}}function nZ(e,t,n,i){let r=Gd($o,n,e,t);if(r&&r.if!==!1)return{label:typeof r.label=="string"?r.label:void 0,parentDeferUsage:i}}function TD(e,t,n,i){let r=t.directives?.find(c=>c.name.value===ka.name);if(r&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(r),!1;if((r?A$(ka,r,n,i,e.hideSuggestions):void 0)?.if===!0)return!1;let s=t.directives?.find(c=>c.name.value===wa.name);return s&&e.forbidSkipAndInclude?(e.forbiddenDirectiveInstances.push(s),!1):(s?A$(wa,s,n,i,e.hideSuggestions):void 0)?.if!==!1}function rZ(e,t,n){let i=t.typeCondition;if(!i)return!0;let r=vn(e,i);return r===n?!0:Kr(r)?e.isSubType(r,n):!1}function OSe(e){return e.alias?e.alias.value:e.name.value}function ID(e){return e.map(t=>t.node)}function oZ(e){return{OperationDefinition(t){if(t.operation==="subscription"){let n=e.getSchema(),i=n.getSubscriptionType();if(i){let r=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(let u of s.definitions)u.kind===$.FRAGMENT_DEFINITION&&(a[u.name.value]={definition:u});let{groupedFieldSet:c,forbiddenDirectiveInstances:l}=iZ(n,a,o,i,t.selectionSet,e.hideSuggestions,!0);if(l.length>0){e.reportError(new O(r!=null?`Subscription "${r}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:l}));return}if(c.size>1){let p=[...c.values()].slice(1).flatMap(f=>ID(f));e.reportError(new O(r!=null?`Subscription "${r}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:p}))}for(let u of c.values())ID(u)[0].name.value.startsWith("__")&&e.reportError(new O(r!=null?`Subscription "${r}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:ID(u)}))}}}}}function sZ(e){return{Directive(t){let n=e.getFieldDef(),i=e.getParentType();n&&i&&t.name.value===_o.name&&!(Ke(n.type)||Bi(n.type)&&Ke(n.type.ofType))&&e.reportError(new O(`Directive "@stream" cannot be used on non-list field "${i}.${n.name}".`,{nodes:t}))}}}function Vd(e,t){let n=new Cr;for(let i of e)n.add(t(i),i);return n}function aZ(e){return{DirectiveDefinition(i){let r=i.arguments??[];return n(`@${i.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(i){let r=i.name.value,o=i.fields??[];for(let s of o){let a=s.name.value,c=s.arguments??[];n(`${r}.${a}`,c)}return!1}function n(i,r){let o=Vd(r,s=>s.name.value);for(let[s,a]of o)a.length>1&&e.reportError(new O(`Argument "${i}(${s}:)" can only be defined once.`,{nodes:a.map(c=>c.name)}));return!1}}function AD(e){return{Field:t,Directive:t};function t(n){let i=n.arguments??[],r=Vd(i,o=>o.name.value);for(let[o,s]of r)s.length>1&&e.reportError(new O(`There can be only one argument named "${o}".`,{nodes:s.map(a=>a.name)}))}}function cZ(e){let t=new Map,n=e.getSchema();return{DirectiveDefinition(i){let r=i.name.value;if(n?.getDirective(r)){e.reportError(new O(`Directive "@${r}" already exists in the schema. It cannot be redefined.`,{nodes:i.name}));return}let o=t.get(r);return o?e.reportError(new O(`There can be only one directive named "@${r}".`,{nodes:[o,i.name]})):t.set(r,i.name),!1}}}function RD(e){let t=new Map,n=e.getSchema(),i=n?n.getDirectives():fr;for(let c of i)t.set(c.name,!c.isRepeatable);let r=e.getDocument().definitions;for(let c of r)c.kind===$.DIRECTIVE_DEFINITION&&t.set(c.name.value,!c.repeatable);let o=new Map,s=new Map,a=new Map;return{enter(c){if(!("directives"in c)||!c.directives)return;let l;if(c.kind===$.SCHEMA_DEFINITION||c.kind===$.SCHEMA_EXTENSION)l=o;else if(_a(c)||_$(c)){let u=c.name.value;l=s.get(u),l===void 0&&(l=new Map,s.set(u,l))}else if(c.kind===$.DIRECTIVE_DEFINITION||c.kind===$.DIRECTIVE_EXTENSION){let u=c.name.value;l=a.get(u),l===void 0&&(l=new Map,a.set(u,l))}else l=new Map;for(let u of c.directives){let d=u.name.value;if(t.get(d)===!0){let p=l.get(d);p!=null?e.reportError(new O(`The directive "@${d}" can only be used once at this location.`,{nodes:[p,u]})):l.set(d,u)}}}}}function lZ(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=new Map;return{EnumTypeDefinition:r,EnumTypeExtension:r};function r(o){let s=o.name.value,a=i.get(s);a==null&&(a=new Map,i.set(s,a));let c=o.values??[];for(let l of c){let u=l.name.value,d=n[s];if(Xt(d)&&d.getValue(u)){e.reportError(new O(`Enum value "${s}.${u}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name}));continue}let p=a.get(u);p!=null?e.reportError(new O(`Enum value "${s}.${u}" can only be defined once.`,{nodes:[p,l.name]})):a.set(u,l.name)}return!1}}function uZ(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=new Map;return{InputObjectTypeDefinition:r,InputObjectTypeExtension:r,InterfaceTypeDefinition:r,InterfaceTypeExtension:r,ObjectTypeDefinition:r,ObjectTypeExtension:r};function r(o){let s=o.name.value,a=i.get(s);a==null&&(a=new Map,i.set(s,a));let c=o.fields??[];for(let l of c){let u=l.name.value;if(MSe(n[s],u)){e.reportError(new O(`Field "${s}.${u}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name}));continue}let d=a.get(u);d!=null?e.reportError(new O(`Field "${s}.${u}" can only be defined once.`,{nodes:[d,l.name]})):a.set(u,l.name)}return!1}}function MSe(e,t){return at(e)||Be(e)||He(e)?e.getFields()[t]!=null:!1}function dZ(e){let t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){let i=n.name.value,r=t.get(i);return r!=null?e.reportError(new O(`There can be only one fragment named "${i}".`,{nodes:[r,n.name]})):t.set(i,n.name),!1}}}function ND(e){let t=[],n=new Map;return{ObjectValue:{enter(){t.push(n),n=new Map},leave(){let i=t.pop();i==null&&it(!1),n=i}},ObjectField(i){let r=i.name.value,o=n.get(r);o!=null?e.reportError(new O(`There can be only one input field named "${r}".`,{nodes:[o,i.name]})):n.set(r,i.name)}}}function pZ(e){let t=new Map;return{OperationDefinition(n){let i=n.name;if(i!=null){let r=t.get(i.value);r!=null?e.reportError(new O(`There can be only one operation named "${i.value}".`,{nodes:[r,i]})):t.set(i.value,i)}return!1},FragmentDefinition:()=>!1}}function fZ(e){let t=e.getSchema(),n=new Map,i=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:r,SchemaExtension:r};function r(o){let s=o.operationTypes??[];for(let a of s){let c=a.operation,l=n.get(c);i[c]?e.reportError(new O(`Type for ${c} already defined in the schema. It cannot be redefined.`,{nodes:a})):l?e.reportError(new O(`There can be only one ${c} type in schema.`,{nodes:[l,a]})):n.set(c,a)}return!1}}function mZ(e){let t=new Map,n=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(r){let o=r.name.value;if(n?.getType(o)){e.reportError(new O(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));return}let s=t.get(o);return s!=null?e.reportError(new O(`There can be only one type named "${o}".`,{nodes:[s,r.name]})):t.set(o,r.name),!1}}function gZ(e){return{OperationDefinition(t){let n=t.variableDefinitions??[],i=Vd(n,r=>r.variable.name.value);for(let[r,o]of i)o.length>1&&e.reportError(new O(`There can be only one variable named "$${r}".`,{nodes:o.map(s=>s.variable.name)}))}}}function hZ(e){return{NullValue:t=>Sa(e,t,e.getInputType()),ListValue:t=>Sa(e,t,e.getParentInputType()),ObjectValue:t=>Sa(e,t,e.getInputType()),EnumValue:t=>Sa(e,t,e.getInputType()),IntValue:t=>Sa(e,t,e.getInputType()),FloatValue:t=>Sa(e,t,e.getInputType()),StringValue:t=>Sa(e,t,e.getInputType()),BooleanValue:t=>Sa(e,t,e.getInputType())}}function Sa(e,t,n){return n&&Kc(t,n,i=>{e.reportError(i)},void 0,void 0,e.hideSuggestions),!1}function yZ(e){return{VariableDefinition(t){let n=vn(e.getSchema(),t.type);if(n!==void 0&&!Wg(n)){let i=t.variable.name.value,r=Ye(t.type);e.reportError(new O(`Variable "$${i}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}}function bZ(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){let i=e.getRecursiveVariableUsages(n);for(let{node:r,type:o,parentType:s,defaultValue:a,fragmentVariableDefinition:c}of i){let l=r.name.value,u=c;if(u??=t.get(l),u&&o){let d=e.getSchema(),p=vn(d,u.type);p&&!LSe(d,p,u.defaultValue,o,a)&&e.reportError(new O(`Variable "$${l}" of type "${p}" used in position expecting type "${o}".`,{nodes:[u,r]})),He(s)&&s.isOneOf&&l$(p)&&e.reportError(new O(`Variable "$${l}" is of type "${p}" but must be non-nullable to be used for OneOf Input Object "${s}".`,{nodes:[u,r]}))}}}},VariableDefinition(n){t.set(n.variable.name.value,n)}}}function LSe(e,t,n,i,r){if(_e(i)&&!_e(t)){if(!(n!=null&&n.kind!==$.NULL)&&!(r!==void 0))return!1;let a=i.ofType;return qc(e,t,a)}return qc(e,t,i)}var FSe=Object.freeze([MJ]),USe=Object.freeze([TJ,CJ,pZ,DJ,oZ,vD,AJ,yZ,YJ,IJ,dZ,NJ,UJ,HJ,LJ,gZ,FJ,jJ,bD,RD,SJ,EJ,$J,sZ,RJ,AD,hZ,JJ,bZ,BJ,ND,...FSe]),vZ=Object.freeze([OJ,fZ,mZ,lZ,uZ,aZ,cZ,vD,bD,RD,KJ,yD,AD,ND,xD]);var CD=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let i of this.getDocument().definitions)i.kind===$.FRAGMENT_DEFINITION&&(n[i.name.value]=i);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let i=[t],r;for(;r=i.pop();)for(let o of r.selections)o.kind===$.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&i.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let i=new Set,r=[t.selectionSet],o;for(;o=r.pop();)for(let s of this.getFragmentSpreads(o)){let a=s.name.value;if(!i.has(a)){i.add(a);let c=this.getFragment(a);c&&(n.push(c),r.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}},N$=class extends CD{constructor(t,n,i){super(t,i),this._schema=n}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};var set=ga(zg,e=>e.filter(t=>t!=="description")),aet=new O("Too many validation errors, error limit reached. Validation aborted.");function jSe(e,t,n=vZ){let i=[],r=new N$(e,t,s=>{i.push(s)}),o=n.map(s=>s(r));return Md(e,WP(o)),i}function wZ(e){let t=jSe(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` +In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new xe(It),resolve:e=>e.name},description:{type:It,resolve:e=>e.description},isRepeatable:{type:new xe(mn),resolve:e=>e.isRepeatable},locations:{type:new xe(new Zt(new xe(JM))),resolve:e=>e.locations},args:{type:new xe(new Zt(new xe(ly))),args:{includeDeprecated:{type:new xe(mn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(n=>n.deprecationReason==null)}},isDeprecated:{type:new xe(mn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:It,resolve:e=>e.deprecationReason}})}),JM=new Ni({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:ye.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:ye.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:ye.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:ye.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:ye.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:ye.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:ye.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:ye.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:ye.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:ye.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:ye.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:ye.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:ye.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:ye.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:ye.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:ye.UNION,description:"Location adjacent to a union definition."},ENUM:{value:ye.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:ye.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:ye.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:ye.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."},DIRECTIVE_DEFINITION:{value:ye.DIRECTIVE_DEFINITION,description:"Location adjacent to a directive definition."}}}),Di=new rr({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new xe(QM),resolve(e){if(_r(e))return Gn.SCALAR;if(ut(e))return Gn.OBJECT;if(He(e))return Gn.INTERFACE;if(nn(e))return Gn.UNION;if(rn(e))return Gn.ENUM;if(Je(e))return Gn.INPUT_OBJECT;if(Ze(e))return Gn.LIST;if(Re(e))return Gn.NON_NULL;st(!1,`Unexpected type: "${fe(e)}".`)}},name:{type:It,resolve:e=>"name"in e?e.name:void 0},description:{type:It,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:It,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new Zt(new xe(ZM)),args:{includeDeprecated:{type:new xe(mn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(ut(e)||He(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new Zt(new xe(Di)),resolve(e){if(ut(e)||He(e))return e.getInterfaces()}},possibleTypes:{type:new Zt(new xe(Di)),resolve(e,t,n,{schema:r}){if(si(e))return r.getPossibleTypes(e)}},enumValues:{type:new Zt(new xe(YM)),args:{includeDeprecated:{type:new xe(mn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(rn(e)){let n=e.getValues();return t===!0?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new Zt(new xe(ly)),args:{includeDeprecated:{type:new xe(mn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Je(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:Di,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:mn,resolve:e=>{if(Je(e))return e.isOneOf}}})}),ZM=new rr({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new xe(It),resolve:e=>e.name},description:{type:It,resolve:e=>e.description},args:{type:new xe(new Zt(new xe(ly))),args:{includeDeprecated:{type:new xe(mn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new xe(Di),resolve:e=>e.type},isDeprecated:{type:new xe(mn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:It,resolve:e=>e.deprecationReason}})}),ly=new rr({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new xe(It),resolve:e=>e.name},description:{type:It,resolve:e=>e.description},type:{type:new xe(Di),resolve:e=>e.type},defaultValue:{type:It,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let t=NY(e);return t?Qe(t):null}},isDeprecated:{type:new xe(mn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:It,resolve:e=>e.deprecationReason}})}),YM=new rr({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new xe(It),resolve:e=>e.name},description:{type:It,resolve:e=>e.description},isDeprecated:{type:new xe(mn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:It,resolve:e=>e.deprecationReason}})}),Gn={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},QM=new Ni({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Gn.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Gn.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Gn.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Gn.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Gn.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Gn.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Gn.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Gn.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Y$=new pl(void 0,"__schema",{type:new xe(cy),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:r})=>r}),Q$=new pl(void 0,"__type",{type:Di,description:"Request the type information of a single type.",args:{name:{type:new xe(It)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),X$=new pl(void 0,"__typename",{type:new xe(It),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:r})=>r.name}),Ja=Object.freeze([cy,KM,JM,Di,ZM,ly,YM,QM]);function XM(e){return Ja.some(({name:t})=>e.name===t)}var CRe=Symbol("Schema"),uy=class{constructor(t){this.__kind=CRe,this.assumeValid=t.assumeValid??!1,this.__validationErrors=t.assumeValid===!0?[]:void 0,this.description=t.description,this.extensions=br(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=t.directives??wr;let n=new Set(t.types);if(t.types!=null)for(let r of t.types)n.delete(r),lo(r,n);this._queryType!=null&&lo(this._queryType,n),this._mutationType!=null&&lo(this._mutationType,n),this._subscriptionType!=null&&lo(this._subscriptionType,n);for(let r of this._directives)if(Z$(r))for(let i of r.args)lo(i.type,n);lo(cy,n),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(let r of n){if(r==null)continue;let i=r.name;if(this._typeMap[i]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${i}".`);if(this._typeMap[i]=r,He(r)){for(let o of r.getInterfaces())if(He(o)){let s=this._implementationsMap[o.name];s??=this._implementationsMap[o.name]={objects:[],interfaces:[]},s.interfaces.push(r)}}else if(ut(r)){for(let o of r.getInterfaces())if(He(o)){let s=this._implementationsMap[o.name];s??=this._implementationsMap[o.name]={objects:[],interfaces:[]},s.objects.push(r)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case tr.QUERY:return this.getQueryType();case tr.MUTATION:return this.getMutationType();case tr.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return nn(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){return this._implementationsMap[t.name]??{objects:[],interfaces:[]}}isSubType(t,n){let r=this._subTypeMap.get(t);if(r===void 0){if(nn(t))r=new Set(t.getTypes());else{let i=this.getImplementations(t);r=new Set([...i.objects,...i.interfaces])}this._subTypeMap.set(t,r)}return r.has(n)}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}getField(t,n){switch(n){case Y$.name:return this.getQueryType()===t?Y$:void 0;case Q$.name:return this.getQueryType()===t?Q$:void 0;case X$.name:return X$}if("getFields"in t)return t.getFields()[n]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}};function lo(e,t){let n=Do(e);if(!t.has(n)){if(t.add(n),nn(n))for(let r of n.getTypes())lo(r,t);else if(ut(n)||He(n)){for(let r of n.getInterfaces())lo(r,t);for(let r of Object.values(n.getFields())){lo(r.type,t);for(let i of r.args)lo(i.type,t)}}else if(Je(n))for(let r of Object.values(n.getFields()))lo(r.type,t)}return t}function OY(e,t,n,r){if(e.literal){hl(e.literal,t,n,void 0,void 0,r);return}H$(e.value,t,n,r)}function Vt(e,t,n){return new U(`Syntax Error: ${n}`,{source:e,positions:[t]})}function NRe(){let e;try{let t=globalThis.process;typeof t?.getBuiltinModule=="function"&&(e=t.getBuiltinModule("node:diagnostics_channel"))}catch{}return e}var vl=NRe(),e1=vl?.tracingChannel("graphql:parse"),Rrt=vl?.tracingChannel("graphql:validate"),Prt=vl?.tracingChannel("graphql:execute"),Crt=vl?.tracingChannel("graphql:execute:variableCoercion"),Nrt=vl?.tracingChannel("graphql:execute:rootSelectionSet"),Ort=vl?.tracingChannel("graphql:subscribe"),Drt=vl?.tracingChannel("graphql:resolve"),ORe=["start","end","asyncStart","asyncEnd","error"];function DY(e){if(e==null)return!1;let t=e.hasSubscribers;if(t!==void 0)return t;for(let n of ORe)if(e[n].hasSubscribers)return!0;return!1}var H={SOF:"",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",DOT:".",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};var py=class{constructor(t){let n=new rp(H.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==H.EOF)do if(t.next)t=t.next;else{let n=DRe(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===H.COMMENT);return t}};function LY(e){return e===H.BANG||e===H.DOLLAR||e===H.AMP||e===H.PAREN_L||e===H.PAREN_R||e===H.DOT||e===H.SPREAD||e===H.COLON||e===H.EQUALS||e===H.AT||e===H.BRACKET_L||e===H.BRACKET_R||e===H.BRACE_L||e===H.PIPE||e===H.BRACE_R}function up(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function tS(e,t){return FY(e.charCodeAt(t))&&UY(e.charCodeAt(t+1))}function FY(e){return e>=55296&&e<=56319}function UY(e){return e>=56320&&e<=57343}function _l(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return H.EOF;if(n>=32&&n<=126){let r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function gn(e,t,n,r,i){let o=e.line,s=1+n-e.lineStart;return new rp(t,n,r,o,s,i)}function DRe(e,t){let n=e.source.body,r=n.length,i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function zRe(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` +`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Vt(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function GRe(e,t){let n=e.source.body,r=n.length,i=e.lineStart,o=t+3,s=o,a="",c=[];for(;o0||Pi(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Pi(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function zY(e){return jr(e,jY,dp)}function n1(e,t){return DY(e1)?e1.traceSync(()=>GY(e,t),{source:e}):GY(e,t)}function GY(e,t){let n=new t1(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}var t1=class{constructor(t,n={}){let{lexer:r,...i}=n;if(r)this._lexer=r;else{let o=zY(t)?t:new dp(t);this._lexer=new py(o)}this._options=i,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(H.NAME);return this.node(t,{kind:S.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:S.DOCUMENT,definitions:this.many(H.SOF,this.parseDefinition,H.EOF)})}parseDefinition(){if(this.peek(H.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===H.BRACE_L)throw Vt(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===H.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw Vt(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if(n.value==="extend")return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(H.BRACE_L))return this.node(t,{kind:S.OPERATION_DEFINITION,operation:tr.QUERY,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});let n=this.parseDescription(),r=this.parseOperationType(),i;return this.peek(H.NAME)&&(i=this.parseName()),this.node(t,{kind:S.OPERATION_DEFINITION,operation:r,description:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(H.NAME);switch(t.value){case"query":return tr.QUERY;case"mutation":return tr.MUTATION;case"subscription":return tr.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(H.PAREN_L,this.parseVariableDefinition,H.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:S.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(H.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(H.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(H.DOLLAR),this.node(t,{kind:S.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:S.SELECTION_SET,selections:this.many(H.BRACE_L,this.parseSelection,H.BRACE_R)})}parseSelection(){return this.peek(H.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),r,i;return this.expectOptionalToken(H.COLON)?(r=n,i=this.parseName()):i=n,this.node(t,{kind:S.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(H.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(H.PAREN_L,n,H.PAREN_R)}parseFragmentArguments(){let t=this.parseFragmentArgument;return this.optionalMany(H.PAREN_L,t,H.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,r=this.parseName();return this.expectToken(H.COLON),this.node(n,{kind:S.ARGUMENT,name:r,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){let t=this._lexer.token,n=this.parseName();return this.expectToken(H.COLON),this.node(t,{kind:S.FRAGMENT_ARGUMENT,name:n,value:this.parseValueLiteral(!1)})}parseFragment(){let t=this._lexer.token;this.expectToken(H.SPREAD);let n=this.expectOptionalKeyword("on");if(!n&&this.peek(H.NAME)){let r=this.parseFragmentName();return this.peek(H.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(t,{kind:S.FRAGMENT_SPREAD,name:r,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(t,{kind:S.FRAGMENT_SPREAD,name:r,directives:this.parseDirectives(!1)})}return this.node(t,{kind:S.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.experimentalFragmentArguments===!0?this.node(t,{kind:S.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:S.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case H.BRACKET_L:return this.parseList(t);case H.BRACE_L:return this.parseObject(t);case H.INT:return this.advanceLexer(),this.node(n,{kind:S.INT,value:n.value});case H.FLOAT:return this.advanceLexer(),this.node(n,{kind:S.FLOAT,value:n.value});case H.STRING:case H.BLOCK_STRING:return this.parseStringLiteral();case H.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:S.BOOLEAN,value:!0});case"false":return this.node(n,{kind:S.BOOLEAN,value:!1});case"null":return this.node(n,{kind:S.NULL});default:return this.node(n,{kind:S.ENUM,value:n.value})}case H.DOLLAR:if(t)if(this.expectToken(H.DOLLAR),this._lexer.token.kind===H.NAME){let r=this._lexer.token.value;throw Vt(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:S.STRING,value:t.value,block:t.kind===H.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:S.LIST,values:this.any(H.BRACKET_L,n,H.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:S.OBJECT,fields:this.any(H.BRACE_L,n,H.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,r=this.parseName();return this.expectToken(H.COLON),this.node(n,{kind:S.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(H.AT);)n.push(this.parseDirective(t));if(n.length)return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(H.AT),this.node(n,{kind:S.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(H.BRACKET_L)){let r=this.parseTypeReference();this.expectToken(H.BRACKET_R),n=this.node(t,{kind:S.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(H.BANG)?this.node(t,{kind:S.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:S.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(H.STRING)||this.peek(H.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let r=this.parseConstDirectives(),i=this.many(H.BRACE_L,this.parseOperationTypeDefinition,H.BRACE_R);return this.node(t,{kind:S.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(H.COLON);let r=this.parseNamedType();return this.node(t,{kind:S.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let r=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:S.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let r=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:S.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:o,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(H.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(H.BRACE_L,this.parseFieldDefinition,H.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(H.COLON);let o=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(t,{kind:S.FIELD_DEFINITION,description:n,name:r,arguments:i,type:o,directives:s})}parseArgumentDefs(){return this.optionalMany(H.PAREN_L,this.parseInputValueDef,H.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(H.COLON);let i=this.parseTypeReference(),o;this.expectOptionalToken(H.EQUALS)&&(o=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(t,{kind:S.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:o,directives:s})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let r=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:S.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:o,fields:s})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let r=this.parseName(),i=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:S.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(H.EQUALS)?this.delimitedMany(H.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let r=this.parseName(),i=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:S.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:o})}parseEnumValuesDefinition(){return this.optionalMany(H.BRACE_L,this.parseEnumValueDefinition,H.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:S.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Vt(this._lexer.source,this._lexer.token.start,`${nS(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let r=this.parseName(),i=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:S.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(H.BRACE_L,this.parseInputValueDef,H.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===H.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":return this.parseDirectiveExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),r=this.optionalMany(H.BRACE_L,this.parseOperationTypeDefinition,H.BRACE_R);if(n===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:S.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),r=this.parseConstDirectives();if(r===void 0)throw this.unexpected();return this.node(t,{kind:S.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(r===void 0&&i===void 0&&o===void 0)throw this.unexpected();return this.node(t,{kind:S.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(r===void 0&&i===void 0&&o===void 0)throw this.unexpected();return this.node(t,{kind:S.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r===void 0&&i===void 0)throw this.unexpected();return this.node(t,{kind:S.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r===void 0&&i===void 0)throw this.unexpected();return this.node(t,{kind:S.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r===void 0&&i===void 0)throw this.unexpected();return this.node(t,{kind:S.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(H.AT);let n=this.parseName(),r=this.parseConstDirectives();if(r===void 0)throw this.unexpected();return this.node(t,{kind:S.DIRECTIVE_EXTENSION,name:n,directives:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(H.AT);let r=this.parseName(),i=this.parseArgumentDefs(),o=this.parseConstDirectives(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:S.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,directives:o,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(H.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.hasOwn(ye,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){let t=this._lexer.token,n=this.expectOptionalToken(H.AT),r=this.parseName(),i;!n&&this.expectOptionalToken(H.DOT)&&(i=this.parseName());let o;return(n||i)&&this.expectOptionalToken(H.PAREN_L)&&(o=this.parseName(),this.expectToken(H.COLON),this.expectToken(H.PAREN_R)),n?o?this.node(t,{kind:S.DIRECTIVE_ARGUMENT_COORDINATE,name:r,argumentName:o}):this.node(t,{kind:S.DIRECTIVE_COORDINATE,name:r}):i?o?this.node(t,{kind:S.ARGUMENT_COORDINATE,name:r,fieldName:i,argumentName:o}):this.node(t,{kind:S.MEMBER_COORDINATE,name:r,memberName:i}):this.node(t,{kind:S.TYPE_COORDINATE,name:r})}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Kh(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw Vt(this._lexer.source,n.start,`Expected ${BY(t)}, found ${nS(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===H.NAME&&n.value===t)this.advanceLexer();else throw Vt(this._lexer.source,n.start,`Expected "${t}", found ${nS(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===H.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return Vt(this._lexer.source,n.start,`Unexpected ${nS(n)}.`)}any(t,n,r){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(t,n,r){if(this.expectOptionalToken(t)){let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}}many(t,n,r){this.expectToken(t);let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(t,n){this.expectOptionalToken(t);let r=[];do r.push(n.call(this));while(this.expectOptionalToken(t));return r}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==H.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw Vt(this._lexer.source,n.start,`Document contains more than ${t} tokens. Parsing aborted.`)}};function nS(e){let t=e.value;return BY(e.kind)+(t!=null?` "${t}"`:"")}function BY(e){return LY(e)?`"${e}"`:e}function $n(e,t){switch(t.kind){case S.LIST_TYPE:{let n=$n(e,t.type);return n&&new Zt(n)}case S.NON_NULL_TYPE:{let n=$n(e,t.type);return n&&new xe(n)}case S.NAMED_TYPE:return e.getType(t.name.value)}}function VY(e){let t=new Map;return{Directive(n){if(n.name.value===Mo.name||n.name.value===Lo.name){let i=n.arguments?.find(s=>s.name.value==="label")?.value;if(!i||i.kind===S.NULL)return;if(i.kind!==S.STRING){e.reportError(new U(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));return}let o=t.get(i.value);o!=null?e.reportError(new U('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(i.value,n)}}}}function WY(e){return{OperationDefinition(t){let n=e.getDocument(),r=new Map;for(let s of n.definitions)s.kind===S.FRAGMENT_DEFINITION&&r.set(s.name.value,s);if(t.operation!=="subscription"&&t.operation!=="mutation")return;let o=e.getSchema().getRootType(t.operation);o&&r1({context:e,operationType:t.operation,rootType:o,fragments:r,selectionSet:t.selectionSet,visitedFragments:new Set})}}}function r1({context:e,operationType:t,rootType:n,fragments:r,selectionSet:i,visitedFragments:o}){for(let s of i.selections)if(s.kind==="Field"){let a=s.directives?.find(c=>c.name.value===Lo.name);a&&e.reportError(new U(`Stream directive cannot be used on root ${t} type "${n}".`,{nodes:a}))}else if(s.kind==="FragmentSpread"){let a=s.name.value;if(o.has(a))continue;let c=r.get(a);if(c){let l=qY(s);l!==void 0&&e.reportError(new U(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:l})),r1({context:e,operationType:t,rootType:n,fragments:r,selectionSet:c.selectionSet,visitedFragments:o})}o.add(a)}else if(s.kind==="InlineFragment"){let a=qY(s);a!==void 0&&e.reportError(new U(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:a})),r1({context:e,operationType:t,rootType:n,fragments:r,selectionSet:s.selectionSet,visitedFragments:o})}}function qY(e){return e.directives?.find(t=>t.name.value===Mo.name)}function HY(e){let t=e.arguments?.find(n=>n.name.value==="if");if(!t)return!1;if(t.value.kind===S.BOOLEAN){if(t.value.value)return!1}else if(t.value.kind!==S.VARIABLE)return!1;return!0}function VRe(e){let t=e.arguments?.find(n=>n.name.value==="if");return t&&t.value.kind===S.BOOLEAN?!!t.value.value:!0}function qRe(e){let t=e.arguments?.find(n=>n.name.value==="if");return t?t?.value.kind===S.BOOLEAN?!t.value.value:!0:!1}function KY(e){return{OperationDefinition(t){if(t.operation!==tr.SUBSCRIPTION)return;let n=e.getDocument(),r=new Map;for(let o of n.definitions)o.kind===S.FRAGMENT_DEFINITION&&r.set(o.name.value,o);let i=new Set;i1({context:e,fragments:r,selectionSet:t.selectionSet,parentNodes:[],visitedFragments:i})}}}function i1({context:e,fragments:t,selectionSet:n,parentNodes:r,visitedFragments:i}){for(let o of n.selections){let s=o.directives?.find(c=>c.name.value===Ka.name);if(s&&VRe(s))continue;let a=o.directives?.find(c=>c.name.value===Ha.name);if(!(a&&qRe(a))){for(let c of o.directives??[])c.name.value===Mo.name?HY(c)||e.reportError(new U("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:[c,...r]})):c.name.value===Lo.name&&(HY(c)||e.reportError(new U("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:[c,...r]})));if(o.kind==="FragmentSpread"){let c=o.name.value;if(i.has(c))continue;i.add(c);let l=t.get(c);l&&i1({context:e,fragments:t,parentNodes:[o,...r],selectionSet:l?.selectionSet,visitedFragments:i})}else o.selectionSet&&i1({context:e,fragments:t,selectionSet:o.selectionSet,parentNodes:r,visitedFragments:i})}}}function o1(e){return e.kind===S.OPERATION_DEFINITION||e.kind===S.FRAGMENT_DEFINITION}function s1(e){return e.kind===S.SCHEMA_DEFINITION||Za(e)||e.kind===S.DIRECTIVE_DEFINITION}function Za(e){return e.kind===S.SCALAR_TYPE_DEFINITION||e.kind===S.OBJECT_TYPE_DEFINITION||e.kind===S.INTERFACE_TYPE_DEFINITION||e.kind===S.UNION_TYPE_DEFINITION||e.kind===S.ENUM_TYPE_DEFINITION||e.kind===S.INPUT_OBJECT_TYPE_DEFINITION}function a1(e){return e.kind===S.SCHEMA_EXTENSION||e.kind===S.DIRECTIVE_EXTENSION||rS(e)}function rS(e){return e.kind===S.SCALAR_TYPE_EXTENSION||e.kind===S.OBJECT_TYPE_EXTENSION||e.kind===S.INTERFACE_TYPE_EXTENSION||e.kind===S.UNION_TYPE_EXTENSION||e.kind===S.ENUM_TYPE_EXTENSION||e.kind===S.INPUT_OBJECT_TYPE_EXTENSION}function JY(e){return{Document(t){for(let n of t.definitions)if(!o1(n)){let r=n.kind===S.SCHEMA_DEFINITION||n.kind===S.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new U(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}function ZY(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let i=e.getSchema(),o=t.name.value,s=nr("to use an inline fragment on",e.hideSuggestions?[]:WRe(i,n,o));s===""&&(s=nr(e.hideSuggestions?[]:HRe(n,o))),e.reportError(new U(`Cannot query field "${o}" on type "${n}".`+s,{nodes:t}))}}}}function WRe(e,t,n){if(!si(t))return[];let r=new Set,i=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[n]!=null){r.add(o),i[o.name]=1;for(let s of o.getInterfaces())s.getFields()[n]!=null&&(r.add(s),i[s.name]=(i[s.name]??0)+1)}return[...r].sort((o,s)=>{let a=i[s.name]-i[o.name];return a!==0?a:He(o)&&e.isSubType(o,s)?-1:He(s)&&e.isSubType(s,o)?1:ip(o.name,s.name)}).map(o=>o.name)}function HRe(e,t){if(ut(e)||He(e)){let n=Object.keys(e.getFields());return yr(t,n)}return[]}function YY(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let r=$n(e.getSchema(),n);if(r&&!Ts(r)){let i=Qe(n);e.reportError(new U(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(t){let n=$n(e.getSchema(),t.typeCondition);if(n&&!Ts(n)){let r=Qe(t.typeCondition);e.reportError(new U(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}))}}}}function QY(e){return{...c1(e),FragmentArgument(t){let n=e.getFragmentSignature();if(n&&!n.variableDefinitions.get(t.name.value)){let i=t.name.value,o=e.hideSuggestions?[]:yr(i,Array.from(n.variableDefinitions.values()).map(s=>s.variable.name.value));e.reportError(new U(`Unknown argument "${i}" on fragment "${n.definition.name.value}".`+nr(o),{nodes:t}))}},Argument(t){let n=e.getArgument(),r=e.getFieldDef();if(!n&&r){let i=t.name.value,o=e.hideSuggestions?[]:yr(i,r.args.map(s=>s.name));e.reportError(new U(`Unknown argument "${i}" on field "${r}".`+nr(o),{nodes:t}))}}}}function c1(e){let t=new Map,n=e.getSchema(),r=n?n.getDirectives():wr;for(let o of r)t.set(o.name,o.args.map(s=>s.name));let i=e.getDocument().definitions;for(let o of i)if(o.kind===S.DIRECTIVE_DEFINITION){let s=o.arguments??[];t.set(o.name.value,s.map(a=>a.name.value))}return{Directive(o){let s=o.name.value,a=t.get(s);if(o.arguments!=null&&a!=null)for(let c of o.arguments){let l=c.name.value;if(!a.includes(l)){let u=yr(l,a);e.reportError(new U(`Unknown argument "${l}" on directive "@${s}".`+(e.hideSuggestions?"":nr(u)),{nodes:c}))}}return!1}}}function l1(e){let t=new Map,n=e.getSchema(),r=n?n.getDirectives():wr;for(let o of r)t.set(o.name,o.locations);let i=e.getDocument().definitions;for(let o of i)o.kind===S.DIRECTIVE_DEFINITION&&t.set(o.name.value,o.locations.map(s=>s.value));return{Directive(o,s,a,c,l){let u=o.name.value,d=t.get(u);if(d==null){e.reportError(new U(`Unknown directive "@${u}".`,{nodes:o}));return}let p=KRe(l);p!=null&&!d.includes(p)&&e.reportError(new U(`Directive "@${u}" may not be used on ${p}.`,{nodes:o}))}}}function KRe(e){let t=e.at(-1);switch(t!=null&&"kind"in t||st(!1),t.kind){case S.OPERATION_DEFINITION:return JRe(t.operation);case S.FIELD:return ye.FIELD;case S.FRAGMENT_SPREAD:return ye.FRAGMENT_SPREAD;case S.INLINE_FRAGMENT:return ye.INLINE_FRAGMENT;case S.FRAGMENT_DEFINITION:return ye.FRAGMENT_DEFINITION;case S.VARIABLE_DEFINITION:{let n=e[e.length-3];return"kind"in n||st(!1),n.kind===S.OPERATION_DEFINITION?ye.VARIABLE_DEFINITION:ye.FRAGMENT_VARIABLE_DEFINITION}case S.SCHEMA_DEFINITION:case S.SCHEMA_EXTENSION:return ye.SCHEMA;case S.SCALAR_TYPE_DEFINITION:case S.SCALAR_TYPE_EXTENSION:return ye.SCALAR;case S.OBJECT_TYPE_DEFINITION:case S.OBJECT_TYPE_EXTENSION:return ye.OBJECT;case S.FIELD_DEFINITION:return ye.FIELD_DEFINITION;case S.INTERFACE_TYPE_DEFINITION:case S.INTERFACE_TYPE_EXTENSION:return ye.INTERFACE;case S.UNION_TYPE_DEFINITION:case S.UNION_TYPE_EXTENSION:return ye.UNION;case S.ENUM_TYPE_DEFINITION:case S.ENUM_TYPE_EXTENSION:return ye.ENUM;case S.ENUM_VALUE_DEFINITION:return ye.ENUM_VALUE;case S.INPUT_OBJECT_TYPE_DEFINITION:case S.INPUT_OBJECT_TYPE_EXTENSION:return ye.INPUT_OBJECT;case S.INPUT_VALUE_DEFINITION:{let n=e.at(-3);return n!=null&&"kind"in n||st(!1),n.kind===S.INPUT_OBJECT_TYPE_DEFINITION||n.kind===S.INPUT_OBJECT_TYPE_EXTENSION?ye.INPUT_FIELD_DEFINITION:ye.ARGUMENT_DEFINITION}case S.DIRECTIVE_DEFINITION:case S.DIRECTIVE_EXTENSION:return ye.DIRECTIVE_DEFINITION;default:st(!1,"Unexpected kind: "+fe(t.kind))}}function JRe(e){switch(e){case tr.QUERY:return ye.QUERY;case tr.MUTATION:return ye.MUTATION;case tr.SUBSCRIPTION:return ye.SUBSCRIPTION}}function XY(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new U(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function e9(e){let t=e.getSchema();return{OperationDefinition(n){let r=n.operation;t.getRootType(r)||e.reportError(new U(`The ${r} operation is not supported by the schema.`,{nodes:n}))}}}function u1(e){let{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(Za).map(i=>i.name.value)]);return{NamedType(i,o,s,a,c){let l=i.name.value;if(!r.has(l)){let u=c[2]??s,d=u!=null&&ZRe(u);if(d&&t9.has(l))return;let p=e.hideSuggestions?[]:yr(l,d?[...t9,...r]:[...r]);e.reportError(new U(`Unknown type "${l}".`+nr(p),{nodes:i}))}}}}var t9=new Set([...Wa,...Ja].map(e=>e.name));function ZRe(e){return"kind"in e&&(s1(e)||a1(e))}function n9(e){let t=0;return{Document(n){t=n.definitions.filter(r=>r.kind===S.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new U("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function r9(e){let t=e.getSchema(),n=t?.astNode??t?.getQueryType()??t?.getMutationType()??t?.getSubscriptionType(),r=0;return{SchemaDefinition(i){if(n){e.reportError(new U("Cannot define a new schema within a schema extension.",{nodes:i}));return}r>0&&e.reportError(new U("Must provide only one schema definition.",{nodes:i})),++r}}}var YRe=3;function i9(e){function t(n,r=Object.create(null),i=0){if(n.kind===S.FRAGMENT_SPREAD){let o=n.name.value;if(r[o]===!0)return!1;let s=e.getFragment(o);if(!s)return!1;try{return r[o]=!0,t(s,r,i)}finally{r[o]=void 0}}if(n.kind===S.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(i++,i>=YRe))return!0;if("selectionSet"in n&&n.selectionSet){for(let o of n.selectionSet.selections)if(t(o,r,i))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new U("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function o9(e){let t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(o){return i(o),!1}};function i(o){if(t.has(o.name.value))return;let s=o.name.value;t.add(s);let a=e.getFragmentSpreads(o.selectionSet);if(a.length!==0){r[s]=n.length;for(let c of a){let l=c.name.value,u=r[l];if(n.push(c),u===void 0){let d=e.getFragment(l);d&&i(d)}else{let d=n.slice(u),p=d.slice(0,-1).map(f=>'"'+f.name.value+'"').join(", ");e.reportError(new U(`Cannot spread fragment "${l}" within itself`+(p!==""?` via ${p}.`:"."),{nodes:d}))}n.pop()}r[s]=void 0}}}function s9(e){return{OperationDefinition(t){let n=new Set(t.variableDefinitions?.map(i=>i.variable.name.value)),r=e.getRecursiveVariableUsages(t);for(let{node:i,fragmentVariableDefinition:o}of r){if(o)continue;let s=i.name.value;n.has(s)||e.reportError(new U(t.name?`Variable "$${s}" is not defined by operation "${t.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,t]}))}}}}function a9(e){let t=new Set,n=[];return{OperationDefinition(r){for(let i of e.getRecursivelyReferencedFragments(r))t.add(i.name.value);return!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){for(let r of n){let i=r.name.value;t.has(i)||e.reportError(new U(`Fragment "${i}" is never used.`,{nodes:r}))}}}}}function c9(e){return{FragmentDefinition(t){let n=e.getVariableUsages(t),r=new Set(n.map(({node:o})=>o.name.value)),i=t.variableDefinitions??[];for(let o of i){let s=o.variable.name.value;r.has(s)||e.reportError(new U(`Variable "$${s}" is never used in fragment "${t.name.value}".`,{nodes:o}))}},OperationDefinition(t){let n=e.getRecursiveVariableUsages(t),r=new Set;for(let{node:o,fragmentVariableDefinition:s}of n){let a=o.name.value;s||r.add(a)}let i=t.variableDefinitions??[];for(let o of i){let s=o.variable.name.value;r.has(s)||e.reportError(new U(t.name?`Variable "$${s}" is never used in operation "${t.name.value}".`:`Variable "$${s}" is never used.`,{nodes:o}))}}}}function fy(e){switch(e.kind){case S.OBJECT:return{...e,fields:QRe(e.fields)};case S.LIST:return{...e,values:e.values.map(fy)};case S.INT:case S.FLOAT:case S.STRING:case S.BOOLEAN:case S.NULL:case S.ENUM:case S.VARIABLE:return e}}function QRe(e){return e.map(t=>({...t,value:fy(t.value)})).sort((t,n)=>ip(t.name.value,n.name.value))}function d9(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+d9(n)).join(" and "):e}function p9(e){let t=new aS,n=new f1,r=new Map;return{SelectionSet(i){let o=XRe(e,r,t,n,e.getParentType(),i);for(let[[s,a],c,l]of o){let u=d9(a);e.reportError(new U(`Fields "${s}" conflict because ${u}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:c.concat(l)}))}}}}function XRe(e,t,n,r,i,o){let s=[],[a,c]=sS(e,t,i,o,void 0);if(t0e(e,s,t,n,r,a),c.length!==0)for(let l=0;l1)for(let c=0;c[o.value,r===void 0?s:my(s,r)]));return e.every(o=>{let s=o.value;t&&(s=my(s,t));let a=i.get(o.name.value);return a===void 0?!1:l9(s)===l9(a)})}function my(e,t){switch(e.kind){case S.VARIABLE:return t.get(e.name.value)??e;case S.LIST:return{...e,values:e.values.map(n=>my(n,t))};case S.OBJECT:return{...e,fields:e.fields.map(n=>({...n,value:my(n.value,t)}))};default:return e}}function l9(e){return Qe(fy(e))}function u9(e){return e?.find(t=>t.name.value==="stream")}function n0e(e,t,n,r){let i=u9(e),o=u9(n);if(!(!i&&!o))return i&&o&&g1(i.arguments,t,o.arguments,r)?"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100":"they have overlapping stream directives"}function d1(e,t){return Ze(e)?Ze(t)?d1(e.ofType,t.ofType):!0:Ze(t)?!0:Re(e)?Re(t)?d1(e.ofType,t.ofType):!0:Re(t)?!0:Oi(e)||Oi(t)?e!==t:!1}function sS(e,t,n,r,i){let o=t.get(r);if(o)return o;let s=new Map,a=new Map;m9(e,n,r,s,a,i);let c=[s,Array.from(a.values())];return t.set(r,c),c}function p1(e,t,n,r){let i=t.get(n.selectionSet);if(i)return i;let o=$n(e.getSchema(),n.typeCondition);return sS(e,t,o,n.selectionSet,r)}function m9(e,t,n,r,i,o){for(let s of n.selections)switch(s.kind){case S.FIELD:{let a=s.name.value,c;(ut(t)||He(t))&&(c=t.getFields()[a]);let l=s.alias?s.alias.value:a,u=r.get(l);u==null&&(u=[],r.set(l,u)),u.push([t,s,c]);break}case S.FRAGMENT_SPREAD:{let a=r0e(e,s,o);i.set(a.key,a);break}case S.INLINE_FRAGMENT:{let a=s.typeCondition,c=a?$n(e.getSchema(),a):t;m9(e,c,s.selectionSet,r,i,o);break}}}function r0e(e,t,n){let r="",i=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(let a of t.arguments)s.set(a.name.value,a.value);if(o?.variableDefinitions){r+=t.name.value+"(";for(let[a,c]of o.variableDefinitions){let l=s.get(a);l&&(r+=a+": "+Qe(fy(l)));let u=s.get(a);u!==void 0?i.set(a,n!==void 0?my(u,n):u):c.defaultValue&&i.set(a,c.defaultValue)}r+=")"}return{key:r,node:t,varMap:i.size>0?i:void 0}}function i0e(e,t,n,r){if(e.length>0)return[[t,e.map(([i])=>i)],[n,...e.map(([,i])=>i).flat()],[r,...e.map(([,,i])=>i).flat()]]}var aS=class{constructor(){this._data=new Map}has(t,n,r){let i=this._data.get(t)?.get(n);return i===void 0?!1:r?!0:r===i}add(t,n,r){let i=this._data.get(t);i===void 0?this._data.set(t,new Map([[n,r]])):i.set(n,r)}},f1=class{constructor(){this._orderedPairSet=new aS}has(t,n,r){return ti.name.value));for(let i of n.args)!r.has(i.name)&&Ba(i)&&e.reportError(new U(`Argument "${i}" of type "${i.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){let n=e.getFragmentSignature();if(!n)return!1;let r=new Set(t.arguments?.map(i=>i.name.value));for(let[i,o]of n.variableDefinitions)if(!r.has(i)&&b9(o)){let s=$n(e.getSchema(),o.type),a=fe(s);e.reportError(new U(`Fragment "${t.name.value}" argument "${i}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}function h1(e){let t=new Map,r=e.getSchema()?.getDirectives()??wr;for(let o of r)t.set(o.name,new Map(o.args.filter(Ba).map(s=>[s.name,s])));let i=e.getDocument().definitions;for(let o of i)if(o.kind===S.DIRECTIVE_DEFINITION){let s=o.arguments??[];t.set(o.name.value,new Map(s.filter(b9).map(a=>[a.name.value,a])))}return{Directive:{leave(o){let s=o.name.value,a=t.get(s);if(a!=null){let c=o.arguments??[],l=new Set(c.map(u=>u.name.value));for(let[u,d]of a.entries())if(!l.has(u)){let p=Xh(d.type)?fe(d.type):Qe(d.type);e.reportError(new U(`Argument "@${s}(${u}:)" of type "${p}" is required, but it was not provided.`,{nodes:o}))}}}}}}function b9(e){return e.type.kind===S.NON_NULL_TYPE&&e.defaultValue==null}function v9(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n)if(Oi(Do(n))){if(r){let i=t.name.value,o=fe(n);e.reportError(new U(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(r){if(r.selections.length===0){let i=t.name.value,o=fe(n);e.reportError(new U(`Field "${i}" of type "${o}" must have at least one field selected.`,{nodes:t}))}}else{let i=t.name.value,o=fe(n);e.reportError(new U(`Field "${i}" of type "${o}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}function Fo(e,t){if(Re(t))return e==null?void 0:Fo(e,t.ofType);if(e==null)return null;if(Ze(t)){if(!$s(e)){let i=Fo(e,t.ofType);return i===void 0?void 0:[i]}let r=[];for(let i of e){let o=Fo(i,t.ofType);if(o===void 0)return;r.push(o)}return r}if(Je(t)){if(!er(e)||Array.isArray(e))return;let r=Object.create(null),i=t.getFields(),o=0;for(let s of Object.keys(e))if(e[s]!==void 0&&(o++,!Object.hasOwn(i,s)))return;for(let s of Object.values(i)){let a=e[s.name];if(a===void 0){if(ao(s))return;let c=cS(s);c!==void 0&&(r[s.name]=c)}else{let c=Fo(a,s.type);if(c===void 0)return;r[s.name]=c}}if(t.isOneOf){let s=Object.keys(r);if(o!==1||s.length!==1)return;let a=s[0];if(r[a]===null)return}return r}let n=Oo(t);try{return n.coerceInputValue(e)}catch{}}function Is(e,t,n,r){if(e.kind===S.VARIABLE){let o=_9(e,n,r);return o==null&&Re(t)?void 0:o}if(Re(t))return e.kind===S.NULL?void 0:Is(e,t.ofType,n,r);if(e.kind===S.NULL)return null;if(Ze(t)){if(e.kind!==S.LIST){let s=Is(e,t.ofType,n,r);return s===void 0?void 0:[s]}let o=[];for(let s of e.values){let a=Is(s,t.ofType,n,r);if(a===void 0)if(s.kind===S.VARIABLE&&_9(s,n,r)==null&&!Re(t.ofType))a=null;else return;o.push(a)}return o}if(Je(t)){if(e.kind!==S.OBJECT)return;let o=Object.create(null),s=t.getFields();if(e.fields.some(l=>!Object.hasOwn(s,l.name.value)))return;let c=new Map(e.fields.map(l=>[l.name.value,l]));for(let l of Object.values(s)){let u=c.get(l.name);if(!u||u.value.kind===S.VARIABLE&&l0e(u.value,n,r)){if(ao(l))return;let d=cS(l);d!==void 0&&(o[l.name]=d)}else{let d=Is(u.value,l.type,n,r);if(d===void 0)return;o[l.name]=d}}if(t.isOneOf){let l=Object.keys(o);if(c.size!==1||l.length!==1)return;for(let[u,d]of c)if(d.value.kind===S.NULL||o[u]===null)return}return o}let i=Oo(t);try{return i.coerceInputLiteral?i.coerceInputLiteral(Va(e,n,r)):i.parseLiteral(e,n?.coerced)}catch{}}function _9(e,t,n){let r=e.name.value;return n?.sources[r]!==void 0?n.coerced[r]:t?.coerced[r]}function l0e(e,t,n){let r=e.name.value;return(n?.sources[r]!==void 0?n.coerced:t?.coerced)?.[r]===void 0}function cS(e){let t=e._memoizedCoercedDefaultValue;if(t!==void 0)return t;let n=e.default;if(n!==void 0)return t=n.literal?Is(n.literal,e.type):Fo(n.value,e.type),t===void 0&&st(!1,`Expected value of type "${e.type}" to be valid, found: ${fe(n.literal??n.value)}.`),e._memoizedCoercedDefaultValue=t,t;let r=e.defaultValue;return r!==void 0&&(e._memoizedCoercedDefaultValue=r),r}function w9(e,t,n,r,i){try{let o=cS(n);o!==void 0&&(e[t]=o)}catch(o){let s=n.default;if(s===void 0)throw o;let a=!1;OY(s,n.type,(c,l)=>{a=!0,r(c,l)},i),a||r(Hh(o),[])}}function k9(e,t,n,r,i){let o=e.arguments??[],s=new Map(o.map(l=>[l.name.value,l])),a=Object.create(null),c=Object.create(null);for(let[l,u]of Object.entries(t)){let d=s.get(l);d!==void 0?a[l]=r==null?{signature:u,value:d.value}:{signature:u,value:d.value,fragmentVariableValues:r}:a[l]={signature:u},$9(c,e,l,u,d,n,r,i)}return{sources:a,coerced:c}}function lS(e,t,n,r,i){let o=Object.create(null),s=t.arguments??[],a=new Map(s.map(c=>[c.name.value,c]));for(let c of e.args){let l=c.name;$9(o,t,l,c,a.get(c.name),n,r,i)}return o}function $9(e,t,n,r,i,o,s,a){let c=r.type,l=(p,f)=>{throw new U(`${y1(r,t)} has invalid default value${CM(f)}: ${p.message}`,{nodes:t})};if(!i){if(Ba(r))throw new U(`${y1(r,t)} of required type "${c}" was not provided.`,{nodes:t});w9(e,n,r,l,a);return}let u=i.value;if(u.kind===S.VARIABLE){let p=u.name.value,f=s?.sources[p]?s:o;if((f==null||!Object.hasOwn(f.coerced,p))&&!Ba(r)){w9(e,n,r,l,a);return}}let d=Is(u,c,o,s);d===void 0&&(hl(u,c,(p,f)=>{throw p.message=`${y1(r,t)} has invalid value${CM(f)}: ${p.message}`,p},o,s,a),st(!1,"Invalid argument")),e[n]=d}function y1(e,t){return G$(e)?`Argument "${e}"`:`Variable "$${e.name}" defined by fragment "${t.name.value}"`}function pp(e,t,n,r,i){let o=t.directives?.find(s=>s.name.value===e.name);if(o)return lS(e,o,n,r,i)}function E9(e,t,n,r,i,o,s=!1){let a=new zr,c=[],l={schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Map,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return uS(l,i,a,c),{groupedFieldSet:a,newDeferUsages:c,forbiddenDirectiveInstances:l.forbiddenDirectiveInstances}}function uS(e,t,n,r,i,o){let{schema:s,fragments:a,variableValues:c,runtimeType:l,visitedFragmentNames:u,hideSuggestions:d}=e;for(let p of t.selections)switch(p.kind){case S.FIELD:{if(!b1(e,p,c,o))continue;n.add(u0e(p),{node:p,deferUsage:i,fragmentVariableValues:o});break}case S.INLINE_FRAGMENT:{if(!b1(e,p,c,o)||!x9(s,p,l))continue;let f=S9(c,o,p,i);f?(r.push(f),uS(e,p.selectionSet,n,r,f,o)):uS(e,p.selectionSet,n,r,i,o);break}case S.FRAGMENT_SPREAD:{let f=p.name.value;if(!b1(e,p,c,o))continue;let m=a[f];if(m==null||!x9(s,m.definition,l))continue;let g=S9(c,o,p,i),h=u.get(f),v;if(g){if(h!==void 0)continue;u.set(f,!0),r.push(g),v=g}else{if(h===!1)continue;u.set(f,!1),v=i}let b=m.variableSignatures,_;b&&(_=k9(p,b,c,o,d)),uS(e,m.definition.selectionSet,n,r,v,_);break}}}function S9(e,t,n,r){let i=pp(Mo,n,e,t);if(i&&i.if!==!1)return{label:typeof i.label=="string"?i.label:void 0,parentDeferUsage:r}}function b1(e,t,n,r){let i=t.directives?.find(c=>c.name.value===Ka.name);if(i&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(i),!1;if((i?lS(Ka,i,n,r,e.hideSuggestions):void 0)?.if===!0)return!1;let s=t.directives?.find(c=>c.name.value===Ha.name);return s&&e.forbidSkipAndInclude?(e.forbiddenDirectiveInstances.push(s),!1):(s?lS(Ha,s,n,r,e.hideSuggestions):void 0)?.if!==!1}function x9(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=$n(e,r);return i===n?!0:si(i)?e.isSubType(i,n):!1}function u0e(e){return e.alias?e.alias.value:e.name.value}function v1(e){return e.map(t=>t.node)}function T9(e){return{OperationDefinition(t){if(t.operation==="subscription"){let n=e.getSchema(),r=n.getSubscriptionType();if(r){let i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(let u of s.definitions)u.kind===S.FRAGMENT_DEFINITION&&(a[u.name.value]={definition:u});let{groupedFieldSet:c,forbiddenDirectiveInstances:l}=E9(n,a,o,r,t.selectionSet,e.hideSuggestions,!0);if(l.length>0){e.reportError(new U(i!=null?`Subscription "${i}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:l}));return}if(c.size>1){let p=[...c.values()].slice(1).flatMap(f=>v1(f));e.reportError(new U(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:p}))}for(let u of c.values())v1(u)[0].name.value.startsWith("__")&&e.reportError(new U(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:v1(u)}))}}}}}function A9(e){return{Directive(t){let n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===Lo.name&&!(Ze(n.type)||so(n.type)&&Ze(n.type.ofType))&&e.reportError(new U(`Directive "@stream" cannot be used on non-list field "${r}.${n.name}".`,{nodes:t}))}}}function fp(e,t){let n=new zr;for(let r of e)n.add(t(r),r);return n}function I9(e){return{DirectiveDefinition(r){let i=r.arguments??[];return n(`@${r.name.value}`,i)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(r){let i=r.name.value,o=r.fields??[];for(let s of o){let a=s.name.value,c=s.arguments??[];n(`${i}.${a}`,c)}return!1}function n(r,i){let o=fp(i,s=>s.name.value);for(let[s,a]of o)a.length>1&&e.reportError(new U(`Argument "${r}(${s}:)" can only be defined once.`,{nodes:a.map(c=>c.name)}));return!1}}function _1(e){return{Field:t,Directive:t};function t(n){let r=n.arguments??[],i=fp(r,o=>o.name.value);for(let[o,s]of i)s.length>1&&e.reportError(new U(`There can be only one argument named "${o}".`,{nodes:s.map(a=>a.name)}))}}function R9(e){let t=new Map,n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n?.getDirective(i)){e.reportError(new U(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}let o=t.get(i);return o?e.reportError(new U(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}}}function w1(e){let t=new Map,n=e.getSchema(),r=n?n.getDirectives():wr;for(let c of r)t.set(c.name,!c.isRepeatable);let i=e.getDocument().definitions;for(let c of i)c.kind===S.DIRECTIVE_DEFINITION&&t.set(c.name.value,!c.repeatable);let o=new Map,s=new Map,a=new Map;return{enter(c){if(!("directives"in c)||!c.directives)return;let l;if(c.kind===S.SCHEMA_DEFINITION||c.kind===S.SCHEMA_EXTENSION)l=o;else if(Za(c)||rS(c)){let u=c.name.value;l=s.get(u),l===void 0&&(l=new Map,s.set(u,l))}else if(c.kind===S.DIRECTIVE_DEFINITION||c.kind===S.DIRECTIVE_EXTENSION){let u=c.name.value;l=a.get(u),l===void 0&&(l=new Map,a.set(u,l))}else l=new Map;for(let u of c.directives){let d=u.name.value;if(t.get(d)===!0){let p=l.get(d);p!=null?e.reportError(new U(`The directive "@${d}" can only be used once at this location.`,{nodes:[p,u]})):l.set(d,u)}}}}}function P9(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(o){let s=o.name.value,a=r.get(s);a==null&&(a=new Map,r.set(s,a));let c=o.values??[];for(let l of c){let u=l.name.value,d=n[s];if(rn(d)&&d.getValue(u)){e.reportError(new U(`Enum value "${s}.${u}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name}));continue}let p=a.get(u);p!=null?e.reportError(new U(`Enum value "${s}.${u}" can only be defined once.`,{nodes:[p,l.name]})):a.set(u,l.name)}return!1}}function C9(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(o){let s=o.name.value,a=r.get(s);a==null&&(a=new Map,r.set(s,a));let c=o.fields??[];for(let l of c){let u=l.name.value;if(d0e(n[s],u)){e.reportError(new U(`Field "${s}.${u}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name}));continue}let d=a.get(u);d!=null?e.reportError(new U(`Field "${s}.${u}" can only be defined once.`,{nodes:[d,l.name]})):a.set(u,l.name)}return!1}}function d0e(e,t){return ut(e)||He(e)||Je(e)?e.getFields()[t]!=null:!1}function N9(e){let t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value,i=t.get(r);return i!=null?e.reportError(new U(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]})):t.set(r,n.name),!1}}}function k1(e){let t=[],n=new Map;return{ObjectValue:{enter(){t.push(n),n=new Map},leave(){let r=t.pop();r==null&&st(!1),n=r}},ObjectField(r){let i=r.name.value,o=n.get(i);o!=null?e.reportError(new U(`There can be only one input field named "${i}".`,{nodes:[o,r.name]})):n.set(i,r.name)}}}function O9(e){let t=new Map;return{OperationDefinition(n){let r=n.name;if(r!=null){let i=t.get(r.value);i!=null?e.reportError(new U(`There can be only one operation named "${r.value}".`,{nodes:[i,r]})):t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}}function D9(e){let t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(o){let s=o.operationTypes??[];for(let a of s){let c=a.operation,l=n.get(c);r[c]?e.reportError(new U(`Type for ${c} already defined in the schema. It cannot be redefined.`,{nodes:a})):l?e.reportError(new U(`There can be only one ${c} type in schema.`,{nodes:[l,a]})):n.set(c,a)}return!1}}function M9(e){let t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){let o=i.name.value;if(n?.getType(o)){e.reportError(new U(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}let s=t.get(o);return s!=null?e.reportError(new U(`There can be only one type named "${o}".`,{nodes:[s,i.name]})):t.set(o,i.name),!1}}function L9(e){return{OperationDefinition(t){let n=t.variableDefinitions??[],r=fp(n,i=>i.variable.name.value);for(let[i,o]of r)o.length>1&&e.reportError(new U(`There can be only one variable named "$${i}".`,{nodes:o.map(s=>s.variable.name)}))}}}function F9(e){return{NullValue:t=>Ya(e,t,e.getInputType()),ListValue:t=>Ya(e,t,e.getParentInputType()),ObjectValue:t=>Ya(e,t,e.getInputType()),EnumValue:t=>Ya(e,t,e.getInputType()),IntValue:t=>Ya(e,t,e.getInputType()),FloatValue:t=>Ya(e,t,e.getInputType()),StringValue:t=>Ya(e,t,e.getInputType()),BooleanValue:t=>Ya(e,t,e.getInputType())}}function Ya(e,t,n){return n&&hl(t,n,r=>{e.reportError(r)},void 0,void 0,e.hideSuggestions),!1}function U9(e){return{VariableDefinition(t){let n=$n(e.getSchema(),t.type);if(n!==void 0&&!ey(n)){let r=t.variable.name.value,i=Qe(t.type);e.reportError(new U(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}function j9(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i,type:o,parentType:s,defaultValue:a,fragmentVariableDefinition:c}of r){let l=i.name.value,u=c;if(u??=t.get(l),u&&o){let d=e.getSchema(),p=$n(d,u.type);p&&!p0e(d,p,u.defaultValue,o,a)&&e.reportError(new U(`Variable "$${l}" of type "${p}" used in position expecting type "${o}".`,{nodes:[u,i]})),Je(s)&&s.isOneOf&&B$(p)&&e.reportError(new U(`Variable "$${l}" is of type "${p}" but must be non-nullable to be used for OneOf Input Object "${s}".`,{nodes:[u,i]}))}}}},VariableDefinition(n){t.set(n.variable.name.value,n)}}}function p0e(e,t,n,r,i){if(Re(r)&&!Re(t)){if(!(n!=null&&n.kind!==S.NULL)&&!(i!==void 0))return!1;let a=r.ofType;return fl(e,t,a)}return fl(e,t,r)}var f0e=Object.freeze([i9]),m0e=Object.freeze([JY,e9,O9,n9,T9,u1,YY,U9,v9,ZY,N9,XY,a9,g9,o9,L9,s9,c9,l1,w1,WY,KY,VY,A9,QY,_1,F9,y9,j9,p9,k1,...f0e]),z9=Object.freeze([r9,D9,M9,P9,C9,I9,R9,u1,l1,w1,h9,c1,_1,k1,h1]);var $1=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let r of this.getDocument().definitions)r.kind===S.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let r=[t],i;for(;i=r.pop();)for(let o of i.selections)o.kind===S.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&r.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let r=new Set,i=[t.selectionSet],o;for(;o=i.pop();)for(let s of this.getFragmentSpreads(o)){let a=s.name.value;if(!r.has(a)){r.add(a);let c=this.getFragment(a);c&&(n.push(c),i.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}},dS=class extends $1{constructor(t,n,r){super(t,r),this._schema=n}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};var Ict=Ga(Jh,e=>e.filter(t=>t!=="description")),Rct=new U("Too many validation errors, error limit reached. Validation aborted.");function g0e(e,t,n=z9){let r=[],i=new dS(e,t,s=>{r.push(s)}),o=n.map(s=>s(i));return sp(e,LM(o)),r}function G9(e){let t=g0e(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` -`))}var dn={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function kZ(e,t){let n=t({getNamedType:c,setNamedType:l,getNamedTypes:u}),i=new Map;for(let x of e.types){let E=x.name,T=d(x);T&&i.set(E,T)}let r=[];for(let x of e.directives){if(Jc(x)){r.push(x);continue}let E=S(x.toConfig());E&&r.push(new Tn(E))}let o={...e,query:e.query&&c(e.query.name),mutation:e.mutation&&c(e.mutation.name),subscription:e.subscription&&c(e.subscription.name),types:Array.from(i.values()),directives:r},s=n[dn.SCHEMA];return s==null?o:s(o);function a(x){return Ke(x)?new qt(a(x.ofType)):_e(x)?new ve(a(x.ofType)):c(x.name)}function c(x){let E=mxe.get(x)??i.get(x);return E===void 0&&it(!1,`Unknown type: "${x}".`),E}function l(x){i.set(x.name,x)}function u(){return Array.from(i.values())}function d(x){if(cD(x)||tD(x))return x;if(pr(x))return p(x);if(at(x))return f(x);if(Be(x))return h(x);if(Qt(x))return b(x);if(Xt(x))return y(x);if(He(x))return k(x);it(!1,"Unexpected type: "+ce(x))}function p(x){let E=x.toConfig(),T=n[dn.SCALAR];return E=T==null?E:T(E),new dr(E)}function f(x){let E=x.toConfig(),T={...E,interfaces:()=>E.interfaces.map(L=>c(L.name)),fields:()=>m(E.fields,x.name)},A=n[dn.OBJECT];return T=A==null?T:A(T),new Yn(T)}function m(x,E){let T=Object.create(null);for(let[A,L]of Object.entries(x)){let F={...L,type:a(L.type),args:g(L.args,A,E)},K=n[dn.FIELD];K&&(F=K(F,E)),T[A]=F}return T}function g(x,E,T){let A=Object.create(null);for(let[L,F]of Object.entries(x)){let K={...F,type:a(F.type)},te=n[dn.ARGUMENT];te&&(K=te(K,E,T)),A[L]=K}return A}function h(x){let E=x.toConfig(),T={...E,interfaces:()=>E.interfaces.map(L=>c(L.name)),fields:()=>m(E.fields,x.name)},A=n[dn.INTERFACE];return T=A==null?T:A(T),new ns(T)}function b(x){let E=x.toConfig(),T={...E,types:()=>E.types.map(L=>c(L.name))},A=n[dn.UNION];return T=A==null?T:A(T),new rs(T)}function y(x){let E=x.toConfig(),T={...E,values:()=>{let L=Object.create(null);for(let[F,K]of Object.entries(E.values)){let te=w(K,F,x.name);L[F]=te}return L}},A=n[dn.ENUM];return T=A==null?T:A(T),new gi(T)}function w(x,E,T){let A={...x},L=n[dn.ENUM_VALUE];return L==null?A:L(A,E,T)}function k(x){let E=x.toConfig(),T={...E,fields:()=>{let L=Object.create(null);for(let[F,K]of Object.entries(E.fields)){let te=_(K,F,x.name);L[F]=te}return L}},A=n[dn.INPUT_OBJECT];return T=A==null?T:A(T),new is(T)}function _(x,E,T){let A={...x,type:a(x.type)},L=n[dn.INPUT_FIELD];return L==null?A:L(A,E,T)}function S(x){let E={...x,args:g(x.args,x.name,void 0)},T=n[dn.DIRECTIVE];return T==null?E:T(E)}}var mxe=new Map([...va,...$a].map(e=>[e.name,e]));function $Z(e,t,n){let i=[],r=new Cr,o=new Cr,s=new Cr,a=new Cr,c=new Cr,l=new Cr,u=new Cr,d=[],p,f=[],m=!1;for(let g of t.definitions){switch(g.kind){case $.SCHEMA_DEFINITION:p=g;break;case $.SCHEMA_EXTENSION:f.push(g);break;case $.DIRECTIVE_DEFINITION:d.push(g);break;case $.DIRECTIVE_EXTENSION:u.add(g.name.value,g);break;case $.SCALAR_TYPE_DEFINITION:case $.OBJECT_TYPE_DEFINITION:case $.INTERFACE_TYPE_DEFINITION:case $.UNION_TYPE_DEFINITION:case $.ENUM_TYPE_DEFINITION:case $.INPUT_OBJECT_TYPE_DEFINITION:i.push(g);break;case $.SCALAR_TYPE_EXTENSION:r.add(g.name.value,g);break;case $.OBJECT_TYPE_EXTENSION:o.add(g.name.value,g);break;case $.INTERFACE_TYPE_EXTENSION:s.add(g.name.value,g);break;case $.UNION_TYPE_EXTENSION:a.add(g.name.value,g);break;case $.ENUM_TYPE_EXTENSION:c.add(g.name.value,g);break;case $.INPUT_OBJECT_TYPE_EXTENSION:l.add(g.name.value,g);break;default:continue}m=!0}return m?kZ(e,g=>{let{getNamedType:h,setNamedType:b,getNamedTypes:y}=g;return{[dn.SCHEMA]:D=>{for(let re of i){let ie=gxe.get(re.name.value)??te(re);b(ie)}let X={query:D.query&&h(D.query.name),mutation:D.mutation&&h(D.mutation.name),subscription:D.subscription&&h(D.subscription.name),...p&&w([p]),...w(f)};return{description:p?.description?.value??D.description,...X,types:y(),directives:[...D.directives.map(x),...d.map(S)],extensions:D.extensions,astNode:p??D.astNode,extensionASTNodes:D.extensionASTNodes.concat(f),assumeValid:n?.assumeValid??!1}},[dn.INPUT_OBJECT]:D=>{let X=l.get(D.name)??[];return{...D,fields:()=>({...D.fields(),...A(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.ENUM]:D=>{let X=c.get(D.name)??[];return{...D,values:()=>({...D.values(),...L(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.SCALAR]:D=>{let X=r.get(D.name)??[],re=D.specifiedByURL;for(let ie of X)re=PD(ie)??re;return{...D,specifiedByURL:re,extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.OBJECT]:D=>{let X=o.get(D.name)??[];return{...D,interfaces:()=>[...D.interfaces(),...F(X)],fields:()=>({...D.fields(),...E(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.INTERFACE]:D=>{let X=s.get(D.name)??[];return{...D,interfaces:()=>[...D.interfaces(),...F(X)],fields:()=>({...D.fields(),...E(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.UNION]:D=>{let X=a.get(D.name)??[];return{...D,types:()=>[...D.types(),...K(X)],extensionASTNodes:D.extensionASTNodes.concat(X)}}};function w(D){let X={};for(let re of D){let ie=re.operationTypes??[];for(let ke of ie)X[ke.operation]=k(ke.type)}return X}function k(D){let X=D.name.value,re=h(X);return re===void 0&&it(!1,`Unknown type: "${X}".`),re}function _(D){return D.kind===$.LIST_TYPE?new qt(_(D.type)):D.kind===$.NON_NULL_TYPE?new ve(_(D.type)):k(D)}function S(D){let X=u.get(D.name.value)??[],re=Xc(D)??X.map(ie=>Xc(ie)).find(ie=>ie!=null);return new Tn({name:D.name.value,description:D.description?.value,locations:D.locations.map(({value:ie})=>ie),isRepeatable:D.repeatable,args:T(D.arguments),deprecationReason:re,astNode:D,extensionASTNodes:X})}function x(D){let X=u.get(D.name)??[];if(X.length===0)return D;let re=D.deprecationReason??X.map(ie=>Xc(ie)).find(ie=>ie!=null);return new Tn({...D.toConfig(),deprecationReason:re,extensionASTNodes:D.extensionASTNodes.concat(X)})}function E(D){let X=Object.create(null);for(let re of D){let ie=re.fields??[];for(let ke of ie)X[ke.name.value]={type:_(ke.type),description:ke.description?.value,args:T(ke.arguments),deprecationReason:Xc(ke),astNode:ke}}return X}function T(D){let X=D??[],re=Object.create(null);for(let ie of X){let ke=_(ie.type);re[ie.name.value]={type:ke,description:ie.description?.value,default:ie.defaultValue&&{literal:ie.defaultValue},deprecationReason:Xc(ie),astNode:ie}}return re}function A(D){let X=Object.create(null);for(let re of D){let ie=re.fields??[];for(let ke of ie){let We=_(ke.type);X[ke.name.value]={type:We,description:ke.description?.value,default:ke.defaultValue&&{literal:ke.defaultValue},deprecationReason:Xc(ke),astNode:ke}}}return X}function L(D){let X=Object.create(null);for(let re of D){let ie=re.values??[];for(let ke of ie)X[ke.name.value]={description:ke.description?.value,deprecationReason:Xc(ke),astNode:ke}}return X}function F(D){return D.flatMap(X=>X.interfaces?.map(k)??[])}function K(D){return D.flatMap(X=>X.types?.map(k)??[])}function te(D){let X=D.name.value;switch(D.kind){case $.OBJECT_TYPE_DEFINITION:{let re=o.get(X)??[],ie=[D,...re];return new Yn({name:X,description:D.description?.value,interfaces:()=>F(ie),fields:()=>E(ie),astNode:D,extensionASTNodes:re})}case $.INTERFACE_TYPE_DEFINITION:{let re=s.get(X)??[],ie=[D,...re];return new ns({name:X,description:D.description?.value,interfaces:()=>F(ie),fields:()=>E(ie),astNode:D,extensionASTNodes:re})}case $.ENUM_TYPE_DEFINITION:{let re=c.get(X)??[],ie=[D,...re];return new gi({name:X,description:D.description?.value,values:()=>L(ie),astNode:D,extensionASTNodes:re})}case $.UNION_TYPE_DEFINITION:{let re=a.get(X)??[],ie=[D,...re];return new rs({name:X,description:D.description?.value,types:()=>K(ie),astNode:D,extensionASTNodes:re})}case $.SCALAR_TYPE_DEFINITION:{let re=r.get(X)??[],ie=PD(D);for(let ke of re)ie=PD(ke)??ie;return new dr({name:X,description:D.description?.value,specifiedByURL:ie,astNode:D,extensionASTNodes:re})}case $.INPUT_OBJECT_TYPE_DEFINITION:{let re=l.get(X)??[],ie=[D,...re];return new is({name:X,description:D.description?.value,fields:()=>A(ie),astNode:D,extensionASTNodes:re,isOneOf:hxe(D)})}}}}):e}var gxe=new Map([...va,...$a].map(e=>[e.name,e]));function Xc(e){return Gd(Jr,e)?.reason}function PD(e){return Gd(Qg,e)?.url}function hxe(e){return!!Gd(Xg,e)}function DD(e,t){t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&wZ(e);let i=$Z({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(i.astNode==null)for(let o of i.types)switch(o.name){case"Query":i.query=o;break;case"Mutation":i.mutation=o;break;case"Subscription":i.subscription=o;break}let r=[...i.directives,...fr.filter(o=>i.directives.every(s=>s.name!==o.name))];return new nh({...i,directives:r})}function ah(e,t){let n=dD(e,{noLocation:t?.noLocation,experimentalFragmentArguments:t?.experimentalFragmentArguments});return DD(n,{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}function xa(e,t,n){if(e){if(e.kind===$.VARIABLE){let i=e.name.value;if(n==null||!Object.hasOwn(n,i))return;let r=n[i];return r===void 0||r===null&&_e(t)?void 0:r}if(_e(t))return e.kind===$.NULL?void 0:xa(e,t.ofType,n);if(e.kind===$.NULL)return null;if(Ke(t)){let i=t.ofType;if(e.kind===$.LIST){let o=[];for(let s of e.values)if(_Z(s,n)){if(_e(i))return;o.push(null)}else{let a=xa(s,i,n);if(a===void 0)return;o.push(a)}return o}let r=xa(e,i,n);return r===void 0?void 0:[r]}if(He(t)){if(e.kind!==$.OBJECT)return;let i=Object.create(null),r=t.getFields();if(e.fields.some(a=>!Object.hasOwn(r,a.name.value)))return;let s=new Map(e.fields.map(a=>[a.name.value,a]));for(let a of Object.values(r)){let c=s.get(a.name);if(c==null||_Z(c.value,n)){if(a.defaultValue!==void 0)i[a.name]=a.defaultValue;else if(_e(a.type))return;continue}let l=xa(c.value,a.type,n);if(l===void 0)return;i[a.name]=l}if(t.isOneOf){let a=Object.keys(i);if(s.size!==1||a.length!==1)return;for(let[c,l]of s)if(l.value.kind===$.NULL||i[c]===null)return}return i}if(hi(t)){let i;try{i=t.parseLiteral(e,n)}catch{return}return i===void 0?void 0:i}it(!1,"Unexpected input type: "+ce(t))}}function _Z(e,t){return e.kind===$.VARIABLE&&(t?.[e.name.value]===void 0||!Object.hasOwn(t,e.name.value))}function cs(e){return"isDeprecated"in e?!!e.isDeprecated:!!(e.deprecationReason!=null||e.astNode?.directives?.some(t=>t.name.value==="deprecated"))}function Zr(e){return e.default!==void 0?e.default.literal!==void 0?xa(e.default.literal,e.type):So(e.default.value,e.type):e.defaultValue}function Bd(e){return e.default!==void 0||e.defaultValue!==void 0}function qd(e,t){return OD(e==null?void 0:Zr(e),Zr(t))}function OD(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((n,i)=>OD(n,t[i]));if(e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"){let n=e,i=t,r=Object.keys(n),o=Object.keys(i);return r.length===o.length&&r.every(s=>Object.prototype.hasOwnProperty.call(i,s)&&OD(n[s],i[s]))}return!1}function ch(e,t){if(!Bi(e)&&!Bi(t))return e.toString()===t.toString();if(_e(t)){let n=_e(e)?e.ofType:e;return ch(n,t.ofType)}return Ke(e)?Ke(t)&&ch(e.ofType,t.ofType)||_e(t)&&ch(e,t.ofType):!1}function Ea(e,t){if(!Bi(e)&&!Bi(t))return e?.toString()===t.toString();if(Ke(e)&&Ke(t))return Ea(e.ofType,t.ofType);if(_e(e)){let n=_e(t)?t.ofType:t;return Ea(e.ofType,n)}return!1}function lh(e){return e.astNode?.kind||""}function MD(e){return["String","Int","Float","Boolean","ID"].includes(typeof e=="string"?e:e.name)}function LD(e){return["__Schema","__Type","__TypeKind","__Field","__InputValue","__EnumValue","__Directive","__DirectiveLocation"].includes(typeof e=="string"?e:e.name)}var W;(function(e){e.Breaking="BREAKING",e.NonBreaking="NON_BREAKING",e.Dangerous="DANGEROUS"})(W||(W={}));var P={FieldArgumentDescriptionChanged:"FIELD_ARGUMENT_DESCRIPTION_CHANGED",FieldArgumentDefaultChanged:"FIELD_ARGUMENT_DEFAULT_CHANGED",FieldArgumentTypeChanged:"FIELD_ARGUMENT_TYPE_CHANGED",DirectiveRemoved:"DIRECTIVE_REMOVED",DirectiveAdded:"DIRECTIVE_ADDED",DirectiveDescriptionChanged:"DIRECTIVE_DESCRIPTION_CHANGED",DirectiveLocationAdded:"DIRECTIVE_LOCATION_ADDED",DirectiveLocationRemoved:"DIRECTIVE_LOCATION_REMOVED",DirectiveArgumentAdded:"DIRECTIVE_ARGUMENT_ADDED",DirectiveArgumentRemoved:"DIRECTIVE_ARGUMENT_REMOVED",DirectiveArgumentDescriptionChanged:"DIRECTIVE_ARGUMENT_DESCRIPTION_CHANGED",DirectiveArgumentDefaultValueChanged:"DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED",DirectiveArgumentTypeChanged:"DIRECTIVE_ARGUMENT_TYPE_CHANGED",DirectiveRepeatableAdded:"DIRECTIVE_REPEATABLE_ADDED",DirectiveRepeatableRemoved:"DIRECTIVE_REPEATABLE_REMOVED",EnumValueRemoved:"ENUM_VALUE_REMOVED",EnumValueAdded:"ENUM_VALUE_ADDED",EnumValueDescriptionChanged:"ENUM_VALUE_DESCRIPTION_CHANGED",EnumValueDeprecationReasonChanged:"ENUM_VALUE_DEPRECATION_REASON_CHANGED",EnumValueDeprecationReasonAdded:"ENUM_VALUE_DEPRECATION_REASON_ADDED",EnumValueDeprecationReasonRemoved:"ENUM_VALUE_DEPRECATION_REASON_REMOVED",FieldRemoved:"FIELD_REMOVED",FieldAdded:"FIELD_ADDED",FieldDescriptionChanged:"FIELD_DESCRIPTION_CHANGED",FieldDescriptionAdded:"FIELD_DESCRIPTION_ADDED",FieldDescriptionRemoved:"FIELD_DESCRIPTION_REMOVED",FieldDeprecationAdded:"FIELD_DEPRECATION_ADDED",FieldDeprecationRemoved:"FIELD_DEPRECATION_REMOVED",FieldDeprecationReasonChanged:"FIELD_DEPRECATION_REASON_CHANGED",FieldDeprecationReasonAdded:"FIELD_DEPRECATION_REASON_ADDED",FieldDeprecationReasonRemoved:"FIELD_DEPRECATION_REASON_REMOVED",FieldTypeChanged:"FIELD_TYPE_CHANGED",FieldArgumentAdded:"FIELD_ARGUMENT_ADDED",FieldArgumentRemoved:"FIELD_ARGUMENT_REMOVED",InputFieldRemoved:"INPUT_FIELD_REMOVED",InputFieldAdded:"INPUT_FIELD_ADDED",InputFieldDescriptionAdded:"INPUT_FIELD_DESCRIPTION_ADDED",InputFieldDescriptionRemoved:"INPUT_FIELD_DESCRIPTION_REMOVED",InputFieldDescriptionChanged:"INPUT_FIELD_DESCRIPTION_CHANGED",InputFieldDefaultValueChanged:"INPUT_FIELD_DEFAULT_VALUE_CHANGED",InputFieldTypeChanged:"INPUT_FIELD_TYPE_CHANGED",ObjectTypeInterfaceAdded:"OBJECT_TYPE_INTERFACE_ADDED",ObjectTypeInterfaceRemoved:"OBJECT_TYPE_INTERFACE_REMOVED",SchemaQueryTypeChanged:"SCHEMA_QUERY_TYPE_CHANGED",SchemaMutationTypeChanged:"SCHEMA_MUTATION_TYPE_CHANGED",SchemaSubscriptionTypeChanged:"SCHEMA_SUBSCRIPTION_TYPE_CHANGED",TypeRemoved:"TYPE_REMOVED",TypeAdded:"TYPE_ADDED",TypeKindChanged:"TYPE_KIND_CHANGED",TypeDescriptionChanged:"TYPE_DESCRIPTION_CHANGED",TypeDescriptionRemoved:"TYPE_DESCRIPTION_REMOVED",TypeDescriptionAdded:"TYPE_DESCRIPTION_ADDED",UnionMemberRemoved:"UNION_MEMBER_REMOVED",UnionMemberAdded:"UNION_MEMBER_ADDED",DirectiveUsageUnionMemberAdded:"DIRECTIVE_USAGE_UNION_MEMBER_ADDED",DirectiveUsageUnionMemberRemoved:"DIRECTIVE_USAGE_UNION_MEMBER_REMOVED",DirectiveUsageEnumAdded:"DIRECTIVE_USAGE_ENUM_ADDED",DirectiveUsageEnumRemoved:"DIRECTIVE_USAGE_ENUM_REMOVED",DirectiveUsageEnumValueAdded:"DIRECTIVE_USAGE_ENUM_VALUE_ADDED",DirectiveUsageEnumValueRemoved:"DIRECTIVE_USAGE_ENUM_VALUE_REMOVED",DirectiveUsageInputObjectAdded:"DIRECTIVE_USAGE_INPUT_OBJECT_ADDED",DirectiveUsageInputObjectRemoved:"DIRECTIVE_USAGE_INPUT_OBJECT_REMOVED",DirectiveUsageFieldAdded:"DIRECTIVE_USAGE_FIELD_ADDED",DirectiveUsageFieldRemoved:"DIRECTIVE_USAGE_FIELD_REMOVED",DirectiveUsageScalarAdded:"DIRECTIVE_USAGE_SCALAR_ADDED",DirectiveUsageScalarRemoved:"DIRECTIVE_USAGE_SCALAR_REMOVED",DirectiveUsageObjectAdded:"DIRECTIVE_USAGE_OBJECT_ADDED",DirectiveUsageObjectRemoved:"DIRECTIVE_USAGE_OBJECT_REMOVED",DirectiveUsageInterfaceAdded:"DIRECTIVE_USAGE_INTERFACE_ADDED",DirectiveUsageInterfaceRemoved:"DIRECTIVE_USAGE_INTERFACE_REMOVED",DirectiveUsageArgumentDefinitionAdded:"DIRECTIVE_USAGE_ARGUMENT_DEFINITION_ADDED",DirectiveUsageArgumentDefinitionRemoved:"DIRECTIVE_USAGE_ARGUMENT_DEFINITION_REMOVED",DirectiveUsageSchemaAdded:"DIRECTIVE_USAGE_SCHEMA_ADDED",DirectiveUsageSchemaRemoved:"DIRECTIVE_USAGE_SCHEMA_REMOVED",DirectiveUsageFieldDefinitionAdded:"DIRECTIVE_USAGE_FIELD_DEFINITION_ADDED",DirectiveUsageFieldDefinitionRemoved:"DIRECTIVE_USAGE_FIELD_DEFINITION_REMOVED",DirectiveUsageInputFieldDefinitionAdded:"DIRECTIVE_USAGE_INPUT_FIELD_DEFINITION_ADDED",DirectiveUsageInputFieldDefinitionRemoved:"DIRECTIVE_USAGE_INPUT_FIELD_DEFINITION_REMOVED",DirectiveUsageArgumentAdded:"DIRECTIVE_USAGE_ARGUMENT_ADDED",DirectiveUsageArgumentRemoved:"DIRECTIVE_USAGE_ARGUMENT_REMOVED"};function SZ(e,t){return e.reduce((n,i)=>(n[t(i)]=i,n),Object.create(null))}function C$(e,t){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n"u"||e===null}function FD(e,t){return e.filter(n=>!t.some(i=>C$(i,n)))}function bi(e){return typeof e=="string"?e:e.value}function en(e,t,n){let i=SZ(e,({name:c})=>bi(c)),r=SZ(t,({name:c})=>bi(c)),o=[],s=[],a=[];for(let c of e){let l=r[bi(c.name)]??null;l===null?s.push(c):a.push({newVersion:l,oldVersion:c??null})}for(let c of t)i[bi(c.name)]===void 0&&o.push(c);if(n){if(n.onRemoved)for(let c of s)n.onRemoved(c);if(n.onAdded)for(let c of o)n.onAdded(c);if(n.onMutual)for(let c of a)n.onMutual(c)}return{added:o,removed:s,mutual:a}}function tn(e,t,n){let i=xZ(e,({name:c})=>bi(c)),r=xZ(t,({name:c})=>bi(c)),o=[],s=[],a=[];for(let c of e){let l=r[bi(c.name)]??null;if(l===null)s.push(c);else{let[u,...d]=l;d.length>0?r[bi(c.name)]=d:delete r[bi(c.name)],a.push({newVersion:u,oldVersion:c??null})}}for(let c of t){let l=i[bi(c.name)]??null;if(l===null)o.push(c);else{let[u,...d]=l;d.length>0?i[bi(c.name)]=d:delete i[bi(c.name)]}}if(n){if(n.onRemoved)for(let c of s)n.onRemoved(c);if(n.onAdded)for(let c of o)n.onAdded(c);if(n.onMutual)for(let c of a)n.onMutual(c)}return{added:o,removed:s,mutual:a}}function xZ(e,t){return e.reduce((n,i)=>{let r=t(i);return n[r]=[...n[r]??[],i],n},Object.create(null))}function vi(e,t){return e==="deprecated"?W.NonBreaking:e==="oneOf"?W.Breaking:t}function wi(e,t){return e==="deprecated"?W.NonBreaking:e==="oneOf"?W.NonBreaking:t}function vxe(e){return`Directive '${e.addedDirectiveName}' was added to argument '${e.argumentName}' of field '${e.fieldName}' in type '${e.typeName}'`}function wxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to argument '${e.meta.argumentName}'`},type:P.DirectiveUsageArgumentDefinitionAdded,message:vxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function kxe(e){return`Directive '${e.removedDirectiveName}' was removed from argument '${e.argumentName}' of field '${e.fieldName}' in type '${e.typeName}'`}function $xe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from argument '${e.meta.argumentName}'`},type:P.DirectiveUsageArgumentDefinitionRemoved,message:kxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function _xe(e){return`Directive '${e.addedDirectiveName}' was added to input object '${e.inputObjectName}'`}function Sxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to input object '${e.meta.inputObjectName}'`},type:P.DirectiveUsageInputObjectAdded,message:_xe(e.meta),path:[e.meta.inputObjectName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function xxe(e){return`Directive '${e.removedDirectiveName}' was removed from input object '${e.inputObjectName}'`}function Exe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from input object '${e.meta.inputObjectName}'`},type:P.DirectiveUsageInputObjectRemoved,message:xxe(e.meta),path:[e.meta.inputObjectName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Txe(e){return`Directive '${e.addedDirectiveName}' was added to interface '${e.interfaceName}'`}function Ixe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to interface '${e.meta.interfaceName}'`},type:P.DirectiveUsageInterfaceAdded,message:Txe(e.meta),path:[e.meta.interfaceName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Axe(e){return`Directive '${e.removedDirectiveName}' was removed from interface '${e.interfaceName}'`}function Rxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from interface '${e.meta.interfaceName}'`},type:P.DirectiveUsageInterfaceRemoved,message:Axe(e.meta),path:[e.meta.interfaceName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Nxe(e){return`Directive '${e.addedDirectiveName}' was added to input field '${e.inputFieldName}' in input object '${e.inputObjectName}'`}function Cxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to input field '${e.meta.inputFieldName}'`},type:P.DirectiveUsageInputFieldDefinitionAdded,message:Nxe(e.meta),path:[e.meta.inputObjectName,e.meta.inputFieldName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Pxe(e){return`Directive '${e.removedDirectiveName}' was removed from input field '${e.inputFieldName}' in input object '${e.inputObjectName}'`}function Dxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from input field '${e.meta.inputFieldName}'`},type:P.DirectiveUsageInputFieldDefinitionRemoved,message:Pxe(e.meta),path:[e.meta.inputObjectName,e.meta.inputFieldName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Oxe(e){return`Directive '${e.addedDirectiveName}' was added to object '${e.objectName}'`}function Mxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to object '${e.meta.objectName}'`},type:P.DirectiveUsageObjectAdded,message:Oxe(e.meta),path:[e.meta.objectName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Lxe(e){return`Directive '${e.removedDirectiveName}' was removed from object '${e.objectName}'`}function Fxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from object '${e.meta.objectName}'`},type:P.DirectiveUsageObjectRemoved,message:Lxe(e.meta),path:[e.meta.objectName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Uxe(e){return`Directive '${e.addedDirectiveName}' was added to enum '${e.enumName}'`}function jxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to enum '${e.meta.enumName}'`},type:P.DirectiveUsageEnumAdded,message:Uxe(e.meta),path:[e.meta.enumName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function zxe(e){return`Directive '${e.removedDirectiveName}' was removed from enum '${e.enumName}'`}function Gxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from enum '${e.meta.enumName}'`},type:P.DirectiveUsageEnumRemoved,message:zxe(e.meta),path:[e.meta.enumName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Vxe(e){return`Directive '${e.addedDirectiveName}' was added to field '${e.typeName}.${e.fieldName}'`}function Bxe(e){return{criticality:{level:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldAdded,message:Vxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.addedDirectiveName].join("."),meta:e.meta}}function qxe(e){return`Directive '${e.addedDirectiveName}' was added to field '${e.typeName}.${e.fieldName}'`}function Wxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldDefinitionAdded,message:qxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Hxe(e){return`Directive '${e.removedDirectiveName}' was removed from field '${e.typeName}.${e.fieldName}'`}function Kxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldRemoved,message:Hxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.removedDirectiveName].join("."),meta:e.meta}}function Jxe(e){return`Directive '${e.removedDirectiveName}' was removed from field '${e.typeName}.${e.fieldName}'`}function Zxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldDefinitionRemoved,message:Jxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Yxe(e){return`Directive '${e.addedDirectiveName}' was added to enum value '${e.enumName}.${e.enumValueName}'`}function Qxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to enum value '${e.meta.enumName}.${e.meta.enumValueName}'`},type:P.DirectiveUsageEnumValueAdded,message:Yxe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Xxe(e){return`Directive '${e.removedDirectiveName}' was removed from enum value '${e.enumName}.${e.enumValueName}'`}function eEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from enum value '${e.meta.enumName}.${e.meta.enumValueName}'`},type:P.DirectiveUsageEnumValueRemoved,message:Xxe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function tEe(e){return`Directive '${e.addedDirectiveName}' was added to schema`}function nEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to schema`},type:P.DirectiveUsageSchemaAdded,message:tEe(e.meta),path:`.@${e.meta.addedDirectiveName}`,meta:e.meta}}function rEe(e){return`Directive '${e.removedDirectiveName}' was removed from schema`}function iEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from schema`},type:P.DirectiveUsageSchemaRemoved,message:rEe(e.meta),path:`.@${e.meta.removedDirectiveName}`,meta:e.meta}}function oEe(e){return`Directive '${e.addedDirectiveName}' was added to scalar '${e.scalarName}'`}function sEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to scalar '${e.meta.scalarName}'`},type:P.DirectiveUsageScalarAdded,message:oEe(e.meta),path:[e.meta.scalarName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function aEe(e){return`Directive '${e.removedDirectiveName}' was removed from scalar '${e.scalarName}'`}function cEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from scalar '${e.meta.scalarName}'`},type:P.DirectiveUsageScalarRemoved,message:aEe(e.meta),path:[e.meta.scalarName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function lEe(e){return`Directive '${e.addedDirectiveName}' was added to union member '${e.unionName}'`}function uEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to union member '${e.meta.unionName}.${e.meta.addedUnionMemberTypeName}'`},type:P.DirectiveUsageUnionMemberAdded,message:lEe(e.meta),path:[e.meta.unionName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function dEe(e){return`Directive '${e.removedDirectiveName}' was removed from union member '${e.unionName}'`}function pEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from union member '${e.meta.unionName}.${e.meta.removedUnionMemberTypeName}'`},type:P.DirectiveUsageUnionMemberRemoved,message:dEe(e.meta),path:[e.meta.unionName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function nn(e,t,n,i){return Nt(e,$.ARGUMENT,n)?wxe({type:P.DirectiveUsageArgumentDefinitionAdded,meta:{addedDirectiveName:t.name.value,argumentName:n.argument.name,fieldName:n.field.name,typeName:n.type.name,addedToNewType:i,directiveRepeatedTimes:yt(n.argument.astNode?.directives??[],t)}}):Nt(e,$.INPUT_VALUE_DEFINITION,n)?Cxe({type:P.DirectiveUsageInputFieldDefinitionAdded,meta:{addedDirectiveName:t.name.value,inputFieldName:n.field.name,inputFieldType:n.field.type.toString(),inputObjectName:n.type.name,addedToNewType:i,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.INPUT_OBJECT_TYPE_DEFINITION,n)?Sxe({type:P.DirectiveUsageInputObjectAdded,meta:{addedDirectiveName:t.name.value,addedInputFieldName:t.name.value,addedInputFieldType:n.name,inputObjectName:n.name,isAddedInputFieldTypeNullable:e===$.INPUT_VALUE_DEFINITION,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.INTERFACE_TYPE_DEFINITION,n)?Ixe({type:P.DirectiveUsageInterfaceAdded,meta:{addedDirectiveName:t.name.value,interfaceName:n.name,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.OBJECT,n)?Mxe({type:P.DirectiveUsageObjectAdded,meta:{objectName:n.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.ENUM_TYPE_DEFINITION,n)?jxe({type:P.DirectiveUsageEnumAdded,meta:{enumName:n.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.FIELD,n)?Bxe({type:P.DirectiveUsageFieldAdded,meta:{addedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.FIELD_DEFINITION,n)?Wxe({type:P.DirectiveUsageFieldDefinitionAdded,meta:{addedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,addedToNewType:i,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.UNION_TYPE_DEFINITION,n)?uEe({type:P.DirectiveUsageUnionMemberAdded,meta:{addedDirectiveName:t.name.value,addedUnionMemberTypeName:n.name,unionName:n.name,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.ENUM_VALUE_DEFINITION,n)?Qxe({type:P.DirectiveUsageEnumValueAdded,meta:{enumName:n.type.name,enumValueName:n.value.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.value.astNode?.directives??[],t)}}):Nt(e,$.SCHEMA_DEFINITION,n)?nEe({type:P.DirectiveUsageSchemaAdded,meta:{addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n?.astNode?.directives??[],t)}}):Nt(e,$.SCALAR_TYPE_DEFINITION,n)?sEe({type:P.DirectiveUsageScalarAdded,meta:{scalarName:n.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):{}}function yt(e,t){let n=t.name.value,i=0;for(let r of e)if(r.name.value===n&&(i+=1),r===t)return i;return 0}function rn(e,t,n){return Nt(e,$.ARGUMENT,n)?$xe({type:P.DirectiveUsageArgumentDefinitionRemoved,meta:{removedDirectiveName:t.name.value,argumentName:n.argument.name,fieldName:n.field.name,typeName:n.type.name,directiveRepeatedTimes:yt(n.argument.astNode?.directives??[],t)}}):Nt(e,$.INPUT_VALUE_DEFINITION,n)?Dxe({type:P.DirectiveUsageInputFieldDefinitionRemoved,meta:{removedDirectiveName:t.name.value,inputFieldName:n.field.name,inputObjectName:n.type.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.INPUT_OBJECT_TYPE_DEFINITION,n)?Exe({type:P.DirectiveUsageInputObjectRemoved,meta:{removedDirectiveName:t.name.value,removedInputFieldName:t.name.value,removedInputFieldType:n.name,inputObjectName:n.name,isRemovedInputFieldTypeNullable:e===$.INPUT_VALUE_DEFINITION,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.INTERFACE_TYPE_DEFINITION,n)?Rxe({type:P.DirectiveUsageInterfaceRemoved,meta:{removedDirectiveName:t.name.value,interfaceName:n.name,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.OBJECT,n)?Fxe({type:P.DirectiveUsageObjectRemoved,meta:{objectName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.ENUM_TYPE_DEFINITION,n)?Gxe({type:P.DirectiveUsageEnumRemoved,meta:{enumName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.FIELD,n)?Kxe({type:P.DirectiveUsageFieldRemoved,meta:{removedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.FIELD_DEFINITION,n)?Zxe({type:P.DirectiveUsageFieldDefinitionRemoved,meta:{removedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.UNION_TYPE_DEFINITION,n)?pEe({type:P.DirectiveUsageUnionMemberRemoved,meta:{removedDirectiveName:t.name.value,removedUnionMemberTypeName:n.name,unionName:n.name,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.ENUM_VALUE_DEFINITION,n)?eEe({type:P.DirectiveUsageEnumValueRemoved,meta:{enumName:n.type.name,enumValueName:n.value.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.value.astNode?.directives??[],t)}}):Nt(e,$.SCHEMA_DEFINITION,n)?iEe({type:P.DirectiveUsageSchemaRemoved,meta:{removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n?.astNode?.directives??[],t)}}):Nt(e,$.SCALAR_TYPE_DEFINITION,n)?cEe({type:P.DirectiveUsageScalarRemoved,meta:{scalarName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):{}}function Nt(e,t,n){return e===t}function EZ(e){return{type:P.DirectiveUsageArgumentAdded,criticality:{level:W.NonBreaking},message:`Argument '${e.meta.addedArgumentName}' was added to '@${e.meta.directiveName}'`,path:[e.meta.parentTypeName??"",e.meta.parentFieldName??e.meta.parentEnumValueName,e.meta.parentArgumentName,`@${e.meta.directiveName}`,e.meta.addedArgumentName].filter(t=>t!==null).join("."),meta:e.meta}}function TZ(e){return{type:P.DirectiveUsageArgumentRemoved,criticality:{level:W.Dangerous,reason:"Changing an argument on a directive can change runtime behavior."},message:`Argument '${e.meta.removedArgumentName}' was removed from '@${e.meta.directiveName}'`,path:[e.meta.parentTypeName??"",e.meta.parentFieldName??e.meta.parentEnumValueName,e.meta.parentArgumentName,`@${e.meta.directiveName}`,e.meta.removedArgumentName].filter(t=>t!==null).join("."),meta:e.meta}}function et(e,t,n,i,r,o,s){en(e?.arguments||[],t.arguments||[],{onAdded(a){n(EZ({type:P.DirectiveUsageArgumentAdded,meta:{addedArgumentName:a.name.value,addedArgumentValue:Ye(a.value),oldArgumentValue:null,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}}))},onMutual(a){a.oldVersion&&Ye(a.oldVersion.value)===Ye(a.newVersion.value)||(a.oldVersion&&n(TZ({type:P.DirectiveUsageArgumentRemoved,meta:{removedArgumentName:a.oldVersion.name.value,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}})),n(EZ({type:P.DirectiveUsageArgumentAdded,meta:{addedArgumentName:a.newVersion.name.value,addedArgumentValue:Ye(a.newVersion.value),oldArgumentValue:(a.oldVersion?.value&&Ye(a.oldVersion.value))??null,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}})))},onRemoved(a){n(TZ({type:P.DirectiveUsageArgumentRemoved,meta:{removedArgumentName:a.name.value,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}}))}})}var ZZ=gt(JZ(),1);function Ki(e){return typeof e=="string"?JSON.stringify(e):(0,ZZ.default)(e).replace(/\[Object: null prototype\] /g,"").replace(/(^')|('$)/g,"")}function je(e){return e.replace(/'/g,"\\'")}function jEe(e){return`Directive '${e.removedDirectiveName}' was removed`}var zEe="A directive could be in use of a client application. Removing it could break the client application.";function GEe(e){return{criticality:{level:W.Breaking,reason:zEe},type:P.DirectiveRemoved,message:jEe(e.meta),path:`@${e.meta.removedDirectiveName}`,meta:e.meta}}function YZ(e){return GEe({type:P.DirectiveRemoved,meta:{removedDirectiveName:e.name}})}function VEe(e){return`Directive '${e.addedDirectiveName}' was added`}function BEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveAdded,message:VEe(e.meta),path:`@${e.meta.addedDirectiveName}`,meta:e.meta}}function QZ(e){return BEe({type:P.DirectiveAdded,meta:{addedDirectiveName:e.name,addedDirectiveDescription:e.description??null,addedDirectiveLocations:e.locations.map(t=>String(t)),addedDirectiveRepeatable:e.isRepeatable}})}function qEe(e){return e.oldDirectiveDescription===null&&e.newDirectiveDescription!==null?`Directive '${e.directiveName}' description '${je(e.newDirectiveDescription)}' was added`:e.newDirectiveDescription===null&&e.oldDirectiveDescription!==null?`Directive '${e.directiveName}' description '${je(e.oldDirectiveDescription)}' was removed`:`Directive '${e.directiveName}' description changed from '${je(e.oldDirectiveDescription??"")}' to '${je(e.newDirectiveDescription??"")}'`}function WEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveDescriptionChanged,message:qEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function XZ(e,t){return WEe({type:P.DirectiveDescriptionChanged,meta:{directiveName:t.name,oldDirectiveDescription:e?.description??null,newDirectiveDescription:t.description??null}})}function HEe(e){return`Directive '${e.directiveName}' added repeatable.`}function KEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveRepeatableAdded,message:HEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function e3(e){return KEe({type:P.DirectiveRepeatableAdded,meta:{directiveName:e.name}})}function JEe(e){return`Directive '${e.directiveName}' removed repeatable.`}function ZEe(e){return{criticality:{level:W.Dangerous},type:P.DirectiveRepeatableRemoved,message:JEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function t3(e){return ZEe({type:P.DirectiveRepeatableRemoved,meta:{directiveName:e.name}})}function YEe(e){return`Location '${e.addedDirectiveLocation}' was added to directive '${e.directiveName}'`}function QEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveLocationAdded,message:YEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function n3(e,t){return QEe({type:P.DirectiveLocationAdded,meta:{directiveName:e.name,addedDirectiveLocation:String(t)}})}function XEe(e){return`Location '${e.removedDirectiveLocation}' was removed from directive '${e.directiveName}'`}var eTe="A directive could be in use of a client application. Removing it could break the client application.";function tTe(e){return{criticality:{level:W.Breaking,reason:eTe},type:P.DirectiveLocationRemoved,message:XEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function r3(e,t){return tTe({type:P.DirectiveLocationRemoved,meta:{directiveName:e.name,removedDirectiveLocation:t.toString()}})}var nTe="A directive could be in use of a client application. Adding a non-nullable argument will break those clients.",rTe="A directive could be in use of a client application. Adding a nullable argument will not break those clients.",iTe="Refer to the directive usage for the breaking status. If the directive is new and therefore unused, then adding an argument does not risk breaking clients.";function oTe(e){return{criticality:e.meta.addedToNewDirective?{level:W.NonBreaking,reason:iTe}:e.meta.addedDirectiveArgumentTypeIsNonNull?{level:W.Breaking,reason:nTe}:{level:W.NonBreaking,reason:rTe},type:P.DirectiveArgumentAdded,message:`Argument '${e.meta.addedDirectiveArgumentName}' was added to directive '${e.meta.directiveName}'`,path:`@${e.meta.directiveName}`,meta:e.meta}}function i3(e,t,n){return oTe({type:P.DirectiveArgumentAdded,meta:{directiveName:e.name,addedDirectiveArgumentName:t.name,addedDirectiveArgumentType:t.type.toString(),addedDirectiveDefaultValue:Bd(t)?Ki(Zr(t)):void 0,addedDirectiveArgumentTypeIsNonNull:_e(t.type),addedDirectiveArgumentDescription:t.description??void 0,addedToNewDirective:n}})}function sTe(e){return`Argument '${e.removedDirectiveArgumentName}' was removed from directive '${e.directiveName}'`}var aTe="A directive argument could be in use of a client application. Removing the argument can break client applications.";function cTe(e){return{criticality:{level:W.Breaking,reason:aTe},type:P.DirectiveArgumentRemoved,message:sTe(e.meta),path:`@${e.meta.directiveName}.${e.meta.removedDirectiveArgumentName}`,meta:e.meta}}function o3(e,t){return cTe({type:P.DirectiveArgumentRemoved,meta:{directiveName:e.name,removedDirectiveArgumentName:t.name}})}function lTe(e){return e.oldDirectiveArgumentDescription===null&&e.newDirectiveArgumentDescription!==null?`Description '${je(e.newDirectiveArgumentDescription)}' was added to argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:e.newDirectiveArgumentDescription===null&&e.oldDirectiveArgumentDescription!==null?`Description '${je(e.oldDirectiveArgumentDescription)}' was removed from argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:`Description for argument '${e.directiveArgumentName}' on directive '${e.directiveName}' changed from '${je(e.oldDirectiveArgumentDescription??"")}' to '${je(e.newDirectiveArgumentDescription??"")}'`}function uTe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveArgumentDescriptionChanged,message:lTe(e.meta),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function s3(e,t,n){return uTe({type:P.DirectiveArgumentDescriptionChanged,meta:{directiveName:e.name,directiveArgumentName:n.name,oldDirectiveArgumentDescription:t?.description??null,newDirectiveArgumentDescription:n.description??null}})}function dTe(e){return e.oldDirectiveArgumentDefaultValue===void 0?`Default value '${e.newDirectiveArgumentDefaultValue}' was added to argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:`Default value for argument '${e.directiveArgumentName}' on directive '${e.directiveName}' changed from '${e.oldDirectiveArgumentDefaultValue}' to '${e.newDirectiveArgumentDefaultValue}'`}var pTe="Changing the default value for an argument may change the runtime behaviour of a field if it was never provided.";function fTe(e){return{criticality:{level:W.Dangerous,reason:pTe},type:P.DirectiveArgumentDefaultValueChanged,message:dTe(e.meta),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function a3(e,t,n){let i={directiveName:e.name,directiveArgumentName:n.name},r=t===null?void 0:Zr(t),o=Zr(n);return r!==void 0&&(i.oldDirectiveArgumentDefaultValue=Ki(r)),o!==void 0&&(i.newDirectiveArgumentDefaultValue=Ki(o)),fTe({type:P.DirectiveArgumentDefaultValueChanged,meta:i})}function mTe(e){return`Type for argument '${e.meta.directiveArgumentName}' on directive '${e.meta.directiveName}' changed from '${e.meta.oldDirectiveArgumentType}' to '${e.meta.newDirectiveArgumentType}'`}var gTe="Changing an input field from non-null to null is considered non-breaking.";function hTe(e){return{criticality:e.meta.isSafeDirectiveArgumentTypeChange?{level:W.NonBreaking,reason:gTe}:{level:W.Breaking},type:P.DirectiveArgumentTypeChanged,message:mTe(e),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function c3(e,t,n){return hTe({type:P.DirectiveArgumentTypeChanged,meta:{directiveName:e.name,directiveArgumentName:n.name,oldDirectiveArgumentType:t?.type.toString()??"",newDirectiveArgumentType:n.type.toString(),isSafeDirectiveArgumentTypeChange:Ea(t.type,n.type)}})}function yTe(e){return e.oldQueryTypeName===null?`Schema query root type was set to '${e.newQueryTypeName}'.`:e.newQueryTypeName===null?`Schema query root type '${e.oldQueryTypeName}' was removed.`:`Schema query root type was changed from '${e.oldQueryTypeName}' to '${e.newQueryTypeName}'`}function bTe(e){return{type:P.SchemaQueryTypeChanged,criticality:{level:e.meta.oldQueryTypeName===null?W.NonBreaking:W.Breaking},message:yTe(e.meta),meta:e.meta}}function l3(e,t){let n=e?.getQueryType()?.name||null,i=t?.getQueryType()?.name||null;return bTe({type:P.SchemaQueryTypeChanged,meta:{oldQueryTypeName:n,newQueryTypeName:i}})}function vTe(e){return e.oldMutationTypeName===null?`Schema mutation type was set to '${e.newMutationTypeName}'.`:e.newMutationTypeName===null?`Schema mutation type '${e.oldMutationTypeName}' was removed.`:`Schema mutation type was changed from '${e.oldMutationTypeName}' to '${e.newMutationTypeName}'`}function wTe(e){return{type:P.SchemaMutationTypeChanged,criticality:{level:e.meta.oldMutationTypeName===null?W.NonBreaking:W.Breaking},message:vTe(e.meta),meta:e.meta}}function u3(e,t){let n=e?.getMutationType()?.name||null,i=t?.getMutationType()?.name||null;return wTe({type:P.SchemaMutationTypeChanged,meta:{newMutationTypeName:i,oldMutationTypeName:n}})}function kTe(e){return e.oldSubscriptionTypeName===null?`Schema subscription type was set to '${e.newSubscriptionTypeName}'.`:e.newSubscriptionTypeName===null?`Schema subscription type '${e.oldSubscriptionTypeName}' was removed.`:`Schema subscription type was changed from '${e.oldSubscriptionTypeName}' to '${e.newSubscriptionTypeName}'`}function $Te(e){return{type:P.SchemaSubscriptionTypeChanged,criticality:{level:e.meta.oldSubscriptionTypeName===null?W.NonBreaking:W.Breaking},message:kTe(e.meta),meta:e.meta}}function d3(e,t){let n=e?.getSubscriptionType()?.name||null,i=t?.getSubscriptionType()?.name||null;return $Te({type:P.SchemaSubscriptionTypeChanged,meta:{newSubscriptionTypeName:i,oldSubscriptionTypeName:n}})}function _Te(e){return`Type '${e.removedTypeName}' was removed`}function STe(e){return{criticality:{level:W.Breaking},type:P.TypeRemoved,message:_Te(e.meta),meta:e.meta,path:e.meta.removedTypeName}}function p3(e){return STe({type:P.TypeRemoved,meta:{removedTypeName:e.name}})}function xTe(e){return`Type '${e.addedTypeName}' was added`}function ETe(e){return{criticality:{level:W.NonBreaking},type:P.TypeAdded,message:xTe(e.meta),meta:e.meta,path:e.meta.addedTypeName}}function TTe(e){return Xt(e)?{addedTypeKind:$.ENUM_TYPE_DEFINITION,addedTypeName:e.name}:at(e)||Be(e)?{addedTypeKind:lh(e),addedTypeName:e.name}:Qt(e)?{addedTypeKind:$.UNION_TYPE_DEFINITION,addedTypeName:e.name}:He(e)?{addedTypeKind:$.INPUT_OBJECT_TYPE_DEFINITION,addedTypeIsOneOf:e.isOneOf,addedTypeName:e.name}:{addedTypeKind:lh(e),addedTypeName:e.name}}function f3(e){return ETe({type:P.TypeAdded,meta:TTe(e)})}function ITe(e){return`'${e.meta.typeName}' kind changed from '${e.meta.oldTypeKind}' to '${e.meta.newTypeKind}'`}function ATe(e){return{criticality:{level:W.Breaking,reason:"Changing the kind of a type is a breaking change because it can cause existing queries to error. For example, turning an object type to a scalar type would break queries that define a selection set for this type."},type:P.TypeKindChanged,message:ITe(e),path:e.meta.typeName,meta:e.meta}}function m3(e,t){return ATe({type:P.TypeKindChanged,meta:{typeName:t.name,newTypeKind:String(lh(t)),oldTypeKind:String(lh(e))}})}function RTe(e){let t=je(e.oldTypeDescription),n=je(e.newTypeDescription);return`Description '${t}' on type '${e.typeName}' has changed to '${n}'`}function NTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeDescriptionChanged,message:RTe(e.meta),path:e.meta.typeName,meta:e.meta}}function g3(e,t){return NTe({type:P.TypeDescriptionChanged,meta:{typeName:e.name,newTypeDescription:t.description??"",oldTypeDescription:e.description??""}})}function CTe(e){return`Description '${je(e.removedTypeDescription)}' was removed from object type '${e.typeName}'`}function PTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeDescriptionRemoved,message:CTe(e.meta),path:e.meta.typeName,meta:e.meta}}function h3(e){return PTe({type:P.TypeDescriptionRemoved,meta:{typeName:e.name,removedTypeDescription:e.description??""}})}function DTe(e){let t=je(e.addedTypeDescription);return`Object type '${e.typeName}' has description '${t}'`}function OTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeDescriptionAdded,message:DTe(e.meta),path:e.meta.typeName,meta:e.meta}}function y3(e){return OTe({type:P.TypeDescriptionAdded,meta:{typeName:e.name,addedTypeDescription:e.description??""}})}function YD(e,t,n){Wt(e?.description,t.description)&&n(XZ(e,t)),!t.isRepeatable&&e?.isRepeatable&&n(t3(t)),t.isRepeatable&&!e?.isRepeatable&&n(e3(t));let i={added:FD(t.locations,e?.locations??[]),removed:FD(e?.locations??[],t.locations)};for(let r of i.added)n(n3(t,r));for(let r of i.removed)n(r3(t,r));en(e?.args??[],t.args,{onAdded(r){n(i3(t,r,e===null))},onRemoved(r){n(o3(t,r))},onMutual(r){MTe(t,r.oldVersion,r.newVersion,n)}})}function MTe(e,t,n,i){Wt(t?.description,n.description)&&i(s3(e,t,n)),qd(t,n)||i(a3(e,t,n)),Wt(t.type.toString(),n.type.toString())&&i(c3(e,t,n))}function LTe(e){return`Enum value '${e.removedEnumValueName}' ${e.isEnumValueDeprecated?"(deprecated) ":""}was removed from enum '${e.enumName}'`}var FTe="Removing an enum value will cause existing queries that use this enum value to error.";function UTe(e){return{type:P.EnumValueRemoved,criticality:{level:W.Breaking,reason:FTe},message:LTe(e.meta),meta:e.meta,path:[e.meta.enumName,e.meta.removedEnumValueName].join(".")}}function b3(e,t){return UTe({type:P.EnumValueRemoved,meta:{enumName:e.name,removedEnumValueName:t.name,isEnumValueDeprecated:cs(t)}})}function jTe(e){return`Enum value '${e.meta.addedEnumValueName}' was added to enum '${e.meta.enumName}'`}var zTe="Adding an enum value may break existing clients that were not programming defensively against an added case when querying an enum.";function GTe(e){let t=e.meta.addedToNewType;return{type:P.EnumValueAdded,criticality:{level:t?W.NonBreaking:W.Dangerous,reason:t?void 0:zTe},message:jTe(e),meta:e.meta,path:[e.meta.enumName,e.meta.addedEnumValueName].join(".")}}function v3(e,t,n){return GTe({type:P.EnumValueAdded,meta:{enumName:e.name,addedEnumValueName:t.name,addedToNewType:n,addedDirectiveDescription:t.description??null}})}function VTe(e){return e.oldEnumValueDescription===null&&e.newEnumValueDescription!==null?`Description '${je(e.newEnumValueDescription)}' was added to enum value '${e.enumName}.${e.enumValueName}'`:e.newEnumValueDescription===null&&e.oldEnumValueDescription!==null?`Description '${je(e.oldEnumValueDescription)}' was removed from enum value '${e.enumName}.${e.enumValueName}'`:`Description for enum value '${e.enumName}.${e.enumValueName}' changed from '${je(e.oldEnumValueDescription??"")}' to '${je(e.newEnumValueDescription??"")}'`}function BTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDescriptionChanged,message:VTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName].join("."),meta:e.meta}}function w3(e,t,n){return BTe({type:P.EnumValueDescriptionChanged,meta:{enumName:e.name,enumValueName:n.name,oldEnumValueDescription:t?.description??null,newEnumValueDescription:n.description??null}})}function qTe(e){let t=je(e.oldEnumValueDeprecationReason),n=je(e.newEnumValueDeprecationReason);return`Enum value '${e.enumName}.${e.enumValueName}' deprecation reason changed from '${t}' to '${n}'`}function WTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDeprecationReasonChanged,message:qTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${Jr.name}`].join("."),meta:e.meta}}function k3(e,t,n){return WTe({type:P.EnumValueDeprecationReasonChanged,meta:{enumName:e.name,enumValueName:t.name,oldEnumValueDeprecationReason:t.deprecationReason??"",newEnumValueDeprecationReason:n.deprecationReason??""}})}function HTe(e){let t=je(e.addedValueDeprecationReason);return`Enum value '${e.enumName}.${e.enumValueName}' was deprecated with reason '${t}'`}function KTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDeprecationReasonAdded,message:HTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${Jr.name}`].join("."),meta:e.meta}}function $3(e,t,n){return KTe({type:P.EnumValueDeprecationReasonAdded,meta:{enumName:e.name,enumValueName:n.name,addedValueDeprecationReason:n.deprecationReason??""}})}function JTe(e){return`Deprecation reason was removed from enum value '${e.enumName}.${e.enumValueName}'`}function ZTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDeprecationReasonRemoved,message:JTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName].join("."),meta:e.meta}}function _3(e,t,n){return ZTe({type:P.EnumValueDeprecationReasonRemoved,meta:{enumName:e.name,enumValueName:t.name,removedEnumValueDeprecationReason:t.deprecationReason??""}})}var S3="No longer supported";function E3(e,t,n){en(e?.getValues()??[],t.getValues(),{onAdded(i){n(v3(t,i,e===null)),x3({newVersion:i,oldVersion:null},t,n)},onRemoved(i){n(b3(e,i))},onMutual(i){x3(i,t,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(i){n(nn($.ENUM_TYPE_DEFINITION,i,t,e===null)),et(null,i,n,t)},onMutual(i){et(i.oldVersion,i.newVersion,n,t)},onRemoved(i){n(rn($.ENUM_TYPE_DEFINITION,i,t))}})}function x3(e,t,n){let i=e.oldVersion,r=e.newVersion;Wt(i?.description,r.description)&&n(w3(t,i,r)),Wt(i?.deprecationReason,r.deprecationReason)&&(At(i?.deprecationReason)||i?.deprecationReason===S3?n($3(t,i,r)):At(r.deprecationReason)||r?.deprecationReason===S3?n(_3(t,i,r)):n(k3(t,i,r))),tn(i?.astNode?.directives||[],r.astNode?.directives||[],{onAdded(o){n(nn($.ENUM_VALUE_DEFINITION,o,{type:t,value:r},i===null)),et(null,o,n,t,void 0,void 0,r)},onMutual(o){et(o.oldVersion,o.newVersion,n,t,void 0,void 0,r)},onRemoved(o){n(rn($.ENUM_VALUE_DEFINITION,o,{type:t,value:i}))}})}function YTe(e){return`Input field '${e.removedFieldName}' ${e.isInputFieldDeprecated?"(deprecated) ":""}was removed from input object type '${e.inputName}'`}function QTe(e){return{type:P.InputFieldRemoved,criticality:{level:W.Breaking,reason:"Removing an input field will cause existing queries that use this input field to error."},message:YTe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.removedFieldName].join(".")}}function T3(e,t){return QTe({type:P.InputFieldRemoved,meta:{inputName:e.name,removedFieldName:t.name,isInputFieldDeprecated:cs(t)}})}function XTe(e){return`Input field '${e.addedInputFieldName}' of type '${e.addedInputFieldType}'${e.addedFieldDefault?` with default value '${e.addedFieldDefault}'`:""} was added to input object type '${e.inputName}'`}function eIe(e){let t,n=e.meta.isAddedInputFieldTypeNullable&&e.meta.addedFieldDefault===void 0;return e.meta.addedToNewType?t={level:W.NonBreaking,reason:"The field is being added to a new type."}:n?t={level:W.NonBreaking,reason:"The field is nullable and no default is set."}:e.meta.addedFieldDefault===void 0?t={level:W.Breaking,reason:"Adding a required input field to an existing input object type is a breaking change because it will cause existing uses of this input object type to error."}:t={level:W.Dangerous,reason:"Adding a field with a default value can change runtime behavior for clients that previously omitted it, and during rolling deploys consumers may receive the new default before producers are ready to handle it."},{type:P.InputFieldAdded,criticality:t,message:XTe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.addedInputFieldName].join(".")}}function I3(e,t,n){let i=Zr(t);return eIe({type:P.InputFieldAdded,meta:{inputName:e.name,addedInputFieldName:t.name,isAddedInputFieldTypeNullable:!_e(t.type),addedInputFieldType:t.type.toString(),...Bd(t)?{addedFieldDefault:Ki(i)}:{},addedToNewType:n}})}function tIe(e){let t=je(e.addedInputFieldDescription);return`Input field '${e.inputName}.${e.inputFieldName}' has description '${t}'`}function nIe(e){return{type:P.InputFieldDescriptionAdded,criticality:{level:W.NonBreaking},message:tIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function A3(e,t){return nIe({type:P.InputFieldDescriptionAdded,meta:{inputName:e.name,inputFieldName:t.name,addedInputFieldDescription:t.description??""}})}function rIe(e){return`Description '${je(e.removedDescription)}' was removed from input field '${e.inputName}.${e.inputFieldName}'`}function iIe(e){return{type:P.InputFieldDescriptionRemoved,criticality:{level:W.NonBreaking},message:rIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function R3(e,t){return iIe({type:P.InputFieldDescriptionRemoved,meta:{inputName:e.name,inputFieldName:t.name,removedDescription:t.description??""}})}function oIe(e){let t=je(e.oldInputFieldDescription),n=je(e.newInputFieldDescription);return`Input field '${e.inputName}.${e.inputFieldName}' description changed from '${t}' to '${n}'`}function sIe(e){return{type:P.InputFieldDescriptionChanged,criticality:{level:W.NonBreaking},message:oIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function N3(e,t,n){return sIe({type:P.InputFieldDescriptionChanged,meta:{inputName:e.name,inputFieldName:t.name,oldInputFieldDescription:t.description??"",newInputFieldDescription:n.description??""}})}function aIe(e){return`Input field '${e.inputName}.${e.inputFieldName}' default value changed from '${e.oldDefaultValue}' to '${e.newDefaultValue}'`}function cIe(e){let t={level:W.Dangerous,reason:"Changing the default value for an argument may change the runtime behavior of a field if it was never provided."};return{type:P.InputFieldDefaultValueChanged,criticality:t,message:aIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function C3(e,t,n){let i={inputName:e.name,inputFieldName:n.name},r=Zr(t),o=Zr(n);return r!==void 0&&(i.oldDefaultValue=Ki(r)),o!==void 0&&(i.newDefaultValue=Ki(o)),cIe({type:P.InputFieldDefaultValueChanged,meta:i})}function lIe(e){return`Input field '${e.inputName}.${e.inputFieldName}' changed type from '${e.oldInputFieldType}' to '${e.newInputFieldType}'`}function uIe(e){return{type:P.InputFieldTypeChanged,criticality:e.meta.isInputFieldTypeChangeSafe?{level:W.NonBreaking,reason:"Changing an input field from non-null to null is considered non-breaking."}:{level:W.Breaking,reason:"Changing the type of an input field can cause existing queries that use this field to error."},message:lIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function P3(e,t,n){return uIe({type:P.InputFieldTypeChanged,meta:{inputName:e.name,inputFieldName:n.name,oldInputFieldType:t.type.toString(),newInputFieldType:n.type.toString(),isInputFieldTypeChangeSafe:Ea(t.type,n.type)}})}function O3(e,t,n){let i=e?.getFields()??{},r=t.getFields();en(Object.values(i),Object.values(r),{onAdded(o){n(I3(t,o,e==null)),D3(t,null,o,n)},onRemoved(o){n(T3(e,o))},onMutual(o){D3(t,o.oldVersion,o.newVersion,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(o){n(nn($.INPUT_OBJECT_TYPE_DEFINITION,o,t,e===null)),et(null,o,n,t)},onMutual(o){et(o.oldVersion,o.newVersion,n,t)},onRemoved(o){n(rn($.INPUT_OBJECT_TYPE_DEFINITION,o,e))}})}function D3(e,t,n,i){Wt(t?.description,n.description)&&(At(t?.description)?i(A3(e,n)):At(n.description)?i(R3(e,t)):i(N3(e,t,n))),At(t)||(qd(t,n)||i(C3(e,t,n)),!At(t)&&Wt(t.type.toString(),n.type.toString())&&i(P3(e,t,n))),(t?.astNode?.directives||n.astNode?.directives)&&tn(t?.astNode?.directives||[],n.astNode?.directives||[],{onAdded(r){i(nn($.INPUT_VALUE_DEFINITION,r,{type:e,field:n},t===null)),et(null,r,i,e,n)},onMutual(r){et(r.oldVersion,r.newVersion,i,e,n)},onRemoved(r){i(rn($.INPUT_VALUE_DEFINITION,r,{type:e,field:n}))}})}function dIe(e){return`Field '${e.removedFieldName}' ${e.isRemovedFieldDeprecated?"(deprecated) ":""}was removed from ${e.typeType} '${e.typeName}'`}function pIe(e){return{type:P.FieldRemoved,criticality:{level:W.Breaking,reason:e.meta.isRemovedFieldDeprecated?"Removing a deprecated field is a breaking change. Before removing it, you may want to look at the field's usage to see the impact of removing the field.":"Removing a field is a breaking change. It is preferable to deprecate the field before removing it. This applies to removed union fields as well, since removal breaks client operations that contain fragments that reference the removed type through direct (... on RemovedType) or indirect means such as __typename in the consumers."},message:dIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.removedFieldName].join(".")}}function M$(e,t){let n=Be(e)?"interface":"object type";return pIe({type:P.FieldRemoved,meta:{typeName:e.name,removedFieldName:t.name,isRemovedFieldDeprecated:t.deprecationReason!=null,typeType:n}})}function fIe(e){return`Field '${e.addedFieldName}' was added to ${e.typeType} '${e.typeName}'`}function mIe(e){return{type:P.FieldAdded,criticality:{level:W.NonBreaking},message:fIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.addedFieldName].join(".")}}function L$(e,t){let n=Be(e)?"interface":"object type";return mIe({type:P.FieldAdded,meta:{typeName:e.name,addedFieldName:t.name,typeType:n,addedFieldReturnType:t.type.toString()}})}function gIe(e){return!e.oldDescription&&e.newDescription?`Field '${e.typeName}.${e.fieldName}' description '${je(e.newDescription)}' was added`:!e.newDescription&&e.oldDescription?`Field '${e.typeName}.${e.fieldName}' description '${je(e.oldDescription)}' was removed`:`Field '${e.typeName}.${e.fieldName}' description changed from '${je(e.oldDescription)}' to '${je(e.newDescription)}'`}function hIe(e){return{type:P.FieldDescriptionChanged,criticality:{level:W.NonBreaking},message:gIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function M3(e,t,n){return hIe({type:P.FieldDescriptionChanged,meta:{fieldName:t.name,typeName:e.name,oldDescription:t.description??"",newDescription:n.description??""}})}function yIe(e){let t=je(e.addedDescription);return`Field '${e.typeName}.${e.fieldName}' has description '${t}'`}function bIe(e){return{type:P.FieldDescriptionAdded,criticality:{level:W.NonBreaking},message:yIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function L3(e,t){return bIe({type:P.FieldDescriptionAdded,meta:{typeName:e.name,fieldName:t.name,addedDescription:t.description??""}})}function vIe(e){return`Description was removed from field '${e.typeName}.${e.fieldName}'`}function wIe(e){return{type:P.FieldDescriptionRemoved,criticality:{level:W.NonBreaking},message:vIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function F3(e,t){return wIe({type:P.FieldDescriptionRemoved,meta:{typeName:e.name,fieldName:t.name}})}function kIe(e){return`Field '${e.typeName}.${e.fieldName}' is deprecated`}function $Ie(e){return{type:P.FieldDeprecationAdded,criticality:{level:W.NonBreaking},message:kIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Jr.name}`].join(".")}}function U3(e,t){return $Ie({type:P.FieldDeprecationAdded,meta:{typeName:e.name,fieldName:t.name,deprecationReason:t.deprecationReason??""}})}function _Ie(e){return{type:P.FieldDeprecationRemoved,criticality:{level:W.NonBreaking},message:`Field '${e.meta.typeName}.${e.meta.fieldName}' is no longer deprecated`,meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Jr.name}`].join(".")}}function j3(e,t){return _Ie({type:P.FieldDeprecationRemoved,meta:{fieldName:t.name,typeName:e.name}})}function SIe(e){let t=je(e.oldDeprecationReason),n=je(e.newDeprecationReason);return`Deprecation reason on field '${e.typeName}.${e.fieldName}' has changed from '${t}' to '${n}'`}function xIe(e){return{type:P.FieldDeprecationReasonChanged,criticality:{level:W.NonBreaking},message:SIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Jr.name}`].join(".")}}function z3(e,t,n){return xIe({type:P.FieldDeprecationReasonChanged,meta:{fieldName:n.name,typeName:e.name,newDeprecationReason:n.deprecationReason??"",oldDeprecationReason:t.deprecationReason??""}})}function EIe(e){let t=je(e.addedDeprecationReason);return`Field '${e.typeName}.${e.fieldName}' has deprecation reason '${t}'`}function TIe(e){return{type:P.FieldDeprecationReasonAdded,criticality:{level:W.NonBreaking},message:EIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Jr.name}`].join(".")}}function G3(e,t){return TIe({type:P.FieldDeprecationReasonAdded,meta:{typeName:e.name,fieldName:t.name,addedDeprecationReason:t.deprecationReason??""}})}function IIe(e){return{type:P.FieldDeprecationReasonRemoved,criticality:{level:W.NonBreaking},message:`Deprecation reason was removed from field '${e.meta.typeName}.${e.meta.fieldName}'`,meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function V3(e,t){return IIe({type:P.FieldDeprecationReasonRemoved,meta:{typeName:e.name,fieldName:t.name}})}function AIe(e){return`Field '${e.meta.typeName}.${e.meta.fieldName}' changed type from '${e.meta.oldFieldType}' to '${e.meta.newFieldType}'`}function RIe(e){return{type:P.FieldTypeChanged,criticality:{level:e.meta.isSafeFieldTypeChange?W.NonBreaking:W.Breaking},message:AIe(e),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function B3(e,t,n){return RIe({type:P.FieldTypeChanged,meta:{typeName:e.name,fieldName:t.name,oldFieldType:t.type.toString(),newFieldType:n.type.toString(),isSafeFieldTypeChange:ch(t.type,n.type)}})}function NIe(e){return`Argument '${e.addedArgumentName}: ${e.addedArgumentType}'${e.hasDefaultValue?" (with default value) ":" "}added to field '${e.typeName}.${e.fieldName}'`}function CIe(e){return{type:P.FieldArgumentAdded,criticality:{level:e.meta.addedToNewField?W.NonBreaking:e.meta.isAddedFieldArgumentBreaking?W.Breaking:W.Dangerous},message:NIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.addedArgumentName].join(".")}}function q3(e,t,n,i){let r=Bd(n),o=_e(n.type)&&!r;return CIe({type:P.FieldArgumentAdded,meta:{typeName:e.name,fieldName:t.name,addedArgumentName:n.name,addedArgumentType:n.type.toString(),hasDefaultValue:r,addedToNewField:i,isAddedFieldArgumentBreaking:o}})}function PIe(e){return`Argument '${e.meta.removedFieldArgumentName}: ${e.meta.removedFieldType}' was removed from field '${e.meta.typeName}.${e.meta.fieldName}'`}function DIe(e){return{type:P.FieldArgumentRemoved,criticality:{level:W.Breaking},message:PIe(e),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.removedFieldArgumentName].join(".")}}function W3(e,t,n){return DIe({type:P.FieldArgumentRemoved,meta:{typeName:e.name,fieldName:t.name,removedFieldArgumentName:n.name,removedFieldType:n.type.toString()}})}function OIe(e){return`'${e.objectTypeName}' object implements '${e.addedInterfaceName}' interface`}function MIe(e){return{type:P.ObjectTypeInterfaceAdded,criticality:{level:e.meta.addedToNewType?W.NonBreaking:W.Dangerous,reason:"Adding an interface to an object type may break existing clients that are consuming a field returning the interface type that are not programming defensively against this new possible type."},message:OIe(e.meta),meta:e.meta,path:e.meta.objectTypeName}}function F$(e,t,n){return MIe({type:P.ObjectTypeInterfaceAdded,meta:{objectTypeName:t.name,addedInterfaceName:e.name,addedToNewType:n}})}function LIe(e){return`'${e.objectTypeName}' object type no longer implements '${e.removedInterfaceName}' interface`}function FIe(e){return{type:P.ObjectTypeInterfaceRemoved,criticality:{level:W.Breaking,reason:"Removing an interface from an object type can cause existing queries that use this in a fragment spread to error."},message:LIe(e.meta),meta:e.meta,path:e.meta.objectTypeName}}function U$(e,t){return FIe({type:P.ObjectTypeInterfaceRemoved,meta:{objectTypeName:t.name,removedInterfaceName:e.name}})}function UIe(e){return e.oldDescription===null&&e.newDescription!==null?`Description '${je(e.newDescription)}' was added to argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:e.newDescription===null&&e.oldDescription!==null?`Description '${je(e.oldDescription)}' was removed from argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:`Description for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${je(e.oldDescription??"")}' to '${je(e.newDescription??"")}'`}function jIe(e){return{type:P.FieldArgumentDescriptionChanged,criticality:{level:W.NonBreaking},message:UIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function H3(e,t,n,i){return jIe({type:P.FieldArgumentDescriptionChanged,meta:{typeName:e.name,fieldName:t.name,argumentName:i.name,oldDescription:n?.description??null,newDescription:i.description??null}})}function zIe(e){return e.oldDefaultValue===void 0?`Default value '${e.newDefaultValue}' was added to argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:`Default value for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${e.oldDefaultValue}' to '${e.newDefaultValue}'`}var GIe="Changing the default value for an argument may change the runtime behaviour of a field if it was never provided.";function VIe(e){return{type:P.FieldArgumentDefaultChanged,criticality:{level:W.Dangerous,reason:GIe},message:zIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function K3(e,t,n,i){let r={typeName:e.name,fieldName:t.name,argumentName:i.name},o=n===null?void 0:Zr(n),s=Zr(i);return o!==void 0&&(r.oldDefaultValue=Ki(o)),s!==void 0&&(r.newDefaultValue=Ki(s)),VIe({type:P.FieldArgumentDefaultChanged,meta:r})}function BIe(e){return`Type for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${e.oldArgumentType}' to '${e.newArgumentType}'`}var qIe="Changing an input field from non-null to null is considered non-breaking.",WIe="Changing the type of a field's argument can cause existing queries that use this argument to error.";function HIe(e){return{type:P.FieldArgumentTypeChanged,criticality:e.meta.isSafeArgumentTypeChange?{level:W.NonBreaking,reason:qIe}:{level:W.Breaking,reason:WIe},message:BIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function J3(e,t,n,i){return HIe({type:P.FieldArgumentTypeChanged,meta:{typeName:e.name,fieldName:t.name,argumentName:i.name,oldArgumentType:n?.type.toString()??"",newArgumentType:i.type.toString(),isSafeArgumentTypeChange:!n||Ea(n.type,i.type)}})}function Z3(e,t,n,i,r){Wt(n?.description,i.description)&&r(H3(e,t,n,i)),qd(n,i)||r(K3(e,t,n,i)),Wt(n?.type.toString(),i.type.toString())&&r(J3(e,t,n,i)),(n?.astNode?.directives||i.astNode?.directives)&&tn(n?.astNode?.directives||[],i.astNode?.directives||[],{onAdded(o){r(nn($.ARGUMENT,o,{argument:i,field:t,type:e},n===null)),et(null,o,r,e,t,i)},onMutual(o){et(o.oldVersion,o.newVersion,r,e,t,i)},onRemoved(o){r(rn($.ARGUMENT,o,{argument:n,field:t,type:e}))}})}var Y3="No longer supported";function Hd(e,t,n,i){Wt(t?.description,n.description)&&(At(t?.description)?i(L3(e,n)):At(n.description)?i(F3(e,t)):i(M3(e,t,n))),At(t)||!cs(t)?cs(n)&&i(U3(e,n)):cs(n)?Wt(t.deprecationReason,n.deprecationReason)&&(At(t.deprecationReason)||t.deprecationReason===Y3?i(G3(e,n)):At(n.deprecationReason)||n.deprecationReason===Y3?i(V3(e,t)):i(z3(e,t,n))):cs(t)&&i(j3(e,t)),!At(t)&&Wt(t.type.toString(),n.type.toString())&&i(B3(e,t,n)),en(t?.args??[],n.args,{onAdded(r){i(q3(e,n,r,t===null))},onRemoved(r){i(W3(e,n,r))},onMutual(r){Z3(e,n,r.oldVersion,r.newVersion,i)}}),tn(t?.astNode?.directives||[],n.astNode?.directives||[],{onAdded(r){i(nn($.FIELD_DEFINITION,r,{parentType:e,field:n},t===null)),et(null,r,i,e,n)},onMutual(r){et(r.oldVersion,r.newVersion,i,e,n)},onRemoved(r){i(rn($.FIELD_DEFINITION,r,{parentType:e,field:t}))}})}function Q3(e,t,n){let i=e?.getInterfaces()??[],r=t.getInterfaces();en(i,r,{onAdded(a){n(F$(a,t,e===null))},onRemoved(a){n(U$(a,e))}});let o=e?.getFields()??{},s=t.getFields();en(Object.values(o),Object.values(s),{onAdded(a){n(L$(t,a)),Hd(t,null,a,n)},onRemoved(a){n(M$(e,a))},onMutual(a){Hd(t,a.oldVersion,a.newVersion,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(a){n(nn($.INTERFACE_TYPE_DEFINITION,a,t,e===null)),et(null,a,n,t)},onMutual(a){et(a.oldVersion,a.newVersion,n,t)},onRemoved(a){n(rn($.INTERFACE_TYPE_DEFINITION,a,e))}})}function X3(e,t,n){let i=e?.getInterfaces()??[],r=t.getInterfaces(),o=e?.getFields()??{},s=t.getFields();en(i,r,{onAdded(a){n(F$(a,t,e===null))},onRemoved(a){n(U$(a,e))}}),en(Object.values(o),Object.values(s),{onAdded(a){n(L$(t,a)),Hd(t,null,a,n)},onRemoved(a){n(M$(e,a))},onMutual(a){Hd(t,a.oldVersion,a.newVersion,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(a){n(nn($.OBJECT,a,t,e===null)),et(null,a,n,t)},onMutual(a){et(a.oldVersion,a.newVersion,n,t)},onRemoved(a){n(rn($.OBJECT,a,e))}})}function e8(e,t,n){tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(i){n(nn($.SCALAR_TYPE_DEFINITION,i,t,e===null)),et(null,i,n,t)},onMutual(i){et(i.oldVersion,i.newVersion,n,t)},onRemoved(i){n(rn($.SCALAR_TYPE_DEFINITION,i,e))}})}function KIe(e){return`Member '${e.removedUnionMemberTypeName}' was removed from Union type '${e.unionName}'`}function JIe(e){return{criticality:{level:W.Breaking,reason:"Removing a union member from a union can cause existing queries that use this union member in a fragment spread to error."},type:P.UnionMemberRemoved,message:KIe(e.meta),meta:e.meta,path:e.meta.unionName}}function t8(e,t){return JIe({type:P.UnionMemberRemoved,meta:{unionName:e.name,removedUnionMemberTypeName:t.name}})}function ZIe(e){return`Member '${e.addedUnionMemberTypeName}' was added to Union type '${e.unionName}'`}function YIe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:W.Dangerous,reason:"Adding a possible type to Unions may break existing clients that were not programming defensively against a new possible type."},type:P.UnionMemberAdded,message:ZIe(e.meta),meta:e.meta,path:e.meta.unionName}}function n8(e,t,n){return YIe({type:P.UnionMemberAdded,meta:{unionName:e.name,addedUnionMemberTypeName:t.name,addedToNewType:n}})}function r8(e,t,n){let i=e?.getTypes()??[],r=t.getTypes();en(i,r,{onAdded(o){n(n8(t,o,e===null))},onRemoved(o){n(t8(e,o))}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(o){n(nn($.UNION_TYPE_DEFINITION,o,t,e===null)),et(null,o,n,t)},onMutual(o){et(o.oldVersion,o.newVersion,n,t)},onRemoved(o){n(rn($.UNION_TYPE_DEFINITION,o,e))}})}function o8(e,t){let n=[];function i(r){n.push(r)}en((e?.getDirectives()??[]).filter(r=>!Jc(r)),(t?.getDirectives()??[]).filter(r=>!Jc(r)),{onAdded(r){i(QZ(r)),YD(null,r,i)},onRemoved(r){i(YZ(r))},onMutual(r){YD(r.oldVersion,r.newVersion,i)}}),QIe(e,t,i),en(Object.values(e?.getTypeMap()??{}).filter(r=>!MD(r)&&!LD(r)),Object.values(t?.getTypeMap()??{}).filter(r=>!MD(r)&&!LD(r)),{onAdded(r){i(f3(r)),i8(null,r,i)},onRemoved(r){i(p3(r))},onMutual(r){i8(r.oldVersion,r.newVersion,i)}}),tn(e?.astNode?.directives||[],t?.astNode?.directives||[],{onAdded(r){i(nn($.SCHEMA_DEFINITION,r,t,!1)),et(null,r,i)},onMutual(r){et(r.oldVersion,r.newVersion,i)},onRemoved(r){i(rn($.SCHEMA_DEFINITION,r,e))}});for(let r=0;r{let a=await o;return s({changes:a,oldSchema:e,newSchema:t,config:i})},Promise.resolve(r))}var j$="graphql-inspector",XD={id:"graphql",source:"graphql-diff",tool:j$,weight:1,originClass:"computed-artifact",config:{enabled:"graphql",paths:"graphqlSchemas"},handles(e,t){return/\.(graphql|graphqls|gql|sdl)$/i.test(e)?/\b(type|interface|enum|union|input|scalar|schema|directive)\b/.test(t):!1},async compute(e){let t,n;try{t=ah(e.before,{assumeValidSDL:!0}),n=ah(e.after,{assumeValidSDL:!0})}catch(o){return ma(j$,"parse-failed",`${e.path} could not be parsed as GraphQL SDL on both sides of this change: ${o.message}`)}let i;try{i=await QD(t,n)}catch(o){return ma(j$,"toolchain-failed",`graphql-inspector could not compare ${e.path}: ${o.message}`)}let r=[];for(let o of i){let s=o.criticality?.level;if(s!=="BREAKING"&&s!=="DANGEROUS")continue;let a=o.path??o.type;r.push({code:s8(o.type,s),location:a,pointer:`${e.path}#${a}`,detail:o.message})}return{available:!0,changes:r,tool:j$,weight:1,locator:`${e.path} (GraphQL SDL)`}},codes:{"graphql-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL field \`${e}\` was removed. Every query, mutation, or fragment in this repository that selects it will now be rejected outright \u2014 the whole document fails validation, not just that selection. Find those documents and migrate each to the replacement field; if there is none, propagate the absence rather than substituting a placeholder.`},"graphql-input-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL input field \`${e}\` no longer exists. Stop sending it: an unknown field on an input object fails validation, so every variable payload and inline argument that still carries it will be rejected.`},"graphql-type-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"type",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL type \`${e}\` no longer exists. Every fragment on it, every \`... on ${e}\` inline fragment, and every variable declared with it must be migrated. If there is no replacement type, leave the operation intact with a clearly-marked TODO and explain it in the PR description.`},"graphql-type-kind-changed":{kind:"type-change",taxonomy:{nature:"type-contract",detectability:["runtime-only"],scope:"type",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`\`${e}\` changed kind: ${t} Selections written against the old kind are no longer valid \u2014 an object's field selection does not survive becoming a union or a scalar. Rewrite each selection set for the new kind rather than adjusting it in place.`},"graphql-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL field \`${e}\` changed: ${t} Update the sub-selection and any client-side parsing of the value. A field that became nullable can now return null where the code assumed a value \u2014 handle that explicitly rather than asserting it away.`},"graphql-input-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL input field \`${e}\` changed: ${t} Update every variable payload that sets it so the value sent matches the new type.`},"graphql-argument-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL argument \`${e}\` was removed. Stop passing it \u2014 an unknown argument fails validation, so the whole operation is rejected, not just that argument.`},"graphql-argument-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL argument \`${e}\` changed: ${t} Update the variable declarations and the values passed at every call site.`},"graphql-argument-now-required":{kind:"required-field-added",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` is now required and has no default. Supply it in every operation that reaches this field, using a value that preserves the previous behaviour; if the previous default is not documented, leave a TODO and flag it in the PR description rather than guessing.`},"graphql-argument-default-changed":{kind:"default-change",taxonomy:{nature:"behaviour",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The default value of \`${e}\` changed: ${t} Operations that omit it will silently behave differently. Pass the old value explicitly wherever the previous behaviour was intended.`},"graphql-enum-value-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL enum value \`${e}\` was removed. Find code that sends it and map it onto a still-supported value; code that only *reads* the enum should keep its fallback branch, since a stored value may still carry the old name.`},"graphql-enum-value-added":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` is a new value this code has never seen returned. Add explicit handling; make sure exhaustive switches and mapping tables over that enum have a safe default rather than falling through silently.`},"graphql-union-member-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"type",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`A union or interface membership changed: ${t} An \`... on ${e}\` fragment against a type that is no longer a member fails validation. Rewrite those fragments for the members the schema still declares.`},"graphql-directive-removed":{kind:"config-change",taxonomy:{nature:"configuration",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`A GraphQL directive changed or was removed: ${t} Every operation that applies \`${e}\` \u2014 or applies it where it is no longer allowed \u2014 fails validation. Remove or relocate those usages.`},"graphql-root-type-changed":{kind:"moved-export",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The root operation type \`${e}\` changed: ${t} Every operation of that kind is now rooted somewhere else \u2014 check that the top-level selections in this repository's documents still exist on the new root.`},"graphql-schema-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`graphql-inspector reports a breaking schema change at \`${e}\`: ${t} Update the operations in this repository that touch it.`}}};function s8(e,t){switch(e){case"FIELD_REMOVED":return"graphql-field-removed";case"INPUT_FIELD_REMOVED":return"graphql-input-field-removed";case"TYPE_REMOVED":return"graphql-type-removed";case"TYPE_KIND_CHANGED":return"graphql-type-kind-changed";case"FIELD_TYPE_CHANGED":return"graphql-field-type-changed";case"INPUT_FIELD_TYPE_CHANGED":return"graphql-input-field-type-changed";case"FIELD_ARGUMENT_REMOVED":case"DIRECTIVE_ARGUMENT_REMOVED":return"graphql-argument-removed";case"FIELD_ARGUMENT_TYPE_CHANGED":case"DIRECTIVE_ARGUMENT_TYPE_CHANGED":return"graphql-argument-type-changed";case"FIELD_ARGUMENT_ADDED":case"INPUT_FIELD_ADDED":case"DIRECTIVE_ARGUMENT_ADDED":return t==="BREAKING"?"graphql-argument-now-required":"graphql-schema-changed";case"FIELD_ARGUMENT_DEFAULT_CHANGED":case"INPUT_FIELD_DEFAULT_VALUE_CHANGED":case"DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED":return"graphql-argument-default-changed";case"ENUM_VALUE_REMOVED":return"graphql-enum-value-removed";case"ENUM_VALUE_ADDED":return"graphql-enum-value-added";case"UNION_MEMBER_REMOVED":case"UNION_MEMBER_ADDED":case"OBJECT_TYPE_INTERFACE_REMOVED":return"graphql-union-member-removed";case"DIRECTIVE_REMOVED":case"DIRECTIVE_LOCATION_REMOVED":case"DIRECTIVE_REPEATABLE_REMOVED":return"graphql-directive-removed";case"SCHEMA_QUERY_TYPE_CHANGED":case"SCHEMA_MUTATION_TYPE_CHANGED":case"SCHEMA_SUBSCRIPTION_TYPE_CHANGED":return"graphql-root-type-changed";default:return"graphql-schema-changed"}}var XIe=["openapi-diff","protobuf-diff","graphql-diff"];function a8(e){return XIe.includes(e)}var el=[LP,FP,XD];var u8=Object.fromEntries(el.map(e=>[e.source,e.weight])),d8=Object.fromEntries(el.map(e=>[e.source,e.originClass])),e0e=Object.fromEntries(el.flatMap(e=>Object.entries(e.codes)));function eO(e){return e0e[e]}function p8(e,t){return t.evidence[e.config.enabled]===!0}function f8(e,t){let n=t.evidence[e.config.paths];return Array.isArray(n)?n:[]}var t0e=12e4;async function m8(e,t,n){let i=await(0,z$.mkdtemp)((0,l8.join)((0,c8.tmpdir)(),"drift-spec-"));try{return await e.compute({path:t.path,before:t.before,after:t.after,siblings:n.siblings??[],workdir:i,exec:n.exec??Xe,logger:n.logger,...n.env?{env:n.env}:{},timeoutMs:n.timeoutMs??t0e})}catch(r){return n.logger.debug(`Spec diff crashed for ${t.path}: ${r.message}`),{available:!1,reason:"toolchain-failed",detail:`Drift could not compare ${t.path}: ${r.message}`,tool:e.tool}}finally{await(0,z$.rm)(i,{recursive:!0,force:!0}).catch(()=>{})}}var g8=require("node:crypto"),Ra=require("node:fs/promises"),h8=require("node:path");function y8(e){let t=Lc();return t?(0,h8.join)(t,`artifact-${(0,g8.createHash)("sha256").update(e).digest("hex")}.json`):null}async function Na(e){let t=y8(e);if(!t)return null;try{let n=JSON.parse(await(0,Ra.readFile)(t,"utf8"));return n.format!==1||n.key!==e?null:(nt("artifact.cache.hit"),n.value)}catch{return nt("artifact.cache.miss"),null}}async function Ca(e,t){let n=y8(e);if(n)try{await(0,Ra.mkdir)(Lc(),{recursive:!0});let i=`${n}.${process.pid}.partial`;await(0,Ra.writeFile)(i,JSON.stringify({format:1,key:e,value:t}),"utf8"),await(0,Ra.rename)(i,n)}catch{}}var V$=require("node:zlib");function n0e(e){return e.length>2&&e[0]===31&&e[1]===139}function r0e(e){return e.length>4&&e[0]===80&&e[1]===75}var b8=200*1024*1024;function Fn(e,t={}){let n=t.maxDecompressedBytes??b8;return r0e(e)?tO(e,{maxDecompressedBytes:n}):c0e(n0e(e)?(0,V$.gunzipSync)(e,{maxOutputLength:n}):e)}var i0e=101010256,o0e=33639248;function tO(e,t={}){let n=t.maxDecompressedBytes??b8,i=a0e(e);if(i===-1)return[];let r=e.readUInt16LE(i+10),o=e.readUInt32LE(i+16),s=[];for(let a=0;ae.length||e.readUInt32LE(o)!==o0e);a++){let c=e.readUInt16LE(o+10),l=e.readUInt32LE(o+20),u=e.readUInt32LE(o+24),d=e.readUInt16LE(o+28),p=e.readUInt16LE(o+30),f=e.readUInt16LE(o+32),m=e.readUInt32LE(o+42),g=e.toString("utf8",o+46,o+46+d);o+=46+d+p+f,!g.endsWith("/")&&s.push({path:g,size:u,read:()=>s0e(e,m,c,l,n)})}return s}function s0e(e,t,n,i,r){let o=e.readUInt16LE(t+26),s=e.readUInt16LE(t+28),a=t+30+o+s,c=e.subarray(a,a+i);if(n===0){if(c.length>r)throw new Error(`Stored zip entry exceeds the ${r}-byte decompressed-size limit.`);return Buffer.from(c)}if(n===8)return(0,V$.inflateRawSync)(c,{maxOutputLength:r});throw new Error(`Unsupported zip compression method ${n}`)}function a0e(e){let t=Math.max(0,e.length-65535-22);for(let n=e.length-22;n>=t;n--)if(e.readUInt32LE(n)===i0e)return n;return-1}var fh=512;function c0e(e){let t=[],n=0,i=null;for(;n+fh<=e.length;){let r=e.subarray(n,n+fh);if(r[0]===0)break;let o=G$(r.subarray(0,100)),s=l0e(r.subarray(124,136)),a=String.fromCharCode(r[156]??0),c=G$(r.subarray(345,500)),l=n+fh,u=l+s;if(n=l+Math.ceil(s/fh)*fh,a==="L"){i=G$(e.subarray(l,u));continue}if(a==="x"||a==="X"){i=u0e(e.subarray(l,u))??i;continue}if(a!=="0"&&a!=="\0"&&a!=="7"){i=null;continue}let d=i??(c?`${c}/${o}`:o);if(i=null,!d)continue;let p=e.subarray(l,u);t.push({path:d,size:s,read:()=>Buffer.from(p)})}return t}function G$(e){let t=e.indexOf(0);return e.toString("utf8",0,t===-1?e.length:t).trim()}function l0e(e){let t=G$(e).replace(/[^0-7]/g,"");return t?Number.parseInt(t,8):0}function u0e(e){for(let t of e.toString("utf8").split(` -`)){let n=/^\d+\s+path=(.*)$/.exec(t);if(n)return n[1]}return null}function d0e(e){return/^[aeiou]/i.test(e.trim())?"an":"a"}function Eo(e){return`${d0e(e)} ${e}`}var j8="https://data.jsdelivr.com/v1/packages/npm",dO="https://cdn.jsdelivr.net/npm",p0e="https://registry.npmjs.org",f0e=50*1024*1024,v8=200*1024*1024,w8=20*1024*1024,B$=new Map;function tl(e,t,n={}){if(n.traversal)return m0e+=1,En("surface",e,()=>$8(e,t,n));let i=`${e}@${t}#${n.followDependencies===!1?"own":"deps"}`+(n.subpath?`#${n.subpath}`:""),r=B$.get(i);if(r)return nt("surface.cache.hit"),r;nt("surface.cache.miss");let o=En("surface",e,()=>$8(e,t,n));return B$.set(i,o),o.then(s=>{s||B$.delete(i)},()=>B$.delete(i)),o}var m0e=0;var g0e=6;function h0e(e,t,n,i){return`npm-surface:v${g0e}:${e}@${t}#${n?"deps":"own"}`+(i?`#${i}`:"")}async function y0e(e,t,n,i){let r=fO(z8(n?.exports,i)),o=[...r?gh(nl(r)):[],...gh(nl(i))],s=[...new Set(o)],a=await pO(e,t,s);if(a!==void 0)return a;for(let c of s)if(await Q$(e,t,c))return c;return null}function k8(e){let t=e.split("/");return e.startsWith("@")?t.slice(0,2).join("/"):t[0]??e}function z8(e,t){if(!e||typeof e!="object")return;let n=e;for(let i of[`./${t}`,t])if(i in n)return n[i]}async function $8(e,t,n){let i=n.followDependencies!==!1,r=h0e(e,t,i,n.subpath),o=await Na(r);if(o)return nt("surface.diskCache.hit"),{...o,incomplete:o.incomplete??!1,api:new Map(o.api)};nt("surface.diskCache.miss");let s=await oO(e,t),a=n.subpath?await y0e(e,t,s,n.subpath):await P0e(e,t,s),c=a?await En("surface-sources",e,()=>nO(e,t,a)):{sources:[],truncated:!1};if(!a||c.sources.length===0){let h=await $0e(e,t);if(!h)throw new Kd(e,t);if(s=h.manifest,a=n.subpath?await O0e(s,n.subpath,h.files):D0e(e,s,h.files),a&&(c=await En("surface-sources",e,()=>nO(e,t,a,h)),c.sources.length===0))throw new Kd(e,t)}if(!a){if(a=await M0e(e,t,n.subpath),!a)return null;c=await En("surface-sources",e,()=>nO(e,t,a))}let l=c.sources,u=c.truncated;if(nt("surface.declarationFiles",l.length),l.length===0)return null;let d=new Map,p=[];for(let h of l)B0e(h.content,h.path,d,p,e);K0e(d,p),q8(d);let f=d.size,m=!s||!i?{followed:[],attempted:!1,incomplete:!1}:await En("surface-deps",e,()=>I0e(s,l,d,`${e}@${t}`,n.traversal)),g=d.size>0?{api:d,entryPath:a,viaDependencies:m.followed,ownSymbols:f,subpaths:C0e(s?.exports),incomplete:m.incomplete||u}:null;return g&&!m.attempted&&!g.incomplete&&await Ca(r,{...g,api:[...g.api]}),g}var Y$=class extends Error{constructor(n,i){super(`${n}@${i} could not be fetched`);this.packageName=n;this.version=i;this.name="VersionUnavailableError"}packageName;version},Kd=class extends Error{constructor(n,i){super(`${n}@${i} artifact could not be inspected`);this.packageName=n;this.version=i;this.name="ArtifactUnavailableError"}packageName;version};function oO(e,t){return $e(`${dO}/${e}@${t}/package.json`)}async function G8(e,t,n){let[i,r]=await Promise.all([oO(e,t),oO(e,n)]);if(!i||!r)return[];let o=_8(e,i),s=_8(e,r),a=[],c=[...o.requireConditions].filter(u=>!s.requireConditions.has(u)&&!s.commonJsExports.has(u));for(let u of c){let d=aO(e,u),p=w0e(u)?"affectedSpecifierPatterns":"affectedSpecifiers";a.push({kind:"exports-require-condition-removed",symbol:e,detail:u==="."?"The root CommonJS export condition was removed":`The CommonJS export condition for ${u} was removed`,before:[...o.requireConditions].sort().join(` +`))}var hn={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function B9(e,t){let n=t({getNamedType:c,setNamedType:l,getNamedTypes:u}),r=new Map;for(let A of e.types){let I=A.name,R=d(A);R&&r.set(I,R)}let i=[];for(let A of e.directives){if(yl(A)){i.push(A);continue}let I=x(A.toConfig());I&&i.push(new Pn(I))}let o={...e,query:e.query&&c(e.query.name),mutation:e.mutation&&c(e.mutation.name),subscription:e.subscription&&c(e.subscription.name),types:Array.from(r.values()),directives:i},s=n[hn.SCHEMA];return s==null?o:s(o);function a(A){return Ze(A)?new Zt(a(A.ofType)):Re(A)?new xe(a(A.ofType)):c(A.name)}function c(A){let I=B0e.get(A)??r.get(A);return I===void 0&&st(!1,`Unknown type: "${A}".`),I}function l(A){r.set(A.name,A)}function u(){return Array.from(r.values())}function d(A){if(XM(A)||WM(A))return A;if(_r(A))return p(A);if(ut(A))return f(A);if(He(A))return h(A);if(nn(A))return v(A);if(rn(A))return b(A);if(Je(A))return w(A);st(!1,"Unexpected type: "+fe(A))}function p(A){let I=A.toConfig(),R=n[hn.SCALAR];return I=R==null?I:R(I),new vr(I)}function f(A){let I=A.toConfig(),R={...I,interfaces:()=>I.interfaces.map(j=>c(j.name)),fields:()=>m(I.fields,A.name)},C=n[hn.OBJECT];return R=C==null?R:C(R),new rr(R)}function m(A,I){let R=Object.create(null);for(let[C,j]of Object.entries(A)){let z={...j,type:a(j.type),args:g(j.args,C,I)},Y=n[hn.FIELD];Y&&(z=Y(z,I)),R[C]=z}return R}function g(A,I,R){let C=Object.create(null);for(let[j,z]of Object.entries(A)){let Y={...z,type:a(z.type)},se=n[hn.ARGUMENT];se&&(Y=se(Y,I,R)),C[j]=Y}return C}function h(A){let I=A.toConfig(),R={...I,interfaces:()=>I.interfaces.map(j=>c(j.name)),fields:()=>m(I.fields,A.name)},C=n[hn.INTERFACE];return R=C==null?R:C(R),new Ss(R)}function v(A){let I=A.toConfig(),R={...I,types:()=>I.types.map(j=>c(j.name))},C=n[hn.UNION];return R=C==null?R:C(R),new xs(R)}function b(A){let I=A.toConfig(),R={...I,values:()=>{let j=Object.create(null);for(let[z,Y]of Object.entries(I.values)){let se=_(Y,z,A.name);j[z]=se}return j}},C=n[hn.ENUM];return R=C==null?R:C(R),new Ni(R)}function _(A,I,R){let C={...A},j=n[hn.ENUM_VALUE];return j==null?C:j(C,I,R)}function w(A){let I=A.toConfig(),R={...I,fields:()=>{let j=Object.create(null);for(let[z,Y]of Object.entries(I.fields)){let se=k(Y,z,A.name);j[z]=se}return j}},C=n[hn.INPUT_OBJECT];return R=C==null?R:C(R),new Es(R)}function k(A,I,R){let C={...A,type:a(A.type)},j=n[hn.INPUT_FIELD];return j==null?C:j(C,I,R)}function x(A){let I={...A,args:g(A.args,A.name,void 0)},R=n[hn.DIRECTIVE];return R==null?I:R(I)}}var B0e=new Map([...Wa,...Ja].map(e=>[e.name,e]));function V9(e,t,n){let r=[],i=new zr,o=new zr,s=new zr,a=new zr,c=new zr,l=new zr,u=new zr,d=[],p,f=[],m=!1;for(let g of t.definitions){switch(g.kind){case S.SCHEMA_DEFINITION:p=g;break;case S.SCHEMA_EXTENSION:f.push(g);break;case S.DIRECTIVE_DEFINITION:d.push(g);break;case S.DIRECTIVE_EXTENSION:u.add(g.name.value,g);break;case S.SCALAR_TYPE_DEFINITION:case S.OBJECT_TYPE_DEFINITION:case S.INTERFACE_TYPE_DEFINITION:case S.UNION_TYPE_DEFINITION:case S.ENUM_TYPE_DEFINITION:case S.INPUT_OBJECT_TYPE_DEFINITION:r.push(g);break;case S.SCALAR_TYPE_EXTENSION:i.add(g.name.value,g);break;case S.OBJECT_TYPE_EXTENSION:o.add(g.name.value,g);break;case S.INTERFACE_TYPE_EXTENSION:s.add(g.name.value,g);break;case S.UNION_TYPE_EXTENSION:a.add(g.name.value,g);break;case S.ENUM_TYPE_EXTENSION:c.add(g.name.value,g);break;case S.INPUT_OBJECT_TYPE_EXTENSION:l.add(g.name.value,g);break;default:continue}m=!0}return m?B9(e,g=>{let{getNamedType:h,setNamedType:v,getNamedTypes:b}=g;return{[hn.SCHEMA]:L=>{for(let ce of r){let le=V0e.get(ce.name.value)??se(ce);v(le)}let ee={query:L.query&&h(L.query.name),mutation:L.mutation&&h(L.mutation.name),subscription:L.subscription&&h(L.subscription.name),...p&&_([p]),..._(f)};return{description:p?.description?.value??L.description,...ee,types:b(),directives:[...L.directives.map(A),...d.map(x)],extensions:L.extensions,astNode:p??L.astNode,extensionASTNodes:L.extensionASTNodes.concat(f),assumeValid:n?.assumeValid??!1}},[hn.INPUT_OBJECT]:L=>{let ee=l.get(L.name)??[];return{...L,fields:()=>({...L.fields(),...C(ee)}),extensionASTNodes:L.extensionASTNodes.concat(ee)}},[hn.ENUM]:L=>{let ee=c.get(L.name)??[];return{...L,values:()=>({...L.values(),...j(ee)}),extensionASTNodes:L.extensionASTNodes.concat(ee)}},[hn.SCALAR]:L=>{let ee=i.get(L.name)??[],ce=L.specifiedByURL;for(let le of ee)ce=S1(le)??ce;return{...L,specifiedByURL:ce,extensionASTNodes:L.extensionASTNodes.concat(ee)}},[hn.OBJECT]:L=>{let ee=o.get(L.name)??[];return{...L,interfaces:()=>[...L.interfaces(),...z(ee)],fields:()=>({...L.fields(),...I(ee)}),extensionASTNodes:L.extensionASTNodes.concat(ee)}},[hn.INTERFACE]:L=>{let ee=s.get(L.name)??[];return{...L,interfaces:()=>[...L.interfaces(),...z(ee)],fields:()=>({...L.fields(),...I(ee)}),extensionASTNodes:L.extensionASTNodes.concat(ee)}},[hn.UNION]:L=>{let ee=a.get(L.name)??[];return{...L,types:()=>[...L.types(),...Y(ee)],extensionASTNodes:L.extensionASTNodes.concat(ee)}}};function _(L){let ee={};for(let ce of L){let le=ce.operationTypes??[];for(let Ae of le)ee[Ae.operation]=w(Ae.type)}return ee}function w(L){let ee=L.name.value,ce=h(ee);return ce===void 0&&st(!1,`Unknown type: "${ee}".`),ce}function k(L){return L.kind===S.LIST_TYPE?new Zt(k(L.type)):L.kind===S.NON_NULL_TYPE?new xe(k(L.type)):w(L)}function x(L){let ee=u.get(L.name.value)??[],ce=wl(L)??ee.map(le=>wl(le)).find(le=>le!=null);return new Pn({name:L.name.value,description:L.description?.value,locations:L.locations.map(({value:le})=>le),isRepeatable:L.repeatable,args:R(L.arguments),deprecationReason:ce,astNode:L,extensionASTNodes:ee})}function A(L){let ee=u.get(L.name)??[];if(ee.length===0)return L;let ce=L.deprecationReason??ee.map(le=>wl(le)).find(le=>le!=null);return new Pn({...L.toConfig(),deprecationReason:ce,extensionASTNodes:L.extensionASTNodes.concat(ee)})}function I(L){let ee=Object.create(null);for(let ce of L){let le=ce.fields??[];for(let Ae of le)ee[Ae.name.value]={type:k(Ae.type),description:Ae.description?.value,args:R(Ae.arguments),deprecationReason:wl(Ae),astNode:Ae}}return ee}function R(L){let ee=L??[],ce=Object.create(null);for(let le of ee){let Ae=k(le.type);ce[le.name.value]={type:Ae,description:le.description?.value,default:le.defaultValue&&{literal:le.defaultValue},deprecationReason:wl(le),astNode:le}}return ce}function C(L){let ee=Object.create(null);for(let ce of L){let le=ce.fields??[];for(let Ae of le){let Ke=k(Ae.type);ee[Ae.name.value]={type:Ke,description:Ae.description?.value,default:Ae.defaultValue&&{literal:Ae.defaultValue},deprecationReason:wl(Ae),astNode:Ae}}}return ee}function j(L){let ee=Object.create(null);for(let ce of L){let le=ce.values??[];for(let Ae of le)ee[Ae.name.value]={description:Ae.description?.value,deprecationReason:wl(Ae),astNode:Ae}}return ee}function z(L){return L.flatMap(ee=>ee.interfaces?.map(w)??[])}function Y(L){return L.flatMap(ee=>ee.types?.map(w)??[])}function se(L){let ee=L.name.value;switch(L.kind){case S.OBJECT_TYPE_DEFINITION:{let ce=o.get(ee)??[],le=[L,...ce];return new rr({name:ee,description:L.description?.value,interfaces:()=>z(le),fields:()=>I(le),astNode:L,extensionASTNodes:ce})}case S.INTERFACE_TYPE_DEFINITION:{let ce=s.get(ee)??[],le=[L,...ce];return new Ss({name:ee,description:L.description?.value,interfaces:()=>z(le),fields:()=>I(le),astNode:L,extensionASTNodes:ce})}case S.ENUM_TYPE_DEFINITION:{let ce=c.get(ee)??[],le=[L,...ce];return new Ni({name:ee,description:L.description?.value,values:()=>j(le),astNode:L,extensionASTNodes:ce})}case S.UNION_TYPE_DEFINITION:{let ce=a.get(ee)??[],le=[L,...ce];return new xs({name:ee,description:L.description?.value,types:()=>Y(le),astNode:L,extensionASTNodes:ce})}case S.SCALAR_TYPE_DEFINITION:{let ce=i.get(ee)??[],le=S1(L);for(let Ae of ce)le=S1(Ae)??le;return new vr({name:ee,description:L.description?.value,specifiedByURL:le,astNode:L,extensionASTNodes:ce})}case S.INPUT_OBJECT_TYPE_DEFINITION:{let ce=l.get(ee)??[],le=[L,...ce];return new Es({name:ee,description:L.description?.value,fields:()=>C(le),astNode:L,extensionASTNodes:ce,isOneOf:q0e(L)})}}}}):e}var V0e=new Map([...Wa,...Ja].map(e=>[e.name,e]));function wl(e){return pp(ai,e)?.reason}function S1(e){return pp(sy,e)?.url}function q0e(e){return!!pp(ay,e)}function x1(e,t){t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&G9(e);let r=V9({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(r.astNode==null)for(let o of r.types)switch(o.name){case"Query":r.query=o;break;case"Mutation":r.mutation=o;break;case"Subscription":r.subscription=o;break}let i=[...r.directives,...wr.filter(o=>r.directives.every(s=>s.name!==o.name))];return new uy({...r,directives:i})}function gy(e,t){let n=n1(e,{noLocation:t?.noLocation,experimentalFragmentArguments:t?.experimentalFragmentArguments});return x1(n,{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}function Qa(e,t,n){if(e){if(e.kind===S.VARIABLE){let r=e.name.value;if(n==null||!Object.hasOwn(n,r))return;let i=n[r];return i===void 0||i===null&&Re(t)?void 0:i}if(Re(t))return e.kind===S.NULL?void 0:Qa(e,t.ofType,n);if(e.kind===S.NULL)return null;if(Ze(t)){let r=t.ofType;if(e.kind===S.LIST){let o=[];for(let s of e.values)if(q9(s,n)){if(Re(r))return;o.push(null)}else{let a=Qa(s,r,n);if(a===void 0)return;o.push(a)}return o}let i=Qa(e,r,n);return i===void 0?void 0:[i]}if(Je(t)){if(e.kind!==S.OBJECT)return;let r=Object.create(null),i=t.getFields();if(e.fields.some(a=>!Object.hasOwn(i,a.name.value)))return;let s=new Map(e.fields.map(a=>[a.name.value,a]));for(let a of Object.values(i)){let c=s.get(a.name);if(c==null||q9(c.value,n)){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(Re(a.type))return;continue}let l=Qa(c.value,a.type,n);if(l===void 0)return;r[a.name]=l}if(t.isOneOf){let a=Object.keys(r);if(s.size!==1||a.length!==1)return;for(let[c,l]of s)if(l.value.kind===S.NULL||r[c]===null)return}return r}if(Oi(t)){let r;try{r=t.parseLiteral(e,n)}catch{return}return r===void 0?void 0:r}st(!1,"Unexpected input type: "+fe(t))}}function q9(e,t){return e.kind===S.VARIABLE&&(t?.[e.name.value]===void 0||!Object.hasOwn(t,e.name.value))}function Rs(e){return"isDeprecated"in e?!!e.isDeprecated:!!(e.deprecationReason!=null||e.astNode?.directives?.some(t=>t.name.value==="deprecated"))}function ci(e){return e.default!==void 0?e.default.literal!==void 0?Qa(e.default.literal,e.type):Fo(e.default.value,e.type):e.defaultValue}function mp(e){return e.default!==void 0||e.defaultValue!==void 0}function gp(e,t){return E1(e==null?void 0:ci(e),ci(t))}function E1(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((n,r)=>E1(n,t[r]));if(e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"){let n=e,r=t,i=Object.keys(n),o=Object.keys(r);return i.length===o.length&&i.every(s=>Object.prototype.hasOwnProperty.call(r,s)&&E1(n[s],r[s]))}return!1}function hy(e,t){if(!so(e)&&!so(t))return e.toString()===t.toString();if(Re(t)){let n=Re(e)?e.ofType:e;return hy(n,t.ofType)}return Ze(e)?Ze(t)&&hy(e.ofType,t.ofType)||Re(t)&&hy(e,t.ofType):!1}function Xa(e,t){if(!so(e)&&!so(t))return e?.toString()===t.toString();if(Ze(e)&&Ze(t))return Xa(e.ofType,t.ofType);if(Re(e)){let n=Re(t)?t.ofType:t;return Xa(e.ofType,n)}return!1}function yy(e){return e.astNode?.kind||""}function T1(e){return["String","Int","Float","Boolean","ID"].includes(typeof e=="string"?e:e.name)}function A1(e){return["__Schema","__Type","__TypeKind","__Field","__InputValue","__EnumValue","__Directive","__DirectiveLocation"].includes(typeof e=="string"?e:e.name)}var J;(function(e){e.Breaking="BREAKING",e.NonBreaking="NON_BREAKING",e.Dangerous="DANGEROUS"})(J||(J={}));var F={FieldArgumentDescriptionChanged:"FIELD_ARGUMENT_DESCRIPTION_CHANGED",FieldArgumentDefaultChanged:"FIELD_ARGUMENT_DEFAULT_CHANGED",FieldArgumentTypeChanged:"FIELD_ARGUMENT_TYPE_CHANGED",DirectiveRemoved:"DIRECTIVE_REMOVED",DirectiveAdded:"DIRECTIVE_ADDED",DirectiveDescriptionChanged:"DIRECTIVE_DESCRIPTION_CHANGED",DirectiveLocationAdded:"DIRECTIVE_LOCATION_ADDED",DirectiveLocationRemoved:"DIRECTIVE_LOCATION_REMOVED",DirectiveArgumentAdded:"DIRECTIVE_ARGUMENT_ADDED",DirectiveArgumentRemoved:"DIRECTIVE_ARGUMENT_REMOVED",DirectiveArgumentDescriptionChanged:"DIRECTIVE_ARGUMENT_DESCRIPTION_CHANGED",DirectiveArgumentDefaultValueChanged:"DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED",DirectiveArgumentTypeChanged:"DIRECTIVE_ARGUMENT_TYPE_CHANGED",DirectiveRepeatableAdded:"DIRECTIVE_REPEATABLE_ADDED",DirectiveRepeatableRemoved:"DIRECTIVE_REPEATABLE_REMOVED",EnumValueRemoved:"ENUM_VALUE_REMOVED",EnumValueAdded:"ENUM_VALUE_ADDED",EnumValueDescriptionChanged:"ENUM_VALUE_DESCRIPTION_CHANGED",EnumValueDeprecationReasonChanged:"ENUM_VALUE_DEPRECATION_REASON_CHANGED",EnumValueDeprecationReasonAdded:"ENUM_VALUE_DEPRECATION_REASON_ADDED",EnumValueDeprecationReasonRemoved:"ENUM_VALUE_DEPRECATION_REASON_REMOVED",FieldRemoved:"FIELD_REMOVED",FieldAdded:"FIELD_ADDED",FieldDescriptionChanged:"FIELD_DESCRIPTION_CHANGED",FieldDescriptionAdded:"FIELD_DESCRIPTION_ADDED",FieldDescriptionRemoved:"FIELD_DESCRIPTION_REMOVED",FieldDeprecationAdded:"FIELD_DEPRECATION_ADDED",FieldDeprecationRemoved:"FIELD_DEPRECATION_REMOVED",FieldDeprecationReasonChanged:"FIELD_DEPRECATION_REASON_CHANGED",FieldDeprecationReasonAdded:"FIELD_DEPRECATION_REASON_ADDED",FieldDeprecationReasonRemoved:"FIELD_DEPRECATION_REASON_REMOVED",FieldTypeChanged:"FIELD_TYPE_CHANGED",FieldArgumentAdded:"FIELD_ARGUMENT_ADDED",FieldArgumentRemoved:"FIELD_ARGUMENT_REMOVED",InputFieldRemoved:"INPUT_FIELD_REMOVED",InputFieldAdded:"INPUT_FIELD_ADDED",InputFieldDescriptionAdded:"INPUT_FIELD_DESCRIPTION_ADDED",InputFieldDescriptionRemoved:"INPUT_FIELD_DESCRIPTION_REMOVED",InputFieldDescriptionChanged:"INPUT_FIELD_DESCRIPTION_CHANGED",InputFieldDefaultValueChanged:"INPUT_FIELD_DEFAULT_VALUE_CHANGED",InputFieldTypeChanged:"INPUT_FIELD_TYPE_CHANGED",ObjectTypeInterfaceAdded:"OBJECT_TYPE_INTERFACE_ADDED",ObjectTypeInterfaceRemoved:"OBJECT_TYPE_INTERFACE_REMOVED",SchemaQueryTypeChanged:"SCHEMA_QUERY_TYPE_CHANGED",SchemaMutationTypeChanged:"SCHEMA_MUTATION_TYPE_CHANGED",SchemaSubscriptionTypeChanged:"SCHEMA_SUBSCRIPTION_TYPE_CHANGED",TypeRemoved:"TYPE_REMOVED",TypeAdded:"TYPE_ADDED",TypeKindChanged:"TYPE_KIND_CHANGED",TypeDescriptionChanged:"TYPE_DESCRIPTION_CHANGED",TypeDescriptionRemoved:"TYPE_DESCRIPTION_REMOVED",TypeDescriptionAdded:"TYPE_DESCRIPTION_ADDED",UnionMemberRemoved:"UNION_MEMBER_REMOVED",UnionMemberAdded:"UNION_MEMBER_ADDED",DirectiveUsageUnionMemberAdded:"DIRECTIVE_USAGE_UNION_MEMBER_ADDED",DirectiveUsageUnionMemberRemoved:"DIRECTIVE_USAGE_UNION_MEMBER_REMOVED",DirectiveUsageEnumAdded:"DIRECTIVE_USAGE_ENUM_ADDED",DirectiveUsageEnumRemoved:"DIRECTIVE_USAGE_ENUM_REMOVED",DirectiveUsageEnumValueAdded:"DIRECTIVE_USAGE_ENUM_VALUE_ADDED",DirectiveUsageEnumValueRemoved:"DIRECTIVE_USAGE_ENUM_VALUE_REMOVED",DirectiveUsageInputObjectAdded:"DIRECTIVE_USAGE_INPUT_OBJECT_ADDED",DirectiveUsageInputObjectRemoved:"DIRECTIVE_USAGE_INPUT_OBJECT_REMOVED",DirectiveUsageFieldAdded:"DIRECTIVE_USAGE_FIELD_ADDED",DirectiveUsageFieldRemoved:"DIRECTIVE_USAGE_FIELD_REMOVED",DirectiveUsageScalarAdded:"DIRECTIVE_USAGE_SCALAR_ADDED",DirectiveUsageScalarRemoved:"DIRECTIVE_USAGE_SCALAR_REMOVED",DirectiveUsageObjectAdded:"DIRECTIVE_USAGE_OBJECT_ADDED",DirectiveUsageObjectRemoved:"DIRECTIVE_USAGE_OBJECT_REMOVED",DirectiveUsageInterfaceAdded:"DIRECTIVE_USAGE_INTERFACE_ADDED",DirectiveUsageInterfaceRemoved:"DIRECTIVE_USAGE_INTERFACE_REMOVED",DirectiveUsageArgumentDefinitionAdded:"DIRECTIVE_USAGE_ARGUMENT_DEFINITION_ADDED",DirectiveUsageArgumentDefinitionRemoved:"DIRECTIVE_USAGE_ARGUMENT_DEFINITION_REMOVED",DirectiveUsageSchemaAdded:"DIRECTIVE_USAGE_SCHEMA_ADDED",DirectiveUsageSchemaRemoved:"DIRECTIVE_USAGE_SCHEMA_REMOVED",DirectiveUsageFieldDefinitionAdded:"DIRECTIVE_USAGE_FIELD_DEFINITION_ADDED",DirectiveUsageFieldDefinitionRemoved:"DIRECTIVE_USAGE_FIELD_DEFINITION_REMOVED",DirectiveUsageInputFieldDefinitionAdded:"DIRECTIVE_USAGE_INPUT_FIELD_DEFINITION_ADDED",DirectiveUsageInputFieldDefinitionRemoved:"DIRECTIVE_USAGE_INPUT_FIELD_DEFINITION_REMOVED",DirectiveUsageArgumentAdded:"DIRECTIVE_USAGE_ARGUMENT_ADDED",DirectiveUsageArgumentRemoved:"DIRECTIVE_USAGE_ARGUMENT_REMOVED"};function W9(e,t){return e.reduce((n,r)=>(n[t(r)]=r,n),Object.create(null))}function pS(e,t){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n"u"||e===null}function I1(e,t){return e.filter(n=>!t.some(r=>pS(r,n)))}function Mi(e){return typeof e=="string"?e:e.value}function on(e,t,n){let r=W9(e,({name:c})=>Mi(c)),i=W9(t,({name:c})=>Mi(c)),o=[],s=[],a=[];for(let c of e){let l=i[Mi(c.name)]??null;l===null?s.push(c):a.push({newVersion:l,oldVersion:c??null})}for(let c of t)r[Mi(c.name)]===void 0&&o.push(c);if(n){if(n.onRemoved)for(let c of s)n.onRemoved(c);if(n.onAdded)for(let c of o)n.onAdded(c);if(n.onMutual)for(let c of a)n.onMutual(c)}return{added:o,removed:s,mutual:a}}function sn(e,t,n){let r=H9(e,({name:c})=>Mi(c)),i=H9(t,({name:c})=>Mi(c)),o=[],s=[],a=[];for(let c of e){let l=i[Mi(c.name)]??null;if(l===null)s.push(c);else{let[u,...d]=l;d.length>0?i[Mi(c.name)]=d:delete i[Mi(c.name)],a.push({newVersion:u,oldVersion:c??null})}}for(let c of t){let l=r[Mi(c.name)]??null;if(l===null)o.push(c);else{let[u,...d]=l;d.length>0?r[Mi(c.name)]=d:delete r[Mi(c.name)]}}if(n){if(n.onRemoved)for(let c of s)n.onRemoved(c);if(n.onAdded)for(let c of o)n.onAdded(c);if(n.onMutual)for(let c of a)n.onMutual(c)}return{added:o,removed:s,mutual:a}}function H9(e,t){return e.reduce((n,r)=>{let i=t(r);return n[i]=[...n[i]??[],r],n},Object.create(null))}function Li(e,t){return e==="deprecated"?J.NonBreaking:e==="oneOf"?J.Breaking:t}function Fi(e,t){return e==="deprecated"?J.NonBreaking:e==="oneOf"?J.NonBreaking:t}function K0e(e){return`Directive '${e.addedDirectiveName}' was added to argument '${e.argumentName}' of field '${e.fieldName}' in type '${e.typeName}'`}function J0e(e){return{criticality:{level:e.meta.addedToNewType?J.NonBreaking:Li(e.meta.addedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to argument '${e.meta.argumentName}'`},type:F.DirectiveUsageArgumentDefinitionAdded,message:K0e(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Z0e(e){return`Directive '${e.removedDirectiveName}' was removed from argument '${e.argumentName}' of field '${e.fieldName}' in type '${e.typeName}'`}function Y0e(e){return{criticality:{level:Fi(e.meta.removedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from argument '${e.meta.argumentName}'`},type:F.DirectiveUsageArgumentDefinitionRemoved,message:Z0e(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Q0e(e){return`Directive '${e.addedDirectiveName}' was added to input object '${e.inputObjectName}'`}function X0e(e){return{criticality:{level:e.meta.addedToNewType?J.NonBreaking:Li(e.meta.addedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to input object '${e.meta.inputObjectName}'`},type:F.DirectiveUsageInputObjectAdded,message:Q0e(e.meta),path:[e.meta.inputObjectName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function ePe(e){return`Directive '${e.removedDirectiveName}' was removed from input object '${e.inputObjectName}'`}function tPe(e){return{criticality:{level:Fi(e.meta.removedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from input object '${e.meta.inputObjectName}'`},type:F.DirectiveUsageInputObjectRemoved,message:ePe(e.meta),path:[e.meta.inputObjectName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function nPe(e){return`Directive '${e.addedDirectiveName}' was added to interface '${e.interfaceName}'`}function rPe(e){return{criticality:{level:e.meta.addedToNewType?J.NonBreaking:Li(e.meta.addedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to interface '${e.meta.interfaceName}'`},type:F.DirectiveUsageInterfaceAdded,message:nPe(e.meta),path:[e.meta.interfaceName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function iPe(e){return`Directive '${e.removedDirectiveName}' was removed from interface '${e.interfaceName}'`}function oPe(e){return{criticality:{level:Fi(e.meta.removedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from interface '${e.meta.interfaceName}'`},type:F.DirectiveUsageInterfaceRemoved,message:iPe(e.meta),path:[e.meta.interfaceName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function sPe(e){return`Directive '${e.addedDirectiveName}' was added to input field '${e.inputFieldName}' in input object '${e.inputObjectName}'`}function aPe(e){return{criticality:{level:e.meta.addedToNewType?J.NonBreaking:Li(e.meta.addedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to input field '${e.meta.inputFieldName}'`},type:F.DirectiveUsageInputFieldDefinitionAdded,message:sPe(e.meta),path:[e.meta.inputObjectName,e.meta.inputFieldName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function cPe(e){return`Directive '${e.removedDirectiveName}' was removed from input field '${e.inputFieldName}' in input object '${e.inputObjectName}'`}function lPe(e){return{criticality:{level:Fi(e.meta.removedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from input field '${e.meta.inputFieldName}'`},type:F.DirectiveUsageInputFieldDefinitionRemoved,message:cPe(e.meta),path:[e.meta.inputObjectName,e.meta.inputFieldName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function uPe(e){return`Directive '${e.addedDirectiveName}' was added to object '${e.objectName}'`}function dPe(e){return{criticality:{level:e.meta.addedToNewType?J.NonBreaking:Li(e.meta.addedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to object '${e.meta.objectName}'`},type:F.DirectiveUsageObjectAdded,message:uPe(e.meta),path:[e.meta.objectName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function pPe(e){return`Directive '${e.removedDirectiveName}' was removed from object '${e.objectName}'`}function fPe(e){return{criticality:{level:Fi(e.meta.removedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from object '${e.meta.objectName}'`},type:F.DirectiveUsageObjectRemoved,message:pPe(e.meta),path:[e.meta.objectName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function mPe(e){return`Directive '${e.addedDirectiveName}' was added to enum '${e.enumName}'`}function gPe(e){return{criticality:{level:e.meta.addedToNewType?J.NonBreaking:Li(e.meta.addedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to enum '${e.meta.enumName}'`},type:F.DirectiveUsageEnumAdded,message:mPe(e.meta),path:[e.meta.enumName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function hPe(e){return`Directive '${e.removedDirectiveName}' was removed from enum '${e.enumName}'`}function yPe(e){return{criticality:{level:Fi(e.meta.removedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from enum '${e.meta.enumName}'`},type:F.DirectiveUsageEnumRemoved,message:hPe(e.meta),path:[e.meta.enumName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function bPe(e){return`Directive '${e.addedDirectiveName}' was added to field '${e.typeName}.${e.fieldName}'`}function vPe(e){return{criticality:{level:Li(e.meta.addedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to field '${e.meta.fieldName}'`},type:F.DirectiveUsageFieldAdded,message:bPe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.addedDirectiveName].join("."),meta:e.meta}}function _Pe(e){return`Directive '${e.addedDirectiveName}' was added to field '${e.typeName}.${e.fieldName}'`}function wPe(e){return{criticality:{level:e.meta.addedToNewType?J.NonBreaking:Li(e.meta.addedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to field '${e.meta.fieldName}'`},type:F.DirectiveUsageFieldDefinitionAdded,message:_Pe(e.meta),path:[e.meta.typeName,e.meta.fieldName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function kPe(e){return`Directive '${e.removedDirectiveName}' was removed from field '${e.typeName}.${e.fieldName}'`}function $Pe(e){return{criticality:{level:Fi(e.meta.removedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from field '${e.meta.fieldName}'`},type:F.DirectiveUsageFieldRemoved,message:kPe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.removedDirectiveName].join("."),meta:e.meta}}function SPe(e){return`Directive '${e.removedDirectiveName}' was removed from field '${e.typeName}.${e.fieldName}'`}function xPe(e){return{criticality:{level:Fi(e.meta.removedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from field '${e.meta.fieldName}'`},type:F.DirectiveUsageFieldDefinitionRemoved,message:SPe(e.meta),path:[e.meta.typeName,e.meta.fieldName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function EPe(e){return`Directive '${e.addedDirectiveName}' was added to enum value '${e.enumName}.${e.enumValueName}'`}function TPe(e){return{criticality:{level:e.meta.addedToNewType?J.NonBreaking:Li(e.meta.addedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to enum value '${e.meta.enumName}.${e.meta.enumValueName}'`},type:F.DirectiveUsageEnumValueAdded,message:EPe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function APe(e){return`Directive '${e.removedDirectiveName}' was removed from enum value '${e.enumName}.${e.enumValueName}'`}function IPe(e){return{criticality:{level:Fi(e.meta.removedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from enum value '${e.meta.enumName}.${e.meta.enumValueName}'`},type:F.DirectiveUsageEnumValueRemoved,message:APe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function RPe(e){return`Directive '${e.addedDirectiveName}' was added to schema`}function PPe(e){return{criticality:{level:e.meta.addedToNewType?J.NonBreaking:Li(e.meta.addedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to schema`},type:F.DirectiveUsageSchemaAdded,message:RPe(e.meta),path:`.@${e.meta.addedDirectiveName}`,meta:e.meta}}function CPe(e){return`Directive '${e.removedDirectiveName}' was removed from schema`}function NPe(e){return{criticality:{level:Fi(e.meta.removedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from schema`},type:F.DirectiveUsageSchemaRemoved,message:CPe(e.meta),path:`.@${e.meta.removedDirectiveName}`,meta:e.meta}}function OPe(e){return`Directive '${e.addedDirectiveName}' was added to scalar '${e.scalarName}'`}function DPe(e){return{criticality:{level:e.meta.addedToNewType?J.NonBreaking:Li(e.meta.addedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to scalar '${e.meta.scalarName}'`},type:F.DirectiveUsageScalarAdded,message:OPe(e.meta),path:[e.meta.scalarName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function MPe(e){return`Directive '${e.removedDirectiveName}' was removed from scalar '${e.scalarName}'`}function LPe(e){return{criticality:{level:Fi(e.meta.removedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from scalar '${e.meta.scalarName}'`},type:F.DirectiveUsageScalarRemoved,message:MPe(e.meta),path:[e.meta.scalarName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function FPe(e){return`Directive '${e.addedDirectiveName}' was added to union member '${e.unionName}'`}function UPe(e){return{criticality:{level:e.meta.addedToNewType?J.NonBreaking:Li(e.meta.addedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to union member '${e.meta.unionName}.${e.meta.addedUnionMemberTypeName}'`},type:F.DirectiveUsageUnionMemberAdded,message:FPe(e.meta),path:[e.meta.unionName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function jPe(e){return`Directive '${e.removedDirectiveName}' was removed from union member '${e.unionName}'`}function zPe(e){return{criticality:{level:Fi(e.meta.removedDirectiveName,J.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from union member '${e.meta.unionName}.${e.meta.removedUnionMemberTypeName}'`},type:F.DirectiveUsageUnionMemberRemoved,message:jPe(e.meta),path:[e.meta.unionName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function an(e,t,n,r){return Ft(e,S.ARGUMENT,n)?J0e({type:F.DirectiveUsageArgumentDefinitionAdded,meta:{addedDirectiveName:t.name.value,argumentName:n.argument.name,fieldName:n.field.name,typeName:n.type.name,addedToNewType:r,directiveRepeatedTimes:xt(n.argument.astNode?.directives??[],t)}}):Ft(e,S.INPUT_VALUE_DEFINITION,n)?aPe({type:F.DirectiveUsageInputFieldDefinitionAdded,meta:{addedDirectiveName:t.name.value,inputFieldName:n.field.name,inputFieldType:n.field.type.toString(),inputObjectName:n.type.name,addedToNewType:r,directiveRepeatedTimes:xt(n.field.astNode?.directives??[],t)}}):Ft(e,S.INPUT_OBJECT_TYPE_DEFINITION,n)?X0e({type:F.DirectiveUsageInputObjectAdded,meta:{addedDirectiveName:t.name.value,addedInputFieldName:t.name.value,addedInputFieldType:n.name,inputObjectName:n.name,isAddedInputFieldTypeNullable:e===S.INPUT_VALUE_DEFINITION,addedToNewType:r,directiveRepeatedTimes:xt(n.astNode?.directives??[],t)}}):Ft(e,S.INTERFACE_TYPE_DEFINITION,n)?rPe({type:F.DirectiveUsageInterfaceAdded,meta:{addedDirectiveName:t.name.value,interfaceName:n.name,addedToNewType:r,directiveRepeatedTimes:xt(n.astNode?.directives??[],t)}}):Ft(e,S.OBJECT,n)?dPe({type:F.DirectiveUsageObjectAdded,meta:{objectName:n.name,addedDirectiveName:t.name.value,addedToNewType:r,directiveRepeatedTimes:xt(n.astNode?.directives??[],t)}}):Ft(e,S.ENUM_TYPE_DEFINITION,n)?gPe({type:F.DirectiveUsageEnumAdded,meta:{enumName:n.name,addedDirectiveName:t.name.value,addedToNewType:r,directiveRepeatedTimes:xt(n.astNode?.directives??[],t)}}):Ft(e,S.FIELD,n)?vPe({type:F.DirectiveUsageFieldAdded,meta:{addedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:xt(n.field.astNode?.directives??[],t)}}):Ft(e,S.FIELD_DEFINITION,n)?wPe({type:F.DirectiveUsageFieldDefinitionAdded,meta:{addedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,addedToNewType:r,directiveRepeatedTimes:xt(n.field.astNode?.directives??[],t)}}):Ft(e,S.UNION_TYPE_DEFINITION,n)?UPe({type:F.DirectiveUsageUnionMemberAdded,meta:{addedDirectiveName:t.name.value,addedUnionMemberTypeName:n.name,unionName:n.name,addedToNewType:r,directiveRepeatedTimes:xt(n.astNode?.directives??[],t)}}):Ft(e,S.ENUM_VALUE_DEFINITION,n)?TPe({type:F.DirectiveUsageEnumValueAdded,meta:{enumName:n.type.name,enumValueName:n.value.name,addedDirectiveName:t.name.value,addedToNewType:r,directiveRepeatedTimes:xt(n.value.astNode?.directives??[],t)}}):Ft(e,S.SCHEMA_DEFINITION,n)?PPe({type:F.DirectiveUsageSchemaAdded,meta:{addedDirectiveName:t.name.value,addedToNewType:r,directiveRepeatedTimes:xt(n?.astNode?.directives??[],t)}}):Ft(e,S.SCALAR_TYPE_DEFINITION,n)?DPe({type:F.DirectiveUsageScalarAdded,meta:{scalarName:n.name,addedDirectiveName:t.name.value,addedToNewType:r,directiveRepeatedTimes:xt(n.astNode?.directives??[],t)}}):{}}function xt(e,t){let n=t.name.value,r=0;for(let i of e)if(i.name.value===n&&(r+=1),i===t)return r;return 0}function cn(e,t,n){return Ft(e,S.ARGUMENT,n)?Y0e({type:F.DirectiveUsageArgumentDefinitionRemoved,meta:{removedDirectiveName:t.name.value,argumentName:n.argument.name,fieldName:n.field.name,typeName:n.type.name,directiveRepeatedTimes:xt(n.argument.astNode?.directives??[],t)}}):Ft(e,S.INPUT_VALUE_DEFINITION,n)?lPe({type:F.DirectiveUsageInputFieldDefinitionRemoved,meta:{removedDirectiveName:t.name.value,inputFieldName:n.field.name,inputObjectName:n.type.name,directiveRepeatedTimes:xt(n.field.astNode?.directives??[],t)}}):Ft(e,S.INPUT_OBJECT_TYPE_DEFINITION,n)?tPe({type:F.DirectiveUsageInputObjectRemoved,meta:{removedDirectiveName:t.name.value,removedInputFieldName:t.name.value,removedInputFieldType:n.name,inputObjectName:n.name,isRemovedInputFieldTypeNullable:e===S.INPUT_VALUE_DEFINITION,directiveRepeatedTimes:xt(n.astNode?.directives??[],t)}}):Ft(e,S.INTERFACE_TYPE_DEFINITION,n)?oPe({type:F.DirectiveUsageInterfaceRemoved,meta:{removedDirectiveName:t.name.value,interfaceName:n.name,directiveRepeatedTimes:xt(n.astNode?.directives??[],t)}}):Ft(e,S.OBJECT,n)?fPe({type:F.DirectiveUsageObjectRemoved,meta:{objectName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:xt(n.astNode?.directives??[],t)}}):Ft(e,S.ENUM_TYPE_DEFINITION,n)?yPe({type:F.DirectiveUsageEnumRemoved,meta:{enumName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:xt(n.astNode?.directives??[],t)}}):Ft(e,S.FIELD,n)?$Pe({type:F.DirectiveUsageFieldRemoved,meta:{removedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:xt(n.field.astNode?.directives??[],t)}}):Ft(e,S.FIELD_DEFINITION,n)?xPe({type:F.DirectiveUsageFieldDefinitionRemoved,meta:{removedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:xt(n.field.astNode?.directives??[],t)}}):Ft(e,S.UNION_TYPE_DEFINITION,n)?zPe({type:F.DirectiveUsageUnionMemberRemoved,meta:{removedDirectiveName:t.name.value,removedUnionMemberTypeName:n.name,unionName:n.name,directiveRepeatedTimes:xt(n.astNode?.directives??[],t)}}):Ft(e,S.ENUM_VALUE_DEFINITION,n)?IPe({type:F.DirectiveUsageEnumValueRemoved,meta:{enumName:n.type.name,enumValueName:n.value.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:xt(n.value.astNode?.directives??[],t)}}):Ft(e,S.SCHEMA_DEFINITION,n)?NPe({type:F.DirectiveUsageSchemaRemoved,meta:{removedDirectiveName:t.name.value,directiveRepeatedTimes:xt(n?.astNode?.directives??[],t)}}):Ft(e,S.SCALAR_TYPE_DEFINITION,n)?LPe({type:F.DirectiveUsageScalarRemoved,meta:{scalarName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:xt(n.astNode?.directives??[],t)}}):{}}function Ft(e,t,n){return e===t}function K9(e){return{type:F.DirectiveUsageArgumentAdded,criticality:{level:J.NonBreaking},message:`Argument '${e.meta.addedArgumentName}' was added to '@${e.meta.directiveName}'`,path:[e.meta.parentTypeName??"",e.meta.parentFieldName??e.meta.parentEnumValueName,e.meta.parentArgumentName,`@${e.meta.directiveName}`,e.meta.addedArgumentName].filter(t=>t!==null).join("."),meta:e.meta}}function J9(e){return{type:F.DirectiveUsageArgumentRemoved,criticality:{level:J.Dangerous,reason:"Changing an argument on a directive can change runtime behavior."},message:`Argument '${e.meta.removedArgumentName}' was removed from '@${e.meta.directiveName}'`,path:[e.meta.parentTypeName??"",e.meta.parentFieldName??e.meta.parentEnumValueName,e.meta.parentArgumentName,`@${e.meta.directiveName}`,e.meta.removedArgumentName].filter(t=>t!==null).join("."),meta:e.meta}}function tt(e,t,n,r,i,o,s){on(e?.arguments||[],t.arguments||[],{onAdded(a){n(K9({type:F.DirectiveUsageArgumentAdded,meta:{addedArgumentName:a.name.value,addedArgumentValue:Qe(a.value),oldArgumentValue:null,directiveName:t.name.value,parentTypeName:r?.name??null,parentFieldName:i?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:xt((s||o||i||r)?.astNode?.directives??[],t)}}))},onMutual(a){a.oldVersion&&Qe(a.oldVersion.value)===Qe(a.newVersion.value)||(a.oldVersion&&n(J9({type:F.DirectiveUsageArgumentRemoved,meta:{removedArgumentName:a.oldVersion.name.value,directiveName:t.name.value,parentTypeName:r?.name??null,parentFieldName:i?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:xt((s||o||i||r)?.astNode?.directives??[],t)}})),n(K9({type:F.DirectiveUsageArgumentAdded,meta:{addedArgumentName:a.newVersion.name.value,addedArgumentValue:Qe(a.newVersion.value),oldArgumentValue:(a.oldVersion?.value&&Qe(a.oldVersion.value))??null,directiveName:t.name.value,parentTypeName:r?.name??null,parentFieldName:i?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:xt((s||o||i||r)?.astNode?.directives??[],t)}})))},onRemoved(a){n(J9({type:F.DirectiveUsageArgumentRemoved,meta:{removedArgumentName:a.name.value,directiveName:t.name.value,parentTypeName:r?.name??null,parentFieldName:i?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:xt((s||o||i||r)?.astNode?.directives??[],t)}}))}})}var b5=$t(y5(),1);function uo(e){return typeof e=="string"?JSON.stringify(e):(0,b5.default)(e).replace(/\[Object: null prototype\] /g,"").replace(/(^')|('$)/g,"")}function Ve(e){return e.replace(/'/g,"\\'")}function gCe(e){return`Directive '${e.removedDirectiveName}' was removed`}var hCe="A directive could be in use of a client application. Removing it could break the client application.";function yCe(e){return{criticality:{level:J.Breaking,reason:hCe},type:F.DirectiveRemoved,message:gCe(e.meta),path:`@${e.meta.removedDirectiveName}`,meta:e.meta}}function v5(e){return yCe({type:F.DirectiveRemoved,meta:{removedDirectiveName:e.name}})}function bCe(e){return`Directive '${e.addedDirectiveName}' was added`}function vCe(e){return{criticality:{level:J.NonBreaking},type:F.DirectiveAdded,message:bCe(e.meta),path:`@${e.meta.addedDirectiveName}`,meta:e.meta}}function _5(e){return vCe({type:F.DirectiveAdded,meta:{addedDirectiveName:e.name,addedDirectiveDescription:e.description??null,addedDirectiveLocations:e.locations.map(t=>String(t)),addedDirectiveRepeatable:e.isRepeatable}})}function _Ce(e){return e.oldDirectiveDescription===null&&e.newDirectiveDescription!==null?`Directive '${e.directiveName}' description '${Ve(e.newDirectiveDescription)}' was added`:e.newDirectiveDescription===null&&e.oldDirectiveDescription!==null?`Directive '${e.directiveName}' description '${Ve(e.oldDirectiveDescription)}' was removed`:`Directive '${e.directiveName}' description changed from '${Ve(e.oldDirectiveDescription??"")}' to '${Ve(e.newDirectiveDescription??"")}'`}function wCe(e){return{criticality:{level:J.NonBreaking},type:F.DirectiveDescriptionChanged,message:_Ce(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function w5(e,t){return wCe({type:F.DirectiveDescriptionChanged,meta:{directiveName:t.name,oldDirectiveDescription:e?.description??null,newDirectiveDescription:t.description??null}})}function kCe(e){return`Directive '${e.directiveName}' added repeatable.`}function $Ce(e){return{criticality:{level:J.NonBreaking},type:F.DirectiveRepeatableAdded,message:kCe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function k5(e){return $Ce({type:F.DirectiveRepeatableAdded,meta:{directiveName:e.name}})}function SCe(e){return`Directive '${e.directiveName}' removed repeatable.`}function xCe(e){return{criticality:{level:J.Dangerous},type:F.DirectiveRepeatableRemoved,message:SCe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function $5(e){return xCe({type:F.DirectiveRepeatableRemoved,meta:{directiveName:e.name}})}function ECe(e){return`Location '${e.addedDirectiveLocation}' was added to directive '${e.directiveName}'`}function TCe(e){return{criticality:{level:J.NonBreaking},type:F.DirectiveLocationAdded,message:ECe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function S5(e,t){return TCe({type:F.DirectiveLocationAdded,meta:{directiveName:e.name,addedDirectiveLocation:String(t)}})}function ACe(e){return`Location '${e.removedDirectiveLocation}' was removed from directive '${e.directiveName}'`}var ICe="A directive could be in use of a client application. Removing it could break the client application.";function RCe(e){return{criticality:{level:J.Breaking,reason:ICe},type:F.DirectiveLocationRemoved,message:ACe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function x5(e,t){return RCe({type:F.DirectiveLocationRemoved,meta:{directiveName:e.name,removedDirectiveLocation:t.toString()}})}var PCe="A directive could be in use of a client application. Adding a non-nullable argument will break those clients.",CCe="A directive could be in use of a client application. Adding a nullable argument will not break those clients.",NCe="Refer to the directive usage for the breaking status. If the directive is new and therefore unused, then adding an argument does not risk breaking clients.";function OCe(e){return{criticality:e.meta.addedToNewDirective?{level:J.NonBreaking,reason:NCe}:e.meta.addedDirectiveArgumentTypeIsNonNull?{level:J.Breaking,reason:PCe}:{level:J.NonBreaking,reason:CCe},type:F.DirectiveArgumentAdded,message:`Argument '${e.meta.addedDirectiveArgumentName}' was added to directive '${e.meta.directiveName}'`,path:`@${e.meta.directiveName}`,meta:e.meta}}function E5(e,t,n){return OCe({type:F.DirectiveArgumentAdded,meta:{directiveName:e.name,addedDirectiveArgumentName:t.name,addedDirectiveArgumentType:t.type.toString(),addedDirectiveDefaultValue:mp(t)?uo(ci(t)):void 0,addedDirectiveArgumentTypeIsNonNull:Re(t.type),addedDirectiveArgumentDescription:t.description??void 0,addedToNewDirective:n}})}function DCe(e){return`Argument '${e.removedDirectiveArgumentName}' was removed from directive '${e.directiveName}'`}var MCe="A directive argument could be in use of a client application. Removing the argument can break client applications.";function LCe(e){return{criticality:{level:J.Breaking,reason:MCe},type:F.DirectiveArgumentRemoved,message:DCe(e.meta),path:`@${e.meta.directiveName}.${e.meta.removedDirectiveArgumentName}`,meta:e.meta}}function T5(e,t){return LCe({type:F.DirectiveArgumentRemoved,meta:{directiveName:e.name,removedDirectiveArgumentName:t.name}})}function FCe(e){return e.oldDirectiveArgumentDescription===null&&e.newDirectiveArgumentDescription!==null?`Description '${Ve(e.newDirectiveArgumentDescription)}' was added to argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:e.newDirectiveArgumentDescription===null&&e.oldDirectiveArgumentDescription!==null?`Description '${Ve(e.oldDirectiveArgumentDescription)}' was removed from argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:`Description for argument '${e.directiveArgumentName}' on directive '${e.directiveName}' changed from '${Ve(e.oldDirectiveArgumentDescription??"")}' to '${Ve(e.newDirectiveArgumentDescription??"")}'`}function UCe(e){return{criticality:{level:J.NonBreaking},type:F.DirectiveArgumentDescriptionChanged,message:FCe(e.meta),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function A5(e,t,n){return UCe({type:F.DirectiveArgumentDescriptionChanged,meta:{directiveName:e.name,directiveArgumentName:n.name,oldDirectiveArgumentDescription:t?.description??null,newDirectiveArgumentDescription:n.description??null}})}function jCe(e){return e.oldDirectiveArgumentDefaultValue===void 0?`Default value '${e.newDirectiveArgumentDefaultValue}' was added to argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:`Default value for argument '${e.directiveArgumentName}' on directive '${e.directiveName}' changed from '${e.oldDirectiveArgumentDefaultValue}' to '${e.newDirectiveArgumentDefaultValue}'`}var zCe="Changing the default value for an argument may change the runtime behaviour of a field if it was never provided.";function GCe(e){return{criticality:{level:J.Dangerous,reason:zCe},type:F.DirectiveArgumentDefaultValueChanged,message:jCe(e.meta),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function I5(e,t,n){let r={directiveName:e.name,directiveArgumentName:n.name},i=t===null?void 0:ci(t),o=ci(n);return i!==void 0&&(r.oldDirectiveArgumentDefaultValue=uo(i)),o!==void 0&&(r.newDirectiveArgumentDefaultValue=uo(o)),GCe({type:F.DirectiveArgumentDefaultValueChanged,meta:r})}function BCe(e){return`Type for argument '${e.meta.directiveArgumentName}' on directive '${e.meta.directiveName}' changed from '${e.meta.oldDirectiveArgumentType}' to '${e.meta.newDirectiveArgumentType}'`}var VCe="Changing an input field from non-null to null is considered non-breaking.";function qCe(e){return{criticality:e.meta.isSafeDirectiveArgumentTypeChange?{level:J.NonBreaking,reason:VCe}:{level:J.Breaking},type:F.DirectiveArgumentTypeChanged,message:BCe(e),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function R5(e,t,n){return qCe({type:F.DirectiveArgumentTypeChanged,meta:{directiveName:e.name,directiveArgumentName:n.name,oldDirectiveArgumentType:t?.type.toString()??"",newDirectiveArgumentType:n.type.toString(),isSafeDirectiveArgumentTypeChange:Xa(t.type,n.type)}})}function WCe(e){return e.oldQueryTypeName===null?`Schema query root type was set to '${e.newQueryTypeName}'.`:e.newQueryTypeName===null?`Schema query root type '${e.oldQueryTypeName}' was removed.`:`Schema query root type was changed from '${e.oldQueryTypeName}' to '${e.newQueryTypeName}'`}function HCe(e){return{type:F.SchemaQueryTypeChanged,criticality:{level:e.meta.oldQueryTypeName===null?J.NonBreaking:J.Breaking},message:WCe(e.meta),meta:e.meta}}function P5(e,t){let n=e?.getQueryType()?.name||null,r=t?.getQueryType()?.name||null;return HCe({type:F.SchemaQueryTypeChanged,meta:{oldQueryTypeName:n,newQueryTypeName:r}})}function KCe(e){return e.oldMutationTypeName===null?`Schema mutation type was set to '${e.newMutationTypeName}'.`:e.newMutationTypeName===null?`Schema mutation type '${e.oldMutationTypeName}' was removed.`:`Schema mutation type was changed from '${e.oldMutationTypeName}' to '${e.newMutationTypeName}'`}function JCe(e){return{type:F.SchemaMutationTypeChanged,criticality:{level:e.meta.oldMutationTypeName===null?J.NonBreaking:J.Breaking},message:KCe(e.meta),meta:e.meta}}function C5(e,t){let n=e?.getMutationType()?.name||null,r=t?.getMutationType()?.name||null;return JCe({type:F.SchemaMutationTypeChanged,meta:{newMutationTypeName:r,oldMutationTypeName:n}})}function ZCe(e){return e.oldSubscriptionTypeName===null?`Schema subscription type was set to '${e.newSubscriptionTypeName}'.`:e.newSubscriptionTypeName===null?`Schema subscription type '${e.oldSubscriptionTypeName}' was removed.`:`Schema subscription type was changed from '${e.oldSubscriptionTypeName}' to '${e.newSubscriptionTypeName}'`}function YCe(e){return{type:F.SchemaSubscriptionTypeChanged,criticality:{level:e.meta.oldSubscriptionTypeName===null?J.NonBreaking:J.Breaking},message:ZCe(e.meta),meta:e.meta}}function N5(e,t){let n=e?.getSubscriptionType()?.name||null,r=t?.getSubscriptionType()?.name||null;return YCe({type:F.SchemaSubscriptionTypeChanged,meta:{newSubscriptionTypeName:r,oldSubscriptionTypeName:n}})}function QCe(e){return`Type '${e.removedTypeName}' was removed`}function XCe(e){return{criticality:{level:J.Breaking},type:F.TypeRemoved,message:QCe(e.meta),meta:e.meta,path:e.meta.removedTypeName}}function O5(e){return XCe({type:F.TypeRemoved,meta:{removedTypeName:e.name}})}function eNe(e){return`Type '${e.addedTypeName}' was added`}function tNe(e){return{criticality:{level:J.NonBreaking},type:F.TypeAdded,message:eNe(e.meta),meta:e.meta,path:e.meta.addedTypeName}}function nNe(e){return rn(e)?{addedTypeKind:S.ENUM_TYPE_DEFINITION,addedTypeName:e.name}:ut(e)||He(e)?{addedTypeKind:yy(e),addedTypeName:e.name}:nn(e)?{addedTypeKind:S.UNION_TYPE_DEFINITION,addedTypeName:e.name}:Je(e)?{addedTypeKind:S.INPUT_OBJECT_TYPE_DEFINITION,addedTypeIsOneOf:e.isOneOf,addedTypeName:e.name}:{addedTypeKind:yy(e),addedTypeName:e.name}}function D5(e){return tNe({type:F.TypeAdded,meta:nNe(e)})}function rNe(e){return`'${e.meta.typeName}' kind changed from '${e.meta.oldTypeKind}' to '${e.meta.newTypeKind}'`}function iNe(e){return{criticality:{level:J.Breaking,reason:"Changing the kind of a type is a breaking change because it can cause existing queries to error. For example, turning an object type to a scalar type would break queries that define a selection set for this type."},type:F.TypeKindChanged,message:rNe(e),path:e.meta.typeName,meta:e.meta}}function M5(e,t){return iNe({type:F.TypeKindChanged,meta:{typeName:t.name,newTypeKind:String(yy(t)),oldTypeKind:String(yy(e))}})}function oNe(e){let t=Ve(e.oldTypeDescription),n=Ve(e.newTypeDescription);return`Description '${t}' on type '${e.typeName}' has changed to '${n}'`}function sNe(e){return{criticality:{level:J.NonBreaking},type:F.TypeDescriptionChanged,message:oNe(e.meta),path:e.meta.typeName,meta:e.meta}}function L5(e,t){return sNe({type:F.TypeDescriptionChanged,meta:{typeName:e.name,newTypeDescription:t.description??"",oldTypeDescription:e.description??""}})}function aNe(e){return`Description '${Ve(e.removedTypeDescription)}' was removed from object type '${e.typeName}'`}function cNe(e){return{criticality:{level:J.NonBreaking},type:F.TypeDescriptionRemoved,message:aNe(e.meta),path:e.meta.typeName,meta:e.meta}}function F5(e){return cNe({type:F.TypeDescriptionRemoved,meta:{typeName:e.name,removedTypeDescription:e.description??""}})}function lNe(e){let t=Ve(e.addedTypeDescription);return`Object type '${e.typeName}' has description '${t}'`}function uNe(e){return{criticality:{level:J.NonBreaking},type:F.TypeDescriptionAdded,message:lNe(e.meta),path:e.meta.typeName,meta:e.meta}}function U5(e){return uNe({type:F.TypeDescriptionAdded,meta:{typeName:e.name,addedTypeDescription:e.description??""}})}function G1(e,t,n){Yt(e?.description,t.description)&&n(w5(e,t)),!t.isRepeatable&&e?.isRepeatable&&n($5(t)),t.isRepeatable&&!e?.isRepeatable&&n(k5(t));let r={added:I1(t.locations,e?.locations??[]),removed:I1(e?.locations??[],t.locations)};for(let i of r.added)n(S5(t,i));for(let i of r.removed)n(x5(t,i));on(e?.args??[],t.args,{onAdded(i){n(E5(t,i,e===null))},onRemoved(i){n(T5(t,i))},onMutual(i){dNe(t,i.oldVersion,i.newVersion,n)}})}function dNe(e,t,n,r){Yt(t?.description,n.description)&&r(A5(e,t,n)),gp(t,n)||r(I5(e,t,n)),Yt(t.type.toString(),n.type.toString())&&r(R5(e,t,n))}function pNe(e){return`Enum value '${e.removedEnumValueName}' ${e.isEnumValueDeprecated?"(deprecated) ":""}was removed from enum '${e.enumName}'`}var fNe="Removing an enum value will cause existing queries that use this enum value to error.";function mNe(e){return{type:F.EnumValueRemoved,criticality:{level:J.Breaking,reason:fNe},message:pNe(e.meta),meta:e.meta,path:[e.meta.enumName,e.meta.removedEnumValueName].join(".")}}function j5(e,t){return mNe({type:F.EnumValueRemoved,meta:{enumName:e.name,removedEnumValueName:t.name,isEnumValueDeprecated:Rs(t)}})}function gNe(e){return`Enum value '${e.meta.addedEnumValueName}' was added to enum '${e.meta.enumName}'`}var hNe="Adding an enum value may break existing clients that were not programming defensively against an added case when querying an enum.";function yNe(e){let t=e.meta.addedToNewType;return{type:F.EnumValueAdded,criticality:{level:t?J.NonBreaking:J.Dangerous,reason:t?void 0:hNe},message:gNe(e),meta:e.meta,path:[e.meta.enumName,e.meta.addedEnumValueName].join(".")}}function z5(e,t,n){return yNe({type:F.EnumValueAdded,meta:{enumName:e.name,addedEnumValueName:t.name,addedToNewType:n,addedDirectiveDescription:t.description??null}})}function bNe(e){return e.oldEnumValueDescription===null&&e.newEnumValueDescription!==null?`Description '${Ve(e.newEnumValueDescription)}' was added to enum value '${e.enumName}.${e.enumValueName}'`:e.newEnumValueDescription===null&&e.oldEnumValueDescription!==null?`Description '${Ve(e.oldEnumValueDescription)}' was removed from enum value '${e.enumName}.${e.enumValueName}'`:`Description for enum value '${e.enumName}.${e.enumValueName}' changed from '${Ve(e.oldEnumValueDescription??"")}' to '${Ve(e.newEnumValueDescription??"")}'`}function vNe(e){return{criticality:{level:J.NonBreaking},type:F.EnumValueDescriptionChanged,message:bNe(e.meta),path:[e.meta.enumName,e.meta.enumValueName].join("."),meta:e.meta}}function G5(e,t,n){return vNe({type:F.EnumValueDescriptionChanged,meta:{enumName:e.name,enumValueName:n.name,oldEnumValueDescription:t?.description??null,newEnumValueDescription:n.description??null}})}function _Ne(e){let t=Ve(e.oldEnumValueDeprecationReason),n=Ve(e.newEnumValueDeprecationReason);return`Enum value '${e.enumName}.${e.enumValueName}' deprecation reason changed from '${t}' to '${n}'`}function wNe(e){return{criticality:{level:J.NonBreaking},type:F.EnumValueDeprecationReasonChanged,message:_Ne(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${ai.name}`].join("."),meta:e.meta}}function B5(e,t,n){return wNe({type:F.EnumValueDeprecationReasonChanged,meta:{enumName:e.name,enumValueName:t.name,oldEnumValueDeprecationReason:t.deprecationReason??"",newEnumValueDeprecationReason:n.deprecationReason??""}})}function kNe(e){let t=Ve(e.addedValueDeprecationReason);return`Enum value '${e.enumName}.${e.enumValueName}' was deprecated with reason '${t}'`}function $Ne(e){return{criticality:{level:J.NonBreaking},type:F.EnumValueDeprecationReasonAdded,message:kNe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${ai.name}`].join("."),meta:e.meta}}function V5(e,t,n){return $Ne({type:F.EnumValueDeprecationReasonAdded,meta:{enumName:e.name,enumValueName:n.name,addedValueDeprecationReason:n.deprecationReason??""}})}function SNe(e){return`Deprecation reason was removed from enum value '${e.enumName}.${e.enumValueName}'`}function xNe(e){return{criticality:{level:J.NonBreaking},type:F.EnumValueDeprecationReasonRemoved,message:SNe(e.meta),path:[e.meta.enumName,e.meta.enumValueName].join("."),meta:e.meta}}function q5(e,t,n){return xNe({type:F.EnumValueDeprecationReasonRemoved,meta:{enumName:e.name,enumValueName:t.name,removedEnumValueDeprecationReason:t.deprecationReason??""}})}var W5="No longer supported";function K5(e,t,n){on(e?.getValues()??[],t.getValues(),{onAdded(r){n(z5(t,r,e===null)),H5({newVersion:r,oldVersion:null},t,n)},onRemoved(r){n(j5(e,r))},onMutual(r){H5(r,t,n)}}),sn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(r){n(an(S.ENUM_TYPE_DEFINITION,r,t,e===null)),tt(null,r,n,t)},onMutual(r){tt(r.oldVersion,r.newVersion,n,t)},onRemoved(r){n(cn(S.ENUM_TYPE_DEFINITION,r,t))}})}function H5(e,t,n){let r=e.oldVersion,i=e.newVersion;Yt(r?.description,i.description)&&n(G5(t,r,i)),Yt(r?.deprecationReason,i.deprecationReason)&&(Mt(r?.deprecationReason)||r?.deprecationReason===W5?n(V5(t,r,i)):Mt(i.deprecationReason)||i?.deprecationReason===W5?n(q5(t,r,i)):n(B5(t,r,i))),sn(r?.astNode?.directives||[],i.astNode?.directives||[],{onAdded(o){n(an(S.ENUM_VALUE_DEFINITION,o,{type:t,value:i},r===null)),tt(null,o,n,t,void 0,void 0,i)},onMutual(o){tt(o.oldVersion,o.newVersion,n,t,void 0,void 0,i)},onRemoved(o){n(cn(S.ENUM_VALUE_DEFINITION,o,{type:t,value:r}))}})}function ENe(e){return`Input field '${e.removedFieldName}' ${e.isInputFieldDeprecated?"(deprecated) ":""}was removed from input object type '${e.inputName}'`}function TNe(e){return{type:F.InputFieldRemoved,criticality:{level:J.Breaking,reason:"Removing an input field will cause existing queries that use this input field to error."},message:ENe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.removedFieldName].join(".")}}function J5(e,t){return TNe({type:F.InputFieldRemoved,meta:{inputName:e.name,removedFieldName:t.name,isInputFieldDeprecated:Rs(t)}})}function ANe(e){return`Input field '${e.addedInputFieldName}' of type '${e.addedInputFieldType}'${e.addedFieldDefault?` with default value '${e.addedFieldDefault}'`:""} was added to input object type '${e.inputName}'`}function INe(e){let t,n=e.meta.isAddedInputFieldTypeNullable&&e.meta.addedFieldDefault===void 0;return e.meta.addedToNewType?t={level:J.NonBreaking,reason:"The field is being added to a new type."}:n?t={level:J.NonBreaking,reason:"The field is nullable and no default is set."}:e.meta.addedFieldDefault===void 0?t={level:J.Breaking,reason:"Adding a required input field to an existing input object type is a breaking change because it will cause existing uses of this input object type to error."}:t={level:J.Dangerous,reason:"Adding a field with a default value can change runtime behavior for clients that previously omitted it, and during rolling deploys consumers may receive the new default before producers are ready to handle it."},{type:F.InputFieldAdded,criticality:t,message:ANe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.addedInputFieldName].join(".")}}function Z5(e,t,n){let r=ci(t);return INe({type:F.InputFieldAdded,meta:{inputName:e.name,addedInputFieldName:t.name,isAddedInputFieldTypeNullable:!Re(t.type),addedInputFieldType:t.type.toString(),...mp(t)?{addedFieldDefault:uo(r)}:{},addedToNewType:n}})}function RNe(e){let t=Ve(e.addedInputFieldDescription);return`Input field '${e.inputName}.${e.inputFieldName}' has description '${t}'`}function PNe(e){return{type:F.InputFieldDescriptionAdded,criticality:{level:J.NonBreaking},message:RNe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function Y5(e,t){return PNe({type:F.InputFieldDescriptionAdded,meta:{inputName:e.name,inputFieldName:t.name,addedInputFieldDescription:t.description??""}})}function CNe(e){return`Description '${Ve(e.removedDescription)}' was removed from input field '${e.inputName}.${e.inputFieldName}'`}function NNe(e){return{type:F.InputFieldDescriptionRemoved,criticality:{level:J.NonBreaking},message:CNe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function Q5(e,t){return NNe({type:F.InputFieldDescriptionRemoved,meta:{inputName:e.name,inputFieldName:t.name,removedDescription:t.description??""}})}function ONe(e){let t=Ve(e.oldInputFieldDescription),n=Ve(e.newInputFieldDescription);return`Input field '${e.inputName}.${e.inputFieldName}' description changed from '${t}' to '${n}'`}function DNe(e){return{type:F.InputFieldDescriptionChanged,criticality:{level:J.NonBreaking},message:ONe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function X5(e,t,n){return DNe({type:F.InputFieldDescriptionChanged,meta:{inputName:e.name,inputFieldName:t.name,oldInputFieldDescription:t.description??"",newInputFieldDescription:n.description??""}})}function MNe(e){return`Input field '${e.inputName}.${e.inputFieldName}' default value changed from '${e.oldDefaultValue}' to '${e.newDefaultValue}'`}function LNe(e){let t={level:J.Dangerous,reason:"Changing the default value for an argument may change the runtime behavior of a field if it was never provided."};return{type:F.InputFieldDefaultValueChanged,criticality:t,message:MNe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function eQ(e,t,n){let r={inputName:e.name,inputFieldName:n.name},i=ci(t),o=ci(n);return i!==void 0&&(r.oldDefaultValue=uo(i)),o!==void 0&&(r.newDefaultValue=uo(o)),LNe({type:F.InputFieldDefaultValueChanged,meta:r})}function FNe(e){return`Input field '${e.inputName}.${e.inputFieldName}' changed type from '${e.oldInputFieldType}' to '${e.newInputFieldType}'`}function UNe(e){return{type:F.InputFieldTypeChanged,criticality:e.meta.isInputFieldTypeChangeSafe?{level:J.NonBreaking,reason:"Changing an input field from non-null to null is considered non-breaking."}:{level:J.Breaking,reason:"Changing the type of an input field can cause existing queries that use this field to error."},message:FNe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function tQ(e,t,n){return UNe({type:F.InputFieldTypeChanged,meta:{inputName:e.name,inputFieldName:n.name,oldInputFieldType:t.type.toString(),newInputFieldType:n.type.toString(),isInputFieldTypeChangeSafe:Xa(t.type,n.type)}})}function rQ(e,t,n){let r=e?.getFields()??{},i=t.getFields();on(Object.values(r),Object.values(i),{onAdded(o){n(Z5(t,o,e==null)),nQ(t,null,o,n)},onRemoved(o){n(J5(e,o))},onMutual(o){nQ(t,o.oldVersion,o.newVersion,n)}}),sn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(o){n(an(S.INPUT_OBJECT_TYPE_DEFINITION,o,t,e===null)),tt(null,o,n,t)},onMutual(o){tt(o.oldVersion,o.newVersion,n,t)},onRemoved(o){n(cn(S.INPUT_OBJECT_TYPE_DEFINITION,o,e))}})}function nQ(e,t,n,r){Yt(t?.description,n.description)&&(Mt(t?.description)?r(Y5(e,n)):Mt(n.description)?r(Q5(e,t)):r(X5(e,t,n))),Mt(t)||(gp(t,n)||r(eQ(e,t,n)),!Mt(t)&&Yt(t.type.toString(),n.type.toString())&&r(tQ(e,t,n))),(t?.astNode?.directives||n.astNode?.directives)&&sn(t?.astNode?.directives||[],n.astNode?.directives||[],{onAdded(i){r(an(S.INPUT_VALUE_DEFINITION,i,{type:e,field:n},t===null)),tt(null,i,r,e,n)},onMutual(i){tt(i.oldVersion,i.newVersion,r,e,n)},onRemoved(i){r(cn(S.INPUT_VALUE_DEFINITION,i,{type:e,field:n}))}})}function jNe(e){return`Field '${e.removedFieldName}' ${e.isRemovedFieldDeprecated?"(deprecated) ":""}was removed from ${e.typeType} '${e.typeName}'`}function zNe(e){return{type:F.FieldRemoved,criticality:{level:J.Breaking,reason:e.meta.isRemovedFieldDeprecated?"Removing a deprecated field is a breaking change. Before removing it, you may want to look at the field's usage to see the impact of removing the field.":"Removing a field is a breaking change. It is preferable to deprecate the field before removing it. This applies to removed union fields as well, since removal breaks client operations that contain fragments that reference the removed type through direct (... on RemovedType) or indirect means such as __typename in the consumers."},message:jNe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.removedFieldName].join(".")}}function hS(e,t){let n=He(e)?"interface":"object type";return zNe({type:F.FieldRemoved,meta:{typeName:e.name,removedFieldName:t.name,isRemovedFieldDeprecated:t.deprecationReason!=null,typeType:n}})}function GNe(e){return`Field '${e.addedFieldName}' was added to ${e.typeType} '${e.typeName}'`}function BNe(e){return{type:F.FieldAdded,criticality:{level:J.NonBreaking},message:GNe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.addedFieldName].join(".")}}function yS(e,t){let n=He(e)?"interface":"object type";return BNe({type:F.FieldAdded,meta:{typeName:e.name,addedFieldName:t.name,typeType:n,addedFieldReturnType:t.type.toString()}})}function VNe(e){return!e.oldDescription&&e.newDescription?`Field '${e.typeName}.${e.fieldName}' description '${Ve(e.newDescription)}' was added`:!e.newDescription&&e.oldDescription?`Field '${e.typeName}.${e.fieldName}' description '${Ve(e.oldDescription)}' was removed`:`Field '${e.typeName}.${e.fieldName}' description changed from '${Ve(e.oldDescription)}' to '${Ve(e.newDescription)}'`}function qNe(e){return{type:F.FieldDescriptionChanged,criticality:{level:J.NonBreaking},message:VNe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function iQ(e,t,n){return qNe({type:F.FieldDescriptionChanged,meta:{fieldName:t.name,typeName:e.name,oldDescription:t.description??"",newDescription:n.description??""}})}function WNe(e){let t=Ve(e.addedDescription);return`Field '${e.typeName}.${e.fieldName}' has description '${t}'`}function HNe(e){return{type:F.FieldDescriptionAdded,criticality:{level:J.NonBreaking},message:WNe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function oQ(e,t){return HNe({type:F.FieldDescriptionAdded,meta:{typeName:e.name,fieldName:t.name,addedDescription:t.description??""}})}function KNe(e){return`Description was removed from field '${e.typeName}.${e.fieldName}'`}function JNe(e){return{type:F.FieldDescriptionRemoved,criticality:{level:J.NonBreaking},message:KNe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function sQ(e,t){return JNe({type:F.FieldDescriptionRemoved,meta:{typeName:e.name,fieldName:t.name}})}function ZNe(e){return`Field '${e.typeName}.${e.fieldName}' is deprecated`}function YNe(e){return{type:F.FieldDeprecationAdded,criticality:{level:J.NonBreaking},message:ZNe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${ai.name}`].join(".")}}function aQ(e,t){return YNe({type:F.FieldDeprecationAdded,meta:{typeName:e.name,fieldName:t.name,deprecationReason:t.deprecationReason??""}})}function QNe(e){return{type:F.FieldDeprecationRemoved,criticality:{level:J.NonBreaking},message:`Field '${e.meta.typeName}.${e.meta.fieldName}' is no longer deprecated`,meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${ai.name}`].join(".")}}function cQ(e,t){return QNe({type:F.FieldDeprecationRemoved,meta:{fieldName:t.name,typeName:e.name}})}function XNe(e){let t=Ve(e.oldDeprecationReason),n=Ve(e.newDeprecationReason);return`Deprecation reason on field '${e.typeName}.${e.fieldName}' has changed from '${t}' to '${n}'`}function eOe(e){return{type:F.FieldDeprecationReasonChanged,criticality:{level:J.NonBreaking},message:XNe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${ai.name}`].join(".")}}function lQ(e,t,n){return eOe({type:F.FieldDeprecationReasonChanged,meta:{fieldName:n.name,typeName:e.name,newDeprecationReason:n.deprecationReason??"",oldDeprecationReason:t.deprecationReason??""}})}function tOe(e){let t=Ve(e.addedDeprecationReason);return`Field '${e.typeName}.${e.fieldName}' has deprecation reason '${t}'`}function nOe(e){return{type:F.FieldDeprecationReasonAdded,criticality:{level:J.NonBreaking},message:tOe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${ai.name}`].join(".")}}function uQ(e,t){return nOe({type:F.FieldDeprecationReasonAdded,meta:{typeName:e.name,fieldName:t.name,addedDeprecationReason:t.deprecationReason??""}})}function rOe(e){return{type:F.FieldDeprecationReasonRemoved,criticality:{level:J.NonBreaking},message:`Deprecation reason was removed from field '${e.meta.typeName}.${e.meta.fieldName}'`,meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function dQ(e,t){return rOe({type:F.FieldDeprecationReasonRemoved,meta:{typeName:e.name,fieldName:t.name}})}function iOe(e){return`Field '${e.meta.typeName}.${e.meta.fieldName}' changed type from '${e.meta.oldFieldType}' to '${e.meta.newFieldType}'`}function oOe(e){return{type:F.FieldTypeChanged,criticality:{level:e.meta.isSafeFieldTypeChange?J.NonBreaking:J.Breaking},message:iOe(e),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function pQ(e,t,n){return oOe({type:F.FieldTypeChanged,meta:{typeName:e.name,fieldName:t.name,oldFieldType:t.type.toString(),newFieldType:n.type.toString(),isSafeFieldTypeChange:hy(t.type,n.type)}})}function sOe(e){return`Argument '${e.addedArgumentName}: ${e.addedArgumentType}'${e.hasDefaultValue?" (with default value) ":" "}added to field '${e.typeName}.${e.fieldName}'`}function aOe(e){return{type:F.FieldArgumentAdded,criticality:{level:e.meta.addedToNewField?J.NonBreaking:e.meta.isAddedFieldArgumentBreaking?J.Breaking:J.Dangerous},message:sOe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.addedArgumentName].join(".")}}function fQ(e,t,n,r){let i=mp(n),o=Re(n.type)&&!i;return aOe({type:F.FieldArgumentAdded,meta:{typeName:e.name,fieldName:t.name,addedArgumentName:n.name,addedArgumentType:n.type.toString(),hasDefaultValue:i,addedToNewField:r,isAddedFieldArgumentBreaking:o}})}function cOe(e){return`Argument '${e.meta.removedFieldArgumentName}: ${e.meta.removedFieldType}' was removed from field '${e.meta.typeName}.${e.meta.fieldName}'`}function lOe(e){return{type:F.FieldArgumentRemoved,criticality:{level:J.Breaking},message:cOe(e),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.removedFieldArgumentName].join(".")}}function mQ(e,t,n){return lOe({type:F.FieldArgumentRemoved,meta:{typeName:e.name,fieldName:t.name,removedFieldArgumentName:n.name,removedFieldType:n.type.toString()}})}function uOe(e){return`'${e.objectTypeName}' object implements '${e.addedInterfaceName}' interface`}function dOe(e){return{type:F.ObjectTypeInterfaceAdded,criticality:{level:e.meta.addedToNewType?J.NonBreaking:J.Dangerous,reason:"Adding an interface to an object type may break existing clients that are consuming a field returning the interface type that are not programming defensively against this new possible type."},message:uOe(e.meta),meta:e.meta,path:e.meta.objectTypeName}}function bS(e,t,n){return dOe({type:F.ObjectTypeInterfaceAdded,meta:{objectTypeName:t.name,addedInterfaceName:e.name,addedToNewType:n}})}function pOe(e){return`'${e.objectTypeName}' object type no longer implements '${e.removedInterfaceName}' interface`}function fOe(e){return{type:F.ObjectTypeInterfaceRemoved,criticality:{level:J.Breaking,reason:"Removing an interface from an object type can cause existing queries that use this in a fragment spread to error."},message:pOe(e.meta),meta:e.meta,path:e.meta.objectTypeName}}function vS(e,t){return fOe({type:F.ObjectTypeInterfaceRemoved,meta:{objectTypeName:t.name,removedInterfaceName:e.name}})}function mOe(e){return e.oldDescription===null&&e.newDescription!==null?`Description '${Ve(e.newDescription)}' was added to argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:e.newDescription===null&&e.oldDescription!==null?`Description '${Ve(e.oldDescription)}' was removed from argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:`Description for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${Ve(e.oldDescription??"")}' to '${Ve(e.newDescription??"")}'`}function gOe(e){return{type:F.FieldArgumentDescriptionChanged,criticality:{level:J.NonBreaking},message:mOe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function gQ(e,t,n,r){return gOe({type:F.FieldArgumentDescriptionChanged,meta:{typeName:e.name,fieldName:t.name,argumentName:r.name,oldDescription:n?.description??null,newDescription:r.description??null}})}function hOe(e){return e.oldDefaultValue===void 0?`Default value '${e.newDefaultValue}' was added to argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:`Default value for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${e.oldDefaultValue}' to '${e.newDefaultValue}'`}var yOe="Changing the default value for an argument may change the runtime behaviour of a field if it was never provided.";function bOe(e){return{type:F.FieldArgumentDefaultChanged,criticality:{level:J.Dangerous,reason:yOe},message:hOe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function hQ(e,t,n,r){let i={typeName:e.name,fieldName:t.name,argumentName:r.name},o=n===null?void 0:ci(n),s=ci(r);return o!==void 0&&(i.oldDefaultValue=uo(o)),s!==void 0&&(i.newDefaultValue=uo(s)),bOe({type:F.FieldArgumentDefaultChanged,meta:i})}function vOe(e){return`Type for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${e.oldArgumentType}' to '${e.newArgumentType}'`}var _Oe="Changing an input field from non-null to null is considered non-breaking.",wOe="Changing the type of a field's argument can cause existing queries that use this argument to error.";function kOe(e){return{type:F.FieldArgumentTypeChanged,criticality:e.meta.isSafeArgumentTypeChange?{level:J.NonBreaking,reason:_Oe}:{level:J.Breaking,reason:wOe},message:vOe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function yQ(e,t,n,r){return kOe({type:F.FieldArgumentTypeChanged,meta:{typeName:e.name,fieldName:t.name,argumentName:r.name,oldArgumentType:n?.type.toString()??"",newArgumentType:r.type.toString(),isSafeArgumentTypeChange:!n||Xa(n.type,r.type)}})}function bQ(e,t,n,r,i){Yt(n?.description,r.description)&&i(gQ(e,t,n,r)),gp(n,r)||i(hQ(e,t,n,r)),Yt(n?.type.toString(),r.type.toString())&&i(yQ(e,t,n,r)),(n?.astNode?.directives||r.astNode?.directives)&&sn(n?.astNode?.directives||[],r.astNode?.directives||[],{onAdded(o){i(an(S.ARGUMENT,o,{argument:r,field:t,type:e},n===null)),tt(null,o,i,e,t,r)},onMutual(o){tt(o.oldVersion,o.newVersion,i,e,t,r)},onRemoved(o){i(cn(S.ARGUMENT,o,{argument:n,field:t,type:e}))}})}var vQ="No longer supported";function yp(e,t,n,r){Yt(t?.description,n.description)&&(Mt(t?.description)?r(oQ(e,n)):Mt(n.description)?r(sQ(e,t)):r(iQ(e,t,n))),Mt(t)||!Rs(t)?Rs(n)&&r(aQ(e,n)):Rs(n)?Yt(t.deprecationReason,n.deprecationReason)&&(Mt(t.deprecationReason)||t.deprecationReason===vQ?r(uQ(e,n)):Mt(n.deprecationReason)||n.deprecationReason===vQ?r(dQ(e,t)):r(lQ(e,t,n))):Rs(t)&&r(cQ(e,t)),!Mt(t)&&Yt(t.type.toString(),n.type.toString())&&r(pQ(e,t,n)),on(t?.args??[],n.args,{onAdded(i){r(fQ(e,n,i,t===null))},onRemoved(i){r(mQ(e,n,i))},onMutual(i){bQ(e,n,i.oldVersion,i.newVersion,r)}}),sn(t?.astNode?.directives||[],n.astNode?.directives||[],{onAdded(i){r(an(S.FIELD_DEFINITION,i,{parentType:e,field:n},t===null)),tt(null,i,r,e,n)},onMutual(i){tt(i.oldVersion,i.newVersion,r,e,n)},onRemoved(i){r(cn(S.FIELD_DEFINITION,i,{parentType:e,field:t}))}})}function _Q(e,t,n){let r=e?.getInterfaces()??[],i=t.getInterfaces();on(r,i,{onAdded(a){n(bS(a,t,e===null))},onRemoved(a){n(vS(a,e))}});let o=e?.getFields()??{},s=t.getFields();on(Object.values(o),Object.values(s),{onAdded(a){n(yS(t,a)),yp(t,null,a,n)},onRemoved(a){n(hS(e,a))},onMutual(a){yp(t,a.oldVersion,a.newVersion,n)}}),sn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(a){n(an(S.INTERFACE_TYPE_DEFINITION,a,t,e===null)),tt(null,a,n,t)},onMutual(a){tt(a.oldVersion,a.newVersion,n,t)},onRemoved(a){n(cn(S.INTERFACE_TYPE_DEFINITION,a,e))}})}function wQ(e,t,n){let r=e?.getInterfaces()??[],i=t.getInterfaces(),o=e?.getFields()??{},s=t.getFields();on(r,i,{onAdded(a){n(bS(a,t,e===null))},onRemoved(a){n(vS(a,e))}}),on(Object.values(o),Object.values(s),{onAdded(a){n(yS(t,a)),yp(t,null,a,n)},onRemoved(a){n(hS(e,a))},onMutual(a){yp(t,a.oldVersion,a.newVersion,n)}}),sn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(a){n(an(S.OBJECT,a,t,e===null)),tt(null,a,n,t)},onMutual(a){tt(a.oldVersion,a.newVersion,n,t)},onRemoved(a){n(cn(S.OBJECT,a,e))}})}function kQ(e,t,n){sn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(r){n(an(S.SCALAR_TYPE_DEFINITION,r,t,e===null)),tt(null,r,n,t)},onMutual(r){tt(r.oldVersion,r.newVersion,n,t)},onRemoved(r){n(cn(S.SCALAR_TYPE_DEFINITION,r,e))}})}function $Oe(e){return`Member '${e.removedUnionMemberTypeName}' was removed from Union type '${e.unionName}'`}function SOe(e){return{criticality:{level:J.Breaking,reason:"Removing a union member from a union can cause existing queries that use this union member in a fragment spread to error."},type:F.UnionMemberRemoved,message:$Oe(e.meta),meta:e.meta,path:e.meta.unionName}}function $Q(e,t){return SOe({type:F.UnionMemberRemoved,meta:{unionName:e.name,removedUnionMemberTypeName:t.name}})}function xOe(e){return`Member '${e.addedUnionMemberTypeName}' was added to Union type '${e.unionName}'`}function EOe(e){return{criticality:{level:e.meta.addedToNewType?J.NonBreaking:J.Dangerous,reason:"Adding a possible type to Unions may break existing clients that were not programming defensively against a new possible type."},type:F.UnionMemberAdded,message:xOe(e.meta),meta:e.meta,path:e.meta.unionName}}function SQ(e,t,n){return EOe({type:F.UnionMemberAdded,meta:{unionName:e.name,addedUnionMemberTypeName:t.name,addedToNewType:n}})}function xQ(e,t,n){let r=e?.getTypes()??[],i=t.getTypes();on(r,i,{onAdded(o){n(SQ(t,o,e===null))},onRemoved(o){n($Q(e,o))}}),sn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(o){n(an(S.UNION_TYPE_DEFINITION,o,t,e===null)),tt(null,o,n,t)},onMutual(o){tt(o.oldVersion,o.newVersion,n,t)},onRemoved(o){n(cn(S.UNION_TYPE_DEFINITION,o,e))}})}function TQ(e,t){let n=[];function r(i){n.push(i)}on((e?.getDirectives()??[]).filter(i=>!yl(i)),(t?.getDirectives()??[]).filter(i=>!yl(i)),{onAdded(i){r(_5(i)),G1(null,i,r)},onRemoved(i){r(v5(i))},onMutual(i){G1(i.oldVersion,i.newVersion,r)}}),TOe(e,t,r),on(Object.values(e?.getTypeMap()??{}).filter(i=>!T1(i)&&!A1(i)),Object.values(t?.getTypeMap()??{}).filter(i=>!T1(i)&&!A1(i)),{onAdded(i){r(D5(i)),EQ(null,i,r)},onRemoved(i){r(O5(i))},onMutual(i){EQ(i.oldVersion,i.newVersion,r)}}),sn(e?.astNode?.directives||[],t?.astNode?.directives||[],{onAdded(i){r(an(S.SCHEMA_DEFINITION,i,t,!1)),tt(null,i,r)},onMutual(i){tt(i.oldVersion,i.newVersion,r)},onRemoved(i){r(cn(S.SCHEMA_DEFINITION,i,e))}});for(let i=0;i{let a=await o;return s({changes:a,oldSchema:e,newSchema:t,config:r})},Promise.resolve(i))}var _S="graphql-inspector",V1={id:"graphql",source:"graphql-diff",tool:_S,weight:1,originClass:"computed-artifact",config:{enabled:"graphql",paths:"graphqlSchemas"},handles(e,t){return/\.(graphql|graphqls|gql|sdl)$/i.test(e)?/\b(type|interface|enum|union|input|scalar|schema|directive)\b/.test(t):!1},async compute(e){let t,n;try{t=gy(e.before,{assumeValidSDL:!0}),n=gy(e.after,{assumeValidSDL:!0})}catch(o){return za(_S,"parse-failed",`${e.path} could not be parsed as GraphQL SDL on both sides of this change: ${o.message}`)}let r;try{r=await B1(t,n)}catch(o){return za(_S,"toolchain-failed",`graphql-inspector could not compare ${e.path}: ${o.message}`)}let i=[];for(let o of r){let s=o.criticality?.level;if(s!=="BREAKING"&&s!=="DANGEROUS")continue;let a=o.path??o.type;i.push({code:AQ(o.type,s),location:a,pointer:`${e.path}#${a}`,detail:o.message})}return{available:!0,changes:i,tool:_S,weight:1,locator:`${e.path} (GraphQL SDL)`}},codes:{"graphql-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL field \`${e}\` was removed. Every query, mutation, or fragment in this repository that selects it will now be rejected outright \u2014 the whole document fails validation, not just that selection. Find those documents and migrate each to the replacement field; if there is none, propagate the absence rather than substituting a placeholder.`},"graphql-input-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL input field \`${e}\` no longer exists. Stop sending it: an unknown field on an input object fails validation, so every variable payload and inline argument that still carries it will be rejected.`},"graphql-type-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"type",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL type \`${e}\` no longer exists. Every fragment on it, every \`... on ${e}\` inline fragment, and every variable declared with it must be migrated. If there is no replacement type, leave the operation intact with a clearly-marked TODO and explain it in the PR description.`},"graphql-type-kind-changed":{kind:"type-change",taxonomy:{nature:"type-contract",detectability:["runtime-only"],scope:"type",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`\`${e}\` changed kind: ${t} Selections written against the old kind are no longer valid \u2014 an object's field selection does not survive becoming a union or a scalar. Rewrite each selection set for the new kind rather than adjusting it in place.`},"graphql-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL field \`${e}\` changed: ${t} Update the sub-selection and any client-side parsing of the value. A field that became nullable can now return null where the code assumed a value \u2014 handle that explicitly rather than asserting it away.`},"graphql-input-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL input field \`${e}\` changed: ${t} Update every variable payload that sets it so the value sent matches the new type.`},"graphql-argument-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL argument \`${e}\` was removed. Stop passing it \u2014 an unknown argument fails validation, so the whole operation is rejected, not just that argument.`},"graphql-argument-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL argument \`${e}\` changed: ${t} Update the variable declarations and the values passed at every call site.`},"graphql-argument-now-required":{kind:"required-field-added",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` is now required and has no default. Supply it in every operation that reaches this field, using a value that preserves the previous behaviour; if the previous default is not documented, leave a TODO and flag it in the PR description rather than guessing.`},"graphql-argument-default-changed":{kind:"default-change",taxonomy:{nature:"behaviour",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The default value of \`${e}\` changed: ${t} Operations that omit it will silently behave differently. Pass the old value explicitly wherever the previous behaviour was intended.`},"graphql-enum-value-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL enum value \`${e}\` was removed. Find code that sends it and map it onto a still-supported value; code that only *reads* the enum should keep its fallback branch, since a stored value may still carry the old name.`},"graphql-enum-value-added":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` is a new value this code has never seen returned. Add explicit handling; make sure exhaustive switches and mapping tables over that enum have a safe default rather than falling through silently.`},"graphql-union-member-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"type",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`A union or interface membership changed: ${t} An \`... on ${e}\` fragment against a type that is no longer a member fails validation. Rewrite those fragments for the members the schema still declares.`},"graphql-directive-removed":{kind:"config-change",taxonomy:{nature:"configuration",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`A GraphQL directive changed or was removed: ${t} Every operation that applies \`${e}\` \u2014 or applies it where it is no longer allowed \u2014 fails validation. Remove or relocate those usages.`},"graphql-root-type-changed":{kind:"moved-export",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The root operation type \`${e}\` changed: ${t} Every operation of that kind is now rooted somewhere else \u2014 check that the top-level selections in this repository's documents still exist on the new root.`},"graphql-schema-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`graphql-inspector reports a breaking schema change at \`${e}\`: ${t} Update the operations in this repository that touch it.`}}};function AQ(e,t){switch(e){case"FIELD_REMOVED":return"graphql-field-removed";case"INPUT_FIELD_REMOVED":return"graphql-input-field-removed";case"TYPE_REMOVED":return"graphql-type-removed";case"TYPE_KIND_CHANGED":return"graphql-type-kind-changed";case"FIELD_TYPE_CHANGED":return"graphql-field-type-changed";case"INPUT_FIELD_TYPE_CHANGED":return"graphql-input-field-type-changed";case"FIELD_ARGUMENT_REMOVED":case"DIRECTIVE_ARGUMENT_REMOVED":return"graphql-argument-removed";case"FIELD_ARGUMENT_TYPE_CHANGED":case"DIRECTIVE_ARGUMENT_TYPE_CHANGED":return"graphql-argument-type-changed";case"FIELD_ARGUMENT_ADDED":case"INPUT_FIELD_ADDED":case"DIRECTIVE_ARGUMENT_ADDED":return t==="BREAKING"?"graphql-argument-now-required":"graphql-schema-changed";case"FIELD_ARGUMENT_DEFAULT_CHANGED":case"INPUT_FIELD_DEFAULT_VALUE_CHANGED":case"DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED":return"graphql-argument-default-changed";case"ENUM_VALUE_REMOVED":return"graphql-enum-value-removed";case"ENUM_VALUE_ADDED":return"graphql-enum-value-added";case"UNION_MEMBER_REMOVED":case"UNION_MEMBER_ADDED":case"OBJECT_TYPE_INTERFACE_REMOVED":return"graphql-union-member-removed";case"DIRECTIVE_REMOVED":case"DIRECTIVE_LOCATION_REMOVED":case"DIRECTIVE_REPEATABLE_REMOVED":return"graphql-directive-removed";case"SCHEMA_QUERY_TYPE_CHANGED":case"SCHEMA_MUTATION_TYPE_CHANGED":case"SCHEMA_SUBSCRIPTION_TYPE_CHANGED":return"graphql-root-type-changed";default:return"graphql-schema-changed"}}var AOe=["openapi-diff","protobuf-diff","graphql-diff"];function IQ(e){return AOe.includes(e)}var kl=[AM,IM,V1];var CQ=Object.fromEntries(kl.map(e=>[e.source,e.weight])),NQ=Object.fromEntries(kl.map(e=>[e.source,e.originClass])),IOe=Object.fromEntries(kl.flatMap(e=>Object.entries(e.codes)));function q1(e){return IOe[e]}function OQ(e,t){return t.evidence[e.config.enabled]===!0}function DQ(e,t){let n=t.evidence[e.config.paths];return Array.isArray(n)?n:[]}var ROe=12e4;async function MQ(e,t,n){let r=await(0,wS.mkdtemp)((0,PQ.join)((0,RQ.tmpdir)(),"drift-spec-"));try{return await e.compute({path:t.path,before:t.before,after:t.after,siblings:n.siblings??[],workdir:r,exec:n.exec??et,logger:n.logger,...n.env?{env:n.env}:{},timeoutMs:n.timeoutMs??ROe})}catch(i){return n.logger.debug(`Spec diff crashed for ${t.path}: ${i.message}`),{available:!1,reason:"toolchain-failed",detail:`Drift could not compare ${t.path}: ${i.message}`,tool:e.tool}}finally{await(0,wS.rm)(r,{recursive:!0,force:!0}).catch(()=>{})}}var LQ=require("node:crypto"),rc=require("node:fs/promises"),FQ=require("node:path");function UQ(e){let t=ol();return t?(0,FQ.join)(t,`artifact-${(0,LQ.createHash)("sha256").update(e).digest("hex")}.json`):null}async function ic(e){let t=UQ(e);if(!t)return null;try{let n=JSON.parse(await(0,rc.readFile)(t,"utf8"));return n.format!==1||n.key!==e?null:(it("artifact.cache.hit"),n.value)}catch{return it("artifact.cache.miss"),null}}async function oc(e,t){let n=UQ(e);if(n)try{await(0,rc.mkdir)(ol(),{recursive:!0});let r=`${n}.${process.pid}.partial`;await(0,rc.writeFile)(r,JSON.stringify({format:1,key:e,value:t}),"utf8"),await(0,rc.rename)(r,n)}catch{}}var $S=require("node:zlib");function POe(e){return e.length>2&&e[0]===31&&e[1]===139}function COe(e){return e.length>4&&e[0]===80&&e[1]===75}var jQ=200*1024*1024;function Bn(e,t={}){let n=t.maxDecompressedBytes??jQ;return COe(e)?W1(e,{maxDecompressedBytes:n}):LOe(POe(e)?(0,$S.gunzipSync)(e,{maxOutputLength:n}):e)}var NOe=101010256,OOe=33639248;function W1(e,t={}){let n=t.maxDecompressedBytes??jQ,r=MOe(e);if(r===-1)return[];let i=e.readUInt16LE(r+10),o=e.readUInt32LE(r+16),s=[];for(let a=0;ae.length||e.readUInt32LE(o)!==OOe);a++){let c=e.readUInt16LE(o+10),l=e.readUInt32LE(o+20),u=e.readUInt32LE(o+24),d=e.readUInt16LE(o+28),p=e.readUInt16LE(o+30),f=e.readUInt16LE(o+32),m=e.readUInt32LE(o+42),g=e.toString("utf8",o+46,o+46+d);o+=46+d+p+f,!g.endsWith("/")&&s.push({path:g,size:u,read:()=>DOe(e,m,c,l,n)})}return s}function DOe(e,t,n,r,i){let o=e.readUInt16LE(t+26),s=e.readUInt16LE(t+28),a=t+30+o+s,c=e.subarray(a,a+r);if(n===0){if(c.length>i)throw new Error(`Stored zip entry exceeds the ${i}-byte decompressed-size limit.`);return Buffer.from(c)}if(n===8)return(0,$S.inflateRawSync)(c,{maxOutputLength:i});throw new Error(`Unsupported zip compression method ${n}`)}function MOe(e){let t=Math.max(0,e.length-65535-22);for(let n=e.length-22;n>=t;n--)if(e.readUInt32LE(n)===NOe)return n;return-1}var wy=512;function LOe(e){let t=[],n=0,r=null;for(;n+wy<=e.length;){let i=e.subarray(n,n+wy);if(i[0]===0)break;let o=kS(i.subarray(0,100)),s=FOe(i.subarray(124,136)),a=String.fromCharCode(i[156]??0),c=kS(i.subarray(345,500)),l=n+wy,u=l+s;if(n=l+Math.ceil(s/wy)*wy,a==="L"){r=kS(e.subarray(l,u));continue}if(a==="x"||a==="X"){r=UOe(e.subarray(l,u))??r;continue}if(a!=="0"&&a!=="\0"&&a!=="7"){r=null;continue}let d=r??(c?`${c}/${o}`:o);if(r=null,!d)continue;let p=e.subarray(l,u);t.push({path:d,size:s,read:()=>Buffer.from(p)})}return t}function kS(e){let t=e.indexOf(0);return e.toString("utf8",0,t===-1?e.length:t).trim()}function FOe(e){let t=kS(e).replace(/[^0-7]/g,"");return t?Number.parseInt(t,8):0}function UOe(e){for(let t of e.toString("utf8").split(` +`)){let n=/^\d+\s+path=(.*)$/.exec(t);if(n)return n[1]}return null}function jOe(e){return/^[aeiou]/i.test(e.trim())?"an":"a"}function jo(e){return`${jOe(e)} ${e}`}var cX="https://data.jsdelivr.com/v1/packages/npm",nL="https://cdn.jsdelivr.net/npm",zOe="https://registry.npmjs.org",GOe=50*1024*1024,zQ=200*1024*1024,GQ=20*1024*1024,SS=new Map;function $l(e,t,n={}){if(n.traversal)return BOe+=1,Rn("surface",e,()=>VQ(e,t,n));let r=`${e}@${t}#${n.followDependencies===!1?"own":"deps"}`+(n.subpath?`#${n.subpath}`:""),i=SS.get(r);if(i)return it("surface.cache.hit"),i;it("surface.cache.miss");let o=Rn("surface",e,()=>VQ(e,t,n));return SS.set(r,o),o.then(s=>{s||SS.delete(r)},()=>SS.delete(r)),o}var BOe=0;var VOe=6;function qOe(e,t,n,r){return`npm-surface:v${VOe}:${e}@${t}#${n?"deps":"own"}`+(r?`#${r}`:"")}async function WOe(e,t,n,r){let i=iL(lX(n?.exports,r)),o=[...i?$y(Sl(i)):[],...$y(Sl(r))],s=[...new Set(o)],a=await rL(e,t,s);if(a!==void 0)return a;for(let c of s)if(await CS(e,t,c))return c;return null}function BQ(e){let t=e.split("/");return e.startsWith("@")?t.slice(0,2).join("/"):t[0]??e}function lX(e,t){if(!e||typeof e!="object")return;let n=e;for(let r of[`./${t}`,t])if(r in n)return n[r]}async function VQ(e,t,n){let r=n.followDependencies!==!1,i=qOe(e,t,r,n.subpath),o=await ic(i);if(o)return it("surface.diskCache.hit"),{...o,incomplete:o.incomplete??!1,api:new Map(o.api)};it("surface.diskCache.miss");let s=await Z1(e,t),a=n.subpath?await WOe(e,t,s,n.subpath):await cDe(e,t,s),c=a?await Rn("surface-sources",e,()=>H1(e,t,a)):{sources:[],truncated:!1};if(!a||c.sources.length===0){let h=await YOe(e,t);if(!h)throw new bp(e,t);if(s=h.manifest,a=n.subpath?await uDe(s,n.subpath,h.files):lDe(e,s,h.files),a&&(c=await Rn("surface-sources",e,()=>H1(e,t,a,h)),c.sources.length===0))throw new bp(e,t)}if(!a){if(a=await dDe(e,t,n.subpath),!a)return null;c=await Rn("surface-sources",e,()=>H1(e,t,a))}let l=c.sources,u=c.truncated;if(it("surface.declarationFiles",l.length),l.length===0)return null;let d=new Map,p=[];for(let h of l)vDe(h.content,h.path,d,p,e);$De(d,p),fX(d);let f=d.size,m=!s||!r?{followed:[],attempted:!1,incomplete:!1}:await Rn("surface-deps",e,()=>rDe(s,l,d,`${e}@${t}`,n.traversal)),g=d.size>0?{api:d,entryPath:a,viaDependencies:m.followed,ownSymbols:f,subpaths:aDe(s?.exports),incomplete:m.incomplete||u}:null;return g&&!m.attempted&&!g.incomplete&&await oc(i,{...g,api:[...g.api]}),g}var PS=class extends Error{constructor(n,r){super(`${n}@${r} could not be fetched`);this.packageName=n;this.version=r;this.name="VersionUnavailableError"}packageName;version},bp=class extends Error{constructor(n,r){super(`${n}@${r} artifact could not be inspected`);this.packageName=n;this.version=r;this.name="ArtifactUnavailableError"}packageName;version};function Z1(e,t){return Ie(`${nL}/${e}@${t}/package.json`)}async function uX(e,t,n){let[r,i]=await Promise.all([Z1(e,t),Z1(e,n)]);if(!r||!i)return[];let o=qQ(e,r),s=qQ(e,i),a=[],c=[...o.requireConditions].filter(u=>!s.requireConditions.has(u)&&!s.commonJsExports.has(u));for(let u of c){let d=Q1(e,u),p=JOe(u)?"affectedSpecifierPatterns":"affectedSpecifiers";a.push({kind:"exports-require-condition-removed",symbol:e,detail:u==="."?"The root CommonJS export condition was removed":`The CommonJS export condition for ${u} was removed`,before:[...o.requireConditions].sort().join(` `),after:[...s.requireConditions].sort().join(` -`)||"(none)",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"],[p]:[d]}})}let l=c.includes(".");return o.hasRootCommonJsEntry&&!s.hasRootCommonJsEntry&&!l?a.push({kind:"commonjs-entry-removed",symbol:e,detail:"The package no longer exposes a CommonJS-compatible entry point",before:o.entrySummary,after:s.entrySummary,moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"],affectedSpecifiers:[e]}}):i.type!==r.type&&r.type==="module"&&!s.hasRootCommonJsEntry&&!l&&a.push({kind:"package-type-changed",symbol:e,detail:"The package type changed to ESM without a CommonJS-compatible entry point",before:S8(i),after:S8(r),moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"],affectedSpecifiers:[e]}}),k0e(a)}function _8(e,t){let n=b0e(t.exports),i=v0e(t.exports,t),r=t.exports!==void 0?i.has("."):cO(t.main,t)||cO("./index.js",t),o=[`type: ${t.type??"(absent)"}`,t.exports===void 0&&t.main?`main: ${t.main}`:"",t.module?`module: ${t.module}`:"",n.size>0?`exports.require: ${[...n].sort().map(s=>aO(e,s)).join(", ")}`:"",i.size>0?`exports.commonjs: ${[...i].sort().map(s=>aO(e,s)).join(", ")}`:""].filter(Boolean).join(` -`)||"(no CommonJS-compatible entry point detected)";return{hasRootCommonJsEntry:r,requireConditions:n,commonJsExports:i,entrySummary:o}}function b0e(e){let t=new Set;return K$(e,".",t),t}function K$(e,t,n){if(Array.isArray(e)){for(let o of e)K$(o,t,n);return}if(!e||typeof e!="object")return;let i=Object.entries(e),r=i.some(([o])=>o==="."||o.startsWith("./"));for(let[o,s]of i)o==="require"&&n.add(t),r&&(o==="."||o.startsWith("./"))?K$(s,o,n):typeof s=="object"&&K$(s,t,n)}function v0e(e,t){let n=new Set;return sO(e,".",t,n),n}function sO(e,t,n,i){if(J$(e,n)&&i.add(t),Array.isArray(e)){for(let s of e)sO(s,t,n,i);return}if(!e||typeof e!="object")return;let r=Object.entries(e);if(r.some(([s])=>s==="."||s.startsWith("./")))for(let[s,a]of r)(s==="."||s.startsWith("./"))&&sO(a,s,n,i)}function aO(e,t){return t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function w0e(e){return e.includes("*")}function J$(e,t){if(typeof e=="string")return cO(e,t);if(Array.isArray(e))return e.some(i=>J$(i,t));if(!e||typeof e!="object")return!1;let n=e;return"require"in n?mh(n.require):"node"in n&&J$(n.node,t)?!0:"default"in n?J$(n.default,t):!1}function mh(e){if(typeof e=="string")return!/\.mjs$/i.test(e);if(Array.isArray(e))return e.some(mh);if(!e||typeof e!="object")return!1;let t=e;return"require"in t?mh(t.require):"node"in t&&mh(t.node)?!0:"default"in t?mh(t.default):!1}function cO(e,t){return e?/\.cjs$/i.test(e)?!0:/\.mjs$/i.test(e)?!1:(/\.[jt]sx?$/i.test(e),t.type!=="module"):!1}function S8(e){return`type: ${e.type??"(absent)"} -${e.main?`main: ${e.main}`:"main: (absent)"}`}function k0e(e){let t=new Set;return e.filter(n=>{let i=n.moduleSystem?.affectedSpecifiers?.join(",")??"",r=n.moduleSystem?.affectedSpecifierPatterns?.join(",")??"",o=`${n.kind}:${i}:${r}:${n.symbol}`;return t.has(o)?!1:(t.add(o),!0)})}var x8=new Map,q$=new Map;function $0e(e,t){let n=`${e}@${t}`,i=q$.get(n);if(i)return i;let r=encodeURIComponent(e).replaceAll("%40","@"),o=(async()=>{let s=await $e(`${p0e}/${r}/${encodeURIComponent(t)}`,{immutable:!0});if(!s?.dist?.tarball||s.version!==t)return null;let a=await Bt(s.dist.tarball,{maxBytes:f0e,timeoutMs:6e4,retries:2});if(!a.ok)return null;let c;try{c=Fn(a.bytes,{maxDecompressedBytes:v8})}catch{return null}if(c.length===0)return null;let l=c.reduce((f,m)=>f+Math.max(0,m.size),0);if(!Number.isSafeInteger(l)||l>v8)return null;let u=new Map;for(let f of c){let m=_0e(f.path);if(m===null)return null;!m||u.has(m)||u.set(m,f)}let d=u.get("package.json");if(!d||d.size>1024*1024)return null;let p;try{p=JSON.parse(d.read().toString("utf8"))}catch{return null}return p.version!==t?null:{manifest:p,files:u}})();return q$.set(n,o),o.then(s=>{s||q$.delete(n)},()=>q$.delete(n)),o}function _0e(e){let t=e.replaceAll("\\","/");if(!t||t.includes("\0")||t.startsWith("/")||/^[A-Za-z]:\//.test(t))return null;let n=t.split("/");if(n.some(i=>i===".."))return null;for(;n[0]==="."||n[0]==="";)n.shift();return n[0]==="package"&&n.shift(),n.join("/")}function V8(e,t){let n=`${e}@${t}`,i=x8.get(n);if(i)return i;let r=$e(`${j8}/${e}@${t}?structure=flat`,{immutable:!0,retries:0}).then(o=>o?.files?new Set(o.files.map(s=>s.name).filter(s=>typeof s=="string").map(s=>s.startsWith("/")?s.slice(1):s)):null).catch(()=>null);return x8.set(n,r),r}async function pO(e,t,n){let i=await V8(e,t);if(i)return n.find(r=>i.has(r))??null}var S0e=8,E8=8,x0e=4,E0e=24;function T0e(e){return e.star||e.reExported.size>0}async function I0e(e,t,n,i,r){let o={...e?.dependencies,...e?.peerDependencies},s=[...T8(t,n)].some(([y,w])=>w.star&&!o[k8(y)]);if(Object.keys(o).length===0)return{followed:[],attempted:!1,incomplete:s};let a=r?.depth??0,c=r?.budget??{remaining:E0e},l=new Set([...r?.visited??[],i]),u=[...T8(t,n)].map(([y,w])=>{let k=k8(y),_=y.length>k.length?y.slice(k.length+1):void 0;return{specifier:y,reference:w,pkg:k,subpath:_}}).filter(y=>o[y.pkg]),d=u.length>0;if(!d)return{followed:[],attempted:!1,incomplete:s};let p=[],f=!1,m=await qn(u,E8,y=>N0e(y.pkg,o[y.pkg])),g=[],h=0;for(let[y,{specifier:w,reference:k,pkg:_,subpath:S}]of u.entries()){let x=m[y],E=T0e(k);if(!x){E&&(f=!0);continue}let T=l.has(`${w}@${x}`);if(!E){if(h>=S0e)continue;h+=1,g.push({specifier:w,pkg:_,subpath:S,reference:k,resolved:x,publicEdge:E,recurse:!1});continue}let A=!T&&a0;A?c.remaining-=1:T||(f=!0),g.push({specifier:w,pkg:_,subpath:S,reference:k,resolved:x,publicEdge:E,recurse:A})}let b=new Array(g.length);await qn(g.map((y,w)=>({entry:y,index:w})),E8,async({entry:y,index:w})=>{y.recurse||(b[w]=await tl(y.pkg,y.resolved,{followDependencies:!1,...y.subpath?{subpath:y.subpath}:{}}).catch(()=>null))});for(let[y,w]of g.entries())w.recurse&&(b[y]=await tl(w.pkg,w.resolved,{followDependencies:!0,...w.subpath?{subpath:w.subpath}:{},traversal:{depth:a+1,visited:new Set([...l,`${w.specifier}@${w.resolved}`]),budget:c}}).catch(()=>null));for(let[y,w]of g.entries()){let k=b[y];if(w.publicEdge&&!k&&(f=!0),k?.incomplete&&(f=!0),!k)continue;let _=0;for(let[S,x]of w.reference.names(k.api)){let E=k.api.get(x);if(!E)continue;let T=w.reference.star||w.reference.reExported.has(S)?S:`${w.specifier}#${S}`;n.has(T)||(n.set(T,{...hh(E,S),via:w.specifier}),_+=1)}_>0&&p.push(`${w.specifier}@${w.resolved}`)}return{followed:p,attempted:d,incomplete:f||s}}function T8(e,t){let n=new Map,i=s=>{let a=n.get(s);if(a)return a;let c={named:new Map,star:!1,reExported:new Set,names(l){if(!this.star)return[...this.named];let u=[...l.keys()].map(d=>[d,d]);return[...this.named,...u.filter(([d])=>!this.named.has(d))]}};return n.set(s,c),c},r=[...t.values()].map(s=>s.signature).join(` -`),o=s=>new RegExp(`\\b${e_(s)}\\b`).test(r);for(let s of e)for(let a of A0e(s.content)){if(R0e(a.specifier))continue;let c=i(a.specifier);if(a.kind==="export"&&a.star){c.star=!0;continue}for(let l of a.bindings)a.kind==="export"?(c.named.set(l.local,l.imported),c.reExported.add(l.local)):o(l.local)&&c.named.set(l.imported,l.imported)}return n}function A0e(e){let t=[],n=/\b(import|export)\s+(?:type\s+)?(?:(\*(?:\s+as\s+\w+)?)|(\{[^}]*\})|(\w+))\s+from\s+['"]([^'"]+)['"]/g;for(let i of e.matchAll(n)){let[,r="",o,s,a,c=""]=i,l=r==="export"?"export":"import";if(o){t.push({kind:l,specifier:c,star:!0,bindings:[]});continue}if(a){t.push({kind:l,specifier:c,star:!1,bindings:[{imported:"default",local:a}]});continue}let u=[];for(let d of(s??"").replace(/[{}]/g,"").split(",")){let p=d.replace(/\btype\s+/g,"").trim();if(!p)continue;let[f,m]=p.split(/\s+as\s+/).map(g=>g.trim());f&&u.push({imported:f,local:m||f})}u.length>0&&t.push({kind:l,specifier:c,star:!1,bindings:u})}return t}function R0e(e){return e.startsWith(".")||e.startsWith("/")}async function N0e(e,t){return(await $e(`${j8}/${e}/resolved?specifier=${encodeURIComponent(t)}`))?.version??null}function C0e(e){return!e||typeof e!="object"?[]:Object.keys(e).filter(t=>t.startsWith("./")&&!t.endsWith("package.json")).slice(0,20)}async function P0e(e,t,n){let i=B8(e,n),r=await pO(e,t,i);if(r!==void 0){if(r)return r}else for(let o of i)if(await Q$(e,t,o))return o;return null}function D0e(e,t,n){return B8(e,t).find(i=>n.has(i))??null}function O0e(e,t,n){let i=fO(z8(e?.exports,t)),r=[...i?gh(nl(i)):[],...gh(nl(t))];return[...new Set(r)].find(o=>n.has(o))??null}function B8(e,t){let n=[];if(t){let i=t.types??t.typings??fO(t.exports);i&&n.push(...gh(nl(i))),t.main&&n.push(nl(t.main).replace(/\.(c|m)?js$/,".d.ts"))}return n.push(...F0e(e)),[...new Set(n)]}async function M0e(e,t,n){let i=e.startsWith("@")?`@types/${e.slice(1).replace("/","__")}`:`@types/${e}`,r=n?`${n}.d.ts`:"index.d.ts",o=n?`#${n}`:"",s=/^\D*(\d+)\./.exec(t)?.[1]??/^\D*(\d+)$/.exec(t)?.[1];return s&&await Q$(i,s,r)?`@types:${i}@${s}${o}`:await Q$(i,"latest",r)?`@types:${i}@latest${o}`:null}function L0e(e){let t=e.slice(7),n=t.indexOf("#"),i=n===-1?t:t.slice(0,n),r=n===-1?void 0:t.slice(n+1),o=i.lastIndexOf("@"),s=o>0?{name:i.slice(0,o),range:i.slice(o+1)}:{name:i,range:"latest"};return r?{...s,subpath:r}:s}function F0e(e){return["index.d.ts","dist/index.d.ts","lib/index.d.ts","types/index.d.ts",`types/${e.split("/").pop()?.replace(/^@/,"")||e}.d.ts`]}function gh(e){if(/\.d\.(c|m)?ts$/.test(e))return[e,e.replace(/\.d\.(c|m)?ts$/,".d.ts")];let t=e.replace(/\.(c|m)?[jt]s$/,"").replace(/\/$/,""),n=[`${t}.d.ts`,`${t}.d.cts`,`${t}.d.mts`,`${t}/index.d.ts`];return/\.(c|m)?js$/.test(e)||n.push(e),n}function fO(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=(n,i)=>{if(i>6||!n)return null;if(typeof n=="string")return i>0?n:null;if(typeof n!="object")return null;let r=n,o=r.types??r.typings;if(typeof o=="string")return o;let s=[".","import","require","default","node"];for(let a of[...s,...Object.keys(r)]){if(!(a in r))continue;let c=t(r[a],i+1);if(c)return c}return null};return t(e,0)}async function nO(e,t,n,i){let r=n.startsWith("@types:")?L0e(n):null,o=r?`${r.name}@${r.range}`:`${e}@${t}`,s=r?r.subpath?`${r.subpath}.d.ts`:"index.d.ts":n,a=r?null:i?new Set(i.files.keys()):await V8(e,t),c=0,l=[],u=new Set,d=[[s]],p=async g=>{let h=a?g.find(b=>a.has(b))??null:void 0;for(let b of h===void 0?g:h?[h]:[]){let y;if(i){let w=i.files.get(b);if(!w||w.size>w8-c)return null;let k=w.read();if(c+=k.length,c>w8)return null;y=k.toString("utf8")}else y=await rt(`${dO}/${o}/${b}`,{retries:0});if(y)return{path:b,content:y}}return null},f=!1;for(;d.length>0&&l.length0&&g.length+l.length!u.has(y));for(let y of b)u.add(y);b.length>0&&g.push(b)}if(g.length===0)continue;let h=await qn(g,U0e,b=>p(b));for(let b of h)if(b&&l.length>=W$&&(f=!0),!(!b||l.length>=W$)){l.push(b);for(let y of j0e(b.content))d.push(rO(b.path,y));for(let y of V0e(b.content))d.push(rO(b.path,y));for(let y of z0e(b.content))d.push(rO(b.path,y))}}return d.some(g=>g.some(h=>!u.has(h)))&&(f=!0),{sources:l,truncated:f}}var U0e=8,W$=Number(process.env.DRIFT_MAX_DECLARATION_FILES)||150;function j0e(e){let t=new Set,n=/\bexport\b\s*(?:type\b\s*)?(?:\*(?:\s+as\s+\w+)?|\{[^}]*\})\s*from\s*['"](\.[^'"]+)['"]/g;for(let r of e.matchAll(n))t.add(r[1]);let i=/\bimport\s+[A-Za-z_$][\w$]*\s*=\s*require\((['"])(\.[^'"]+)\1\)/g;for(let r of e.matchAll(i))t.add(r[2]);return[...t]}function z0e(e){if(!/\bexport\b\s*\{[^}]*\}(?!\s*from)/.test(e))return[];let t=new Set,n=/\bimport\b[^'"]*?\bfrom\s*['"](\.[^'"]+)['"]/g;for(let i of e.matchAll(n))t.add(i[1]);return[...t]}function G0e(e,t){if(!t)return[];let n=new Set([t,t.replace(/^@types\//,"")]),i=[],r=/\bdeclare\s+module\s+['"]([^'"]+)['"]\s*\{/g;for(let o=r.exec(e);o;o=r.exec(e)){let s=e.indexOf("{",o.index),a=ls(e,s);if(s<0||a<0)continue;let c=o[1];(n.has(c)||[...n].some(l=>c.startsWith(`${l}/`)))&&i.push(e.slice(s+1,a)),r.lastIndex=a+1}return i}function V0e(e){let t=new Set,n=/\/\/\/\s*/g;for(let i of e.matchAll(n))t.add(i[1]);return[...t]}function rO(e,t){let n=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",r=nl(n?`${n}/${t}`:t).replace(/\.(d\.(c|m)?ts|(c|m)?js|(c|m)?ts)$/,"");return[`${r}.d.ts`,`${r}.d.cts`,`${r}.d.mts`,`${r}/index.d.ts`,`${r}/index.d.cts`]}function nl(e){let t=[];for(let n of e.replace(/^\.\//,"").split("/"))!n||n==="."||(n===".."?t.pop():t.push(n));return t.join("/")}async function Q$(e,t,n){let i=await pO(e,t,[n]);return i!==void 0?i!==null:await rt(`${dO}/${e}@${t}/${n}`,{retries:0})!==null}function B0e(e,t,n=new Map,i=[],r){let o=new Map,s=(c,l)=>{let u=c.get(l.name);u&&u.kind===l.kind?(u.signature=`${u.signature} | ${l.signature}`,u.members=[...new Set([...u.members,...l.members])],u.requiredMembers=[...new Set([...u.requiredMembers,...l.requiredMembers])]):u||c.set(l.name,l)},a=gO(e);for(let c of A8(a))s(o,c.entry),c.exported&&s(n,c.entry);for(let c of G0e(a,r)){for(let l of A8(c))s(n,l.entry);I8(c,o,n,{override:!0})}return q0e(a,o),W0e(a,n),H0e(a,o,n,i),I8(a,o,n),Z0e(a,o,n),q8(n,o),n}function q8(e,t){let n=r=>e.get(r)??t?.get(r),i=(r,o)=>{if(!(!r.extends||o.has(r.name))){o.add(r.name);for(let s of r.extends){let a=n(s);!a||a===r||(i(a,o),r.members=[...new Set([...r.members,...a.members])],r.requiredMembers=[...new Set([...r.requiredMembers,...a.requiredMembers])])}}};for(let r of e.values())i(r,new Set)}function q0e(e,t){let n=i=>{t.has(i)||t.set(i,{name:i,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0})};for(let i of e.matchAll(/\bimport\s+\*\s+as\s+([A-Za-z_$][\w$]*)\s+from\s+['"][^'"]+['"]/g))n(i[1]);for(let i of e.matchAll(/\bimport\s+(?:type\s+)?\{([^}]+)\}\s+from\s+['"][^'"]+['"]/g))for(let{exported:r}of hO(i[1]??""))n(r);for(let i of e.matchAll(/\bimport\s+([A-Za-z_$][\w$]*)\s*=\s*require\(['"][^'"]+['"]\)/g))n(i[1]);for(let i of e.matchAll(/\bimport\s+(?!type\s)([A-Za-z_$][\w$]*)\s*(?:,\s*\{[^}]*\})?\s+from\s+['"][^'"]+['"]/g))n(i[1])}function W0e(e,t){let n=/\bexport\b\s*(?:type\b\s*)?\*\s+as\s+([A-Za-z_$][\w$]*)\s*from\s*['"][^'"]+['"]/g;for(let i of e.matchAll(n)){let r=i[1];t.has(r)||t.set(r,{name:r,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0})}}function H0e(e,t,n,i){let r=/\bexport\b\s*(?:type\b\s*)?\{([^}]+)\}(?:\s*from\s*['"][^'"]+['"])?\s*;/g;for(let o of e.matchAll(r))for(let{exported:s,local:a}of hO(o[1]??"")){if(n.has(s))continue;let c=t.get(a);c?n.set(s,hh(c,s)):i.push({exported:s,local:a})}}function K0e(e,t){for(let n of t){if(e.has(n.exported))continue;let i=e.get(n.local);i&&e.set(n.exported,hh(i,n.exported))}}function I8(e,t,n,i={}){for(let r of e.matchAll(/\bexport\s*=\s*([A-Za-z_$][\w$.]*)\s*(?:;|$)/gm))W8("default",r[1],t,n,i.override),J0e("default",r[1],t,n,i.override)}function J0e(e,t,n,i,r=!1){let o=i.get(e);if(!o||o.members.length>0&&!r)return;let s=n.get(t);if(!s)return;let a=s.signature.replace(/\s*\bexport\s*=[\s\S]*$/,"").replace(/\s*\}\s*$/,"").trim(),c=/:\s*([A-Za-z_$][\w$.]*)\s*;?\s*$/.exec(a)?.[1],l=c?n.get(c):void 0;l&&(o.members=[...l.members],o.requiredMembers=[...l.requiredMembers])}function W8(e,t,n,i,r=!1){let o=n.get(t);o&&(r||!i.has(e))&&i.set(e,hh(o,e));for(let s of n.values()){if(!s.name.startsWith(`${t}.`))continue;let a=`${e}.${s.name.slice(t.length+1)}`;(r||!i.has(a))&&i.set(a,hh(s,a))}}function Z0e(e,t,n){for(let i of e.matchAll(/\bexport\s+default\s+(?:abstract\s+)?(?:class|function|enum|const|let|var)?\s*([A-Za-z_$][\w$]*)/g)){let r=i[1];t.has(r)&&W8("default",r,t,n)}}function hh(e,t){return{...e,name:t,signature:e.signature.replace(new RegExp(`\\b${e_(e.name)}\\b`,"g"),t)}}function e_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yh(e){return e.replace(/\/\*(?:[^*]|\*(?!\/))*\*\//g,"").replace(/\/\/[^\n]*/g,"").replace(/\s+/g," ").trim()}function A8(e){let t=[];for(let n of K8(e))t.push({exported:n.exported,entry:{name:n.name,kind:"function",signature:yh(e.slice(n.start,To(e,n.start))),members:[],requiredMembers:[]}});return R8(e,/\b(export\s+)?(?:declare\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\b/g,"variable",t),tAe(e,t),R8(e,/\b(export\s+)?(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)\b/g,"type",t),iO(e,/\b(export\s+)?(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"class",t),iO(e,/\b(export\s+)?(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"interface",t),iO(e,/\b(export\s+)?(?:declare\s+)?enum\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"enum",t),H8(e,"",!1,t),t}function H8(e,t,n,i){let r=/\b(export\s+)?(?:declare\s+)?(?:namespace|module)\s+([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\{/g;for(let o=r.exec(e);o;o=r.exec(e)){let s=e.indexOf("{",o.index),a=ls(e,s);if(s<0||a<0)continue;let c=n||!!o[1],l=t?`${t}.${o[2]}`:o[2],u=e.slice(s+1,a);i.push({exported:c,entry:{name:l,kind:"namespace",signature:`namespace ${l}`,members:X0e(u),requiredMembers:[]}}),Q0e(u,l,c,i),H8(u,l,c,i),Y0e(u,l,c,i),r.lastIndex=a+1}}function Y0e(e,t,n,i){let r=mO(e);for(let o of r.matchAll(/\bexport\b\s*\{([^}]+)\}\s*;?/g))for(let{exported:s}of hO(o[1]??""))i.push({exported:n,entry:{name:`${t}.${s}`,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0}})}function Q0e(e,t,n,i){let r=mO(e),o=(s,a,c,l=[],u=[])=>{i.push({exported:n,entry:{name:`${t}.${s}`,kind:a,signature:yh(c.replace(new RegExp(`\\b${e_(s)}\\b`),`${t}.${s}`)),members:l,requiredMembers:u}})};for(let s of K8(r))o(s.name,"function",r.slice(s.start,To(r,s.start)));for(let s of r.matchAll(/\b(?:declare\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\b/g)){let a=s.index??0;o(s[1],"variable",r.slice(a,To(r,a)))}for(let s of r.matchAll(/\b(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)\b/g)){let a=s.index??0;o(s[1],"type",r.slice(a,To(r,a)))}for(let s of r.matchAll(/\b(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=r.indexOf("{",a),l=ls(r,c),u=c>=0&&l>c?r.slice(c+1,l):"",d=X$(u,!0);o(s[1],"class",r.slice(a,c>=0?c:To(r,a)),d.map(p=>p.name),d.filter(p=>p.required).map(p=>p.name))}for(let s of r.matchAll(/\b(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=r.indexOf("{",a),l=ls(r,c),u=c>=0&&l>c?r.slice(c+1,l):"",d=X$(u,!1);o(s[1],"interface",r.slice(a,c>=0?c:To(r,a)),d.map(p=>p.name),d.filter(p=>p.required).map(p=>p.name))}for(let s of r.matchAll(/\b(?:declare\s+)?enum\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=r.indexOf("{",a),l=ls(r,c),u=c>=0&&l>c?r.slice(c+1,l):"";o(s[1],"enum",r.slice(a,c>=0?c:To(r,a)),Y8(u).map(d=>d.name))}}function mO(e){let t=[],n=/\b(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\s*\{/g;for(let r of e.matchAll(n)){let o=e.indexOf("{",r.index),s=ls(e,o);o>=0&&s>=0&&t.push([r.index??0,s+1])}if(t.length===0)return e;let i=[...e];for(let[r,o]of t)for(let s=r;s"){if(e[i-1]==="=")continue;if(n-=1,n===0)return i}else if(r==="("&&n===0)return-1}return-1}function gO(e){let t="",n=0;for(;n0?`exports.require: ${[...n].sort().map(s=>Q1(e,s)).join(", ")}`:"",r.size>0?`exports.commonjs: ${[...r].sort().map(s=>Q1(e,s)).join(", ")}`:""].filter(Boolean).join(` +`)||"(no CommonJS-compatible entry point detected)";return{hasRootCommonJsEntry:i,requireConditions:n,commonJsExports:r,entrySummary:o}}function HOe(e){let t=new Set;return AS(e,".",t),t}function AS(e,t,n){if(Array.isArray(e)){for(let o of e)AS(o,t,n);return}if(!e||typeof e!="object")return;let r=Object.entries(e),i=r.some(([o])=>o==="."||o.startsWith("./"));for(let[o,s]of r)o==="require"&&n.add(t),i&&(o==="."||o.startsWith("./"))?AS(s,o,n):typeof s=="object"&&AS(s,t,n)}function KOe(e,t){let n=new Set;return Y1(e,".",t,n),n}function Y1(e,t,n,r){if(IS(e,n)&&r.add(t),Array.isArray(e)){for(let s of e)Y1(s,t,n,r);return}if(!e||typeof e!="object")return;let i=Object.entries(e);if(i.some(([s])=>s==="."||s.startsWith("./")))for(let[s,a]of i)(s==="."||s.startsWith("./"))&&Y1(a,s,n,r)}function Q1(e,t){return t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function JOe(e){return e.includes("*")}function IS(e,t){if(typeof e=="string")return X1(e,t);if(Array.isArray(e))return e.some(r=>IS(r,t));if(!e||typeof e!="object")return!1;let n=e;return"require"in n?ky(n.require):"node"in n&&IS(n.node,t)?!0:"default"in n?IS(n.default,t):!1}function ky(e){if(typeof e=="string")return!/\.mjs$/i.test(e);if(Array.isArray(e))return e.some(ky);if(!e||typeof e!="object")return!1;let t=e;return"require"in t?ky(t.require):"node"in t&&ky(t.node)?!0:"default"in t?ky(t.default):!1}function X1(e,t){return e?/\.cjs$/i.test(e)?!0:/\.mjs$/i.test(e)?!1:(/\.[jt]sx?$/i.test(e),t.type!=="module"):!1}function WQ(e){return`type: ${e.type??"(absent)"} +${e.main?`main: ${e.main}`:"main: (absent)"}`}function ZOe(e){let t=new Set;return e.filter(n=>{let r=n.moduleSystem?.affectedSpecifiers?.join(",")??"",i=n.moduleSystem?.affectedSpecifierPatterns?.join(",")??"",o=`${n.kind}:${r}:${i}:${n.symbol}`;return t.has(o)?!1:(t.add(o),!0)})}var HQ=new Map,xS=new Map;function YOe(e,t){let n=`${e}@${t}`,r=xS.get(n);if(r)return r;let i=encodeURIComponent(e).replaceAll("%40","@"),o=(async()=>{let s=await Ie(`${zOe}/${i}/${encodeURIComponent(t)}`,{immutable:!0});if(!s?.dist?.tarball||s.version!==t)return null;let a=await Jt(s.dist.tarball,{maxBytes:GOe,timeoutMs:6e4,retries:2});if(!a.ok)return null;let c;try{c=Bn(a.bytes,{maxDecompressedBytes:zQ})}catch{return null}if(c.length===0)return null;let l=c.reduce((f,m)=>f+Math.max(0,m.size),0);if(!Number.isSafeInteger(l)||l>zQ)return null;let u=new Map;for(let f of c){let m=QOe(f.path);if(m===null)return null;!m||u.has(m)||u.set(m,f)}let d=u.get("package.json");if(!d||d.size>1024*1024)return null;let p;try{p=JSON.parse(d.read().toString("utf8"))}catch{return null}return p.version!==t?null:{manifest:p,files:u}})();return xS.set(n,o),o.then(s=>{s||xS.delete(n)},()=>xS.delete(n)),o}function QOe(e){let t=e.replaceAll("\\","/");if(!t||t.includes("\0")||t.startsWith("/")||/^[A-Za-z]:\//.test(t))return null;let n=t.split("/");if(n.some(r=>r===".."))return null;for(;n[0]==="."||n[0]==="";)n.shift();return n[0]==="package"&&n.shift(),n.join("/")}function dX(e,t){let n=`${e}@${t}`,r=HQ.get(n);if(r)return r;let i=Ie(`${cX}/${e}@${t}?structure=flat`,{immutable:!0,retries:0}).then(o=>o?.files?new Set(o.files.map(s=>s.name).filter(s=>typeof s=="string").map(s=>s.startsWith("/")?s.slice(1):s)):null).catch(()=>null);return HQ.set(n,i),i}async function rL(e,t,n){let r=await dX(e,t);if(r)return n.find(i=>r.has(i))??null}var XOe=8,KQ=8,eDe=4,tDe=24;function nDe(e){return e.star||e.reExported.size>0}async function rDe(e,t,n,r,i){let o={...e?.dependencies,...e?.peerDependencies},s=[...JQ(t,n)].some(([b,_])=>_.star&&!o[BQ(b)]);if(Object.keys(o).length===0)return{followed:[],attempted:!1,incomplete:s};let a=i?.depth??0,c=i?.budget??{remaining:tDe},l=new Set([...i?.visited??[],r]),u=[...JQ(t,n)].map(([b,_])=>{let w=BQ(b),k=b.length>w.length?b.slice(w.length+1):void 0;return{specifier:b,reference:_,pkg:w,subpath:k}}).filter(b=>o[b.pkg]),d=u.length>0;if(!d)return{followed:[],attempted:!1,incomplete:s};let p=[],f=!1,m=await Yn(u,KQ,b=>sDe(b.pkg,o[b.pkg])),g=[],h=0;for(let[b,{specifier:_,reference:w,pkg:k,subpath:x}]of u.entries()){let A=m[b],I=nDe(w);if(!A){I&&(f=!0);continue}let R=l.has(`${_}@${A}`);if(!I){if(h>=XOe)continue;h+=1,g.push({specifier:_,pkg:k,subpath:x,reference:w,resolved:A,publicEdge:I,recurse:!1});continue}let C=!R&&a0;C?c.remaining-=1:R||(f=!0),g.push({specifier:_,pkg:k,subpath:x,reference:w,resolved:A,publicEdge:I,recurse:C})}let v=new Array(g.length);await Yn(g.map((b,_)=>({entry:b,index:_})),KQ,async({entry:b,index:_})=>{b.recurse||(v[_]=await $l(b.pkg,b.resolved,{followDependencies:!1,...b.subpath?{subpath:b.subpath}:{}}).catch(()=>null))});for(let[b,_]of g.entries())_.recurse&&(v[b]=await $l(_.pkg,_.resolved,{followDependencies:!0,..._.subpath?{subpath:_.subpath}:{},traversal:{depth:a+1,visited:new Set([...l,`${_.specifier}@${_.resolved}`]),budget:c}}).catch(()=>null));for(let[b,_]of g.entries()){let w=v[b];if(_.publicEdge&&!w&&(f=!0),w?.incomplete&&(f=!0),!w)continue;let k=0;for(let[x,A]of _.reference.names(w.api)){let I=w.api.get(A);if(!I)continue;let R=_.reference.star||_.reference.reExported.has(x)?x:`${_.specifier}#${x}`;n.has(R)||(n.set(R,{...Sy(I,x),via:_.specifier}),k+=1)}k>0&&p.push(`${_.specifier}@${_.resolved}`)}return{followed:p,attempted:d,incomplete:f||s}}function JQ(e,t){let n=new Map,r=s=>{let a=n.get(s);if(a)return a;let c={named:new Map,star:!1,reExported:new Set,names(l){if(!this.star)return[...this.named];let u=[...l.keys()].map(d=>[d,d]);return[...this.named,...u.filter(([d])=>!this.named.has(d))]}};return n.set(s,c),c},i=[...t.values()].map(s=>s.signature).join(` +`),o=s=>new RegExp(`\\b${OS(s)}\\b`).test(i);for(let s of e)for(let a of iDe(s.content)){if(oDe(a.specifier))continue;let c=r(a.specifier);if(a.kind==="export"&&a.star){c.star=!0;continue}for(let l of a.bindings)a.kind==="export"?(c.named.set(l.local,l.imported),c.reExported.add(l.local)):o(l.local)&&c.named.set(l.imported,l.imported)}return n}function iDe(e){let t=[],n=/\b(import|export)\s+(?:type\s+)?(?:(\*(?:\s+as\s+\w+)?)|(\{[^}]*\})|(\w+))\s+from\s+['"]([^'"]+)['"]/g;for(let r of e.matchAll(n)){let[,i="",o,s,a,c=""]=r,l=i==="export"?"export":"import";if(o){t.push({kind:l,specifier:c,star:!0,bindings:[]});continue}if(a){t.push({kind:l,specifier:c,star:!1,bindings:[{imported:"default",local:a}]});continue}let u=[];for(let d of(s??"").replace(/[{}]/g,"").split(",")){let p=d.replace(/\btype\s+/g,"").trim();if(!p)continue;let[f,m]=p.split(/\s+as\s+/).map(g=>g.trim());f&&u.push({imported:f,local:m||f})}u.length>0&&t.push({kind:l,specifier:c,star:!1,bindings:u})}return t}function oDe(e){return e.startsWith(".")||e.startsWith("/")}async function sDe(e,t){return(await Ie(`${cX}/${e}/resolved?specifier=${encodeURIComponent(t)}`))?.version??null}function aDe(e){return!e||typeof e!="object"?[]:Object.keys(e).filter(t=>t.startsWith("./")&&!t.endsWith("package.json")).slice(0,20)}async function cDe(e,t,n){let r=pX(e,n),i=await rL(e,t,r);if(i!==void 0){if(i)return i}else for(let o of r)if(await CS(e,t,o))return o;return null}function lDe(e,t,n){return pX(e,t).find(r=>n.has(r))??null}function uDe(e,t,n){let r=iL(lX(e?.exports,t)),i=[...r?$y(Sl(r)):[],...$y(Sl(t))];return[...new Set(i)].find(o=>n.has(o))??null}function pX(e,t){let n=[];if(t){let r=t.types??t.typings??iL(t.exports);r&&n.push(...$y(Sl(r))),t.main&&n.push(Sl(t.main).replace(/\.(c|m)?js$/,".d.ts"))}return n.push(...fDe(e)),[...new Set(n)]}async function dDe(e,t,n){let r=e.startsWith("@")?`@types/${e.slice(1).replace("/","__")}`:`@types/${e}`,i=n?`${n}.d.ts`:"index.d.ts",o=n?`#${n}`:"",s=/^\D*(\d+)\./.exec(t)?.[1]??/^\D*(\d+)$/.exec(t)?.[1];return s&&await CS(r,s,i)?`@types:${r}@${s}${o}`:await CS(r,"latest",i)?`@types:${r}@latest${o}`:null}function pDe(e){let t=e.slice(7),n=t.indexOf("#"),r=n===-1?t:t.slice(0,n),i=n===-1?void 0:t.slice(n+1),o=r.lastIndexOf("@"),s=o>0?{name:r.slice(0,o),range:r.slice(o+1)}:{name:r,range:"latest"};return i?{...s,subpath:i}:s}function fDe(e){return["index.d.ts","dist/index.d.ts","lib/index.d.ts","types/index.d.ts",`types/${e.split("/").pop()?.replace(/^@/,"")||e}.d.ts`]}function $y(e){if(/\.d\.(c|m)?ts$/.test(e))return[e,e.replace(/\.d\.(c|m)?ts$/,".d.ts")];let t=e.replace(/\.(c|m)?[jt]s$/,"").replace(/\/$/,""),n=[`${t}.d.ts`,`${t}.d.cts`,`${t}.d.mts`,`${t}/index.d.ts`];return/\.(c|m)?js$/.test(e)||n.push(e),n}function iL(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=(n,r)=>{if(r>6||!n)return null;if(typeof n=="string")return r>0?n:null;if(typeof n!="object")return null;let i=n,o=i.types??i.typings;if(typeof o=="string")return o;let s=[".","import","require","default","node"];for(let a of[...s,...Object.keys(i)]){if(!(a in i))continue;let c=t(i[a],r+1);if(c)return c}return null};return t(e,0)}async function H1(e,t,n,r){let i=n.startsWith("@types:")?pDe(n):null,o=i?`${i.name}@${i.range}`:`${e}@${t}`,s=i?i.subpath?`${i.subpath}.d.ts`:"index.d.ts":n,a=i?null:r?new Set(r.files.keys()):await dX(e,t),c=0,l=[],u=new Set,d=[[s]],p=async g=>{let h=a?g.find(v=>a.has(v))??null:void 0;for(let v of h===void 0?g:h?[h]:[]){let b;if(r){let _=r.files.get(v);if(!_||_.size>GQ-c)return null;let w=_.read();if(c+=w.length,c>GQ)return null;b=w.toString("utf8")}else b=await ot(`${nL}/${o}/${v}`,{retries:0});if(b)return{path:v,content:b}}return null},f=!1;for(;d.length>0&&l.length0&&g.length+l.length!u.has(b));for(let b of v)u.add(b);v.length>0&&g.push(v)}if(g.length===0)continue;let h=await Yn(g,mDe,v=>p(v));for(let v of h)if(v&&l.length>=ES&&(f=!0),!(!v||l.length>=ES)){l.push(v);for(let b of gDe(v.content))d.push(K1(v.path,b));for(let b of bDe(v.content))d.push(K1(v.path,b));for(let b of hDe(v.content))d.push(K1(v.path,b))}}return d.some(g=>g.some(h=>!u.has(h)))&&(f=!0),{sources:l,truncated:f}}var mDe=8,ES=Number(process.env.DRIFT_MAX_DECLARATION_FILES)||150;function gDe(e){let t=new Set,n=/\bexport\b\s*(?:type\b\s*)?(?:\*(?:\s+as\s+\w+)?|\{[^}]*\})\s*from\s*['"](\.[^'"]+)['"]/g;for(let i of e.matchAll(n))t.add(i[1]);let r=/\bimport\s+[A-Za-z_$][\w$]*\s*=\s*require\((['"])(\.[^'"]+)\1\)/g;for(let i of e.matchAll(r))t.add(i[2]);return[...t]}function hDe(e){if(!/\bexport\b\s*\{[^}]*\}(?!\s*from)/.test(e))return[];let t=new Set,n=/\bimport\b[^'"]*?\bfrom\s*['"](\.[^'"]+)['"]/g;for(let r of e.matchAll(n))t.add(r[1]);return[...t]}function yDe(e,t){if(!t)return[];let n=new Set([t,t.replace(/^@types\//,"")]),r=[],i=/\bdeclare\s+module\s+['"]([^'"]+)['"]\s*\{/g;for(let o=i.exec(e);o;o=i.exec(e)){let s=e.indexOf("{",o.index),a=Ps(e,s);if(s<0||a<0)continue;let c=o[1];(n.has(c)||[...n].some(l=>c.startsWith(`${l}/`)))&&r.push(e.slice(s+1,a)),i.lastIndex=a+1}return r}function bDe(e){let t=new Set,n=/\/\/\/\s*/g;for(let r of e.matchAll(n))t.add(r[1]);return[...t]}function K1(e,t){let n=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",i=Sl(n?`${n}/${t}`:t).replace(/\.(d\.(c|m)?ts|(c|m)?js|(c|m)?ts)$/,"");return[`${i}.d.ts`,`${i}.d.cts`,`${i}.d.mts`,`${i}/index.d.ts`,`${i}/index.d.cts`]}function Sl(e){let t=[];for(let n of e.replace(/^\.\//,"").split("/"))!n||n==="."||(n===".."?t.pop():t.push(n));return t.join("/")}async function CS(e,t,n){let r=await rL(e,t,[n]);return r!==void 0?r!==null:await ot(`${nL}/${e}@${t}/${n}`,{retries:0})!==null}function vDe(e,t,n=new Map,r=[],i){let o=new Map,s=(c,l)=>{let u=c.get(l.name);u&&u.kind===l.kind?(u.signature=`${u.signature} | ${l.signature}`,u.members=[...new Set([...u.members,...l.members])],u.requiredMembers=[...new Set([...u.requiredMembers,...l.requiredMembers])]):u||c.set(l.name,l)},a=sL(e);for(let c of YQ(a))s(o,c.entry),c.exported&&s(n,c.entry);for(let c of yDe(a,i)){for(let l of YQ(c))s(n,l.entry);ZQ(c,o,n,{override:!0})}return _De(a,o),wDe(a,n),kDe(a,o,n,r),ZQ(a,o,n),xDe(a,o,n),fX(n,o),n}function fX(e,t){let n=i=>e.get(i)??t?.get(i),r=(i,o)=>{if(!(!i.extends||o.has(i.name))){o.add(i.name);for(let s of i.extends){let a=n(s);!a||a===i||(r(a,o),i.members=[...new Set([...i.members,...a.members])],i.requiredMembers=[...new Set([...i.requiredMembers,...a.requiredMembers])])}}};for(let i of e.values())r(i,new Set)}function _De(e,t){let n=r=>{t.has(r)||t.set(r,{name:r,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0})};for(let r of e.matchAll(/\bimport\s+\*\s+as\s+([A-Za-z_$][\w$]*)\s+from\s+['"][^'"]+['"]/g))n(r[1]);for(let r of e.matchAll(/\bimport\s+(?:type\s+)?\{([^}]+)\}\s+from\s+['"][^'"]+['"]/g))for(let{exported:i}of aL(r[1]??""))n(i);for(let r of e.matchAll(/\bimport\s+([A-Za-z_$][\w$]*)\s*=\s*require\(['"][^'"]+['"]\)/g))n(r[1]);for(let r of e.matchAll(/\bimport\s+(?!type\s)([A-Za-z_$][\w$]*)\s*(?:,\s*\{[^}]*\})?\s+from\s+['"][^'"]+['"]/g))n(r[1])}function wDe(e,t){let n=/\bexport\b\s*(?:type\b\s*)?\*\s+as\s+([A-Za-z_$][\w$]*)\s*from\s*['"][^'"]+['"]/g;for(let r of e.matchAll(n)){let i=r[1];t.has(i)||t.set(i,{name:i,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0})}}function kDe(e,t,n,r){let i=/\bexport\b\s*(?:type\b\s*)?\{([^}]+)\}(?:\s*from\s*['"][^'"]+['"])?\s*;/g;for(let o of e.matchAll(i))for(let{exported:s,local:a}of aL(o[1]??"")){if(n.has(s))continue;let c=t.get(a);c?n.set(s,Sy(c,s)):r.push({exported:s,local:a})}}function $De(e,t){for(let n of t){if(e.has(n.exported))continue;let r=e.get(n.local);r&&e.set(n.exported,Sy(r,n.exported))}}function ZQ(e,t,n,r={}){for(let i of e.matchAll(/\bexport\s*=\s*([A-Za-z_$][\w$.]*)\s*(?:;|$)/gm))mX("default",i[1],t,n,r.override),SDe("default",i[1],t,n,r.override)}function SDe(e,t,n,r,i=!1){let o=r.get(e);if(!o||o.members.length>0&&!i)return;let s=n.get(t);if(!s)return;let a=s.signature.replace(/\s*\bexport\s*=[\s\S]*$/,"").replace(/\s*\}\s*$/,"").trim(),c=/:\s*([A-Za-z_$][\w$.]*)\s*;?\s*$/.exec(a)?.[1],l=c?n.get(c):void 0;l&&(o.members=[...l.members],o.requiredMembers=[...l.requiredMembers])}function mX(e,t,n,r,i=!1){let o=n.get(t);o&&(i||!r.has(e))&&r.set(e,Sy(o,e));for(let s of n.values()){if(!s.name.startsWith(`${t}.`))continue;let a=`${e}.${s.name.slice(t.length+1)}`;(i||!r.has(a))&&r.set(a,Sy(s,a))}}function xDe(e,t,n){for(let r of e.matchAll(/\bexport\s+default\s+(?:abstract\s+)?(?:class|function|enum|const|let|var)?\s*([A-Za-z_$][\w$]*)/g)){let i=r[1];t.has(i)&&mX("default",i,t,n)}}function Sy(e,t){return{...e,name:t,signature:e.signature.replace(new RegExp(`\\b${OS(e.name)}\\b`,"g"),t)}}function OS(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xy(e){return e.replace(/\/\*(?:[^*]|\*(?!\/))*\*\//g,"").replace(/\/\/[^\n]*/g,"").replace(/\s+/g," ").trim()}function YQ(e){let t=[];for(let n of hX(e))t.push({exported:n.exported,entry:{name:n.name,kind:"function",signature:xy(e.slice(n.start,zo(e,n.start))),members:[],requiredMembers:[]}});return QQ(e,/\b(export\s+)?(?:declare\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\b/g,"variable",t),RDe(e,t),QQ(e,/\b(export\s+)?(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)\b/g,"type",t),J1(e,/\b(export\s+)?(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"class",t),J1(e,/\b(export\s+)?(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"interface",t),J1(e,/\b(export\s+)?(?:declare\s+)?enum\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"enum",t),gX(e,"",!1,t),t}function gX(e,t,n,r){let i=/\b(export\s+)?(?:declare\s+)?(?:namespace|module)\s+([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\{/g;for(let o=i.exec(e);o;o=i.exec(e)){let s=e.indexOf("{",o.index),a=Ps(e,s);if(s<0||a<0)continue;let c=n||!!o[1],l=t?`${t}.${o[2]}`:o[2],u=e.slice(s+1,a);r.push({exported:c,entry:{name:l,kind:"namespace",signature:`namespace ${l}`,members:ADe(u),requiredMembers:[]}}),TDe(u,l,c,r),gX(u,l,c,r),EDe(u,l,c,r),i.lastIndex=a+1}}function EDe(e,t,n,r){let i=oL(e);for(let o of i.matchAll(/\bexport\b\s*\{([^}]+)\}\s*;?/g))for(let{exported:s}of aL(o[1]??""))r.push({exported:n,entry:{name:`${t}.${s}`,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0}})}function TDe(e,t,n,r){let i=oL(e),o=(s,a,c,l=[],u=[])=>{r.push({exported:n,entry:{name:`${t}.${s}`,kind:a,signature:xy(c.replace(new RegExp(`\\b${OS(s)}\\b`),`${t}.${s}`)),members:l,requiredMembers:u}})};for(let s of hX(i))o(s.name,"function",i.slice(s.start,zo(i,s.start)));for(let s of i.matchAll(/\b(?:declare\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\b/g)){let a=s.index??0;o(s[1],"variable",i.slice(a,zo(i,a)))}for(let s of i.matchAll(/\b(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)\b/g)){let a=s.index??0;o(s[1],"type",i.slice(a,zo(i,a)))}for(let s of i.matchAll(/\b(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=i.indexOf("{",a),l=Ps(i,c),u=c>=0&&l>c?i.slice(c+1,l):"",d=NS(u,!0);o(s[1],"class",i.slice(a,c>=0?c:zo(i,a)),d.map(p=>p.name),d.filter(p=>p.required).map(p=>p.name))}for(let s of i.matchAll(/\b(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=i.indexOf("{",a),l=Ps(i,c),u=c>=0&&l>c?i.slice(c+1,l):"",d=NS(u,!1);o(s[1],"interface",i.slice(a,c>=0?c:zo(i,a)),d.map(p=>p.name),d.filter(p=>p.required).map(p=>p.name))}for(let s of i.matchAll(/\b(?:declare\s+)?enum\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=i.indexOf("{",a),l=Ps(i,c),u=c>=0&&l>c?i.slice(c+1,l):"";o(s[1],"enum",i.slice(a,c>=0?c:zo(i,a)),vX(u).map(d=>d.name))}}function oL(e){let t=[],n=/\b(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\s*\{/g;for(let i of e.matchAll(n)){let o=e.indexOf("{",i.index),s=Ps(e,o);o>=0&&s>=0&&t.push([i.index??0,s+1])}if(t.length===0)return e;let r=[...e];for(let[i,o]of t)for(let s=i;s"){if(e[r-1]==="=")continue;if(n-=1,n===0)return r}else if(i==="("&&n===0)return-1}return-1}function sL(e){let t="",n=0;for(;nl.name),requiredMembers:a.filter(l=>l.required).map(l=>l.name)}})}}}function nAe(e){let t=/^\s*(?:export\s+)?(?:declare\s+)?(?:const|let|var)\s+/.exec(e);if(!t)return[];let n=0,i=0,r=0,o=0,s=[],a="";for(let c=t[0].length;c"&&e[c-1]!=="=")o=Math.max(0,o-1);else if(l==="{")r+=1;else if(l==="}")r-=1;else if(n<=0&&i<=0&&r<=0&&o<=0){if(l===","){s.push(a),a="";continue}if(l===";")break}a+=l}return s.push(a),s.slice(1).filter(c=>c.trim()!=="")}function R8(e,t,n,i){for(let r of e.matchAll(t)){let o=r.index??0,s=To(e,o),a=e.slice(o,s),c=n==="type"?rAe(a):n==="variable"?J8(a):[];i.push({exported:!!r[1],entry:{name:r[2],kind:n,signature:yh(a),members:c.map(l=>l.name),requiredMembers:c.filter(l=>l.required).map(l=>l.name)}})}}function rAe(e){return Z8(e,"=")}function J8(e){return Z8(e,":")}function Z8(e,t){let n=e.indexOf(t);if(n<0)return[];let i=e.slice(n+1),r=i.indexOf("{");if(r<0||i.slice(0,r).trim()!=="")return[];let o=ls(i,r);return o<0?[]:i.slice(o+1).replace(/;\s*$/,"").trim()!==""?[]:X$(i.slice(r+1,o),!1)}function iO(e,t,n,i){for(let r of e.matchAll(t)){let o=r.index??0,s=e.indexOf("{",o),a=ls(e,s),c=a>=0?a+1:To(e,o),l=s>=0&&a>s?e.slice(s+1,a):"",u=n==="enum"?Y8(l):X$(l,n==="class"),d=s>=0?iAe(e.slice(o,s)):[];i.push({exported:!!r[1],entry:{name:r[2],kind:n,signature:yh(e.slice(o,s>=0?s:c)),members:u.map(p=>p.name),requiredMembers:u.filter(p=>p.required).map(p=>p.name),...d.length>0?{extends:d}:{}}})}}function iAe(e){let t=/\b(?:extends|implements)\s+([\s\S]+)$/.exec(e);return t?bh(t[1]).map(n=>/^\s*([A-Za-z_$][\w$]*)/.exec(n.replace(/\bimplements\b/g,","))?.[1]).filter(n=>!!n):[]}function To(e,t){let n=0,i=0,r=0,o=0;for(let s=t;s"&&e[s-1]!=="=")o=Math.max(0,o-1);else if(a==="{"){if(n===0&&i===0&&r===0&&o===0){let c=ls(e,s);return c>=0?c+1:e.length}r+=1}else if(a==="}")r-=1;else if(a===";"&&n<=0&&i<=0&&r<=0&&o<=0)return s+1}return e.length}function ls(e,t){if(t<0)return-1;let n=0;for(let i=t;i/^[\s\n]*([A-Za-z_$][\w$]*)/.exec(t)?.[1]).filter(t=>!!t).map(t=>({name:t,required:!1}))}function X$(e,t){let n=[],i=/(?:^|[;\n])\s*((?:public|protected|private|readonly|static|abstract|declare|override)\s+)*(#?[A-Za-z_$][\w$]*)(\?)?\s*(\(|:|<)/g;for(let r of e.matchAll(i)){let o=r[1]??"",s=r[2];s==="constructor"||o.includes("private")||s.startsWith("#")||n.push({name:s,required:t?r[4]===":"&&!r[3]:!r[3]})}return n}function hO(e){let t=[];for(let n of e.split(",")){let i=n.replace(/\btype\s+/g,"").trim();if(!i)continue;let[r,o]=i.split(/\s+as\s+/).map(s=>s.trim());r&&t.push({local:r,exported:o||r})}return t}function oAe(e,t){let n=r=>r==="variable"||r==="function";if(n(e)&&n(t))return!0;let i=r=>r==="interface"||r==="type";return i(e)&&i(t)}function Q8(e,t,n){if(t.api.size<20)return null;let r=0;for(let a of t.api.keys())n.api.has(a)&&(r+=1);if(r>t.api.size*.1||n.api.size>t.api.size*.1)return null;let o=n.subpaths.filter(a=>a!=="."),s=o.length>0?` The new version publishes ${o.length} other entry point${o.length===1?"":"s"}: ${o.join(", ")}. Import from the one that carries the API you use, rather than replacing the symbols individually.`:" Nothing in the new version publishes the old symbols under the old import path.";return{kind:"entry-point-moved",symbol:e,detail:`Importing \`${e}\` no longer gives you its API: the root entry point went from ${t.api.size} exported symbols to ${n.api.size}.${s}`,before:`${t.entryPath} \u2014 ${t.api.size} exports`,after:`${n.entryPath} \u2014 ${n.api.size} exports`}}function sAe(e,t,n){if(e.shapeUnknown||t.length===0)return null;let i=a=>/^[A-Za-z_$][\w$]*$/.test(Z$(a.name))&&!/[#/]/.test(a.name),r=Z$(e.name);if(r.length<3||!/^[A-Za-z_$][\w$]*$/.test(r))return null;let o=t.filter(a=>i(a)&&a.kind===e.kind&&N8(e)&&N8(a)&&C8(e.signature,e.name)===C8(a.signature,a.name)&&aAe(e,a));if(o.length===1)return o[0];let s=(n??"").replace(/^@[^/]+\//,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase();if(s){let a=t.filter(c=>{if(!i(c))return!1;let l=Z$(c.name).toLowerCase();return l===`${s}${r.toLowerCase()}`||l===`${r.toLowerCase()}${s}`});if(a.length===1)return a[0]}return null}function N8(e){let t=e.signature??"";return t.includes("(")&&t.replace(/\s+/g,"").length>=20?!0:e.members.length>=2}function aAe(e,t){if(e.members.length===0&&t.members.length===0)return!0;let n=[...e.members].sort().join(","),i=[...t.members].sort().join(",");return n===i}function Z$(e){return e.split(".").pop()??e}function C8(e,t){let n=Z$(t);return e.replace(new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"g"),"\0").replace(/\s+/g," ").trim()}function Dr(e,t,n={}){let i=[],r=[...t.entries()].filter(([o])=>!e.has(o)).map(([,o])=>o);for(let[o,s]of e){let a=t.get(o),c=s.name,l=s.via?` (declared in ${s.via})`:"";if(!a){if(n.afterComplete===!1&&s.via)continue;let g=sAe(s,r,n.packageName);i.push({kind:"export-removed",symbol:c,detail:s.shapeUnknown?`\`${c}\` is no longer exported${l}.${g?` The new version exports \`${g.name}\` in its place.`:""}`:`\`${c}\` is no longer exported (was ${Eo(s.kind)})${l}.${g?` The new version exports \`${g.name}\` in its place.`:""}`,before:s.signature,...g?{after:g.signature,replacement:g.name}:{},...s.shapeUnknown?{}:{fromKind:s.kind}});continue}if(s.shapeUnknown||a.shapeUnknown)continue;if(s.kind!==a.kind&&!oAe(s.kind,a.kind)){i.push({kind:"kind-changed",symbol:c,detail:`\`${c}\` changed from ${Eo(s.kind)} to ${Eo(a.kind)}${l}.`,before:s.signature,after:a.signature,fromKind:s.kind,toKind:a.kind});continue}for(let g of s.members)if(!a.members.includes(g))i.push({kind:"member-removed",symbol:`${c}.${g}`,detail:`\`${c}.${g}\` was removed${l}.`});else{let h=s.memberSignatures?.[g],b=a.memberSignatures?.[g];h&&b&&h!==b&&i.push({kind:"signature-changed",symbol:`${c}.${g}`,detail:`The signature of \`${c}.${g}\` changed${l}.`,before:h,after:b})}let u=new Set(s.requiredMembers);for(let g of a.requiredMembers)!u.has(g)&&s.members.includes(g)&&i.push({kind:"member-now-required",symbol:`${c}.${g}`,detail:`\`${c}.${g}\` is now required; it was previously optional${l}.`});let[d,p]=tY(s.signature,a.signature),f=!!(s.callable&&a.callable);(f?!uAe(s.callable,a.callable):d!==p&&s.kind!=="interface"&&s.kind!=="class"&&!vAe(d,p)&&!lAe(d,p))&&i.push({kind:"signature-changed",symbol:c,detail:`The signature of \`${c}\` changed${l}.`,before:s.signature,after:a.signature,...f?{changed:"parameters"}:cAe(d,p)??{}})}return i}function cAe(e,t){let n=rl(e),i=rl(t);if(!n||!i)return null;let r=!il(n.returns,i.returns),o=n.parameters.length!==i.parameters.length||n.parameters.some((s,a)=>{let c=i.parameters[a];return!c||s.optional!==c.optional||s.rest!==c.rest||!il(s.type,c.type)});return r&&o?{changed:"both"}:r?{changed:"return-type"}:o?{changed:"parameters"}:null}function lAe(e,t){if(e.includes(" | declare ")||t.includes(" | declare ")||e.includes(" | export ")||t.includes(" | export "))return!1;let n=rl(e),i=rl(t);if(!n||!i||!il(n.returns,i.returns)||i.parameters.lengthr.optional||r.rest)}function uAe(e,t){let n=p=>p.parameters.filter(f=>f.kind==="positional-only"||f.kind==="positional-or-keyword"),i=(p,f)=>p.parameters.some(m=>m.kind===f),r=p=>p.parameters.filter(f=>f.kind==="positional-or-keyword"||f.kind==="keyword-only"),o=(p,f)=>p.parameters.find(m=>m.name===f),s=n(e),a=n(t),c=s.filter(p=>p.required).length,l=a.filter(p=>p.required).length,u=i(e,"var-positional")?1/0:s.length,d=i(t,"var-positional")?1/0:a.length;if(l>c||dc!==null),s=uO(r).map(rl).filter(c=>c!==null);if(o.length===0||s.length===0)return!1;let a=o.filter(c=>lO(c,n));return a.length===0?!1:a.every(c=>s.some(l=>{if(!lO(l,n)||!il(c.returns,l.returns))return!1;for(let u=0;ui!==null);return n.length===0?!1:!n.some(i=>lO(i,t))}function lO(e,t){let n=e.parameters.filter(i=>!i.optional&&!i.rest).length;return ti.rest)||t<=e.parameters.length}function uO(e){return e.split(/ \| (?=(?:export\s+)?declare\b)/).map(t=>t.trim()).filter(Boolean)}function rl(e){let t=dAe(e);if(t<0)return null;let n=pAe(e,t);if(n<0)return null;let i=e.slice(t+1,n),r=e.slice(n+1).trim(),o=/^(?:=>|:)\s*([\s\S]*?)\s*;?$/.exec(r)?.[1];if(o===void 0)return null;let s=[];for(let a of bh(i)){let c=a.trim();if(!c)continue;let l=/^(\.\.\.)?\s*(?:readonly\s+)?([A-Za-z_$][\w$]*|\{[\s\S]*?\}|\[[\s\S]*?\])\s*(\?)?\s*:\s*([\s\S]+)$/.exec(c);if(!l)return null;s.push({rest:!!l[1],optional:!!l[3]||!!l[1],type:l[4]})}return{parameters:s,returns:o}}function dAe(e){let t=0;for(let n=0;n"&&e[n-1]!=="=")t-=1;else if(i==="("&&t<=0)return n}return-1}function pAe(e,t){let n=0;for(let i=t;i=fAe)return!1;let i=e.trim(),r=t.trim(),o=[O8(i),O8(r)];return o[0]&&o[1]?il(o[0].check,o[1].check)&&Jd(o[0].whenTrue,o[1].whenTrue,n+1)&&Jd(o[0].whenFalse,o[1].whenFalse,n+1):H$(i,"{","}")&&H$(r,"{","}")?mAe(i,r,n):H$(i,"[","]")&&H$(r,"[","]")?gAe(i,r,n):!1}var fAe=6;function mAe(e,t,n){let i=P8(e),r=P8(t);if(!i||!r)return!1;for(let[o,s]of i){let a=r.get(o);if(!a||s.optional&&!a.optional||!Jd(s.type,a.type,n+1))return!1}for(let[o,s]of r)if(!i.has(o)&&!s.optional)return!1;return!0}function gAe(e,t,n){let i=D8(e),r=D8(t);if(!i||!r||r.lengtho.optional||o.rest)}function P8(e){let t=new Map;for(let n of yAe(e.trim().slice(1,-1))){let i=n.trim();if(!i)continue;let r=/^(?:readonly\s+)?(?:'([^']+)'|"([^"]+)"|([A-Za-z_$][\w$]*))\s*(\?)?\s*:\s*([\s\S]+)$/.exec(i);if(!r)return null;let o=r[1]??r[2]??r[3];t.set(o,{optional:!!r[4],type:r[5].trim()})}return t}function D8(e){let t=[];for(let n of bh(e.trim().slice(1,-1))){let i=n.trim();if(!i)continue;let r=/^(\.\.\.)?\s*([A-Za-z_$][\w$]*)\s*(\?)?\s*:\s*([\s\S]+)$/.exec(i);if(r){t.push({rest:!!r[1],optional:!!r[3]||!!r[1],type:r[4].trim()});continue}let o=/^(\.\.\.)?\s*([\s\S]+?)(\?)?$/.exec(i);if(!o)return null;t.push({rest:!!o[1],optional:!!o[3]||!!o[1],type:o[2].trim()})}return t}function O8(e){let t=0;for(let n=0;n)]}".includes(i))i===">"&&e[n-1]==="="||(t-=1);else if(i==="?"&&t===0){let r=e.slice(0,n);if(!/\bextends\b/.test(r))return null;let o=hAe(e,n+1);return o===-1?null:{check:r.trim(),whenTrue:e.slice(n+1,o).trim(),whenFalse:e.slice(o+1).trim()}}}return null}function hAe(e,t){let n=0,i=0;for(let r=t;r)]}".includes(o))o===">"&&e[r-1]==="="||(n-=1);else if(n===0&&o==="?")i+=1;else if(n===0&&o===":"){if(i===0)return r;i-=1}}return-1}function yAe(e){return bh(e,";,")}function H$(e,t,n){if(!e.startsWith(t)||!e.endsWith(n))return!1;let i=0;for(let r=0;rn.some(o=>il(r,o)))}function M8(e){let t=[],n=0,i="";for(let r of e){if("<([{".includes(r)?n+=1:">)]}".includes(r)&&(n-=1),r==="|"&&n===0){t.push(i),i="";continue}i+=r}return i.trim()&&t.push(i),t.map(r=>r.trim()).filter(Boolean)}function il(e,t){let n=i=>i.replace(/\s+/g,"").replace(/\|undefined$/,"");return n(e)===n(t)}function vAe(e,t){if(e===t)return!0;let n=U8(e);return n===U8(t)&&n!==null}function tY(e,t){let n=L8(e),i=L8(t);if(n.size===0&&i.size===0)return[e,t];for(let[r,o]of n){let s=i.get(r);if(s!==void 0&&s!==o)return[e,t]}return[F8(e),F8(t)]}function L8(e){let t=new Map,n=/\bimport\((["'])((?:(?!\1).)*)\1\)\.([A-Za-z_$][\w$]*)/g;for(let i of e.matchAll(n))t.set(i[3],i[2]);return t}function F8(e){return e.replace(/\bimport\((["'])(?:(?!\1).)*\1\)\./g,"")}function U8(e){let t=wAe(e);if(t.length===0)return null;let n=e;return t.forEach((i,r)=>{n=n.replace(new RegExp(`\\b${e_(i)}\\b`,"g"),`\0T${r}`)}),n}function wAe(e){let t=[];for(let n=0;n"&&(n-=1,n===0))return i;return-1}function bh(e,t=","){let n=[],i=0,r="";for(let o=0;o)]}".includes(s)&&(s===">"&&e[o-1]==="="||(i-=1)),t.includes(s)&&i===0){n.push(r),r="";continue}r+=s}return r.trim()&&n.push(r),n}var c_=require("node:fs/promises"),W9=require("node:os"),H9=require("node:path");var vh=require("node:fs/promises"),Zd=require("node:path");var yO=new Map;async function bO(e,t){if(!e.autoInstall)return!1;let n=yO.get(t.id);if(n)return n;let i=$Ae(e,t).finally(()=>{yO.delete(t.id)});return yO.set(t.id,i),i}async function $Ae(e,t){e.logger.info(`Installing ${t.label.replace(/^Install\s+/i,"")}...`);let n=await e.exec(t.command,t.args,{...e.env?{env:e.env}:{},timeoutMs:10*6e4});return n.code!==0?(e.logger.warn(`${t.label} failed: ${(n.stderr||n.stdout||"no output").trim()}`),!1):(e.logger.info(`${t.label.replace(/^Install\s+/i,"")} installed.`),!0)}function ne(e,t,n,i,r){return{available:!1,reason:t,detail:n,...i?{remedy:i}:{},...r?{install:r}:{},tool:e}}function t_(e,t){return new Promise(n=>{let i=setTimeout(()=>n({timedOut:!0}),Math.max(0,t));e.then(r=>{clearTimeout(i),n({timedOut:!1,value:r})},()=>{clearTimeout(i),n({timedOut:!0})})})}var _Ae=1,SAe=3,nY=750,lY=1,vO=0,rY=[];async function xAe(){vO<_Ae?vO+=1:await new Promise(t=>rY.push(t));let e=!1;return()=>{if(e)return;e=!0;let t=rY.shift();t?t():vO-=1}}function EAe(e){return/waiting for file lock on (?:package cache|build directory|the registry index)/i.test(e)?!/error\[E\d+\]|could not compile|error: could not|linking with|error: linker|failed to run custom build|toolchain '[^']*' is not installed/i.test(e):!1}var iY=/^(?:Updating|Downloading|Downloaded|Compiling|Compiled|Checking|Blocking)\b/i;function oY(e){let t=e.replace(/\u001b\[[0-9;]*m/g,"").split(` -`).map(r=>r.trim()).filter(Boolean),n=r=>/error\[E\d+\]/i.test(r)?100:/requires rustc\b/i.test(r)?95:/failed to select a version|no matching package/i.test(r)?90:/failed to run custom build command|failed custom build/i.test(r)?85:/linking with .* failed|linker .* (?:failed|not found)|cannot find -l/i.test(r)?80:/missing (?:required )?feature|feature .* (?:is not enabled|does not exist|not found)/i.test(r)?75:/could not compile/i.test(r)?70:/^error:/i.test(r)?60:0,i=null;for(let[r,o]of t.entries()){let s=n(o);s>(i?.score??0)&&(i={line:o,score:s,index:r})}if(i){let r=t.slice(i.index+1).find(o=>!iY.test(o)&&n(o)>0&&o!==i.line);return r?`${i.line} -${r}`:i.line}return t.find(r=>!iY.test(r))??t[0]??"unknown Cargo failure"}var TAe=e=>new Promise(t=>setTimeout(t,e)),Io="cargo public-api",IAe="Install Rust and Cargo with rustup, or make sure `cargo` is on PATH.",sY={id:"cargo-public-api",label:"Install cargo-public-api",command:"cargo",args:["install","cargo-public-api","--locked"]},AAe="Drift can install the missing `cargo-public-api` helper for you after approval.",wO={id:"rustup-nightly",label:"Install the Rust nightly toolchain",command:"rustup",args:["toolchain","install","nightly","--profile","minimal"]},uY="Drift can install the Rust nightly toolchain for you after approval, or run `rustup toolchain install nightly` yourself.",dY={ecosystem:"cargo",tool:Io,weight:1,async compute(e){let t=e.workdir,n=(g,h)=>OAe(e.exec,g,h,e.env,t),i=(g,h)=>DAe(e.exec,g,h,e.env,t),r=await n("cargo",["--version"]);if(r===null)return ne(Io,"tool-missing",`The Rust Cargo toolchain is not installed or is not on PATH, so ${e.name}'s public API could not be compared directly.`,IAe);let o=await n("cargo",["public-api","--version"]);if(o===null&&!(await bO(e,sY)&&(o=await n("cargo",["public-api","--version"]))!==null))return ne(Io,"tool-missing",`Rust and Cargo are installed, but Drift's Rust API helper is missing. ${e.name}'s public API could not be compared directly.`,AAe,sY);let s=/^cargo 1\b/.test(r)&&!/nightly/.test(r),a=/nightly/.test(r),c=null,l="nightly";if(a)l="active",c=await n("rustc",["--version"]);else if(s&&await i("rustup",["--version"])&&(c=await n("rustup",["run","nightly","rustc","--version"]),c===null&&!(await bO(e,wO)&&(c=await n("rustup",["run","nightly","rustc","--version"]))!==null)))return ne(Io,"tool-missing",`\`cargo public-api\` needs the Rust nightly toolchain to read rustdoc's JSON output, and it is not installed. ${e.name}'s public API could not be compared directly.`,uY,wO);let u=o===null||c===null?null:[`cpa=${o}`,`${l}=${c}`,`parser=${lY}`].join("|"),d=aY(e,e.from,u),p=aY(e,e.to,u);p.catch(()=>{});let f=await d;if(!f.ok)return f.failure;let m=await p;return m.ok?{available:!0,changes:Dr(f.api,m.api),tool:Io,weight:1,locator:`${e.name} ${e.from} \u2192 ${e.to} (rustdoc JSON)`}:m.failure}};async function aY(e,t,n){let i=(0,Zd.join)(e.workdir,`probe-${t}`),r=n===null?null:`rust-surface:v${lY}:${e.name}@${t}#${n}`;if(r){let d=await Na(r);if(d&&d.length>0)return{ok:!0,api:new Map(d)}}try{await(0,vh.mkdir)((0,Zd.join)(i,"src"),{recursive:!0}),await(0,vh.writeFile)((0,Zd.join)(i,"Cargo.toml"),RAe(e.name,t),"utf8"),await(0,vh.writeFile)((0,Zd.join)(i,"src","lib.rs"),"","utf8")}catch(d){return{ok:!1,failure:ne(Io,"toolchain-failed",`Could not prepare a scratch crate: ${d.message}`)}}let s={...e.env??process.env,CARGO_TARGET_DIR:(0,Zd.join)(i,"target")},a=Date.now()+e.timeoutMs,c=()=>({ok:!1,failure:ne(Io,"toolchain-failed",`\`cargo public-api\` on ${e.name} ${t} ran out of time waiting for the Cargo package-cache lock.`)}),l;for(let d=0;;d+=1){if(a-Date.now()<=0)return c();let p=await xAe(),f=!1;try{let m=a-Date.now();if(m<=0)return p(),f=!0,c();l=await e.exec("cargo",["public-api","--simplified","--package",e.name],{cwd:i,timeoutMs:m,env:s})}finally{f||p()}if(l.code===0)break;if(dl.name),requiredMembers:a.filter(l=>l.required).map(l=>l.name)}})}}}function PDe(e){let t=/^\s*(?:export\s+)?(?:declare\s+)?(?:const|let|var)\s+/.exec(e);if(!t)return[];let n=0,r=0,i=0,o=0,s=[],a="";for(let c=t[0].length;c"&&e[c-1]!=="=")o=Math.max(0,o-1);else if(l==="{")i+=1;else if(l==="}")i-=1;else if(n<=0&&r<=0&&i<=0&&o<=0){if(l===","){s.push(a),a="";continue}if(l===";")break}a+=l}return s.push(a),s.slice(1).filter(c=>c.trim()!=="")}function QQ(e,t,n,r){for(let i of e.matchAll(t)){let o=i.index??0,s=zo(e,o),a=e.slice(o,s),c=n==="type"?CDe(a):n==="variable"?yX(a):[];r.push({exported:!!i[1],entry:{name:i[2],kind:n,signature:xy(a),members:c.map(l=>l.name),requiredMembers:c.filter(l=>l.required).map(l=>l.name)}})}}function CDe(e){return bX(e,"=")}function yX(e){return bX(e,":")}function bX(e,t){let n=e.indexOf(t);if(n<0)return[];let r=e.slice(n+1),i=r.indexOf("{");if(i<0||r.slice(0,i).trim()!=="")return[];let o=Ps(r,i);return o<0?[]:r.slice(o+1).replace(/;\s*$/,"").trim()!==""?[]:NS(r.slice(i+1,o),!1)}function J1(e,t,n,r){for(let i of e.matchAll(t)){let o=i.index??0,s=e.indexOf("{",o),a=Ps(e,s),c=a>=0?a+1:zo(e,o),l=s>=0&&a>s?e.slice(s+1,a):"",u=n==="enum"?vX(l):NS(l,n==="class"),d=s>=0?NDe(e.slice(o,s)):[];r.push({exported:!!i[1],entry:{name:i[2],kind:n,signature:xy(e.slice(o,s>=0?s:c)),members:u.map(p=>p.name),requiredMembers:u.filter(p=>p.required).map(p=>p.name),...d.length>0?{extends:d}:{}}})}}function NDe(e){let t=/\b(?:extends|implements)\s+([\s\S]+)$/.exec(e);return t?Ey(t[1]).map(n=>/^\s*([A-Za-z_$][\w$]*)/.exec(n.replace(/\bimplements\b/g,","))?.[1]).filter(n=>!!n):[]}function zo(e,t){let n=0,r=0,i=0,o=0;for(let s=t;s"&&e[s-1]!=="=")o=Math.max(0,o-1);else if(a==="{"){if(n===0&&r===0&&i===0&&o===0){let c=Ps(e,s);return c>=0?c+1:e.length}i+=1}else if(a==="}")i-=1;else if(a===";"&&n<=0&&r<=0&&i<=0&&o<=0)return s+1}return e.length}function Ps(e,t){if(t<0)return-1;let n=0;for(let r=t;r/^[\s\n]*([A-Za-z_$][\w$]*)/.exec(t)?.[1]).filter(t=>!!t).map(t=>({name:t,required:!1}))}function NS(e,t){let n=[],r=/(?:^|[;\n])\s*((?:public|protected|private|readonly|static|abstract|declare|override)\s+)*(#?[A-Za-z_$][\w$]*)(\?)?\s*(\(|:|<)/g;for(let i of e.matchAll(r)){let o=i[1]??"",s=i[2];s==="constructor"||o.includes("private")||s.startsWith("#")||n.push({name:s,required:t?i[4]===":"&&!i[3]:!i[3]})}return n}function aL(e){let t=[];for(let n of e.split(",")){let r=n.replace(/\btype\s+/g,"").trim();if(!r)continue;let[i,o]=r.split(/\s+as\s+/).map(s=>s.trim());i&&t.push({local:i,exported:o||i})}return t}function ODe(e,t){let n=i=>i==="variable"||i==="function";if(n(e)&&n(t))return!0;let r=i=>i==="interface"||i==="type";return r(e)&&r(t)}function _X(e,t,n){if(t.api.size<20)return null;let i=0;for(let a of t.api.keys())n.api.has(a)&&(i+=1);if(i>t.api.size*.1||n.api.size>t.api.size*.1)return null;let o=n.subpaths.filter(a=>a!=="."),s=o.length>0?` The new version publishes ${o.length} other entry point${o.length===1?"":"s"}: ${o.join(", ")}. Import from the one that carries the API you use, rather than replacing the symbols individually.`:" Nothing in the new version publishes the old symbols under the old import path.";return{kind:"entry-point-moved",symbol:e,detail:`Importing \`${e}\` no longer gives you its API: the root entry point went from ${t.api.size} exported symbols to ${n.api.size}.${s}`,before:`${t.entryPath} \u2014 ${t.api.size} exports`,after:`${n.entryPath} \u2014 ${n.api.size} exports`}}function DDe(e,t,n){if(e.shapeUnknown||t.length===0)return null;let r=a=>/^[A-Za-z_$][\w$]*$/.test(RS(a.name))&&!/[#/]/.test(a.name),i=RS(e.name);if(i.length<3||!/^[A-Za-z_$][\w$]*$/.test(i))return null;let o=t.filter(a=>r(a)&&a.kind===e.kind&&XQ(e)&&XQ(a)&&eX(e.signature,e.name)===eX(a.signature,a.name)&&MDe(e,a));if(o.length===1)return o[0];let s=(n??"").replace(/^@[^/]+\//,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase();if(s){let a=t.filter(c=>{if(!r(c))return!1;let l=RS(c.name).toLowerCase();return l===`${s}${i.toLowerCase()}`||l===`${i.toLowerCase()}${s}`});if(a.length===1)return a[0]}return null}function XQ(e){let t=e.signature??"";return t.includes("(")&&t.replace(/\s+/g,"").length>=20?!0:e.members.length>=2}function MDe(e,t){if(e.members.length===0&&t.members.length===0)return!0;let n=[...e.members].sort().join(","),r=[...t.members].sort().join(",");return n===r}function RS(e){return e.split(".").pop()??e}function eX(e,t){let n=RS(t);return e.replace(new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"g"),"\0").replace(/\s+/g," ").trim()}function Br(e,t,n={}){let r=[],i=[...t.entries()].filter(([o])=>!e.has(o)).map(([,o])=>o);for(let[o,s]of e){let a=t.get(o),c=s.name,l=s.via?` (declared in ${s.via})`:"";if(!a){if(n.afterComplete===!1&&s.via)continue;let g=DDe(s,i,n.packageName);r.push({kind:"export-removed",symbol:c,detail:s.shapeUnknown?`\`${c}\` is no longer exported${l}.${g?` The new version exports \`${g.name}\` in its place.`:""}`:`\`${c}\` is no longer exported (was ${jo(s.kind)})${l}.${g?` The new version exports \`${g.name}\` in its place.`:""}`,before:s.signature,...g?{after:g.signature,replacement:g.name}:{},...s.shapeUnknown?{}:{fromKind:s.kind}});continue}if(s.shapeUnknown||a.shapeUnknown)continue;if(s.kind!==a.kind&&!ODe(s.kind,a.kind)){r.push({kind:"kind-changed",symbol:c,detail:`\`${c}\` changed from ${jo(s.kind)} to ${jo(a.kind)}${l}.`,before:s.signature,after:a.signature,fromKind:s.kind,toKind:a.kind});continue}for(let g of s.members)if(!a.members.includes(g))r.push({kind:"member-removed",symbol:`${c}.${g}`,detail:`\`${c}.${g}\` was removed${l}.`});else{let h=s.memberSignatures?.[g],v=a.memberSignatures?.[g];h&&v&&h!==v&&r.push({kind:"signature-changed",symbol:`${c}.${g}`,detail:`The signature of \`${c}.${g}\` changed${l}.`,before:h,after:v})}let u=new Set(s.requiredMembers);for(let g of a.requiredMembers)!u.has(g)&&s.members.includes(g)&&r.push({kind:"member-now-required",symbol:`${c}.${g}`,detail:`\`${c}.${g}\` is now required; it was previously optional${l}.`});let[d,p]=$X(s.signature,a.signature),f=!!(s.callable&&a.callable);(f?!UDe(s.callable,a.callable):d!==p&&s.kind!=="interface"&&s.kind!=="class"&&!KDe(d,p)&&!FDe(d,p))&&r.push({kind:"signature-changed",symbol:c,detail:`The signature of \`${c}\` changed${l}.`,before:s.signature,after:a.signature,...f?{changed:"parameters"}:LDe(d,p)??{}})}return r}function LDe(e,t){let n=xl(e),r=xl(t);if(!n||!r)return null;let i=!El(n.returns,r.returns),o=n.parameters.length!==r.parameters.length||n.parameters.some((s,a)=>{let c=r.parameters[a];return!c||s.optional!==c.optional||s.rest!==c.rest||!El(s.type,c.type)});return i&&o?{changed:"both"}:i?{changed:"return-type"}:o?{changed:"parameters"}:null}function FDe(e,t){if(e.includes(" | declare ")||t.includes(" | declare ")||e.includes(" | export ")||t.includes(" | export "))return!1;let n=xl(e),r=xl(t);if(!n||!r||!El(n.returns,r.returns)||r.parameters.lengthi.optional||i.rest)}function UDe(e,t){let n=p=>p.parameters.filter(f=>f.kind==="positional-only"||f.kind==="positional-or-keyword"),r=(p,f)=>p.parameters.some(m=>m.kind===f),i=p=>p.parameters.filter(f=>f.kind==="positional-or-keyword"||f.kind==="keyword-only"),o=(p,f)=>p.parameters.find(m=>m.name===f),s=n(e),a=n(t),c=s.filter(p=>p.required).length,l=a.filter(p=>p.required).length,u=r(e,"var-positional")?1/0:s.length,d=r(t,"var-positional")?1/0:a.length;if(l>c||dc!==null),s=tL(i).map(xl).filter(c=>c!==null);if(o.length===0||s.length===0)return!1;let a=o.filter(c=>eL(c,n));return a.length===0?!1:a.every(c=>s.some(l=>{if(!eL(l,n)||!El(c.returns,l.returns))return!1;for(let u=0;ur!==null);return n.length===0?!1:!n.some(r=>eL(r,t))}function eL(e,t){let n=e.parameters.filter(r=>!r.optional&&!r.rest).length;return tr.rest)||t<=e.parameters.length}function tL(e){return e.split(/ \| (?=(?:export\s+)?declare\b)/).map(t=>t.trim()).filter(Boolean)}function xl(e){let t=jDe(e);if(t<0)return null;let n=zDe(e,t);if(n<0)return null;let r=e.slice(t+1,n),i=e.slice(n+1).trim(),o=/^(?:=>|:)\s*([\s\S]*?)\s*;?$/.exec(i)?.[1];if(o===void 0)return null;let s=[];for(let a of Ey(r)){let c=a.trim();if(!c)continue;let l=/^(\.\.\.)?\s*(?:readonly\s+)?([A-Za-z_$][\w$]*|\{[\s\S]*?\}|\[[\s\S]*?\])\s*(\?)?\s*:\s*([\s\S]+)$/.exec(c);if(!l)return null;s.push({rest:!!l[1],optional:!!l[3]||!!l[1],type:l[4]})}return{parameters:s,returns:o}}function jDe(e){let t=0;for(let n=0;n"&&e[n-1]!=="=")t-=1;else if(r==="("&&t<=0)return n}return-1}function zDe(e,t){let n=0;for(let r=t;r=GDe)return!1;let r=e.trim(),i=t.trim(),o=[rX(r),rX(i)];return o[0]&&o[1]?El(o[0].check,o[1].check)&&vp(o[0].whenTrue,o[1].whenTrue,n+1)&&vp(o[0].whenFalse,o[1].whenFalse,n+1):TS(r,"{","}")&&TS(i,"{","}")?BDe(r,i,n):TS(r,"[","]")&&TS(i,"[","]")?VDe(r,i,n):!1}var GDe=6;function BDe(e,t,n){let r=tX(e),i=tX(t);if(!r||!i)return!1;for(let[o,s]of r){let a=i.get(o);if(!a||s.optional&&!a.optional||!vp(s.type,a.type,n+1))return!1}for(let[o,s]of i)if(!r.has(o)&&!s.optional)return!1;return!0}function VDe(e,t,n){let r=nX(e),i=nX(t);if(!r||!i||i.lengtho.optional||o.rest)}function tX(e){let t=new Map;for(let n of WDe(e.trim().slice(1,-1))){let r=n.trim();if(!r)continue;let i=/^(?:readonly\s+)?(?:'([^']+)'|"([^"]+)"|([A-Za-z_$][\w$]*))\s*(\?)?\s*:\s*([\s\S]+)$/.exec(r);if(!i)return null;let o=i[1]??i[2]??i[3];t.set(o,{optional:!!i[4],type:i[5].trim()})}return t}function nX(e){let t=[];for(let n of Ey(e.trim().slice(1,-1))){let r=n.trim();if(!r)continue;let i=/^(\.\.\.)?\s*([A-Za-z_$][\w$]*)\s*(\?)?\s*:\s*([\s\S]+)$/.exec(r);if(i){t.push({rest:!!i[1],optional:!!i[3]||!!i[1],type:i[4].trim()});continue}let o=/^(\.\.\.)?\s*([\s\S]+?)(\?)?$/.exec(r);if(!o)return null;t.push({rest:!!o[1],optional:!!o[3]||!!o[1],type:o[2].trim()})}return t}function rX(e){let t=0;for(let n=0;n)]}".includes(r))r===">"&&e[n-1]==="="||(t-=1);else if(r==="?"&&t===0){let i=e.slice(0,n);if(!/\bextends\b/.test(i))return null;let o=qDe(e,n+1);return o===-1?null:{check:i.trim(),whenTrue:e.slice(n+1,o).trim(),whenFalse:e.slice(o+1).trim()}}}return null}function qDe(e,t){let n=0,r=0;for(let i=t;i)]}".includes(o))o===">"&&e[i-1]==="="||(n-=1);else if(n===0&&o==="?")r+=1;else if(n===0&&o===":"){if(r===0)return i;r-=1}}return-1}function WDe(e){return Ey(e,";,")}function TS(e,t,n){if(!e.startsWith(t)||!e.endsWith(n))return!1;let r=0;for(let i=0;in.some(o=>El(i,o)))}function iX(e){let t=[],n=0,r="";for(let i of e){if("<([{".includes(i)?n+=1:">)]}".includes(i)&&(n-=1),i==="|"&&n===0){t.push(r),r="";continue}r+=i}return r.trim()&&t.push(r),t.map(i=>i.trim()).filter(Boolean)}function El(e,t){let n=r=>r.replace(/\s+/g,"").replace(/\|undefined$/,"");return n(e)===n(t)}function KDe(e,t){if(e===t)return!0;let n=aX(e);return n===aX(t)&&n!==null}function $X(e,t){let n=oX(e),r=oX(t);if(n.size===0&&r.size===0)return[e,t];for(let[i,o]of n){let s=r.get(i);if(s!==void 0&&s!==o)return[e,t]}return[sX(e),sX(t)]}function oX(e){let t=new Map,n=/\bimport\((["'])((?:(?!\1).)*)\1\)\.([A-Za-z_$][\w$]*)/g;for(let r of e.matchAll(n))t.set(r[3],r[2]);return t}function sX(e){return e.replace(/\bimport\((["'])(?:(?!\1).)*\1\)\./g,"")}function aX(e){let t=JDe(e);if(t.length===0)return null;let n=e;return t.forEach((r,i)=>{n=n.replace(new RegExp(`\\b${OS(r)}\\b`,"g"),`\0T${i}`)}),n}function JDe(e){let t=[];for(let n=0;n"&&(n-=1,n===0))return r;return-1}function Ey(e,t=","){let n=[],r=0,i="";for(let o=0;o)]}".includes(s)&&(s===">"&&e[o-1]==="="||(r-=1)),t.includes(s)&&r===0){n.push(i),i="";continue}i+=s}return i.trim()&&n.push(i),n}var GS=require("node:fs/promises"),mee=require("node:os"),gee=require("node:path");var Ty=require("node:fs/promises"),_p=require("node:path");var cL=new Map;async function lL(e,t){if(!e.autoInstall)return!1;let n=cL.get(t.id);if(n)return n;let r=YDe(e,t).finally(()=>{cL.delete(t.id)});return cL.set(t.id,r),r}async function YDe(e,t){e.logger.info(`Installing ${t.label.replace(/^Install\s+/i,"")}...`);let n=await e.exec(t.command,t.args,{...e.env?{env:e.env}:{},timeoutMs:10*6e4});return n.code!==0?(e.logger.warn(`${t.label} failed: ${(n.stderr||n.stdout||"no output").trim()}`),!1):(e.logger.info(`${t.label.replace(/^Install\s+/i,"")} installed.`),!0)}function ae(e,t,n,r,i){return{available:!1,reason:t,detail:n,...r?{remedy:r}:{},...i?{install:i}:{},tool:e}}function DS(e,t){return new Promise(n=>{let r=setTimeout(()=>n({timedOut:!0}),Math.max(0,t));e.then(i=>{clearTimeout(r),n({timedOut:!1,value:i})},()=>{clearTimeout(r),n({timedOut:!0})})})}var QDe=1,XDe=3,SX=750,PX=1,uL=0,xX=[];async function eMe(){uLxX.push(t));let e=!1;return()=>{if(e)return;e=!0;let t=xX.shift();t?t():uL-=1}}function tMe(e){return/waiting for file lock on (?:package cache|build directory|the registry index)/i.test(e)?!/error\[E\d+\]|could not compile|error: could not|linking with|error: linker|failed to run custom build|toolchain '[^']*' is not installed/i.test(e):!1}var EX=/^(?:Updating|Downloading|Downloaded|Compiling|Compiled|Checking|Blocking)\b/i;function TX(e){let t=e.replace(/\u001b\[[0-9;]*m/g,"").split(` +`).map(i=>i.trim()).filter(Boolean),n=i=>/error\[E\d+\]/i.test(i)?100:/requires rustc\b/i.test(i)?95:/failed to select a version|no matching package/i.test(i)?90:/failed to run custom build command|failed custom build/i.test(i)?85:/linking with .* failed|linker .* (?:failed|not found)|cannot find -l/i.test(i)?80:/missing (?:required )?feature|feature .* (?:is not enabled|does not exist|not found)/i.test(i)?75:/could not compile/i.test(i)?70:/^error:/i.test(i)?60:0,r=null;for(let[i,o]of t.entries()){let s=n(o);s>(r?.score??0)&&(r={line:o,score:s,index:i})}if(r){let i=t.slice(r.index+1).find(o=>!EX.test(o)&&n(o)>0&&o!==r.line);return i?`${r.line} +${i}`:r.line}return t.find(i=>!EX.test(i))??t[0]??"unknown Cargo failure"}var nMe=e=>new Promise(t=>setTimeout(t,e)),Go="cargo public-api",rMe="Install Rust and Cargo with rustup, or make sure `cargo` is on PATH.",AX={id:"cargo-public-api",label:"Install cargo-public-api",command:"cargo",args:["install","cargo-public-api","--locked"]},iMe="Drift can install the missing `cargo-public-api` helper for you after approval.",dL={id:"rustup-nightly",label:"Install the Rust nightly toolchain",command:"rustup",args:["toolchain","install","nightly","--profile","minimal"]},CX="Drift can install the Rust nightly toolchain for you after approval, or run `rustup toolchain install nightly` yourself.",NX={ecosystem:"cargo",tool:Go,weight:1,async compute(e){let t=e.workdir,n=(g,h)=>uMe(e.exec,g,h,e.env,t),r=(g,h)=>lMe(e.exec,g,h,e.env,t),i=await n("cargo",["--version"]);if(i===null)return ae(Go,"tool-missing",`The Rust Cargo toolchain is not installed or is not on PATH, so ${e.name}'s public API could not be compared directly.`,rMe);let o=await n("cargo",["public-api","--version"]);if(o===null&&!(await lL(e,AX)&&(o=await n("cargo",["public-api","--version"]))!==null))return ae(Go,"tool-missing",`Rust and Cargo are installed, but Drift's Rust API helper is missing. ${e.name}'s public API could not be compared directly.`,iMe,AX);let s=/^cargo 1\b/.test(i)&&!/nightly/.test(i),a=/nightly/.test(i),c=null,l="nightly";if(a)l="active",c=await n("rustc",["--version"]);else if(s&&await r("rustup",["--version"])&&(c=await n("rustup",["run","nightly","rustc","--version"]),c===null&&!(await lL(e,dL)&&(c=await n("rustup",["run","nightly","rustc","--version"]))!==null)))return ae(Go,"tool-missing",`\`cargo public-api\` needs the Rust nightly toolchain to read rustdoc's JSON output, and it is not installed. ${e.name}'s public API could not be compared directly.`,CX,dL);let u=o===null||c===null?null:[`cpa=${o}`,`${l}=${c}`,`parser=${PX}`].join("|"),d=IX(e,e.from,u),p=IX(e,e.to,u);p.catch(()=>{});let f=await d;if(!f.ok)return f.failure;let m=await p;return m.ok?{available:!0,changes:Br(f.api,m.api),tool:Go,weight:1,locator:`${e.name} ${e.from} \u2192 ${e.to} (rustdoc JSON)`}:m.failure}};async function IX(e,t,n){let r=(0,_p.join)(e.workdir,`probe-${t}`),i=n===null?null:`rust-surface:v${PX}:${e.name}@${t}#${n}`;if(i){let d=await ic(i);if(d&&d.length>0)return{ok:!0,api:new Map(d)}}try{await(0,Ty.mkdir)((0,_p.join)(r,"src"),{recursive:!0}),await(0,Ty.writeFile)((0,_p.join)(r,"Cargo.toml"),oMe(e.name,t),"utf8"),await(0,Ty.writeFile)((0,_p.join)(r,"src","lib.rs"),"","utf8")}catch(d){return{ok:!1,failure:ae(Go,"toolchain-failed",`Could not prepare a scratch crate: ${d.message}`)}}let s={...e.env??process.env,CARGO_TARGET_DIR:(0,_p.join)(r,"target")},a=Date.now()+e.timeoutMs,c=()=>({ok:!1,failure:ae(Go,"toolchain-failed",`\`cargo public-api\` on ${e.name} ${t} ran out of time waiting for the Cargo package-cache lock.`)}),l;for(let d=0;;d+=1){if(a-Date.now()<=0)return c();let p=await eMe(),f=!1;try{let m=a-Date.now();if(m<=0)return p(),f=!0,c();l=await e.exec("cargo",["public-api","--simplified","--package",e.name],{cwd:r,timeoutMs:m,env:s})}finally{f||p()}if(l.code===0)break;if(d({pkg:ol(r.Pkg),error:ol(r.Error)})):[],platforms:Yd(n.Platforms)}}function ol(e){return typeof e=="string"?e:""}function Yd(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}var mY=8,gY=200,hY={"package-removed":0,"export-removed":1,"kind-changed":2,"member-removed":3,"member-now-required":4,"signature-changed":5,"constant-value-changed":6};function vY(e,t){let n=[],i=[],r=new Set(e.packages),o=new Set(t.packages),s=e.packages.filter(u=>!o.has(u));for(let u of s)n.push({kind:"package-removed",symbol:u,detail:`The package \`${u}\` no longer exists. Every import of it must move to its replacement \u2014 do not re-implement the symbols it exported.`});for(let u of t.packages)r.has(u)||i.push({kind:"package-added",symbol:u});let a=new Set(s),c=[];for(let[u,d]of e.symbols){if(a.has(d.pkg))continue;let p=t.symbols.get(u),f=yY(d);if(!p){if(MAe(d,e,t))continue;n.push({kind:"export-removed",symbol:f,detail:`\`${f}\` is no longer exported (was ${Eo(kO(d.kind))}).`,before:d.signatures[0]});continue}if(d.kind!==p.kind){n.push({kind:"kind-changed",symbol:f,detail:`\`${f}\` changed from ${Eo(kO(d.kind))} to ${Eo(kO(p.kind))}.`,before:d.signatures[0],after:p.signatures[0]});continue}let m=d.platforms.filter(b=>!p.platforms.includes(b));m.length>0&&p.platforms.length>0&&n.push({kind:"export-removed",symbol:f,detail:`\`${f}\` is no longer available on ${m.join(", ")}; it remains on ${p.platforms.join(", ")}.`,before:d.signatures[0]});for(let b of d.members)p.members.includes(b)||n.push({kind:"member-removed",symbol:`${f}.${b}`,detail:d.kind==="interface"?`The method \`${b}\` was removed from the interface \`${f}\`.`:`\`${f}.${b}\` was removed.`});if(d.kind==="interface")for(let b of p.requiredMembers)d.requiredMembers.includes(b)||n.push({kind:"member-now-required",symbol:`${f}.${b}`,detail:`The interface \`${f}\` now requires a \`${b}\` method. Any type in this repository that implements \`${f}\` must gain one.`,after:t.symbols.get(`${p.pkg}.${p.name}.${b}`)?.signatures[0]});let g=d.signatures.join(" | "),h=p.signatures.join(" | ");if(g!==h){if(LAe(d.signatures,p.signatures)){c.push(`${f}: ${g} \u2192 ${h}`);continue}n.push({kind:"signature-changed",symbol:f,detail:`The signature of \`${f}\` changed.`,before:g,after:h})}}for(let[u,d]of t.symbols)e.symbols.has(u)||!r.has(d.pkg)||i.push({kind:"export-added",symbol:yY(d)});if(c.length>0&&c.length<=mY)for(let u of c){let[d,p]=wh(u,": ");n.push({kind:"constant-value-changed",symbol:d,detail:`The constant \`${d}\` changed value.`,before:wh(p," \u2192 ")[0],after:wh(p," \u2192 ")[1]})}else c.length>mY&&n.push({kind:"constant-value-changed",symbol:`${e.module} constants`,detail:`${c.length} exported constants changed value. This is usually a regenerated platform header rather than a deliberate API change, but code that compares against a literal copy of one of these values will now disagree.`,after:c.slice(0,10).join("; ")});n.sort((u,d)=>(hY[u.kind]??9)-(hY[d.kind]??9));let l=Math.max(0,n.length-gY);return{changes:n.slice(0,gY),additions:i,omitted:l}}function MAe(e,t,n){let i=e.name.lastIndexOf(".");if(i<=0)return!1;let r=`${e.pkg}.${e.name.slice(0,i)}`;return t.symbols.has(r)&&n.symbols.has(r)}function yY(e){return e.pkgName?`${e.pkgName}.${e.name}`:e.name}function kO(e){switch(e){case"class":return"struct";case"function":return"function";case"interface":return"interface";case"variable":return"constant or variable";default:return"type"}}function LAe(e,t){if(e.length!==1||t.length!==1)return!1;let[n,i]=[e[0],t[0]];return!n.startsWith("const ")||!i.startsWith("const ")?!1:wh(n," = ")[0]===wh(i," = ")[0]}function wh(e,t){let n=e.indexOf(t);return n<0?[e,""]:[e.slice(0,n),e.slice(n+t.length)]}var FAe="1.24",UAe=["linux/amd64","darwin/arm64","windows/amd64"];function wY(){let e=[...UAe],t=`${jAe()}/${zAe()}`;return e.includes(t)?e:[...e,t]}function jAe(){switch(process.platform){case"win32":return"windows";case"darwin":return"darwin";default:return"linux"}}function zAe(){switch(process.arch){case"x64":return"amd64";case"arm64":return"arm64";case"arm":return"arm";default:return"amd64"}}async function kY(e,t){let n=await e("go",["version"],{timeoutMs:2e4,...t?{env:t}:{}});if(n.failure==="not-found"||n.code!==0)return{available:!1};let i=/go(\d+\.\d+(?:\.\d+)?)/.exec(n.stdout)?.[1],r=await e("go",["env","GOMODCACHE"],{timeoutMs:2e4,...t?{env:t}:{}}),o=r.code===0?r.stdout.trim():"";return{available:!0,...i?{version:i}:{},...o?{moduleCache:o}:{}}}async function $Y(e,t=GAe){if(e)for(let n of t){let i=await e(n).catch(()=>null);if(!i)continue;let r=n.endsWith(".yml")||n.endsWith(".yaml")?BAe(i):VAe(i);if(r)return{version:r,source:n}}return{version:FAe,source:"Drift default"}}var GAe=["go.work","go.mod",".github/workflows/go.yml",".github/workflows/ci.yml",".github/workflows/test.yml",".github/workflows/build.yml"];function VAe(e){let t=/^\s*toolchain\s+go(\d+\.\d+(?:\.\d+)?)/m.exec(e)?.[1];return t||(/^\s*go\s+(\d+\.\d+(?:\.\d+)?)/m.exec(e)?.[1]??null)}function BAe(e){let t=/go-version(?:-file)?\s*:\s*['"]?(\d+\.\d+(?:\.\d+|\.x)?)/.exec(e)?.[1];return t?t.replace(/\.x$/,""):null}function _Y(e,t){let n=e.version;return t?`Add \`actions/setup-go\` with \`go-version: '${n}'\` to the Drift workflow, before the Drift step, to install Go ${n} and enable exported-API comparison.`:`Install Go ${n} and make \`go\` available on PATH, or configure \`go-version\` in the Drift workflow, to enable exported-API comparison.`}function SY(){return process.env.GITHUB_ACTIONS==="true"}var us="go (go/build + go/parser)",IY={ecosystem:"go",tool:us,weight:1,async compute(e){let t=await $Y(e.readRepoFile);if(!(await kY(e.exec,e.env)).available)return ne(us,"tool-missing",`The Go toolchain is not installed, so ${e.name}'s exported API could not be compared.`,_Y(t,SY()));let i=await HAe(e.exec,e.logger,e.env);if(!i)return ne(us,"toolchain-failed",`Drift could not prepare a scratch Go module to run its API extractor in, so ${e.name} could not be compared.`);let r=wY(),o=await xY(e,i,e.from,r,t);if("failure"in o)return o.failure;let s=await xY(e,i,e.to,r,t);if("failure"in s)return s.failure;let{changes:a,additions:c,omitted:l}=vY(o.api,s.api),u=new Set([...o.api.failures,...s.api.failures].map(d=>d.pkg));return u.size>0&&e.logger.debug(`${e.name}: ${u.size} package(s) could not be parsed and were skipped`),{available:!0,changes:a,tool:us,weight:1,locator:qAe(e,o.api,s.api,r,u.size,l),additions:c}}};function qAe(e,t,n,i,r,o){let s=[`${e.name} ${e.from} \u2192 ${e.to}`,`${n.packages.length} package(s), ${n.symbols.size} exported symbol(s)`,`platforms: ${i.join(", ")}`];return t.packages.length!==n.packages.length&&s.push(`${t.packages.length} package(s) before`),r>0&&s.push(`${r} package(s) unparseable and skipped`),o>0&&s.push(`${o} further finding(s) not listed`),s.join(" \xB7 ")}var AY=new Map,Qd=new Map;async function xY(e,t,n,i,r){let o=n.startsWith("v")?n:`v${n}`,s=`${e.name}@${o}|${i.join(",")}`;for(;;){let a=AY.get(s);if(a)return{api:a};let c=Qd.get(s);if(c){let d=await t_(c,e.timeoutMs);if(d.timedOut)return{failure:ne(us,"toolchain-failed",`Ran out of time comparing ${e.name} ${o}'s exported API.`)};if("failure"in d.value&&!d.value.failure.available&&d.value.failure.reason==="toolchain-failed"){Qd.get(s)===c&&Qd.delete(s);continue}return d.value}let l=WAe(e,t,n,i,r,s);Qd.set(s,l);let u=()=>{Qd.get(s)===l&&Qd.delete(s)};return l.then(u,u),l}}async function WAe(e,t,n,i,r,o){let s=n.startsWith("v")?n:`v${n}`,a=await e.exec("go",["mod","download","-json",`${e.name}@${s}`],{cwd:t,timeoutMs:e.timeoutMs,env:$O(e.env)}),c=RY(a.stdout);if(!c){let d=`${a.stderr} -${a.stdout}`,p=/unknown revision|invalid version|no matching versions|404 Not Found|does not contain package/i.test(d);return{failure:ne(us,p?"version-unavailable":"toolchain-failed",p?`The Go module proxy has no ${e.name} ${s}, so there was nothing to compare against. It may be retracted, or the module may be private.`:`\`go mod download ${e.name}@${s}\` failed: ${_O(d)}`)}}let l=await e.exec("go",["run","apidump.go","-dir",c,"-module",e.name,"-platforms",i.join(",")],{cwd:t,timeoutMs:e.timeoutMs,env:$O(e.env)});if(l.code!==0)return{failure:ne(us,"toolchain-failed",`Drift's API extractor could not run under the installed Go toolchain (${r.source} asks for Go ${r.version}): ${_O(l.stderr)}`)};let u=bY(l.stdout);return u?u.symbols.size===0?{failure:ne(us,"no-public-surface",`${e.name} ${s} exports nothing from any importable package on ${i.join(", ")}, so there is no API to compare.`)}:(AY.set(o,u),{api:u}):{failure:ne(us,"parse-failed",`Drift could not read its own API extractor's output for ${e.name} ${s}.`)}}function RY(e){let t=e.indexOf("{");if(t<0)return null;try{let n=JSON.parse(e.slice(t,e.lastIndexOf("}")+1));return n.Dir&&!n.Error?n.Dir:null}catch{return/"Dir":\s*"((?:[^"\\]|\\.)*)"/.exec(e)?.[1]?.replace(/\\(.)/g,"$1")??null}}var EY=new Map;function HAe(e,t,n){let i=n?.PATH??process.env.PATH??"",r=EY.get(i);return r??=(async()=>{try{let o=await(0,sl.mkdtemp)((0,kh.join)((0,TY.tmpdir)(),"drift-go-apidump-"));await(0,sl.mkdir)(o,{recursive:!0}),await(0,sl.writeFile)((0,kh.join)(o,"go.mod"),`module driftapidump +`;function jX(e){let t;try{t=JSON.parse(e.trim())}catch{return null}if(!t||typeof t!="object")return null;let n=t;if(!Array.isArray(n.Symbols)||!Array.isArray(n.Packages))return null;let r=new Map;for(let i of n.Symbols){let o=typeof i.Key=="string"?i.Key:null;o&&r.set(o,{key:o,name:Tl(i.Name),pkg:Tl(i.Pkg),pkgName:Tl(i.PkgName),kind:Tl(i.Kind)||"variable",signatures:wp(i.Signatures),members:wp(i.Members),requiredMembers:wp(i.RequiredMembers),platforms:wp(i.Platforms)})}return{module:Tl(n.Module),packages:wp(n.Packages),symbols:r,failures:Array.isArray(n.Failures)?n.Failures.map(i=>({pkg:Tl(i.Pkg),error:Tl(i.Error)})):[],platforms:wp(n.Platforms)}}function Tl(e){return typeof e=="string"?e:""}function wp(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}var MX=8,LX=200,FX={"package-removed":0,"export-removed":1,"kind-changed":2,"member-removed":3,"member-now-required":4,"signature-changed":5,"constant-value-changed":6};function zX(e,t){let n=[],r=[],i=new Set(e.packages),o=new Set(t.packages),s=e.packages.filter(u=>!o.has(u));for(let u of s)n.push({kind:"package-removed",symbol:u,detail:`The package \`${u}\` no longer exists. Every import of it must move to its replacement \u2014 do not re-implement the symbols it exported.`});for(let u of t.packages)i.has(u)||r.push({kind:"package-added",symbol:u});let a=new Set(s),c=[];for(let[u,d]of e.symbols){if(a.has(d.pkg))continue;let p=t.symbols.get(u),f=UX(d);if(!p){if(dMe(d,e,t))continue;n.push({kind:"export-removed",symbol:f,detail:`\`${f}\` is no longer exported (was ${jo(pL(d.kind))}).`,before:d.signatures[0]});continue}if(d.kind!==p.kind){n.push({kind:"kind-changed",symbol:f,detail:`\`${f}\` changed from ${jo(pL(d.kind))} to ${jo(pL(p.kind))}.`,before:d.signatures[0],after:p.signatures[0]});continue}let m=d.platforms.filter(v=>!p.platforms.includes(v));m.length>0&&p.platforms.length>0&&n.push({kind:"export-removed",symbol:f,detail:`\`${f}\` is no longer available on ${m.join(", ")}; it remains on ${p.platforms.join(", ")}.`,before:d.signatures[0]});for(let v of d.members)p.members.includes(v)||n.push({kind:"member-removed",symbol:`${f}.${v}`,detail:d.kind==="interface"?`The method \`${v}\` was removed from the interface \`${f}\`.`:`\`${f}.${v}\` was removed.`});if(d.kind==="interface")for(let v of p.requiredMembers)d.requiredMembers.includes(v)||n.push({kind:"member-now-required",symbol:`${f}.${v}`,detail:`The interface \`${f}\` now requires a \`${v}\` method. Any type in this repository that implements \`${f}\` must gain one.`,after:t.symbols.get(`${p.pkg}.${p.name}.${v}`)?.signatures[0]});let g=d.signatures.join(" | "),h=p.signatures.join(" | ");if(g!==h){if(pMe(d.signatures,p.signatures)){c.push(`${f}: ${g} \u2192 ${h}`);continue}n.push({kind:"signature-changed",symbol:f,detail:`The signature of \`${f}\` changed.`,before:g,after:h})}}for(let[u,d]of t.symbols)e.symbols.has(u)||!i.has(d.pkg)||r.push({kind:"export-added",symbol:UX(d)});if(c.length>0&&c.length<=MX)for(let u of c){let[d,p]=Ay(u,": ");n.push({kind:"constant-value-changed",symbol:d,detail:`The constant \`${d}\` changed value.`,before:Ay(p," \u2192 ")[0],after:Ay(p," \u2192 ")[1]})}else c.length>MX&&n.push({kind:"constant-value-changed",symbol:`${e.module} constants`,detail:`${c.length} exported constants changed value. This is usually a regenerated platform header rather than a deliberate API change, but code that compares against a literal copy of one of these values will now disagree.`,after:c.slice(0,10).join("; ")});n.sort((u,d)=>(FX[u.kind]??9)-(FX[d.kind]??9));let l=Math.max(0,n.length-LX);return{changes:n.slice(0,LX),additions:r,omitted:l}}function dMe(e,t,n){let r=e.name.lastIndexOf(".");if(r<=0)return!1;let i=`${e.pkg}.${e.name.slice(0,r)}`;return t.symbols.has(i)&&n.symbols.has(i)}function UX(e){return e.pkgName?`${e.pkgName}.${e.name}`:e.name}function pL(e){switch(e){case"class":return"struct";case"function":return"function";case"interface":return"interface";case"variable":return"constant or variable";default:return"type"}}function pMe(e,t){if(e.length!==1||t.length!==1)return!1;let[n,r]=[e[0],t[0]];return!n.startsWith("const ")||!r.startsWith("const ")?!1:Ay(n," = ")[0]===Ay(r," = ")[0]}function Ay(e,t){let n=e.indexOf(t);return n<0?[e,""]:[e.slice(0,n),e.slice(n+t.length)]}var fMe="1.24",mMe=["linux/amd64","darwin/arm64","windows/amd64"];function GX(){let e=[...mMe],t=`${gMe()}/${hMe()}`;return e.includes(t)?e:[...e,t]}function gMe(){switch(process.platform){case"win32":return"windows";case"darwin":return"darwin";default:return"linux"}}function hMe(){switch(process.arch){case"x64":return"amd64";case"arm64":return"arm64";case"arm":return"arm";default:return"amd64"}}async function BX(e,t){let n=await e("go",["version"],{timeoutMs:2e4,...t?{env:t}:{}});if(n.failure==="not-found"||n.code!==0)return{available:!1};let r=/go(\d+\.\d+(?:\.\d+)?)/.exec(n.stdout)?.[1],i=await e("go",["env","GOMODCACHE"],{timeoutMs:2e4,...t?{env:t}:{}}),o=i.code===0?i.stdout.trim():"";return{available:!0,...r?{version:r}:{},...o?{moduleCache:o}:{}}}async function VX(e,t=yMe){if(e)for(let n of t){let r=await e(n).catch(()=>null);if(!r)continue;let i=n.endsWith(".yml")||n.endsWith(".yaml")?vMe(r):bMe(r);if(i)return{version:i,source:n}}return{version:fMe,source:"Drift default"}}var yMe=["go.work","go.mod",".github/workflows/go.yml",".github/workflows/ci.yml",".github/workflows/test.yml",".github/workflows/build.yml"];function bMe(e){let t=/^\s*toolchain\s+go(\d+\.\d+(?:\.\d+)?)/m.exec(e)?.[1];return t||(/^\s*go\s+(\d+\.\d+(?:\.\d+)?)/m.exec(e)?.[1]??null)}function vMe(e){let t=/go-version(?:-file)?\s*:\s*['"]?(\d+\.\d+(?:\.\d+|\.x)?)/.exec(e)?.[1];return t?t.replace(/\.x$/,""):null}function qX(e,t){let n=e.version;return t?`Add \`actions/setup-go\` with \`go-version: '${n}'\` to the Drift workflow, before the Drift step, to install Go ${n} and enable exported-API comparison.`:`Install Go ${n} and make \`go\` available on PATH, or configure \`go-version\` in the Drift workflow, to enable exported-API comparison.`}function WX(){return process.env.GITHUB_ACTIONS==="true"}var Cs="go (go/build + go/parser)",ZX={ecosystem:"go",tool:Cs,weight:1,async compute(e){let t=await VX(e.readRepoFile);if(!(await BX(e.exec,e.env)).available)return ae(Cs,"tool-missing",`The Go toolchain is not installed, so ${e.name}'s exported API could not be compared.`,qX(t,WX()));let r=await kMe(e.exec,e.logger,e.env);if(!r)return ae(Cs,"toolchain-failed",`Drift could not prepare a scratch Go module to run its API extractor in, so ${e.name} could not be compared.`);let i=GX(),o=await HX(e,r,e.from,i,t);if("failure"in o)return o.failure;let s=await HX(e,r,e.to,i,t);if("failure"in s)return s.failure;let{changes:a,additions:c,omitted:l}=zX(o.api,s.api),u=new Set([...o.api.failures,...s.api.failures].map(d=>d.pkg));return u.size>0&&e.logger.debug(`${e.name}: ${u.size} package(s) could not be parsed and were skipped`),{available:!0,changes:a,tool:Cs,weight:1,locator:_Me(e,o.api,s.api,i,u.size,l),additions:c}}};function _Me(e,t,n,r,i,o){let s=[`${e.name} ${e.from} \u2192 ${e.to}`,`${n.packages.length} package(s), ${n.symbols.size} exported symbol(s)`,`platforms: ${r.join(", ")}`];return t.packages.length!==n.packages.length&&s.push(`${t.packages.length} package(s) before`),i>0&&s.push(`${i} package(s) unparseable and skipped`),o>0&&s.push(`${o} further finding(s) not listed`),s.join(" \xB7 ")}var YX=new Map,kp=new Map;async function HX(e,t,n,r,i){let o=n.startsWith("v")?n:`v${n}`,s=`${e.name}@${o}|${r.join(",")}`;for(;;){let a=YX.get(s);if(a)return{api:a};let c=kp.get(s);if(c){let d=await DS(c,e.timeoutMs);if(d.timedOut)return{failure:ae(Cs,"toolchain-failed",`Ran out of time comparing ${e.name} ${o}'s exported API.`)};if("failure"in d.value&&!d.value.failure.available&&d.value.failure.reason==="toolchain-failed"){kp.get(s)===c&&kp.delete(s);continue}return d.value}let l=wMe(e,t,n,r,i,s);kp.set(s,l);let u=()=>{kp.get(s)===l&&kp.delete(s)};return l.then(u,u),l}}async function wMe(e,t,n,r,i,o){let s=n.startsWith("v")?n:`v${n}`,a=await e.exec("go",["mod","download","-json",`${e.name}@${s}`],{cwd:t,timeoutMs:e.timeoutMs,env:fL(e.env)}),c=QX(a.stdout);if(!c){let d=`${a.stderr} +${a.stdout}`,p=/unknown revision|invalid version|no matching versions|404 Not Found|does not contain package/i.test(d);return{failure:ae(Cs,p?"version-unavailable":"toolchain-failed",p?`The Go module proxy has no ${e.name} ${s}, so there was nothing to compare against. It may be retracted, or the module may be private.`:`\`go mod download ${e.name}@${s}\` failed: ${mL(d)}`)}}let l=await e.exec("go",["run","apidump.go","-dir",c,"-module",e.name,"-platforms",r.join(",")],{cwd:t,timeoutMs:e.timeoutMs,env:fL(e.env)});if(l.code!==0)return{failure:ae(Cs,"toolchain-failed",`Drift's API extractor could not run under the installed Go toolchain (${i.source} asks for Go ${i.version}): ${mL(l.stderr)}`)};let u=jX(l.stdout);return u?u.symbols.size===0?{failure:ae(Cs,"no-public-surface",`${e.name} ${s} exports nothing from any importable package on ${r.join(", ")}, so there is no API to compare.`)}:(YX.set(o,u),{api:u}):{failure:ae(Cs,"parse-failed",`Drift could not read its own API extractor's output for ${e.name} ${s}.`)}}function QX(e){let t=e.indexOf("{");if(t<0)return null;try{let n=JSON.parse(e.slice(t,e.lastIndexOf("}")+1));return n.Dir&&!n.Error?n.Dir:null}catch{return/"Dir":\s*"((?:[^"\\]|\\.)*)"/.exec(e)?.[1]?.replace(/\\(.)/g,"$1")??null}}var KX=new Map;function kMe(e,t,n){let r=n?.PATH??process.env.PATH??"",i=KX.get(r);return i??=(async()=>{try{let o=await(0,Al.mkdtemp)((0,Iy.join)((0,JX.tmpdir)(),"drift-go-apidump-"));await(0,Al.mkdir)(o,{recursive:!0}),await(0,Al.writeFile)((0,Iy.join)(o,"go.mod"),`module driftapidump go 1.21 -`,"utf8"),await(0,sl.writeFile)((0,kh.join)(o,"apidump.go"),fY,"utf8");let s=await e("go",["build","-o",(0,kh.join)(o,"apidump-check"),"."],{cwd:o,timeoutMs:12e4,env:$O(n)});return s.code!==0?(t.debug(`Drift's Go API extractor failed to build: ${_O(s.stderr)}`),null):o}catch(o){return t.debug(`Could not create the Go scratch module: ${o.message}`),null}})(),EY.set(i,r),r}function $O(e=process.env){return{...e,GOFLAGS:"-mod=mod"}}function _O(e){return e.split(` -`).find(t=>t.trim().length>0)?.trim()??"no output"}var al=require("node:fs/promises"),WY=require("node:path");var CY=require("node:crypto"),Ao=require("node:fs/promises"),PY=require("node:os"),$h=require("node:path");var SO=new Map,KAe=new Map;function JAe(){let e=Lc()??(0,$h.join)((0,PY.tmpdir)(),"drift-cache");return(0,$h.join)(e,"helpers")}function NY(e){return(0,CY.createHash)("sha256").update(e).digest("hex")}function DY(e){let t=KAe.get(e.id);if(t)return Promise.resolve({ok:!0,path:t});let n=`${e.id}@${e.version}#${e.sha256}`,i=SO.get(n);if(i)return i;let r=ZAe(e).finally(()=>SO.delete(n));return SO.set(n,r),r}async function ZAe(e){let t=JAe(),n=(0,$h.join)(t,`${e.id}-${e.version}.${e.extension??"jar"}`);try{let s=await(0,Ao.readFile)(n);if(NY(s)===e.sha256)return{ok:!0,path:n}}catch{}let i;try{i=await Bt(e.url,{timeoutMs:12e4})}catch(s){return{ok:!1,error:{kind:"download-failed",detail:`${e.url}: ${s.message}`}}}if(!i.ok){let s=i.status?`HTTP ${i.status}`:i.error??"the request failed";return{ok:!1,error:{kind:"download-failed",detail:`${e.url}: ${s}`}}}let r=NY(i.bytes);if(r!==e.sha256)return{ok:!1,error:{kind:"checksum-failed",detail:`${e.url}: expected SHA-256 ${e.sha256}, got ${r}`}};let o=(0,$h.join)(t,`.${e.id}-${e.version}.${process.pid}.${Date.now()}.tmp`);try{return await(0,Ao.mkdir)(t,{recursive:!0}),await(0,Ao.writeFile)(o,i.bytes),await(0,Ao.rename)(o,n),{ok:!0,path:n}}catch(s){return await(0,Ao.rm)(o,{force:!0}).catch(()=>{}),{ok:!1,error:{kind:"cache-failed",detail:`${n}: ${s.message}`}}}}function FY(e){let t=0,n="";for(let i of e)i==="<"?t++:i===">"?t=Math.max(0,t-1):t===0&&(n+=i);return n.replace(/\[\]/g,"").trim()}function YAe(e){let t=[],n=0,i="";for(let r of e){if(r==="<"?n++:r===">"&&(n=Math.max(0,n-1)),r===","&&n===0){t.push(i),i="";continue}i+=r}return t.push(i),t.map(r=>FY(r)).filter(r=>r.length>0)}function UY(e,t,n){let i=e.replace(/\s*\(<-\s*[^)]+\)/g,"").replace(/\([+-]\)/g,"").trim(),r=i.indexOf("("),o=i.lastIndexOf(")");if(r===-1||o0?e.slice(0,t):null}function MY(e){return e.slice(e.lastIndexOf(".")+1)}function jY(e,t){let n=c=>`${c.owner} ${c.name} ${c.params.length}`,i=new Map;for(let c of t){let l=i.get(n(c));l?l.push(c):i.set(n(c),[c])}let r=new Map;for(let c of e)for(let l of i.get(n(c))??[]){let u=[...c.params,...c.returns===null?[]:[c.returns]],d=[...l.params,...l.returns===null?[]:[l.returns]];if(u.length===d.length)for(let[p,f]of u.entries()){let m=d[p];if(f===m||MY(f)!==MY(m))continue;let g=OY(f),h=OY(m);if(!g||!h||g===h)continue;let b=`${g} ${h}`,y=r.get(b);y||(y={types:new Map,witnesses:new Set,binaryBreaking:!1},r.set(b,y)),y.types.set(f,m),y.witnesses.add(`${c.owner}.${c.name}/${c.params.length}`),c.binaryBreaking&&(y.binaryBreaking=!0)}}let o=[];for(let[c,l]of r){if(!l.binaryBreaking||l.witnesses.size<2)continue;let[u,d]=c.split(" ");o.push({fromPackage:u,toPackage:d,types:[...l.types].map(([p,f])=>({from:p,to:f}))})}o.sort((c,l)=>l.types.length-c.types.length||c.fromPackage.localeCompare(l.fromPackage));let s=64,a=[];for(let c of o){if(s<=0)break;a.push({...c,types:c.types.slice(0,s)}),s-=Math.min(s,c.types.length)}return a}function LY(e){let t=e-44;return t>=5&&t<=99?t:null}function zY(e){let t=0,n=0;for(let o of e.split(` -`)){let s=/CLASS FILE FORMAT VERSION:\s*(\d+)(?:\.\d+)?\s*<-\s*(\d+)(?:\.\d+)?/.exec(o);s&&(n=Math.max(n,Number(s[1])),t=Math.max(t,Number(s[2])))}if(n<=t)return null;let i=LY(t),r=LY(n);return i!==null&&r!==null?{from:i,to:r}:null}var Ro="japicmp",r_="Maven POM contract",ds="https://repo1.maven.org/maven2",GY=5*1024*1024,EO="0.23.1",QAe=`${ds}/com/github/siom79/japicmp/japicmp/${EO}/japicmp-${EO}-jar-with-dependencies.jar`,XAe="f2300a8531b68e25b678247874a1eae13a07d6842a4a1236845481fc90c5c6c7",eRe="Install a JDK (11 or newer) and re-run. Drift downloads and runs japicmp itself, but does not install Java.",HY={ecosystem:"maven",tool:Ro,weight:1,async compute(e){let t=KY(e.name);if(!t)return ne(Ro,"unsupported-ecosystem",`\`${e.name}\` is not a \`groupId:artifactId\` coordinate, so Drift could not locate it on Maven Central.`);let n=[ds,...await nRe(e)],[i,r]=await Promise.all([i_(t,e.from,n),i_(t,e.to,n)]);if(!i.ok)return i.failure;if(!r.ok)return r.failure;let o=BY(i.contract.packaging),s=BY(r.contract.packaging);if(o==="pom"||s==="pom")return{available:!0,changes:rRe(i.contract,r.contract),tool:r_,weight:.9,locator:`${e.name} ${e.from} \u2192 ${e.to} (POM contract; ${o} \u2192 ${s})`,packageRole:s};let a;if(o!=="library"||s!=="library"){await(0,al.mkdir)(e.workdir,{recursive:!0});let[h,b]=await Promise.all([n_(t,e.from,e.workdir,n),n_(t,e.to,e.workdir,n)]);if(!h.ok||!b.ok)return{...ne(r_,"artifact-type-unsupported",`${e.name} is packaged as ${r.contract.packaging}, not as a Java library jar, and publishes no companion jar Drift could compare instead.`),packageRole:s};a={before:h,after:b}}if(!await Jk(e.exec,"java",["-version"]))return ne(Ro,"tool-missing",`Java is not installed, so ${e.name}'s classfile API could not be compared directly.`,eRe);let c=await DY({id:"japicmp",version:EO,url:QAe,sha256:XAe});if(!c.ok){let h=c.error.kind==="checksum-failed"?`Drift's pinned japicmp helper failed its SHA-256 check and was not run (${c.error.detail}).`:c.error.kind==="cache-failed"?`Drift verified its pinned japicmp helper but could not cache it for use (${c.error.detail}).`:`Drift could not download its pinned japicmp helper (${c.error.detail}).`;return ne(Ro,"toolchain-failed",h)}let l=c.path;await(0,al.mkdir)(e.workdir,{recursive:!0});let u,d;if(a)u=a.before,d=a.after;else{let h=n_(t,e.from,e.workdir,n),b=n_(t,e.to,e.workdir,n);if(b.catch(()=>{}),u=await h,!u.ok)return u.failure;if(d=await b,!d.ok)return d.failure}if(!u.ok)return u.failure;if(!d.ok)return d.failure;let[p,f]=await Promise.all([qY(u.path),qY(d.path)]);if(!p||!f)return{...ne(Ro,"artifact-type-unsupported",`${e.name} ${e.from} \u2192 ${e.to} ships no classfiles of its own (an aggregator, starter, or relocated artifact) \u2014 its published API surface is not this jar's contents, so Drift did not claim a classfile comparison for it.`),packageRole:"jar"};let m=await e.exec("java",["-jar",l,"-o",u.path,"-n",d.path,"--only-modified","--ignore-missing-classes"],{cwd:e.workdir,timeoutMs:e.timeoutMs});if(m.stdout.trim().length===0)return ne(Ro,m.code===0?"no-public-surface":"toolchain-failed",m.code===0?`japicmp found no differences it could read between ${e.name} ${e.from} and ${e.to}.`:`japicmp execution failed on ${e.name}: ${uRe(m.stderr)}`);if(!lRe(m.stdout))return ne(Ro,"parse-failed",`japicmp output for ${e.name} was not in a recognised report format.`);let g=aRe(m.stdout);return{available:!0,changes:JY(m.stdout),...g>0?{sourceIncompatibleCount:g}:{},tool:Ro,weight:1,locator:`${e.name} ${e.from} \u2192 ${e.to} (classfiles)`,packageRole:"jar"}}},tRe=4;async function nRe(e){let t=e.readRepoFile;if(!t)return[];let n=[...new Set([e.manifestPath,"pom.xml"].filter(r=>!!r))],i=[];for(let r of n){let o=await t(r).catch(()=>null);if(o){for(let s of o.replace(//g,"").matchAll(/([\s\S]*?)<\/repositories>/g))for(let a of s[1].matchAll(/]*)?>([\s\S]*?)<\/repository>/g)){let c=Xn(a[1],"url");c&&/^https:\/\//i.test(c)&&i.push(c.replace(/\/+$/,""))}if(i.length>0)break}}return[...new Set(i)].slice(0,tRe)}function KY(e){let[t,n]=e.split(":");return!t||!n?null:{groupId:t,artifactId:n}}function TO(e,t,n=ds){let i=e.groupId.replace(/\./g,"/");return`${n}/${i}/${e.artifactId}/${t}/${e.artifactId}-${t}.jar`}function VY(e,t,n=ds){let i=e.groupId.replace(/\./g,"/");return`${n}/${i}/${e.artifactId}/${t}/${e.artifactId}-${t}.pom`}function BY(e){let t=(e??"jar").trim().toLowerCase();return t==="jar"||t==="bundle"?"library":t==="pom"?"pom":t==="maven-plugin"?"maven-plugin":"unsupported"}async function i_(e,t,n=[ds]){let i=VY(e,t,n[0]??ds),r=await Bt(i,{timeoutMs:6e4,maxBytes:GY});for(let o of n.slice(1)){if(r.ok)break;i=VY(e,t,o),r=await Bt(i,{timeoutMs:6e4,maxBytes:GY})}if(!r.ok)return{ok:!1,failure:ne(r_,r.status===404?"version-unavailable":"artifact-unavailable",r.status===404?`No POM for ${e.groupId}:${e.artifactId}:${t} in ${ZY(n)}.`:`The exact Maven POM at ${i} could not be downloaded (HTTP ${r.status||"unavailable"}).`)};try{return{ok:!0,contract:IO(r.bytes.toString("utf8"))}}catch(o){return{ok:!1,failure:ne(r_,"parse-failed",`The exact Maven POM at ${i} could not be parsed: ${o.message}`)}}}function IO(e){if(!/)/i.test(e))throw new Error("missing project element");let t=e.replace(//g,""),n=Xn(t,"packaging")??"jar",i=_h(t,"parent"),r=i?[Xn(i,"groupId"),Xn(i,"artifactId"),Xn(i,"version")].map(o=>o??"").join(":"):null;return{packaging:n,parent:r,properties:iRe(_h(t,"properties")),dependencyManagement:oRe(_h(t,"dependencyManagement")),pluginManagement:sRe(_h(t,"pluginManagement"))}}function rRe(e,t){let n=[];return e.packaging!==t.packaging&&n.push({kind:"signature-changed",symbol:"pom:packaging",detail:`The Maven artifact role changed from ${e.packaging} to ${t.packaging}.`,before:e.packaging,after:t.packaging}),e.parent!==t.parent&&n.push({kind:"signature-changed",symbol:"pom:parent",detail:"The inherited Maven parent coordinates changed.",before:e.parent??"(none)",after:t.parent??"(none)"}),xO("property",e.properties,t.properties,n),xO("dependencyManagement",e.dependencyManagement,t.dependencyManagement,n),xO("pluginManagement",e.pluginManagement,t.pluginManagement,n),n}function xO(e,t,n,i){for(let[r,o]of t){let s=`pom:${e}:${r}`;n.has(r)?n.get(r)!==o&&i.push({kind:"signature-changed",symbol:s,detail:`The ${e} entry ${r} changed in the published POM contract.`,before:o,after:n.get(r)}):i.push({kind:"export-removed",symbol:s,detail:`The ${e} entry ${r} was removed from the published POM contract.`,before:o})}}function Xn(e,t){return new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${t}>`,"i").exec(e)?.[1]?.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()||null}function _h(e,t){return e?new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${t}>`,"i").exec(e)?.[1]??null:null}function iRe(e){let t=new Map;if(!e)return t;let n=/<([A-Za-z_][\w.-]*)(?:\s[^>]*)?>([\s\S]*?)<\/\1>/g;for(let i of e.matchAll(n)){let r=i[2].replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();r&&t.set(i[1],r)}return t}function oRe(e){let t=new Map;if(!e)return t;for(let n of e.matchAll(/]*)?>([\s\S]*?)<\/dependency>/g)){let i=n[1],r=`${Xn(i,"groupId")??""}:${Xn(i,"artifactId")??""}`;if(r===":")continue;let o=[...i.matchAll(/]*)?>([\s\S]*?)<\/exclusion>/g)].map(s=>`${Xn(s[1],"groupId")??""}:${Xn(s[1],"artifactId")??""}`).sort();t.set(r,[Xn(i,"version"),Xn(i,"type"),Xn(i,"scope"),Xn(i,"classifier"),...o].filter(Boolean).join("|"))}return t}function sRe(e){let t=new Map;if(!e)return t;for(let n of e.matchAll(/]*)?>([\s\S]*?)<\/plugin>/g)){let i=n[1],r=`${Xn(i,"groupId")??"org.apache.maven.plugins"}:${Xn(i,"artifactId")??""}`;r.endsWith(":")||t.set(r,[Xn(i,"version"),_h(i,"configuration")?.replace(/\s+/g," ").trim()].filter(Boolean).join("|"))}return t}async function qY(e){let t=await(0,al.readFile)(e);return tO(t).some(n=>n.path.endsWith(".class"))}async function n_(e,t,n,i=[ds]){let r=TO(e,t,i[0]??ds),o=(0,WY.join)(n,`${e.artifactId}-${t}.jar`);try{let s=await Bt(r,{timeoutMs:6e4});for(let a of i.slice(1)){if(s.ok)break;r=TO(e,t,a),s=await Bt(r,{timeoutMs:6e4})}if(!s.ok&&s.status===0)throw new Error(s.error??"the request failed");return s.ok?(await(0,al.writeFile)(o,s.bytes),{ok:!0,path:o}):{ok:!1,failure:ne(Ro,s.status===404?"version-unavailable":"toolchain-failed",s.status===404?`No jar for ${e.groupId}:${e.artifactId}:${t} in ${ZY(i)}. It may be an internal artefact, or published only as a POM or a BOM.`:`${r} returned ${s.status}.`)}}catch(s){return{ok:!1,failure:ne(Ro,"toolchain-failed",`Could not download ${r}: ${s.message}`)}}}function JY(e){let t=[],n=null,i=[],r=[];for(let s of e.split(` -`)){let a=s.trim(),c=/^([-+*])\1\1([!*])?\s+(\w+)\s+(CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)(?:\s*\(<-\s*\w+\))?\s*:\s*(.+)$/.exec(a);if(!c)continue;let[,,l,u,d,p]=c,f=d==="CLASS"||d==="INTERFACE"||d==="ANNOTATION",m=cRe(p);if(!m)continue;if(f&&(n=m),!f&&n&&(d==="METHOD"||d==="CONSTRUCTOR")){let h=UY(p,n,l==="!");h&&(u==="REMOVED"?i.push(h):u==="NEW"&&r.push(h))}if(u==="NEW"||l!=="!")continue;let g=f||!n?m:`${n}.${m}`;u==="REMOVED"?t.push({kind:f?"export-removed":"member-removed",symbol:g,detail:f?`\`${g}\` is no longer published (was ${Eo(d.toLowerCase())}).`:`\`${g}\` was removed.`}):u==="MODIFIED"&&t.push({kind:"signature-changed",symbol:g,detail:f?`The declaration of \`${g}\` changed in a way an existing compiled caller may not be binary-compatible with.`:`The signature of \`${g}\` changed.`,after:p.trim()})}let o=zY(e);o&&t.push({kind:"runtime-requirement-raised",symbol:"Java",detail:`This version is compiled for Java ${o.to}; the previous one was Java ${o.from}. A project building or running on Java ${o.from} cannot use it \u2014 javac rejects it at build time and the JVM raises \`UnsupportedClassVersionError\` at runtime.`,before:String(o.from),after:String(o.to)});for(let s of jY(i,r))for(let a of s.types)t.push({kind:"export-removed",symbol:a.from,detail:`\`${a.from}\` is no longer part of this library's API: \`${s.fromPackage}\` moved to \`${s.toPackage}\`. Code that imports \`${a.from}\` no longer compiles against this version \u2014 import \`${a.to}\` instead.`,before:a.from,after:a.to});return t}function aRe(e){let t=0;for(let n of e.split(` -`))/^([-+*])\1\1\*\s+\w+\s+(CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)/.test(n.trim())&&(t+=1);return t}function cRe(e){let n=(e.replace(/\s*\(<-\s*[^)]+\)/g,"").replace(/\([+-]\)/g,"").replace(/\s+\(not serializable\)\s*$/,"").trim().split("(")[0].trim().split(/\s+/).pop()??"").trim();return/^[\w.$]+$/.test(n)?n:null}function lRe(e){return/Comparing (?:binary|source) compatibility/i.test(e)||/^[*+-]{3}/m.test(e)||/^(?:UNCHANGED|MODIFIED|REMOVED|NEW)\s+(?:CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)/m.test(e)}function ZY(e){let t=e.filter(n=>n!==ds);return t.length===0?"Maven Central":`Maven Central or ${t.join(", ")} (declared by this project)`}function uRe(e){return e.split(` -`).find(t=>t.trim().length>0)?.trim()??"no output"}var ll=require("node:fs/promises"),tp=require("node:path"),d9=require("node:crypto");var dRe=/(^|\/)(detail|details|internal|impl|private|priv|test|tests|examples?|demos?|sketch(es)?|dev|sandbox|tools?|scripts?|fuzz|contrib|bench|benchmarks?|docs?|third[_-]?party|extern(al)?|deps?)(\/|$)/i,pRe=/(^|\/)(_|.*[-_](inl|impl|internal|private|guts)\.)|(^|\/)[\w-]*guts\.h$/i,fRe=/\.(h|hpp|hh|hxx|h\+\+|inl|tpp)$/i,mRe=/(^|_)(VERSION|VERNUM|VER)(_?(MAJOR|MINOR|PATCH|REVISION|SUBREVISION|BUILD|STRING|NUM|TEXT|CODE))?$/i,gRe=["include/","inc/","src/",""];function AO(e){let t=hRe(e);return e.map(n=>({path:n.slice(t.length),original:n})).filter(n=>fRe.test(n.path)).filter(n=>!dRe.test(n.path)).filter(n=>!pRe.test(n.path)).filter(n=>gRe.some(i=>n.path.startsWith(i)))}function hRe(e){let t=e[0];if(!t)return"";let n=t.indexOf("/");if(n===-1)return"";let i=t.slice(0,n+1);return e.every(r=>r.startsWith(i))?i:""}function RO(e){let t=new Map;for(let n of e)for(let i of QY(n.content)){let r=t.get(i.name);r&&r.members.length>=i.members.length||t.set(i.name,i)}return t}function QY(e){let t=[],i=ORe(e).split(` -`),r=0,o=[],s=null,a=!1,c=()=>{for(;o.length>0&&r<=o.at(-1).depth;)o.pop()},l=(u,d)=>{for(let p=u;p<=d&&pyRe.test(S))&&s===null?s=r:y&&o.push({path:w?[]:y.split("::").filter(Boolean),depth:r,inline:w});let k=p.indexOf("{"),_=k>=0?p.slice(k+1).replace(/}\s*;?\s*$/,"").trim():"";if(_&&s===null&&!a){let S=YY(_,o.flatMap(x=>x.path));S&&t.push(S)}l(u,u);continue}if(s!==null||a){l(u,u);continue}let m=kRe(p);if(m){t.push(m),l(u,u);continue}let g=$Re(i,u,o.flatMap(y=>y.path));if(g){t.push(g.entry),l(u,g.endLine),u=g.endLine;continue}let h=DRe(i,u);if(!h){l(u,u);continue}let b=YY(h.text,o.flatMap(y=>y.path));b&&t.push(b),l(u,h.endLine),u=h.endLine}return t}var yRe=/^(detail|details|internal|impl|private|_\w+)$/i,bRe=/^\w*BEGIN_(DETAIL|PRIVATE|INTERNAL|IMPL)_NAMESPACE\b/,vRe=/^\w*(END_(DETAIL|PRIVATE|INTERNAL|IMPL)_NAMESPACE|BEGIN_PUBLIC_NAMESPACE)\b/;function wRe(e){let t=0;for(let n of e)n==="{"?t++:n==="}"&&t--;return t}function kRe(e){let t=/^#\s*define\s+(\w+)\s*(\([^)]*\))?\s*(.*)$/.exec(e);if(!t)return null;let n=t[1];if(/^_+|_H(_|PP)?$|_INCLUDED$|_GUARD$/i.test(n)||mRe.test(n))return null;let i=t[2]??"",r=t[3]?.trim()??"";return{name:n,kind:i?"function":"variable",signature:ps(`#define ${n}${i}${r?` ${r}`:""}`),members:[],requiredMembers:[]}}function $Re(e,t,n){let i=e[t].trim(),r=/^(?:typedef\s+)?(?:template\s*<[^>]*>\s*)?(struct|class|union|enum)(?:\s+class|\s+struct)?\s+(?:\w+_(?:API|EXPORT)\s+)?(\w+)?\s*(?::[^{]*)?\s*\{/.exec(i);if(!r)return null;let o=r[1],s=0,a=t,c=[];for(let f=t;ft&&c.push(m),s<=0&&f>=t){a=f;break}a=f}let l=e[a],u=/\}\s*(\w+)\s*;/.exec(l),d=r[2]??u?.[1];if(!d)return null;let p=Sh(n,d);return{entry:{name:p,kind:_Re(o),signature:ps(`${o} ${p}`),...SRe(c.join(` -`),o),requiredMembers:[]},endLine:a}}function _Re(e){return e==="enum"?"enum":e==="class"?"class":"interface"}function SRe(e,t){if(t==="enum")return{members:[...new Set(e.replace(/\{|\}[^}]*$/g,"").split(",").map(s=>/^\s*(\w+)/.exec(s)?.[1]).filter(s=>!!s))]};let n=[],i={},r=t!=="class",o=0;for(let s of e.split(` -`)){let a=s.trim(),c=/^(public|private|protected)\s*:/.exec(a);if(c){r=c[1]==="public";continue}let l=o;for(let f of a)f==="{"?o++:f==="}"&&o--;if(l>0||!r)continue;let u=NO(a);if(u){n.push(u.identity),i[u.identity]=u.signature;continue}let d=/(\w+)\s*\([^)]*\)\s*(?:const\s*)?(?:noexcept\s*)?[;{=]/.exec(a);if(d?.[1]&&!xh.has(d[1])){n.push(d[1]);continue}if(d?.[1])continue;let p=/^[\w:<>,\s*&[\]]+?(\w+)\s*(?:\[[^\]]*\]\s*)?(?:=\s*[^;]+)?;/.exec(a);p?.[1]&&!xh.has(p[1])&&!MRe.test(p[1])&&n.push(p[1])}return{members:[...new Set(n)],memberSignatures:i}}function xRe(e){return NO(e)?.identity??null}function NO(e){let t=e.search(/\boperator\b/);if(t<0)return null;let n=e.slice(t+8).trimStart(),i=IRe(n);if(!i)return null;let r=i.end;for(;/\s/.test(n[r]??"");)r++;if(n[r]!=="(")return null;let o=XY(n,r);if(!o)return null;let s=ARe(n.slice(o.end+1)),a=i.conversion?`operator ${i.name}`:/^[A-Za-z]/.test(i.name)?`operator ${i.name}(${o_(o.content)})`:`operator${i.name}(${o_(o.content)})`,c=ERe(e.slice(0,t)),l=`${a}${s}`,u=`${c?`${c} `:""}operator ${i.name}(${o_(o.content)})${s}`;return{identity:l,signature:u}}function ERe(e){return ps(e).replace(/\b(?:extern|static|inline|virtual|friend|__cdecl|__stdcall|__fastcall|__thiscall|__vectorcall)\b/g,"").replace(/\s+/g," ").trim()}var TRe=["<=>","->*","<<=",">>=","new[]","delete[]","()","[]","->","<<",">>","==","!=","<=",">=","&&","||","++","--","+=","-=","*=","/=","%=","^=","&=","|=","co_await","new","delete","+","-","*","/","%","^","&","|","~","!","=","<",">",","];function IRe(e){let t=/^""\s*([A-Za-z_]\w*)/.exec(e);if(t)return{name:`""${t[1]}`,end:t[0].length,conversion:!1};for(let i of TRe){let o=(i==="new[]"?/^new\s*\[\]/:i==="delete[]"?/^delete\s*\[\]/:null)?.exec(e)?.[0]??(e.startsWith(i)?i:null);if(o&&!(/^[A-Za-z_]/.test(i)&&/[A-Za-z0-9_]/.test(e[o.length]??"")))return{name:i,end:o.length,conversion:!1}}let n=0;for(let i=0;i"&&n>0)n--;else if(r==="("&&n===0){let o=ps(e.slice(0,i));return o?{name:o,end:i,conversion:!0}:null}}return null}function XY(e,t){let n=0;for(let i=t;i=0){let s=r+8;for(;/\s/.test(t[s]??"");)s++;if(t[s]==="("){let a=XY(t,s);n.push(a?`noexcept(${ps(a.content)})`:"noexcept")}else n.push("noexcept")}let o=/\brequires\s+(.+?)(?=\s*(?:;|\{|$))/.exec(t)?.[1];return o&&n.push(`requires ${ps(o)}`),n.length>0?` ${n.join(" ")}`:""}function YY(e,t=[]){let n=e.trim().replace(/^(?:\[\[[^\]]*\]\]\s*)+/,"").replace(/\s+/g," ");if(!n||n.startsWith("#"))return null;let i=/^typedef\s+(.+?)\s*;$/.exec(n);if(i){let l=/\(\s*\*\s*(\w+)\s*\)/.exec(i[1])?.[1]??/(\w+)\s*(?:\[[^\]]*\])?$/.exec(i[1])?.[1];return!l||xh.has(l)?null:{name:Sh(t,l),kind:"type",signature:ps(n),members:[],requiredMembers:[]}}let r=RRe(n);if(xRe(n)){let c=NO(n);return{name:Sh(t,c.identity),kind:"function",signature:c.signature,members:[],requiredMembers:[]}}let s=/^((?:const\s+|unsigned\s+|signed\s+|struct\s+|enum\s+|class\s+)*[\w:]+(?:\s*<[^>]*>)?[\s*&]+)(\w+)\s*\(([^)]*)\)\s*(const)?\s*(?:noexcept)?\s*[;{]$/.exec(r);if(s){let c=ps(s[1]),l=s[2];return xh.has(l)?null:{name:Sh(t,l),kind:"function",signature:`${c} ${l}(${o_(s[3])})${s[4]?" const":""}`,members:[],requiredMembers:[]}}let a=/^extern\s+((?:const\s+)?[\w:]+[\s*&]+)(\w+)\s*(?:\[[^\]]*\])?\s*;$/.exec(n);if(a){let c=a[2];return xh.has(c)?null:{name:Sh(t,c),kind:"variable",signature:ps(n.replace(/;$/,"")),members:[],requiredMembers:[]}}return null}function RRe(e){let t=e;for(;;){let n=/^(?:extern|static|inline|constexpr|virtual|explicit|friend|EXTERN_C|__cdecl|__stdcall|__fastcall|__thiscall|__vectorcall|__forceinline|__inline__|__restrict__|__host__|__device__|[A-Za-z_]\w*_(?:API|EXPORT))\s+/.exec(t);if(n){t=t.slice(n[0].length);continue}let i=/^(?:__declspec|__attribute__)\s*/.exec(t);if(!i)return t;let r=i[0].length;if(t[r]!=="(")return t;let o=0;for(;r{let r=n.split("=")[0].trim().replace(/\s*\[[^\]]*\]\s*$/,"");if(r.split(/(?<=[\s*&])/).length<2)return r;let s=/\b(\w+)\s*$/.exec(r)?.[1];if(s&&NRe.has(s))return r;let a=r.match(/\b\w+\b/g)??[];return a.length===2&&CRe.has(a[0])?r:r.replace(/\b\w+\s*$/,"").trim()||r}).join(", ")}var NRe=new Set(["void","bool","char","wchar_t","char8_t","char16_t","char32_t","short","int","long","float","double","signed","unsigned","const","volatile"]),CRe=new Set(["struct","class","enum","union","const","volatile","signed","unsigned","short","long"]);function PRe(e){let t=[],n=0,i="";for(let r of e){if(r==="<"||r==="("||r==="["?n++:(r===">"||r===")"||r==="]")&&n--,r===","&&n===0){t.push(i),i="";continue}i+=r}return i.trim()&&t.push(i),t}function DRe(e,t){let n="";for(let i=t;iFRe(e,t)}}var n9=CO("arduino"),r9=CO("conan"),i9=CO("vcpkg");async function FRe(e,t){let n=LRe[e];if(!n)return ne(cl,"unsupported-ecosystem",`No source resolver for ${e}.`);let i=e9(e,n,t,t.from),r=e9(e,n,t,t.to);r.catch(()=>{});let o=await i;if(!o.ok)return o.failure;let s=await r;return s.ok?o.api.size===0&&s.api.size===0?ne(cl,"no-public-surface",`No declarations could be read from ${t.name}'s headers in either version. A library whose API is generated by macros, or shipped as a prebuilt binary, has no header text to compare.`):{available:!0,changes:Dr(o.api,s.api),tool:cl,weight:t9,locator:`${t.name} ${t.from} \u2192 ${t.to} (public headers)`}:s.failure}async function e9(e,t,n,i){let r=await t(n.name,i);if(!r)return{ok:!1,failure:ne(cl,"version-unavailable",`No source archive is published for ${n.name} ${i} in ${URe(e)}, so its headers could not be read.`)};let o;try{let s=await Bt(r,{timeoutMs:n.timeoutMs});if(!s.ok&&s.status===0)throw new Error(s.error??"the request failed");if(!s.ok)return{ok:!1,failure:ne(cl,"version-unavailable",`${r} returned ${s.status}.`)};let a=Fn(s.bytes),c=new Map(a.map(l=>[l.path,l]));o=AO([...c.keys()]).map(l=>({path:l.path,content:c.get(l.original).read().toString("utf8")})).filter(l=>l.content.length>0)}catch(s){return{ok:!1,failure:ne(cl,"artifact-unavailable",`Could not read ${n.name} ${i} from ${r}: ${s.message}`)}}return n.logger.debug(`${n.name} ${i}: ${o.length} public header(s)`),{ok:!0,api:RO(o)}}function URe(e){return e==="conan"?"ConanCenter":e==="vcpkg"?"the vcpkg registry":"the Arduino Library Manager"}async function jRe(e,t){let n=await Uk(e),i=n?.archives[t];if(i)return i;let r=n?.githubRepo??await zRe(e);return r?PO(r,t):null}async function zRe(e){return(await Wn(e,"arduino",null))?.githubRepo??null}async function GRe(e,t){let n=`https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/${encodeURIComponent(e)}`,i=await rt(`${n}/config.yml`);if(!i)return null;let r=o9(i,t)??VRe(i);if(!r)return null;let o=await rt(`${n}/${r}/conandata.yml`);if(!o)return null;let s=s9(o,t);if(s)return s;let a=BRe(o);return a?PO(a,t):null}function VRe(e){return/folder\s*:\s*["']?([^"'\s]+)["']?/.exec(e)?.[1]??null}function BRe(e){for(let t of e.matchAll(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+/g)){let n=Lt(t[0]);if(n)return n}return null}async function PO(e,t){let i=(await $e(`https://api.github.com/repos/${e}/tags?per_page=100`)??[]).map(r=>r.name).find(r=>!!r&&Xd(r,t));return i?`https://codeload.github.com/${e}/tar.gz/refs/tags/${encodeURIComponent(i)}`:null}function o9(e,t){let n=e.split(` -`),i=null;for(let r of n){let o=/^\s{2,}["']?([^"':\s]+)["']?\s*:\s*$/.exec(r.replace(/\s+$/,""));if(o){i=o[1].trim();continue}let s=/^\s{4,}folder\s*:\s*["']?([^"'\s]+)["']?/.exec(r);if(s&&i===t)return s[1]}return null}function s9(e,t){let n=e.split(` -`),i=!1,r=!1;for(let o of n){let s=o.replace(/\s+$/,"");if(!s.trim())continue;if(/^sources\s*:/.test(s)){i=!0;continue}if(!/^\s/.test(s)){i=!1,r=!1;continue}if(!i)continue;let a=/^ {2}["']?([^"':\s]+)["']?\s*:\s*$/.exec(s);if(a){r=a[1].trim()===t;continue}if(!r)continue;let c=/https?:\/\/\S+/.exec(s);if(c&&!c[0].endsWith(".git"))return c[0].replace(/["',]+$/,"")}return null}async function qRe(e,t){let n=await $e(`https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/${encodeURIComponent(e)}/vcpkg.json`),i=Lt(n?.homepage??null);return i?PO(i,t):null}function Xd(e,t){let n=i=>i.replace(/^[^\d]*/,"").replace(/_/g,".");return e===t||n(e)===n(t)}var Un="python ast",WRe="Install Python 3 and make `python3` available on PATH.",a9=.9,HRe=.6,p9={ecosystem:"pypi",tool:Un,weight:a9,async compute(e){if(!await Jk(e.exec,"python3",["--version"]))return ne(Un,"tool-missing",`Python 3 is not installed, so ${e.name}'s public symbols could not be compared.`,WRe);await(0,ll.mkdir)(e.workdir,{recursive:!0});let t=(0,tp.join)(e.workdir,"surface.py");await(0,ll.writeFile)(t,m9,"utf8");let n=`${iNe}/${await oNe(e)}`,i=Date.now()+e.timeoutMs,r=c9(e,e.from,t,n,i),o=c9(e,e.to,t,n,i);o.catch(()=>{});let s=await r;if(!s.ok)return s.failure;let a=await o;if(!a.ok)return a.failure;let c=s.usedGitHubFallback||a.usedGitHubFallback,l=c?"; source: GitHub tag mirror, PyPI archive was unreadable":"";return{available:!0,changes:Dr(s.api,a.api),tool:Un,weight:c?HRe:a9,locator:`${e.name} ${e.from} \u2192 ${e.to} (public symbols, best-effort${l})`}}};function ki(e){return Math.max(0,e-Date.now())}var ep=new Map;async function c9(e,t,n,i,r){let o=`python-surface:${i}:${e.name}@${t}`;for(;;){let s=ki(r);if(s<=0)return{ok:!1,failure:ne(Un,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};let a=ep.get(o);if(a){let l=await t_(a.promise,s);if(l.timedOut)return{ok:!1,failure:ne(Un,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};if(!l.value.ok&&l.value.budgetExhausted){ep.get(o)===a&&ep.delete(o);continue}return l.value}let c=(async()=>{let l=await Na(o);if(l)return{ok:!0,api:new Map(l),usedGitHubFallback:!1};let u=await KRe(e,t,n,r);return u.ok?(u.usedGitHubFallback||await Ca(o,[...u.api]),u):ki(r)<=0?{...u,budgetExhausted:!0}:u})();return ep.set(o,{promise:c}),c.catch(()=>{}).then(()=>{ep.get(o)?.promise===c&&ep.delete(o)}),c}}async function KRe(e,t,n,i){if(ki(i)<=0)return{ok:!1,failure:ne(Un,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};let r=await nNe(e.name,t,ki(i));if(!r)return{ok:!1,failure:ne(Un,"version-unavailable",`PyPI has no source archive for ${e.name} ${t}. It may be private, yanked, or published only as a built wheel Drift cannot open.`)};let o=(0,tp.join)(e.workdir,`probe-${t.replace(/[^\w.-]/g,"_")}`),s,a=!1;try{await(0,ll.mkdir)(o,{recursive:!0});let d=await Bt(r.url,{timeoutMs:ki(i),retries:2});if(d.ok)s=d.bytes;else{let p=ki(i)>0?await QRe(e.name,t,i):null;if(!p)return d.status===0?{ok:!1,failure:ne(Un,"toolchain-failed",`Could not download ${r.url}: ${d.error??"the request did not complete"}`)}:{ok:!1,failure:ne(Un,"version-unavailable",`PyPI returned ${d.status} for ${r.url}.`)};s=p,a=!0}}catch(d){return{ok:!1,failure:ne(Un,"toolchain-failed",`Could not download ${r.url}: ${d.message}`)}}let c=0;try{let d=Fn(s),p=d,f="";if(a){let m=tNe(d.map(h=>h.path),e.name);if(!m)return{ok:!1,failure:ne(Un,"no-public-surface",`Could not confidently identify ${e.name}'s own source directory inside its GitHub repository, so the fallback was declined rather than comparing the whole repository.`)};let g=`${m}/`;p=d.filter(h=>h.path.startsWith(g)),f=m.slice(0,m.lastIndexOf("/")+1)}for(let m of p){let g=ZRe(f?m.path.slice(f.length):m.path);if(!g)continue;let h=(0,tp.join)(o,g);await(0,ll.mkdir)((0,tp.dirname)(h),{recursive:!0}),await(0,ll.writeFile)(h,m.read()),c+=1}}catch(d){return{ok:!1,failure:ne(Un,"toolchain-failed",`Could not unpack ${r.filename}: ${l9(d.message)}`)}}if(c===0)return{ok:!1,failure:ne(Un,"no-public-surface",`${e.name} ${t} ships no Python sources Drift could read.`)};if(ki(i)<=0)return{ok:!1,failure:ne(Un,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t}'s source could be parsed.`)};let l=await e.exec("python3",[n,o,e.name],{timeoutMs:ki(i)});if(l.code!==0)return{ok:!1,failure:ne(Un,"parse-failed",`Could not read ${e.name} ${t}'s public symbols: ${l9(l.stderr)}`)};let u=f9(l.stdout);return u?u.size===0?{ok:!1,failure:ne(Un,"no-public-surface",`${e.name} ${t} declares no public symbols Drift could read statically.`)}:{ok:!0,api:u,usedGitHubFallback:a}:{ok:!1,failure:ne(Un,"parse-failed",`Unreadable symbol listing for ${e.name} ${t}.`)}}var JRe=new Set(["test","tests",".git","__pycache__"]);function ZRe(e){let t=e.split("/").filter(s=>s!==""&&s!==".");if(t.length===0||t.some(s=>s==="..")||e.startsWith("/")||/^[a-zA-Z]:/.test(e)||t.slice(0,-1).some(s=>JRe.has(s)))return null;let n=t.at(-1),i=n.endsWith(".py")||n.endsWith(".pyi"),r=["pyproject.toml","setup.cfg","setup.py"].includes(n),o=n==="top_level.txt"&&t.some(s=>s.endsWith(".dist-info")||s.endsWith(".egg-info"));return!i&&!r&&!o?null:t.join("/")}var YRe=25*1024*1024;async function QRe(e,t,n){let i=await Wn(e,"pypi",t);if(!i?.githubRepo||ki(n)<=0)return null;let r=await $e(`https://api.github.com/repos/${i.githubRepo}/tags?per_page=100`,{timeoutMs:ki(n)}),o=XRe(r??[],e,t);if(!o||ki(n)<=0)return null;let a=r?.find(l=>l.name===o)?.commit?.sha??`refs/tags/${o}`,c=await Bt(`https://codeload.github.com/${i.githubRepo}/tar.gz/${a}`,{timeoutMs:ki(n),retries:2,maxBytes:YRe});return c.ok?c.bytes:null}function XRe(e,t,n){let i=e.filter(a=>!!a.name&&Xd(a.name,n)),r=t.toLowerCase().replace(/[_.]/g,"-"),o=new RegExp(`(^|[^a-z0-9])${eNe(r)}([^a-z0-9]|$)`),s=i.filter(a=>o.test(a.name.toLowerCase().replace(/[_.]/g,"-")));return s.length===1?s[0].name:s.length>1?null:i.length===1?i[0].name:null}function eNe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tNe(e,t){let n=t.toLowerCase().replace(/[-.]+/g,"_"),i=new Set;for(let r of e){let o=r.split("/").filter(s=>s!=="");for(let s=0;sc.packagetype==="sdist"),s=r.find(c=>c.packagetype==="bdist_wheel"),a=o??s;return a?{url:a.url,filename:a.filename}:null}var rNe={function:"function",class:"class",variable:"variable",unknown:"unknown"};function f9(e){let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t))return null;let n=new Map;for(let i of t)if(i?.name){if(i.shapeUnknown){n.set(i.name,{name:i.name,kind:"unknown",signature:i.name,members:[],requiredMembers:[],shapeUnknown:!0});continue}n.set(i.name,{name:i.name,kind:rNe[i.kind]??"variable",signature:i.signature??i.name,members:i.members??[],requiredMembers:[],...Array.isArray(i.callable)?{callable:{parameters:i.callable}}:{}})}return n}var m9=`import ast, json, os, re, sys +`,"utf8"),await(0,Al.writeFile)((0,Iy.join)(o,"apidump.go"),DX,"utf8");let s=await e("go",["build","-o",(0,Iy.join)(o,"apidump-check"),"."],{cwd:o,timeoutMs:12e4,env:fL(n)});return s.code!==0?(t.debug(`Drift's Go API extractor failed to build: ${mL(s.stderr)}`),null):o}catch(o){return t.debug(`Could not create the Go scratch module: ${o.message}`),null}})(),KX.set(r,i),i}function fL(e=process.env){return{...e,GOFLAGS:"-mod=mod"}}function mL(e){return e.split(` +`).find(t=>t.trim().length>0)?.trim()??"no output"}var Il=require("node:fs/promises"),m7=require("node:path");var e7=require("node:crypto"),Bo=require("node:fs/promises"),t7=require("node:os"),Ry=require("node:path");var gL=new Map,$Me=new Map;function SMe(){let e=ol()??(0,Ry.join)((0,t7.tmpdir)(),"drift-cache");return(0,Ry.join)(e,"helpers")}function XX(e){return(0,e7.createHash)("sha256").update(e).digest("hex")}function n7(e){let t=$Me.get(e.id);if(t)return Promise.resolve({ok:!0,path:t});let n=`${e.id}@${e.version}#${e.sha256}`,r=gL.get(n);if(r)return r;let i=xMe(e).finally(()=>gL.delete(n));return gL.set(n,i),i}async function xMe(e){let t=SMe(),n=(0,Ry.join)(t,`${e.id}-${e.version}.${e.extension??"jar"}`);try{let s=await(0,Bo.readFile)(n);if(XX(s)===e.sha256)return{ok:!0,path:n}}catch{}let r;try{r=await Jt(e.url,{timeoutMs:12e4})}catch(s){return{ok:!1,error:{kind:"download-failed",detail:`${e.url}: ${s.message}`}}}if(!r.ok){let s=r.status?`HTTP ${r.status}`:r.error??"the request failed";return{ok:!1,error:{kind:"download-failed",detail:`${e.url}: ${s}`}}}let i=XX(r.bytes);if(i!==e.sha256)return{ok:!1,error:{kind:"checksum-failed",detail:`${e.url}: expected SHA-256 ${e.sha256}, got ${i}`}};let o=(0,Ry.join)(t,`.${e.id}-${e.version}.${process.pid}.${Date.now()}.tmp`);try{return await(0,Bo.mkdir)(t,{recursive:!0}),await(0,Bo.writeFile)(o,r.bytes),await(0,Bo.rename)(o,n),{ok:!0,path:n}}catch(s){return await(0,Bo.rm)(o,{force:!0}).catch(()=>{}),{ok:!1,error:{kind:"cache-failed",detail:`${n}: ${s.message}`}}}}function s7(e){let t=0,n="";for(let r of e)r==="<"?t++:r===">"?t=Math.max(0,t-1):t===0&&(n+=r);return n.replace(/\[\]/g,"").trim()}function EMe(e){let t=[],n=0,r="";for(let i of e){if(i==="<"?n++:i===">"&&(n=Math.max(0,n-1)),i===","&&n===0){t.push(r),r="";continue}r+=i}return t.push(r),t.map(i=>s7(i)).filter(i=>i.length>0)}function a7(e,t,n){let r=e.replace(/\s*\(<-\s*[^)]+\)/g,"").replace(/\([+-]\)/g,"").trim(),i=r.indexOf("("),o=r.lastIndexOf(")");if(i===-1||o0?e.slice(0,t):null}function i7(e){return e.slice(e.lastIndexOf(".")+1)}function c7(e,t){let n=c=>`${c.owner} ${c.name} ${c.params.length}`,r=new Map;for(let c of t){let l=r.get(n(c));l?l.push(c):r.set(n(c),[c])}let i=new Map;for(let c of e)for(let l of r.get(n(c))??[]){let u=[...c.params,...c.returns===null?[]:[c.returns]],d=[...l.params,...l.returns===null?[]:[l.returns]];if(u.length===d.length)for(let[p,f]of u.entries()){let m=d[p];if(f===m||i7(f)!==i7(m))continue;let g=r7(f),h=r7(m);if(!g||!h||g===h)continue;let v=`${g} ${h}`,b=i.get(v);b||(b={types:new Map,witnesses:new Set,binaryBreaking:!1},i.set(v,b)),b.types.set(f,m),b.witnesses.add(`${c.owner}.${c.name}/${c.params.length}`),c.binaryBreaking&&(b.binaryBreaking=!0)}}let o=[];for(let[c,l]of i){if(!l.binaryBreaking||l.witnesses.size<2)continue;let[u,d]=c.split(" ");o.push({fromPackage:u,toPackage:d,types:[...l.types].map(([p,f])=>({from:p,to:f}))})}o.sort((c,l)=>l.types.length-c.types.length||c.fromPackage.localeCompare(l.fromPackage));let s=64,a=[];for(let c of o){if(s<=0)break;a.push({...c,types:c.types.slice(0,s)}),s-=Math.min(s,c.types.length)}return a}function o7(e){let t=e-44;return t>=5&&t<=99?t:null}function l7(e){let t=0,n=0;for(let o of e.split(` +`)){let s=/CLASS FILE FORMAT VERSION:\s*(\d+)(?:\.\d+)?\s*<-\s*(\d+)(?:\.\d+)?/.exec(o);s&&(n=Math.max(n,Number(s[1])),t=Math.max(t,Number(s[2])))}if(n<=t)return null;let r=o7(t),i=o7(n);return r!==null&&i!==null?{from:r,to:i}:null}var Vo="japicmp",LS="Maven POM contract",Ns="https://repo1.maven.org/maven2",u7=5*1024*1024,yL="0.23.1",TMe=`${Ns}/com/github/siom79/japicmp/japicmp/${yL}/japicmp-${yL}-jar-with-dependencies.jar`,AMe="f2300a8531b68e25b678247874a1eae13a07d6842a4a1236845481fc90c5c6c7",IMe="Install a JDK (11 or newer) and re-run. Drift downloads and runs japicmp itself, but does not install Java.",g7={ecosystem:"maven",tool:Vo,weight:1,async compute(e){let t=h7(e.name);if(!t)return ae(Vo,"unsupported-ecosystem",`\`${e.name}\` is not a \`groupId:artifactId\` coordinate, so Drift could not locate it on Maven Central.`);let n=[Ns,...await PMe(e)],[r,i]=await Promise.all([FS(t,e.from,n),FS(t,e.to,n)]);if(!r.ok)return r.failure;if(!i.ok)return i.failure;let o=p7(r.contract.packaging),s=p7(i.contract.packaging);if(o==="pom"||s==="pom")return{available:!0,changes:CMe(r.contract,i.contract),tool:LS,weight:.9,locator:`${e.name} ${e.from} \u2192 ${e.to} (POM contract; ${o} \u2192 ${s})`,packageRole:s};let a;if(o!=="library"||s!=="library"){await(0,Il.mkdir)(e.workdir,{recursive:!0});let[h,v]=await Promise.all([MS(t,e.from,e.workdir,n),MS(t,e.to,e.workdir,n)]);if(!h.ok||!v.ok)return{...ae(LS,"artifact-type-unsupported",`${e.name} is packaged as ${i.contract.packaging}, not as a Java library jar, and publishes no companion jar Drift could compare instead.`),packageRole:s};a={before:h,after:v}}if(!await I$(e.exec,"java",["-version"]))return ae(Vo,"tool-missing",`Java is not installed, so ${e.name}'s classfile API could not be compared directly.`,IMe);let c=await n7({id:"japicmp",version:yL,url:TMe,sha256:AMe});if(!c.ok){let h=c.error.kind==="checksum-failed"?`Drift's pinned japicmp helper failed its SHA-256 check and was not run (${c.error.detail}).`:c.error.kind==="cache-failed"?`Drift verified its pinned japicmp helper but could not cache it for use (${c.error.detail}).`:`Drift could not download its pinned japicmp helper (${c.error.detail}).`;return ae(Vo,"toolchain-failed",h)}let l=c.path;await(0,Il.mkdir)(e.workdir,{recursive:!0});let u,d;if(a)u=a.before,d=a.after;else{let h=MS(t,e.from,e.workdir,n),v=MS(t,e.to,e.workdir,n);if(v.catch(()=>{}),u=await h,!u.ok)return u.failure;if(d=await v,!d.ok)return d.failure}if(!u.ok)return u.failure;if(!d.ok)return d.failure;let[p,f]=await Promise.all([f7(u.path),f7(d.path)]);if(!p||!f)return{...ae(Vo,"artifact-type-unsupported",`${e.name} ${e.from} \u2192 ${e.to} ships no classfiles of its own (an aggregator, starter, or relocated artifact) \u2014 its published API surface is not this jar's contents, so Drift did not claim a classfile comparison for it.`),packageRole:"jar"};let m=await e.exec("java",["-jar",l,"-o",u.path,"-n",d.path,"--only-modified","--ignore-missing-classes"],{cwd:e.workdir,timeoutMs:e.timeoutMs});if(m.stdout.trim().length===0)return ae(Vo,m.code===0?"no-public-surface":"toolchain-failed",m.code===0?`japicmp found no differences it could read between ${e.name} ${e.from} and ${e.to}.`:`japicmp execution failed on ${e.name}: ${UMe(m.stderr)}`);if(!FMe(m.stdout))return ae(Vo,"parse-failed",`japicmp output for ${e.name} was not in a recognised report format.`);let g=MMe(m.stdout);return{available:!0,changes:y7(m.stdout),...g>0?{sourceIncompatibleCount:g}:{},tool:Vo,weight:1,locator:`${e.name} ${e.from} \u2192 ${e.to} (classfiles)`,packageRole:"jar"}}},RMe=4;async function PMe(e){let t=e.readRepoFile;if(!t)return[];let n=[...new Set([e.manifestPath,"pom.xml"].filter(i=>!!i))],r=[];for(let i of n){let o=await t(i).catch(()=>null);if(o){for(let s of o.replace(//g,"").matchAll(/([\s\S]*?)<\/repositories>/g))for(let a of s[1].matchAll(/]*)?>([\s\S]*?)<\/repository>/g)){let c=or(a[1],"url");c&&/^https:\/\//i.test(c)&&r.push(c.replace(/\/+$/,""))}if(r.length>0)break}}return[...new Set(r)].slice(0,RMe)}function h7(e){let[t,n]=e.split(":");return!t||!n?null:{groupId:t,artifactId:n}}function bL(e,t,n=Ns){let r=e.groupId.replace(/\./g,"/");return`${n}/${r}/${e.artifactId}/${t}/${e.artifactId}-${t}.jar`}function d7(e,t,n=Ns){let r=e.groupId.replace(/\./g,"/");return`${n}/${r}/${e.artifactId}/${t}/${e.artifactId}-${t}.pom`}function p7(e){let t=(e??"jar").trim().toLowerCase();return t==="jar"||t==="bundle"?"library":t==="pom"?"pom":t==="maven-plugin"?"maven-plugin":"unsupported"}async function FS(e,t,n=[Ns]){let r=d7(e,t,n[0]??Ns),i=await Jt(r,{timeoutMs:6e4,maxBytes:u7});for(let o of n.slice(1)){if(i.ok)break;r=d7(e,t,o),i=await Jt(r,{timeoutMs:6e4,maxBytes:u7})}if(!i.ok)return{ok:!1,failure:ae(LS,i.status===404?"version-unavailable":"artifact-unavailable",i.status===404?`No POM for ${e.groupId}:${e.artifactId}:${t} in ${b7(n)}.`:`The exact Maven POM at ${r} could not be downloaded (HTTP ${i.status||"unavailable"}).`)};try{return{ok:!0,contract:vL(i.bytes.toString("utf8"))}}catch(o){return{ok:!1,failure:ae(LS,"parse-failed",`The exact Maven POM at ${r} could not be parsed: ${o.message}`)}}}function vL(e){if(!/)/i.test(e))throw new Error("missing project element");let t=e.replace(//g,""),n=or(t,"packaging")??"jar",r=Py(t,"parent"),i=r?[or(r,"groupId"),or(r,"artifactId"),or(r,"version")].map(o=>o??"").join(":"):null;return{packaging:n,parent:i,properties:NMe(Py(t,"properties")),dependencyManagement:OMe(Py(t,"dependencyManagement")),pluginManagement:DMe(Py(t,"pluginManagement"))}}function CMe(e,t){let n=[];return e.packaging!==t.packaging&&n.push({kind:"signature-changed",symbol:"pom:packaging",detail:`The Maven artifact role changed from ${e.packaging} to ${t.packaging}.`,before:e.packaging,after:t.packaging}),e.parent!==t.parent&&n.push({kind:"signature-changed",symbol:"pom:parent",detail:"The inherited Maven parent coordinates changed.",before:e.parent??"(none)",after:t.parent??"(none)"}),hL("property",e.properties,t.properties,n),hL("dependencyManagement",e.dependencyManagement,t.dependencyManagement,n),hL("pluginManagement",e.pluginManagement,t.pluginManagement,n),n}function hL(e,t,n,r){for(let[i,o]of t){let s=`pom:${e}:${i}`;n.has(i)?n.get(i)!==o&&r.push({kind:"signature-changed",symbol:s,detail:`The ${e} entry ${i} changed in the published POM contract.`,before:o,after:n.get(i)}):r.push({kind:"export-removed",symbol:s,detail:`The ${e} entry ${i} was removed from the published POM contract.`,before:o})}}function or(e,t){return new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${t}>`,"i").exec(e)?.[1]?.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()||null}function Py(e,t){return e?new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${t}>`,"i").exec(e)?.[1]??null:null}function NMe(e){let t=new Map;if(!e)return t;let n=/<([A-Za-z_][\w.-]*)(?:\s[^>]*)?>([\s\S]*?)<\/\1>/g;for(let r of e.matchAll(n)){let i=r[2].replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();i&&t.set(r[1],i)}return t}function OMe(e){let t=new Map;if(!e)return t;for(let n of e.matchAll(/]*)?>([\s\S]*?)<\/dependency>/g)){let r=n[1],i=`${or(r,"groupId")??""}:${or(r,"artifactId")??""}`;if(i===":")continue;let o=[...r.matchAll(/]*)?>([\s\S]*?)<\/exclusion>/g)].map(s=>`${or(s[1],"groupId")??""}:${or(s[1],"artifactId")??""}`).sort();t.set(i,[or(r,"version"),or(r,"type"),or(r,"scope"),or(r,"classifier"),...o].filter(Boolean).join("|"))}return t}function DMe(e){let t=new Map;if(!e)return t;for(let n of e.matchAll(/]*)?>([\s\S]*?)<\/plugin>/g)){let r=n[1],i=`${or(r,"groupId")??"org.apache.maven.plugins"}:${or(r,"artifactId")??""}`;i.endsWith(":")||t.set(i,[or(r,"version"),Py(r,"configuration")?.replace(/\s+/g," ").trim()].filter(Boolean).join("|"))}return t}async function f7(e){let t=await(0,Il.readFile)(e);return W1(t).some(n=>n.path.endsWith(".class"))}async function MS(e,t,n,r=[Ns]){let i=bL(e,t,r[0]??Ns),o=(0,m7.join)(n,`${e.artifactId}-${t}.jar`);try{let s=await Jt(i,{timeoutMs:6e4});for(let a of r.slice(1)){if(s.ok)break;i=bL(e,t,a),s=await Jt(i,{timeoutMs:6e4})}if(!s.ok&&s.status===0)throw new Error(s.error??"the request failed");return s.ok?(await(0,Il.writeFile)(o,s.bytes),{ok:!0,path:o}):{ok:!1,failure:ae(Vo,s.status===404?"version-unavailable":"toolchain-failed",s.status===404?`No jar for ${e.groupId}:${e.artifactId}:${t} in ${b7(r)}. It may be an internal artefact, or published only as a POM or a BOM.`:`${i} returned ${s.status}.`)}}catch(s){return{ok:!1,failure:ae(Vo,"toolchain-failed",`Could not download ${i}: ${s.message}`)}}}function y7(e){let t=[],n=null,r=[],i=[];for(let s of e.split(` +`)){let a=s.trim(),c=/^([-+*])\1\1([!*])?\s+(\w+)\s+(CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)(?:\s*\(<-\s*\w+\))?\s*:\s*(.+)$/.exec(a);if(!c)continue;let[,,l,u,d,p]=c,f=d==="CLASS"||d==="INTERFACE"||d==="ANNOTATION",m=LMe(p);if(!m)continue;if(f&&(n=m),!f&&n&&(d==="METHOD"||d==="CONSTRUCTOR")){let h=a7(p,n,l==="!");h&&(u==="REMOVED"?r.push(h):u==="NEW"&&i.push(h))}if(u==="NEW"||l!=="!")continue;let g=f||!n?m:`${n}.${m}`;u==="REMOVED"?t.push({kind:f?"export-removed":"member-removed",symbol:g,detail:f?`\`${g}\` is no longer published (was ${jo(d.toLowerCase())}).`:`\`${g}\` was removed.`}):u==="MODIFIED"&&t.push({kind:"signature-changed",symbol:g,detail:f?`The declaration of \`${g}\` changed in a way an existing compiled caller may not be binary-compatible with.`:`The signature of \`${g}\` changed.`,after:p.trim()})}let o=l7(e);o&&t.push({kind:"runtime-requirement-raised",symbol:"Java",detail:`This version is compiled for Java ${o.to}; the previous one was Java ${o.from}. A project building or running on Java ${o.from} cannot use it \u2014 javac rejects it at build time and the JVM raises \`UnsupportedClassVersionError\` at runtime.`,before:String(o.from),after:String(o.to)});for(let s of c7(r,i))for(let a of s.types)t.push({kind:"export-removed",symbol:a.from,detail:`\`${a.from}\` is no longer part of this library's API: \`${s.fromPackage}\` moved to \`${s.toPackage}\`. Code that imports \`${a.from}\` no longer compiles against this version \u2014 import \`${a.to}\` instead.`,before:a.from,after:a.to});return t}function MMe(e){let t=0;for(let n of e.split(` +`))/^([-+*])\1\1\*\s+\w+\s+(CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)/.test(n.trim())&&(t+=1);return t}function LMe(e){let n=(e.replace(/\s*\(<-\s*[^)]+\)/g,"").replace(/\([+-]\)/g,"").replace(/\s+\(not serializable\)\s*$/,"").trim().split("(")[0].trim().split(/\s+/).pop()??"").trim();return/^[\w.$]+$/.test(n)?n:null}function FMe(e){return/Comparing (?:binary|source) compatibility/i.test(e)||/^[*+-]{3}/m.test(e)||/^(?:UNCHANGED|MODIFIED|REMOVED|NEW)\s+(?:CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)/m.test(e)}function b7(e){let t=e.filter(n=>n!==Ns);return t.length===0?"Maven Central":`Maven Central or ${t.join(", ")} (declared by this project)`}function UMe(e){return e.split(` +`).find(t=>t.trim().length>0)?.trim()??"no output"}var Pl=require("node:fs/promises"),xp=require("node:path"),N7=require("node:crypto");var jMe=/(^|\/)(detail|details|internal|impl|private|priv|test|tests|examples?|demos?|sketch(es)?|dev|sandbox|tools?|scripts?|fuzz|contrib|bench|benchmarks?|docs?|third[_-]?party|extern(al)?|deps?)(\/|$)/i,zMe=/(^|\/)(_|.*[-_](inl|impl|internal|private|guts)\.)|(^|\/)[\w-]*guts\.h$/i,GMe=/\.(h|hpp|hh|hxx|h\+\+|inl|tpp)$/i,BMe=/(^|_)(VERSION|VERNUM|VER)(_?(MAJOR|MINOR|PATCH|REVISION|SUBREVISION|BUILD|STRING|NUM|TEXT|CODE))?$/i,VMe=["include/","inc/","src/",""];function _L(e){let t=qMe(e);return e.map(n=>({path:n.slice(t.length),original:n})).filter(n=>GMe.test(n.path)).filter(n=>!jMe.test(n.path)).filter(n=>!zMe.test(n.path)).filter(n=>VMe.some(r=>n.path.startsWith(r)))}function qMe(e){let t=e[0];if(!t)return"";let n=t.indexOf("/");if(n===-1)return"";let r=t.slice(0,n+1);return e.every(i=>i.startsWith(r))?r:""}function wL(e){let t=new Map;for(let n of e)for(let r of _7(n.content)){let i=t.get(r.name);i&&i.members.length>=r.members.length||t.set(r.name,r)}return t}function _7(e){let t=[],r=u1e(e).split(` +`),i=0,o=[],s=null,a=!1,c=()=>{for(;o.length>0&&i<=o.at(-1).depth;)o.pop()},l=(u,d)=>{for(let p=u;p<=d&&pWMe.test(x))&&s===null?s=i:b&&o.push({path:_?[]:b.split("::").filter(Boolean),depth:i,inline:_});let w=p.indexOf("{"),k=w>=0?p.slice(w+1).replace(/}\s*;?\s*$/,"").trim():"";if(k&&s===null&&!a){let x=v7(k,o.flatMap(A=>A.path));x&&t.push(x)}l(u,u);continue}if(s!==null||a){l(u,u);continue}let m=ZMe(p);if(m){t.push(m),l(u,u);continue}let g=YMe(r,u,o.flatMap(b=>b.path));if(g){t.push(g.entry),l(u,g.endLine),u=g.endLine;continue}let h=l1e(r,u);if(!h){l(u,u);continue}let v=v7(h.text,o.flatMap(b=>b.path));v&&t.push(v),l(u,h.endLine),u=h.endLine}return t}var WMe=/^(detail|details|internal|impl|private|_\w+)$/i,HMe=/^\w*BEGIN_(DETAIL|PRIVATE|INTERNAL|IMPL)_NAMESPACE\b/,KMe=/^\w*(END_(DETAIL|PRIVATE|INTERNAL|IMPL)_NAMESPACE|BEGIN_PUBLIC_NAMESPACE)\b/;function JMe(e){let t=0;for(let n of e)n==="{"?t++:n==="}"&&t--;return t}function ZMe(e){let t=/^#\s*define\s+(\w+)\s*(\([^)]*\))?\s*(.*)$/.exec(e);if(!t)return null;let n=t[1];if(/^_+|_H(_|PP)?$|_INCLUDED$|_GUARD$/i.test(n)||BMe.test(n))return null;let r=t[2]??"",i=t[3]?.trim()??"";return{name:n,kind:r?"function":"variable",signature:Os(`#define ${n}${r}${i?` ${i}`:""}`),members:[],requiredMembers:[]}}function YMe(e,t,n){let r=e[t].trim(),i=/^(?:typedef\s+)?(?:template\s*<[^>]*>\s*)?(struct|class|union|enum)(?:\s+class|\s+struct)?\s+(?:\w+_(?:API|EXPORT)\s+)?(\w+)?\s*(?::[^{]*)?\s*\{/.exec(r);if(!i)return null;let o=i[1],s=0,a=t,c=[];for(let f=t;ft&&c.push(m),s<=0&&f>=t){a=f;break}a=f}let l=e[a],u=/\}\s*(\w+)\s*;/.exec(l),d=i[2]??u?.[1];if(!d)return null;let p=Cy(n,d);return{entry:{name:p,kind:QMe(o),signature:Os(`${o} ${p}`),...XMe(c.join(` +`),o),requiredMembers:[]},endLine:a}}function QMe(e){return e==="enum"?"enum":e==="class"?"class":"interface"}function XMe(e,t){if(t==="enum")return{members:[...new Set(e.replace(/\{|\}[^}]*$/g,"").split(",").map(s=>/^\s*(\w+)/.exec(s)?.[1]).filter(s=>!!s))]};let n=[],r={},i=t!=="class",o=0;for(let s of e.split(` +`)){let a=s.trim(),c=/^(public|private|protected)\s*:/.exec(a);if(c){i=c[1]==="public";continue}let l=o;for(let f of a)f==="{"?o++:f==="}"&&o--;if(l>0||!i)continue;let u=kL(a);if(u){n.push(u.identity),r[u.identity]=u.signature;continue}let d=/(\w+)\s*\([^)]*\)\s*(?:const\s*)?(?:noexcept\s*)?[;{=]/.exec(a);if(d?.[1]&&!Ny.has(d[1])){n.push(d[1]);continue}if(d?.[1])continue;let p=/^[\w:<>,\s*&[\]]+?(\w+)\s*(?:\[[^\]]*\]\s*)?(?:=\s*[^;]+)?;/.exec(a);p?.[1]&&!Ny.has(p[1])&&!d1e.test(p[1])&&n.push(p[1])}return{members:[...new Set(n)],memberSignatures:r}}function e1e(e){return kL(e)?.identity??null}function kL(e){let t=e.search(/\boperator\b/);if(t<0)return null;let n=e.slice(t+8).trimStart(),r=r1e(n);if(!r)return null;let i=r.end;for(;/\s/.test(n[i]??"");)i++;if(n[i]!=="(")return null;let o=w7(n,i);if(!o)return null;let s=i1e(n.slice(o.end+1)),a=r.conversion?`operator ${r.name}`:/^[A-Za-z]/.test(r.name)?`operator ${r.name}(${US(o.content)})`:`operator${r.name}(${US(o.content)})`,c=t1e(e.slice(0,t)),l=`${a}${s}`,u=`${c?`${c} `:""}operator ${r.name}(${US(o.content)})${s}`;return{identity:l,signature:u}}function t1e(e){return Os(e).replace(/\b(?:extern|static|inline|virtual|friend|__cdecl|__stdcall|__fastcall|__thiscall|__vectorcall)\b/g,"").replace(/\s+/g," ").trim()}var n1e=["<=>","->*","<<=",">>=","new[]","delete[]","()","[]","->","<<",">>","==","!=","<=",">=","&&","||","++","--","+=","-=","*=","/=","%=","^=","&=","|=","co_await","new","delete","+","-","*","/","%","^","&","|","~","!","=","<",">",","];function r1e(e){let t=/^""\s*([A-Za-z_]\w*)/.exec(e);if(t)return{name:`""${t[1]}`,end:t[0].length,conversion:!1};for(let r of n1e){let o=(r==="new[]"?/^new\s*\[\]/:r==="delete[]"?/^delete\s*\[\]/:null)?.exec(e)?.[0]??(e.startsWith(r)?r:null);if(o&&!(/^[A-Za-z_]/.test(r)&&/[A-Za-z0-9_]/.test(e[o.length]??"")))return{name:r,end:o.length,conversion:!1}}let n=0;for(let r=0;r"&&n>0)n--;else if(i==="("&&n===0){let o=Os(e.slice(0,r));return o?{name:o,end:r,conversion:!0}:null}}return null}function w7(e,t){let n=0;for(let r=t;r=0){let s=i+8;for(;/\s/.test(t[s]??"");)s++;if(t[s]==="("){let a=w7(t,s);n.push(a?`noexcept(${Os(a.content)})`:"noexcept")}else n.push("noexcept")}let o=/\brequires\s+(.+?)(?=\s*(?:;|\{|$))/.exec(t)?.[1];return o&&n.push(`requires ${Os(o)}`),n.length>0?` ${n.join(" ")}`:""}function v7(e,t=[]){let n=e.trim().replace(/^(?:\[\[[^\]]*\]\]\s*)+/,"").replace(/\s+/g," ");if(!n||n.startsWith("#"))return null;let r=/^typedef\s+(.+?)\s*;$/.exec(n);if(r){let l=/\(\s*\*\s*(\w+)\s*\)/.exec(r[1])?.[1]??/(\w+)\s*(?:\[[^\]]*\])?$/.exec(r[1])?.[1];return!l||Ny.has(l)?null:{name:Cy(t,l),kind:"type",signature:Os(n),members:[],requiredMembers:[]}}let i=o1e(n);if(e1e(n)){let c=kL(n);return{name:Cy(t,c.identity),kind:"function",signature:c.signature,members:[],requiredMembers:[]}}let s=/^((?:const\s+|unsigned\s+|signed\s+|struct\s+|enum\s+|class\s+)*[\w:]+(?:\s*<[^>]*>)?[\s*&]+)(\w+)\s*\(([^)]*)\)\s*(const)?\s*(?:noexcept)?\s*[;{]$/.exec(i);if(s){let c=Os(s[1]),l=s[2];return Ny.has(l)?null:{name:Cy(t,l),kind:"function",signature:`${c} ${l}(${US(s[3])})${s[4]?" const":""}`,members:[],requiredMembers:[]}}let a=/^extern\s+((?:const\s+)?[\w:]+[\s*&]+)(\w+)\s*(?:\[[^\]]*\])?\s*;$/.exec(n);if(a){let c=a[2];return Ny.has(c)?null:{name:Cy(t,c),kind:"variable",signature:Os(n.replace(/;$/,"")),members:[],requiredMembers:[]}}return null}function o1e(e){let t=e;for(;;){let n=/^(?:extern|static|inline|constexpr|virtual|explicit|friend|EXTERN_C|__cdecl|__stdcall|__fastcall|__thiscall|__vectorcall|__forceinline|__inline__|__restrict__|__host__|__device__|[A-Za-z_]\w*_(?:API|EXPORT))\s+/.exec(t);if(n){t=t.slice(n[0].length);continue}let r=/^(?:__declspec|__attribute__)\s*/.exec(t);if(!r)return t;let i=r[0].length;if(t[i]!=="(")return t;let o=0;for(;i{let i=n.split("=")[0].trim().replace(/\s*\[[^\]]*\]\s*$/,"");if(i.split(/(?<=[\s*&])/).length<2)return i;let s=/\b(\w+)\s*$/.exec(i)?.[1];if(s&&s1e.has(s))return i;let a=i.match(/\b\w+\b/g)??[];return a.length===2&&a1e.has(a[0])?i:i.replace(/\b\w+\s*$/,"").trim()||i}).join(", ")}var s1e=new Set(["void","bool","char","wchar_t","char8_t","char16_t","char32_t","short","int","long","float","double","signed","unsigned","const","volatile"]),a1e=new Set(["struct","class","enum","union","const","volatile","signed","unsigned","short","long"]);function c1e(e){let t=[],n=0,r="";for(let i of e){if(i==="<"||i==="("||i==="["?n++:(i===">"||i===")"||i==="]")&&n--,i===","&&n===0){t.push(r),r="";continue}r+=i}return r.trim()&&t.push(r),t}function l1e(e,t){let n="";for(let r=t;rf1e(e,t)}}var S7=$L("arduino"),x7=$L("conan"),E7=$L("vcpkg");async function f1e(e,t){let n=p1e[e];if(!n)return ae(Rl,"unsupported-ecosystem",`No source resolver for ${e}.`);let r=k7(e,n,t,t.from),i=k7(e,n,t,t.to);i.catch(()=>{});let o=await r;if(!o.ok)return o.failure;let s=await i;return s.ok?o.api.size===0&&s.api.size===0?ae(Rl,"no-public-surface",`No declarations could be read from ${t.name}'s headers in either version. A library whose API is generated by macros, or shipped as a prebuilt binary, has no header text to compare.`):{available:!0,changes:Br(o.api,s.api),tool:Rl,weight:$7,locator:`${t.name} ${t.from} \u2192 ${t.to} (public headers)`}:s.failure}async function k7(e,t,n,r){let i=await t(n.name,r);if(!i)return{ok:!1,failure:ae(Rl,"version-unavailable",`No source archive is published for ${n.name} ${r} in ${m1e(e)}, so its headers could not be read.`)};let o;try{let s=await Jt(i,{timeoutMs:n.timeoutMs});if(!s.ok&&s.status===0)throw new Error(s.error??"the request failed");if(!s.ok)return{ok:!1,failure:ae(Rl,"version-unavailable",`${i} returned ${s.status}.`)};let a=Bn(s.bytes),c=new Map(a.map(l=>[l.path,l]));o=_L([...c.keys()]).map(l=>({path:l.path,content:c.get(l.original).read().toString("utf8")})).filter(l=>l.content.length>0)}catch(s){return{ok:!1,failure:ae(Rl,"artifact-unavailable",`Could not read ${n.name} ${r} from ${i}: ${s.message}`)}}return n.logger.debug(`${n.name} ${r}: ${o.length} public header(s)`),{ok:!0,api:wL(o)}}function m1e(e){return e==="conan"?"ConanCenter":e==="vcpkg"?"the vcpkg registry":"the Arduino Library Manager"}async function g1e(e,t){let n=await v$(e),r=n?.archives[t];if(r)return r;let i=n?.githubRepo??await h1e(e);return i?SL(i,t):null}async function h1e(e){return(await Qn(e,"arduino",null))?.githubRepo??null}async function y1e(e,t){let n=`https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/${encodeURIComponent(e)}`,r=await ot(`${n}/config.yml`);if(!r)return null;let i=T7(r,t)??b1e(r);if(!i)return null;let o=await ot(`${n}/${i}/conandata.yml`);if(!o)return null;let s=A7(o,t);if(s)return s;let a=v1e(o);return a?SL(a,t):null}function b1e(e){return/folder\s*:\s*["']?([^"'\s]+)["']?/.exec(e)?.[1]??null}function v1e(e){for(let t of e.matchAll(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+/g)){let n=Bt(t[0]);if(n)return n}return null}async function SL(e,t){let r=(await Ie(`https://api.github.com/repos/${e}/tags?per_page=100`)??[]).map(i=>i.name).find(i=>!!i&&$p(i,t));return r?`https://codeload.github.com/${e}/tar.gz/refs/tags/${encodeURIComponent(r)}`:null}function T7(e,t){let n=e.split(` +`),r=null;for(let i of n){let o=/^\s{2,}["']?([^"':\s]+)["']?\s*:\s*$/.exec(i.replace(/\s+$/,""));if(o){r=o[1].trim();continue}let s=/^\s{4,}folder\s*:\s*["']?([^"'\s]+)["']?/.exec(i);if(s&&r===t)return s[1]}return null}function A7(e,t){let n=e.split(` +`),r=!1,i=!1;for(let o of n){let s=o.replace(/\s+$/,"");if(!s.trim())continue;if(/^sources\s*:/.test(s)){r=!0;continue}if(!/^\s/.test(s)){r=!1,i=!1;continue}if(!r)continue;let a=/^ {2}["']?([^"':\s]+)["']?\s*:\s*$/.exec(s);if(a){i=a[1].trim()===t;continue}if(!i)continue;let c=/https?:\/\/\S+/.exec(s);if(c&&!c[0].endsWith(".git"))return c[0].replace(/["',]+$/,"")}return null}async function _1e(e,t){let n=await Ie(`https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/${encodeURIComponent(e)}/vcpkg.json`),r=Bt(n?.homepage??null);return r?SL(r,t):null}function $p(e,t){let n=r=>r.replace(/^[^\d]*/,"").replace(/_/g,".");return e===t||n(e)===n(t)}var Vn="python ast",w1e="Install Python 3 and make `python3` available on PATH.",I7=.9,k1e=.6,O7={ecosystem:"pypi",tool:Vn,weight:I7,async compute(e){if(!await I$(e.exec,"python3",["--version"]))return ae(Vn,"tool-missing",`Python 3 is not installed, so ${e.name}'s public symbols could not be compared.`,w1e);await(0,Pl.mkdir)(e.workdir,{recursive:!0});let t=(0,xp.join)(e.workdir,"surface.py");await(0,Pl.writeFile)(t,M7,"utf8");let n=`${N1e}/${await O1e(e)}`,r=Date.now()+e.timeoutMs,i=R7(e,e.from,t,n,r),o=R7(e,e.to,t,n,r);o.catch(()=>{});let s=await i;if(!s.ok)return s.failure;let a=await o;if(!a.ok)return a.failure;let c=s.usedGitHubFallback||a.usedGitHubFallback,l=c?"; source: GitHub tag mirror, PyPI archive was unreadable":"";return{available:!0,changes:Br(s.api,a.api),tool:Vn,weight:c?k1e:I7,locator:`${e.name} ${e.from} \u2192 ${e.to} (public symbols, best-effort${l})`}}};function Ui(e){return Math.max(0,e-Date.now())}var Sp=new Map;async function R7(e,t,n,r,i){let o=`python-surface:${r}:${e.name}@${t}`;for(;;){let s=Ui(i);if(s<=0)return{ok:!1,failure:ae(Vn,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};let a=Sp.get(o);if(a){let l=await DS(a.promise,s);if(l.timedOut)return{ok:!1,failure:ae(Vn,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};if(!l.value.ok&&l.value.budgetExhausted){Sp.get(o)===a&&Sp.delete(o);continue}return l.value}let c=(async()=>{let l=await ic(o);if(l)return{ok:!0,api:new Map(l),usedGitHubFallback:!1};let u=await $1e(e,t,n,i);return u.ok?(u.usedGitHubFallback||await oc(o,[...u.api]),u):Ui(i)<=0?{...u,budgetExhausted:!0}:u})();return Sp.set(o,{promise:c}),c.catch(()=>{}).then(()=>{Sp.get(o)?.promise===c&&Sp.delete(o)}),c}}async function $1e(e,t,n,r){if(Ui(r)<=0)return{ok:!1,failure:ae(Vn,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};let i=await P1e(e.name,t,Ui(r));if(!i)return{ok:!1,failure:ae(Vn,"version-unavailable",`PyPI has no source archive for ${e.name} ${t}. It may be private, yanked, or published only as a built wheel Drift cannot open.`)};let o=(0,xp.join)(e.workdir,`probe-${t.replace(/[^\w.-]/g,"_")}`),s,a=!1;try{await(0,Pl.mkdir)(o,{recursive:!0});let d=await Jt(i.url,{timeoutMs:Ui(r),retries:2});if(d.ok)s=d.bytes;else{let p=Ui(r)>0?await T1e(e.name,t,r):null;if(!p)return d.status===0?{ok:!1,failure:ae(Vn,"toolchain-failed",`Could not download ${i.url}: ${d.error??"the request did not complete"}`)}:{ok:!1,failure:ae(Vn,"version-unavailable",`PyPI returned ${d.status} for ${i.url}.`)};s=p,a=!0}}catch(d){return{ok:!1,failure:ae(Vn,"toolchain-failed",`Could not download ${i.url}: ${d.message}`)}}let c=0;try{let d=Bn(s),p=d,f="";if(a){let m=R1e(d.map(h=>h.path),e.name);if(!m)return{ok:!1,failure:ae(Vn,"no-public-surface",`Could not confidently identify ${e.name}'s own source directory inside its GitHub repository, so the fallback was declined rather than comparing the whole repository.`)};let g=`${m}/`;p=d.filter(h=>h.path.startsWith(g)),f=m.slice(0,m.lastIndexOf("/")+1)}for(let m of p){let g=x1e(f?m.path.slice(f.length):m.path);if(!g)continue;let h=(0,xp.join)(o,g);await(0,Pl.mkdir)((0,xp.dirname)(h),{recursive:!0}),await(0,Pl.writeFile)(h,m.read()),c+=1}}catch(d){return{ok:!1,failure:ae(Vn,"toolchain-failed",`Could not unpack ${i.filename}: ${P7(d.message)}`)}}if(c===0)return{ok:!1,failure:ae(Vn,"no-public-surface",`${e.name} ${t} ships no Python sources Drift could read.`)};if(Ui(r)<=0)return{ok:!1,failure:ae(Vn,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t}'s source could be parsed.`)};let l=await e.exec("python3",[n,o,e.name],{timeoutMs:Ui(r)});if(l.code!==0)return{ok:!1,failure:ae(Vn,"parse-failed",`Could not read ${e.name} ${t}'s public symbols: ${P7(l.stderr)}`)};let u=D7(l.stdout);return u?u.size===0?{ok:!1,failure:ae(Vn,"no-public-surface",`${e.name} ${t} declares no public symbols Drift could read statically.`)}:{ok:!0,api:u,usedGitHubFallback:a}:{ok:!1,failure:ae(Vn,"parse-failed",`Unreadable symbol listing for ${e.name} ${t}.`)}}var S1e=new Set(["test","tests",".git","__pycache__"]);function x1e(e){let t=e.split("/").filter(s=>s!==""&&s!==".");if(t.length===0||t.some(s=>s==="..")||e.startsWith("/")||/^[a-zA-Z]:/.test(e)||t.slice(0,-1).some(s=>S1e.has(s)))return null;let n=t.at(-1),r=n.endsWith(".py")||n.endsWith(".pyi"),i=["pyproject.toml","setup.cfg","setup.py"].includes(n),o=n==="top_level.txt"&&t.some(s=>s.endsWith(".dist-info")||s.endsWith(".egg-info"));return!r&&!i&&!o?null:t.join("/")}var E1e=25*1024*1024;async function T1e(e,t,n){let r=await Qn(e,"pypi",t);if(!r?.githubRepo||Ui(n)<=0)return null;let i=await Ie(`https://api.github.com/repos/${r.githubRepo}/tags?per_page=100`,{timeoutMs:Ui(n)}),o=A1e(i??[],e,t);if(!o||Ui(n)<=0)return null;let a=i?.find(l=>l.name===o)?.commit?.sha??`refs/tags/${o}`,c=await Jt(`https://codeload.github.com/${r.githubRepo}/tar.gz/${a}`,{timeoutMs:Ui(n),retries:2,maxBytes:E1e});return c.ok?c.bytes:null}function A1e(e,t,n){let r=e.filter(a=>!!a.name&&$p(a.name,n)),i=t.toLowerCase().replace(/[_.]/g,"-"),o=new RegExp(`(^|[^a-z0-9])${I1e(i)}([^a-z0-9]|$)`),s=r.filter(a=>o.test(a.name.toLowerCase().replace(/[_.]/g,"-")));return s.length===1?s[0].name:s.length>1?null:r.length===1?r[0].name:null}function I1e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function R1e(e,t){let n=t.toLowerCase().replace(/[-.]+/g,"_"),r=new Set;for(let i of e){let o=i.split("/").filter(s=>s!=="");for(let s=0;sc.packagetype==="sdist"),s=i.find(c=>c.packagetype==="bdist_wheel"),a=o??s;return a?{url:a.url,filename:a.filename}:null}var C1e={function:"function",class:"class",variable:"variable",unknown:"unknown"};function D7(e){let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t))return null;let n=new Map;for(let r of t)if(r?.name){if(r.shapeUnknown){n.set(r.name,{name:r.name,kind:"unknown",signature:r.name,members:[],requiredMembers:[],shapeUnknown:!0});continue}n.set(r.name,{name:r.name,kind:C1e[r.kind]??"variable",signature:r.signature??r.name,members:r.members??[],requiredMembers:[],...Array.isArray(r.callable)?{callable:{parameters:r.callable}}:{}})}return n}var M7=`import ast, json, os, re, sys def public(name): return not name.startswith('_') or (name.startswith('__') and name.endswith('__')) @@ -1391,23 +1369,23 @@ for module, entry in index.items(): symbols[key] = emitted json.dump(sorted(symbols.values(), key=lambda s: s['name']), sys.stdout) -`;function l9(e){return e.split(` -`).find(t=>t.trim().length>0)?.trim()??"no output"}var iNe=(0,d9.createHash)("sha256").update(m9).digest("hex").slice(0,12),u9=null;function oNe(e){return u9??=e.exec("python3",["--version"],{timeoutMs:2e4}).then(t=>(t.stdout||t.stderr).trim().replace(/\s+/g,"-")||"unknown").catch(()=>"unknown"),u9}var E9=require("node:crypto");MO();var np="assembly metadata",_9=1,T9={ecosystem:"nuget",tool:np,weight:_9,async compute(e){let t=S9(e,e.from),n=S9(e,e.to);n.catch(()=>{});let i=await t;if(!i.ok)return i.failure;let r=await n;return r.ok?i.role!=="managed-library"||r.role!=="managed-library"?{available:!0,changes:ENe(i,r),tool:"NuGet package contract",weight:.9,locator:`${e.name} ${e.from} \u2192 ${e.to} (NuGet package roles: ${i.role} \u2192 ${r.role})`,packageRole:r.role}:{available:!0,changes:Dr(i.api,r.api),tool:np,weight:_9,locator:`${e.name} ${e.from} \u2192 ${e.to} (${i.framework} assembly metadata)`,packageRole:"managed-library"}:r.failure}};async function S9(e,t){let n=e.name.toLowerCase(),i=t.toLowerCase(),r=`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(n)}/${encodeURIComponent(i)}/${encodeURIComponent(n)}.${encodeURIComponent(i)}.nupkg`,o;try{let u=await Bt(r,{timeoutMs:e.timeoutMs});if(!u.ok&&u.status===0)throw new Error(u.error??"the request failed");if(!u.ok)return{ok:!1,failure:ne(np,u.status===404?"version-unavailable":"artifact-unavailable",u.status===404?`NuGet has no package for ${e.name} ${t}. It may be unlisted, delisted, or published to a private feed.`:`NuGet returned ${u.status} for ${e.name} ${t}.`)};o=Fn(u.bytes)}catch(u){return{ok:!1,failure:ne(np,"artifact-unavailable",`Could not read ${e.name} ${t} from NuGet: ${u.message}`)}}let s=SNe(o);if(s!=="managed-library")return s==="unsupported"?{ok:!1,failure:{...ne("NuGet package contract","artifact-type-unsupported",`${e.name} ${t} contains no managed library, analyzer, MSBuild, tool, or dependency-only contract Drift can classify.`),packageRole:s}}:{ok:!0,role:s,contract:xNe(o,s),framework:s};let a=I9(o.map(u=>u.path));if(!a)return{ok:!1,failure:ne(np,"parse-failed",`${e.name} ${t} was classified as a managed library, but no readable assembly could be selected under lib/ or ref/.`)};let c=o.find(u=>u.path===a.path),l=s_(c.read());return l?{ok:!0,role:s,contract:new Map,api:TNe(l),framework:a.framework}:{ok:!1,failure:ne(np,"parse-failed",`${a.path} in ${e.name} ${t} is not a managed assembly Drift could read.`)}}function SNe(e){let t=e.map(i=>i.path.replaceAll("\\","/").toLowerCase());if(I9(t))return"managed-library";if(t.some(i=>i.startsWith("analyzers/")))return"analyzer";if(t.some(i=>i.startsWith("build/")||i.startsWith("buildtransitive/")))return"msbuild";if(t.some(i=>i.startsWith("tools/")))return"tool";let n=e.find(i=>i.path.toLowerCase().endsWith(".nuspec"));return n&&/<(?:dependency|group)\b/i.test(n.read().toString("utf8"))?"meta-package":"unsupported"}function xNe(e,t){let n=new Map;if(t==="meta-package"){let r=e.find(s=>s.path.toLowerCase().endsWith(".nuspec"));if(!r)return n;let o=r.read().toString("utf8");for(let s of o.matchAll(/]*)\/?\s*>/gi)){let a=Object.fromEntries([...s[1].matchAll(/([\w.-]+)\s*=\s*["']([^"']*)["']/g)].map(c=>[c[1].toLowerCase(),c[2]]));a.id&&n.set(`dependency:${a.id}`,[a.version,a.include,a.exclude].filter(Boolean).join("|"))}return n}let i=t==="analyzer"?["analyzers/"]:t==="msbuild"?["build/","buildtransitive/"]:["tools/"];for(let r of e){let o=r.path.replaceAll("\\","/").toLowerCase();i.some(s=>o.startsWith(s))&&n.set(o,(0,E9.createHash)("sha256").update(r.read()).digest("hex"))}return n}function ENe(e,t){let n=[];e.role!==t.role&&n.push({kind:"signature-changed",symbol:"nuget:package-role",detail:`The NuGet package role changed from ${e.role} to ${t.role}.`,before:e.role,after:t.role});for(let[i,r]of e.contract){let o=`nuget:${e.role}:${i}`;t.contract.has(i)?t.contract.get(i)!==r&&n.push({kind:"signature-changed",symbol:o,detail:`The ${e.role} contract entry ${i} changed in the NuGet package.`,before:r,after:t.contract.get(i)}):n.push({kind:"export-removed",symbol:o,detail:`The ${e.role} contract entry ${i} was removed from the NuGet package.`,before:r})}return n}function TNe(e){let t=new Map;for(let n of e)t.set(n.fullName,{name:n.fullName,kind:n.kind==="struct"||n.kind==="delegate"?"type":n.kind,signature:`${n.kind} ${n.fullName}`,members:[...n.members,...n.signatures],requiredMembers:[]});return t}function I9(e){let t=e.map(r=>{let o=/^(lib|ref)\/([^/]+)\/([^/]+\.dll)$/i.exec(r);if(!o)return null;let s=o[3];return/\.resources\.dll$/i.test(s)?null:{path:r,area:o[1].toLowerCase(),framework:o[2].toLowerCase(),name:s}}).filter(r=>r!==null);if(t.length===0)return null;let i=[...t].sort((r,o)=>{if(r.area!==o.area)return r.area==="ref"?-1:1;let s=x9(o.framework)-x9(r.framework);return s!==0?s:r.name.length-o.name.length||r.name.localeCompare(o.name)})[0];return{path:i.path,framework:i.framework}}function x9(e){if(e.startsWith("netstandard2.0"))return 1e3;if(e.startsWith("netstandard"))return 900;let t=/^net(\d+)\.(\d+)/.exec(e);if(t)return 500+Number(t[1])*10+Number(t[2]);let n=/^net(\d+)$/.exec(e);return n?100+Number(n[1]):0}var C9=require("node:crypto"),P9=gt(gc(),1);var Eh="pub source",A9=.8,D9={ecosystem:"pub",tool:Eh,weight:A9,async compute(e){let t=R9(e,e.from),n=R9(e,e.to);n.catch(()=>{});let i=await t;if(!i.ok)return i.failure;let r=await n;return r.ok?i.role!=="code"||r.role!=="code"?{available:!0,changes:RNe(i,r),tool:"pub package contract",weight:.8,locator:`${e.name} ${e.from} \u2192 ${e.to} (published Pub roles: ${i.role} \u2192 ${r.role})`,packageRole:r.role}:i.api.size===0&&r.api.size===0?ne(Eh,"no-public-surface",`${e.name} publishes no public Dart library Drift could read, so this upgrade rests on prose evidence.`):{available:!0,changes:Dr(i.api,r.api),tool:Eh,weight:A9,locator:`${e.name} ${e.from} \u2192 ${e.to} (published lib/)`,packageRole:"code"}:r.failure}};async function R9(e,t){let n=`https://pub.dev/api/archives/${encodeURIComponent(e.name)}-${encodeURIComponent(t)}.tar.gz`,i;try{let o=await Bt(n,{timeoutMs:e.timeoutMs});if(!o.ok&&o.status===0)throw new Error(o.error??"the request failed");if(!o.ok)return{ok:!1,failure:ne(Eh,o.status===404?"version-unavailable":"artifact-unavailable",o.status===404?`pub.dev has no archive for ${e.name} ${t}. It may be retracted, or published to a private pub server.`:`pub.dev returned ${o.status} for ${e.name} ${t}.`)};i=Fn(o.bytes)}catch(o){return{ok:!1,failure:ne(Eh,"artifact-unavailable",`Could not read ${e.name} ${t} from pub.dev: ${o.message}`)}}let r=INe(i);return r==="unsupported"?{ok:!1,failure:{...ne("pub package contract","artifact-type-unsupported",`${e.name} ${t} contains no Dart library, declared asset/font contract, or executable tooling Drift can classify.`),packageRole:r}}:r==="code"?{ok:!0,role:r,contract:new Map,api:M9(i)}:{ok:!0,role:r,contract:ANe(i,r)}}function INe(e){let t=FO(e).map(({path:a})=>a);if(t.some(a=>/^lib\/.+\.dart$/i.test(a)))return"code";let n=O9(e);if(Pa(n?.executables)&&Object.keys(n.executables).length>0||t.some(a=>/^bin\/.+\.dart$/i.test(a)))return"tooling";let r=Pa(n?.flutter)?n.flutter:void 0,o=Array.isArray(r?.assets)&&r.assets.length>0,s=Array.isArray(r?.fonts)&&r.fonts.length>0;return o||s?"asset":"unsupported"}function ANe(e,t){let n=FO(e),i=new Map,r=O9(e);if(t==="tooling"){if(Pa(r?.executables))for(let[c,l]of Object.entries(r.executables).sort(([u],[d])=>u.localeCompare(d)))i.set(`executable:${c}`,typeof l=="string"?l:"");return N9(i,n.filter(({path:c})=>/^bin\/.+\.dart$/i.test(c))),i}let o=Pa(r?.flutter)?r.flutter:void 0,s=[...Array.isArray(o?.assets)?o.assets:[],...Array.isArray(o?.fonts)?o.fonts:[]];i.set("pubspec:flutter-assets-and-fonts",LO(s));let a=NNe(s);return N9(i,n.filter(({path:c})=>a.some(l=>c===l||c.startsWith(`${l}/`)))),i}function RNe(e,t){let n=[];e.role!==t.role&&n.push({kind:"signature-changed",symbol:"pub:package-role",detail:`The Pub package role changed from ${e.role} to ${t.role}.`,before:e.role,after:t.role});for(let[i,r]of e.contract){let o=`pub:${e.role}:${i}`;t.contract.has(i)?t.contract.get(i)!==r&&n.push({kind:"signature-changed",symbol:o,detail:`The ${e.role} contract entry ${i} changed in the Pub package.`,before:r,after:t.contract.get(i)}):n.push({kind:"export-removed",symbol:o,detail:`The ${e.role} contract entry ${i} was removed from the Pub package.`,before:r})}return n}function FO(e){let t=e.some(n=>/^(?:lib|bin|assets?)\//i.test(n.path)||/^pubspec\.ya?ml$/i.test(n.path));return e.map(n=>({path:(t?n.path:n.path.replace(/^[^/]+\//,"")).replaceAll("\\","/").replace(/\/$/,""),entry:n}))}function O9(e){let t=FO(e).find(({path:n})=>/^pubspec\.ya?ml$/i.test(n));if(t)try{let n=(0,P9.parse)(t.entry.read().toString("utf8"));return Pa(n)?n:void 0}catch{return}}function NNe(e){let t=new Set;for(let n of e){if(typeof n=="string"&&t.add(n.replace(/^\.\//,"").replace(/\/$/,"")),!Pa(n))continue;let i=Array.isArray(n.fonts)?n.fonts:[];for(let r of i)Pa(r)&&typeof r.asset=="string"&&t.add(r.asset.replace(/^\.\//,""))}return[...t].filter(Boolean)}function N9(e,t){for(let{path:n,entry:i}of[...t].sort((r,o)=>r.path.localeCompare(o.path)))e.set(`file:${n}`,(0,C9.createHash)("sha256").update(i.read()).digest("hex"))}function LO(e){return Array.isArray(e)?`[${e.map(LO).join(",")}]`:Pa(e)?`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${LO(e[t])}`).join(",")}}`:JSON.stringify(e)??"null"}function Pa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function M9(e){let t=e.some(s=>s.path.startsWith("lib/")),n=new Map;for(let s of e){let a=t?s.path:s.path.replace(/^[^/]+\//,"");a.startsWith("lib/")&&a.endsWith(".dart")&&n.set(a,s)}let i=new Map,r=new Set,o=[...n.keys()].filter(s=>!s.startsWith("lib/src/"));for(;o.length>0;){let s=o.shift();if(r.has(s))continue;r.add(s);let a=n.get(s);if(!a)continue;let c;try{c=a.read().toString("utf8")}catch{continue}for(let l of L9(c))i.has(l.name)||i.set(l.name,l);for(let l of CNe(c)){let u=PNe(s,l);u&&n.has(u)&&o.push(u)}}return i}function CNe(e){let t=[];for(let n of e.matchAll(/^\s*export\s+['"]([^'"]+)['"]/gm)){let i=n[1];i.startsWith("package:")||i.startsWith("dart:")||t.push(i)}return t}function PNe(e,t){let n=[...e.split("/").slice(0,-1),...t.split("/")],i=[];for(let r of n)if(!(r===""||r===".")){if(r===".."){if(i.length===0)return;i.pop();continue}i.push(r)}return i.join("/")}function L9(e){let t=[],n=ONe(e).split(` -`);for(let i=0;i,\s?[\]]+\s+)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(([^)]*)\)\s*(?:async\s*\*?|sync\s*\*)?\s*[{=;]/.exec(r);if(a?.[1]&&!a[1].startsWith("_")&&!F9.has(a[1])){t.push({name:a[1],kind:"function",signature:a_(r),members:[],requiredMembers:[]});continue}let c=/^(?:const|final|var|late\s+final|late\s+var)\s+(?:[\w$<>,\s?[\]]+\s+)?([A-Za-z_$][\w$]*)\s*=/.exec(r);c?.[1]&&!c[1].startsWith("_")&&t.push({name:c[1],kind:"variable",signature:a_(r),members:[],requiredMembers:[]})}return t}function DNe(e,t){let n=[],i;for(let r=t+1;r,\s?[\]]+\s+)?(?:get\s+|set\s+)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*[({=;]/.exec(o);a?.[1]&&!a[1].startsWith("_")&&!F9.has(a[1])&&n.push(a[1])}return[...new Set(n)]}var F9=new Set(["if","for","while","switch","catch","return","assert","super","this","new","await","yield","throw","else","do","try","case","with","is","as","in","on","of","when","get","set","factory","operator","part","import","export","library","typedef","class","enum","mixin","extension","const","final","var","void","late","required","covariant","abstract","static","external"]);function ONe(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").split(` +`;function P7(e){return e.split(` +`).find(t=>t.trim().length>0)?.trim()??"no output"}var N1e=(0,N7.createHash)("sha256").update(M7).digest("hex").slice(0,12),C7=null;function O1e(e){return C7??=e.exec("python3",["--version"],{timeoutMs:2e4}).then(t=>(t.stdout||t.stderr).trim().replace(/\s+/g,"-")||"unknown").catch(()=>"unknown"),C7}var K7=require("node:crypto");TL();var Ep="assembly metadata",q7=1,J7={ecosystem:"nuget",tool:Ep,weight:q7,async compute(e){let t=W7(e,e.from),n=W7(e,e.to);n.catch(()=>{});let r=await t;if(!r.ok)return r.failure;let i=await n;return i.ok?r.role!=="managed-library"||i.role!=="managed-library"?{available:!0,changes:tLe(r,i),tool:"NuGet package contract",weight:.9,locator:`${e.name} ${e.from} \u2192 ${e.to} (NuGet package roles: ${r.role} \u2192 ${i.role})`,packageRole:i.role}:{available:!0,changes:Br(r.api,i.api),tool:Ep,weight:q7,locator:`${e.name} ${e.from} \u2192 ${e.to} (${r.framework} assembly metadata)`,packageRole:"managed-library"}:i.failure}};async function W7(e,t){let n=e.name.toLowerCase(),r=t.toLowerCase(),i=`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(n)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}.${encodeURIComponent(r)}.nupkg`,o;try{let u=await Jt(i,{timeoutMs:e.timeoutMs});if(!u.ok&&u.status===0)throw new Error(u.error??"the request failed");if(!u.ok)return{ok:!1,failure:ae(Ep,u.status===404?"version-unavailable":"artifact-unavailable",u.status===404?`NuGet has no package for ${e.name} ${t}. It may be unlisted, delisted, or published to a private feed.`:`NuGet returned ${u.status} for ${e.name} ${t}.`)};o=Bn(u.bytes)}catch(u){return{ok:!1,failure:ae(Ep,"artifact-unavailable",`Could not read ${e.name} ${t} from NuGet: ${u.message}`)}}let s=X1e(o);if(s!=="managed-library")return s==="unsupported"?{ok:!1,failure:{...ae("NuGet package contract","artifact-type-unsupported",`${e.name} ${t} contains no managed library, analyzer, MSBuild, tool, or dependency-only contract Drift can classify.`),packageRole:s}}:{ok:!0,role:s,contract:eLe(o,s),framework:s};let a=Z7(o.map(u=>u.path));if(!a)return{ok:!1,failure:ae(Ep,"parse-failed",`${e.name} ${t} was classified as a managed library, but no readable assembly could be selected under lib/ or ref/.`)};let c=o.find(u=>u.path===a.path),l=jS(c.read());return l?{ok:!0,role:s,contract:new Map,api:nLe(l),framework:a.framework}:{ok:!1,failure:ae(Ep,"parse-failed",`${a.path} in ${e.name} ${t} is not a managed assembly Drift could read.`)}}function X1e(e){let t=e.map(r=>r.path.replaceAll("\\","/").toLowerCase());if(Z7(t))return"managed-library";if(t.some(r=>r.startsWith("analyzers/")))return"analyzer";if(t.some(r=>r.startsWith("build/")||r.startsWith("buildtransitive/")))return"msbuild";if(t.some(r=>r.startsWith("tools/")))return"tool";let n=e.find(r=>r.path.toLowerCase().endsWith(".nuspec"));return n&&/<(?:dependency|group)\b/i.test(n.read().toString("utf8"))?"meta-package":"unsupported"}function eLe(e,t){let n=new Map;if(t==="meta-package"){let i=e.find(s=>s.path.toLowerCase().endsWith(".nuspec"));if(!i)return n;let o=i.read().toString("utf8");for(let s of o.matchAll(/]*)\/?\s*>/gi)){let a=Object.fromEntries([...s[1].matchAll(/([\w.-]+)\s*=\s*["']([^"']*)["']/g)].map(c=>[c[1].toLowerCase(),c[2]]));a.id&&n.set(`dependency:${a.id}`,[a.version,a.include,a.exclude].filter(Boolean).join("|"))}return n}let r=t==="analyzer"?["analyzers/"]:t==="msbuild"?["build/","buildtransitive/"]:["tools/"];for(let i of e){let o=i.path.replaceAll("\\","/").toLowerCase();r.some(s=>o.startsWith(s))&&n.set(o,(0,K7.createHash)("sha256").update(i.read()).digest("hex"))}return n}function tLe(e,t){let n=[];e.role!==t.role&&n.push({kind:"signature-changed",symbol:"nuget:package-role",detail:`The NuGet package role changed from ${e.role} to ${t.role}.`,before:e.role,after:t.role});for(let[r,i]of e.contract){let o=`nuget:${e.role}:${r}`;t.contract.has(r)?t.contract.get(r)!==i&&n.push({kind:"signature-changed",symbol:o,detail:`The ${e.role} contract entry ${r} changed in the NuGet package.`,before:i,after:t.contract.get(r)}):n.push({kind:"export-removed",symbol:o,detail:`The ${e.role} contract entry ${r} was removed from the NuGet package.`,before:i})}return n}function nLe(e){let t=new Map;for(let n of e)t.set(n.fullName,{name:n.fullName,kind:n.kind==="struct"||n.kind==="delegate"?"type":n.kind,signature:`${n.kind} ${n.fullName}`,members:[...n.members,...n.signatures],requiredMembers:[]});return t}function Z7(e){let t=e.map(i=>{let o=/^(lib|ref)\/([^/]+)\/([^/]+\.dll)$/i.exec(i);if(!o)return null;let s=o[3];return/\.resources\.dll$/i.test(s)?null:{path:i,area:o[1].toLowerCase(),framework:o[2].toLowerCase(),name:s}}).filter(i=>i!==null);if(t.length===0)return null;let r=[...t].sort((i,o)=>{if(i.area!==o.area)return i.area==="ref"?-1:1;let s=H7(o.framework)-H7(i.framework);return s!==0?s:i.name.length-o.name.length||i.name.localeCompare(o.name)})[0];return{path:r.path,framework:r.framework}}function H7(e){if(e.startsWith("netstandard2.0"))return 1e3;if(e.startsWith("netstandard"))return 900;let t=/^net(\d+)\.(\d+)/.exec(e);if(t)return 500+Number(t[1])*10+Number(t[2]);let n=/^net(\d+)$/.exec(e);return n?100+Number(n[1]):0}var eee=require("node:crypto"),tee=$t(Lc(),1);var Oy="pub source",Y7=.8,nee={ecosystem:"pub",tool:Oy,weight:Y7,async compute(e){let t=Q7(e,e.from),n=Q7(e,e.to);n.catch(()=>{});let r=await t;if(!r.ok)return r.failure;let i=await n;return i.ok?r.role!=="code"||i.role!=="code"?{available:!0,changes:oLe(r,i),tool:"pub package contract",weight:.8,locator:`${e.name} ${e.from} \u2192 ${e.to} (published Pub roles: ${r.role} \u2192 ${i.role})`,packageRole:i.role}:r.api.size===0&&i.api.size===0?ae(Oy,"no-public-surface",`${e.name} publishes no public Dart library Drift could read, so this upgrade rests on prose evidence.`):{available:!0,changes:Br(r.api,i.api),tool:Oy,weight:Y7,locator:`${e.name} ${e.from} \u2192 ${e.to} (published lib/)`,packageRole:"code"}:i.failure}};async function Q7(e,t){let n=`https://pub.dev/api/archives/${encodeURIComponent(e.name)}-${encodeURIComponent(t)}.tar.gz`,r;try{let o=await Jt(n,{timeoutMs:e.timeoutMs});if(!o.ok&&o.status===0)throw new Error(o.error??"the request failed");if(!o.ok)return{ok:!1,failure:ae(Oy,o.status===404?"version-unavailable":"artifact-unavailable",o.status===404?`pub.dev has no archive for ${e.name} ${t}. It may be retracted, or published to a private pub server.`:`pub.dev returned ${o.status} for ${e.name} ${t}.`)};r=Bn(o.bytes)}catch(o){return{ok:!1,failure:ae(Oy,"artifact-unavailable",`Could not read ${e.name} ${t} from pub.dev: ${o.message}`)}}let i=rLe(r);return i==="unsupported"?{ok:!1,failure:{...ae("pub package contract","artifact-type-unsupported",`${e.name} ${t} contains no Dart library, declared asset/font contract, or executable tooling Drift can classify.`),packageRole:i}}:i==="code"?{ok:!0,role:i,contract:new Map,api:iee(r)}:{ok:!0,role:i,contract:iLe(r,i)}}function rLe(e){let t=IL(e).map(({path:a})=>a);if(t.some(a=>/^lib\/.+\.dart$/i.test(a)))return"code";let n=ree(e);if(sc(n?.executables)&&Object.keys(n.executables).length>0||t.some(a=>/^bin\/.+\.dart$/i.test(a)))return"tooling";let i=sc(n?.flutter)?n.flutter:void 0,o=Array.isArray(i?.assets)&&i.assets.length>0,s=Array.isArray(i?.fonts)&&i.fonts.length>0;return o||s?"asset":"unsupported"}function iLe(e,t){let n=IL(e),r=new Map,i=ree(e);if(t==="tooling"){if(sc(i?.executables))for(let[c,l]of Object.entries(i.executables).sort(([u],[d])=>u.localeCompare(d)))r.set(`executable:${c}`,typeof l=="string"?l:"");return X7(r,n.filter(({path:c})=>/^bin\/.+\.dart$/i.test(c))),r}let o=sc(i?.flutter)?i.flutter:void 0,s=[...Array.isArray(o?.assets)?o.assets:[],...Array.isArray(o?.fonts)?o.fonts:[]];r.set("pubspec:flutter-assets-and-fonts",AL(s));let a=sLe(s);return X7(r,n.filter(({path:c})=>a.some(l=>c===l||c.startsWith(`${l}/`)))),r}function oLe(e,t){let n=[];e.role!==t.role&&n.push({kind:"signature-changed",symbol:"pub:package-role",detail:`The Pub package role changed from ${e.role} to ${t.role}.`,before:e.role,after:t.role});for(let[r,i]of e.contract){let o=`pub:${e.role}:${r}`;t.contract.has(r)?t.contract.get(r)!==i&&n.push({kind:"signature-changed",symbol:o,detail:`The ${e.role} contract entry ${r} changed in the Pub package.`,before:i,after:t.contract.get(r)}):n.push({kind:"export-removed",symbol:o,detail:`The ${e.role} contract entry ${r} was removed from the Pub package.`,before:i})}return n}function IL(e){let t=e.some(n=>/^(?:lib|bin|assets?)\//i.test(n.path)||/^pubspec\.ya?ml$/i.test(n.path));return e.map(n=>({path:(t?n.path:n.path.replace(/^[^/]+\//,"")).replaceAll("\\","/").replace(/\/$/,""),entry:n}))}function ree(e){let t=IL(e).find(({path:n})=>/^pubspec\.ya?ml$/i.test(n));if(t)try{let n=(0,tee.parse)(t.entry.read().toString("utf8"));return sc(n)?n:void 0}catch{return}}function sLe(e){let t=new Set;for(let n of e){if(typeof n=="string"&&t.add(n.replace(/^\.\//,"").replace(/\/$/,"")),!sc(n))continue;let r=Array.isArray(n.fonts)?n.fonts:[];for(let i of r)sc(i)&&typeof i.asset=="string"&&t.add(i.asset.replace(/^\.\//,""))}return[...t].filter(Boolean)}function X7(e,t){for(let{path:n,entry:r}of[...t].sort((i,o)=>i.path.localeCompare(o.path)))e.set(`file:${n}`,(0,eee.createHash)("sha256").update(r.read()).digest("hex"))}function AL(e){return Array.isArray(e)?`[${e.map(AL).join(",")}]`:sc(e)?`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${AL(e[t])}`).join(",")}}`:JSON.stringify(e)??"null"}function sc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function iee(e){let t=e.some(s=>s.path.startsWith("lib/")),n=new Map;for(let s of e){let a=t?s.path:s.path.replace(/^[^/]+\//,"");a.startsWith("lib/")&&a.endsWith(".dart")&&n.set(a,s)}let r=new Map,i=new Set,o=[...n.keys()].filter(s=>!s.startsWith("lib/src/"));for(;o.length>0;){let s=o.shift();if(i.has(s))continue;i.add(s);let a=n.get(s);if(!a)continue;let c;try{c=a.read().toString("utf8")}catch{continue}for(let l of oee(c))r.has(l.name)||r.set(l.name,l);for(let l of aLe(c)){let u=cLe(s,l);u&&n.has(u)&&o.push(u)}}return r}function aLe(e){let t=[];for(let n of e.matchAll(/^\s*export\s+['"]([^'"]+)['"]/gm)){let r=n[1];r.startsWith("package:")||r.startsWith("dart:")||t.push(r)}return t}function cLe(e,t){let n=[...e.split("/").slice(0,-1),...t.split("/")],r=[];for(let i of n)if(!(i===""||i===".")){if(i===".."){if(r.length===0)return;r.pop();continue}r.push(i)}return r.join("/")}function oee(e){let t=[],n=uLe(e).split(` +`);for(let r=0;r,\s?[\]]+\s+)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(([^)]*)\)\s*(?:async\s*\*?|sync\s*\*)?\s*[{=;]/.exec(i);if(a?.[1]&&!a[1].startsWith("_")&&!see.has(a[1])){t.push({name:a[1],kind:"function",signature:zS(i),members:[],requiredMembers:[]});continue}let c=/^(?:const|final|var|late\s+final|late\s+var)\s+(?:[\w$<>,\s?[\]]+\s+)?([A-Za-z_$][\w$]*)\s*=/.exec(i);c?.[1]&&!c[1].startsWith("_")&&t.push({name:c[1],kind:"variable",signature:zS(i),members:[],requiredMembers:[]})}return t}function lLe(e,t){let n=[],r;for(let i=t+1;i,\s?[\]]+\s+)?(?:get\s+|set\s+)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*[({=;]/.exec(o);a?.[1]&&!a[1].startsWith("_")&&!see.has(a[1])&&n.push(a[1])}return[...new Set(n)]}var see=new Set(["if","for","while","switch","catch","return","assert","super","this","new","await","yield","throw","else","do","try","case","with","is","as","in","on","of","when","get","set","factory","operator","part","import","export","library","typedef","class","enum","mixin","extension","const","final","var","void","late","required","covariant","abstract","static","external"]);function uLe(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").split(` `).map(t=>/^\s*\/\//.test(t)?"":t).join(` -`)}function a_(e){return e.replace(/\s+/g," ").replace(/\s*[{=;]\s*$/,"").trim()}var ul="hex sources",U9=.8,G9={ecosystem:"hex",tool:ul,weight:U9,async compute(e){let t=j9(e,e.from),n=j9(e,e.to);n.catch(()=>{});let i=await t;if(!i.ok)return i.failure;let r=await n;return r.ok?i.api.size===0&&r.api.size===0?ne(ul,"no-public-surface",`${e.name} ships no Elixir or Erlang source Drift could read, so this upgrade rests on prose evidence.`):{available:!0,changes:Dr(i.api,r.api),tool:ul,weight:U9,locator:`${e.name} ${e.from} \u2192 ${e.to} (published sources)`}:r.failure}};async function j9(e,t){let n=`https://repo.hex.pm/tarballs/${encodeURIComponent(e.name)}-${encodeURIComponent(t)}.tar`,i;try{let o=await Bt(n,{timeoutMs:e.timeoutMs});if(!o.ok&&o.status===0)throw new Error(o.error??"the request failed");if(!o.ok)return{ok:!1,failure:ne(ul,"version-unavailable",o.status===404?`Hex has no release for ${e.name} ${t}. It may have been retired, or published to a private repository.`:`Hex returned ${o.status} for ${e.name} ${t}.`)};i=Fn(o.bytes)}catch(o){return{ok:!1,failure:ne(ul,"toolchain-failed",`Could not read ${e.name} ${t} from Hex: ${o.message}`)}}let r=i.find(o=>o.path==="contents.tar.gz"||o.path.endsWith("/contents.tar.gz"));if(!r)return{ok:!1,failure:ne(ul,"parse-failed",`${e.name} ${t} is not in the layout Hex tarballs use, so Drift could not read its sources.`)};try{return{ok:!0,api:V9(Fn(r.read()))}}catch(o){return{ok:!1,failure:ne(ul,"parse-failed",`Could not unpack ${e.name} ${t}: ${o.message}`)}}}function V9(e){let t=new Map;for(let n of e){if(!/^(lib|src)\//.test(n.path))continue;let i;try{i=n.read().toString("utf8")}catch{continue}if(/\.ex$/.test(n.path)){for(let[r,o]of B9(i))z9(t,r,o,`defmodule ${r}`);continue}if(/\.erl$/.test(n.path)){let r=/^\s*-module\(\s*'?([a-z][\w]*)'?\s*\)/m.exec(i)?.[1];r&&z9(t,r,q9(i),`-module(${r})`)}}return t}function z9(e,t,n,i){let r=e.get(t);if(r){r.members=[...new Set([...r.members,...n])];return}e.set(t,{name:t,kind:"class",signature:i,members:n,requiredMembers:[]})}function B9(e){let t=new Map,n=[],i=e.split(` -`),r=!1,o=(s,a)=>{for(;n.length>0&&n[n.length-1].indent>=s;)n.pop();n.push({indent:s,name:a})};for(let s=0;s0&&n[n.length-1].indent>=m;)n.pop();let g=n[n.length-1]?.name,h=g?`${g}.${l[2]}`:l[2];o(m,h),t.has(h)||t.set(h,[]);continue}let u=/^(\s*)defimpl\s+/.exec(a);if(u){o(u[1].length,null);continue}let d=/^(\s*)(?:def|defmacro|defguard|defdelegate)\s+([a-z_][\w]*[!?]?)\s*(\(|,|\s+when\b|\s+do\b|\s*$)/.exec(a);if(!d)continue;let p=d[1].length;for(;n.length>0&&n[n.length-1].indent>=p;)n.pop();let f=n[n.length-1]?.name;if(f)for(let m of MNe(i,s,d[3]==="("))t.get(f)?.push(`${d[2]}/${m}`)}for(let[s,a]of t)t.set(s,[...new Set(a)]);return t}function MNe(e,t,n){if(!n)return[0];let i=e[t].indexOf("("),r="",o=0,s=!1;e:for(let u=t;u=1&&(r+=f)}r+=" "}if(!s)return[0];let a=LNe(r);if(a.length===0)return[0];let c=a.filter(u=>!u.includes("\\\\")).length,l=a.length;return Array.from({length:l-c+1},(u,d)=>c+d)}function LNe(e){let t=e.trim();if(t==="")return[];let n=[],i=0,r="";for(let o of t){if(o==="("||o==="["||o==="{"||o==="<"?i+=1:(o===")"||o==="]"||o==="}"||o===">")&&(i-=1),o===","&&i===0){n.push(r),r="";continue}r+=o}return n.push(r),n.map(o=>o.trim()).filter(o=>o!=="")}function q9(e){let t=[];for(let n of e.matchAll(/-export\(\s*\[([\s\S]*?)\]\s*\)/g))for(let i of n[1].split(",")){let r=/([a-z_][\w]*)\s*\/\s*(\d+)/.exec(i);r&&t.push(`${r[1]}/${r[2]}`)}return[...new Set(t)]}var FNe=[dY,IY,HY,p9,r9,i9,n9,T9,D9,G9];function UNe(e){return FNe.find(t=>t.ecosystem===e)}var jNe=18e4;async function K9(e,t){let n=UNe(e.ecosystem);if(!n)return ne("none","unsupported-ecosystem",`Drift has no computed API-surface diff for ${e.ecosystem}; this upgrade rests on prose evidence alone.`);if(!e.from||!e.to)return ne(n.tool,"version-unavailable",`${e.name} has no pair of versions to compare.`);let i=await(0,c_.mkdtemp)((0,H9.join)((0,W9.tmpdir)(),"drift-surface-"));try{return await En("surface",e.name,()=>n.compute({name:e.name,from:e.from,to:e.to,exec:t.exec??Xe,workdir:i,logger:t.logger,...t.env?{env:t.env}:{},timeoutMs:t.timeoutMs??jNe,...t.readRepoFile?{readRepoFile:t.readRepoFile}:{},...e.manifestPath?{manifestPath:e.manifestPath}:{},...t.autoInstall?{autoInstall:!0}:{}}),{ecosystem:e.ecosystem})}catch(r){return t.logger.debug(`Surface diff crashed for ${e.name}: ${r.message}`),ne(n.tool,"toolchain-failed",`Drift could not compare ${e.name}: ${r.message}`)}finally{await(0,c_.rm)(i,{recursive:!0,force:!0}).catch(()=>{})}}var X9=require("node:fs/promises"),e5=require("node:path"),_i={"type-surface-diff":1,...u8,"migration-guide":.8,"github-release":.7,changelog:.65,"registry-metadata":.4,"semver-heuristic":.25};async function t5(e,t){let n=await qn(e,4,r=>n5(r,t)),i=await KNe(t);return[...n.flat(),...i]}async function n5(e,t){let{config:n,logger:i}=t,r=[],o=y=>e.workspace===void 0?y:y.map(w=>({...w,workspace:e.workspace})),s=QNe(e);if(s&&r.push({id:St("ev",e.name,"semver",e.from,e.to),source:"semver-heuristic",dependency:e.name,url:YNe(e),title:`${e.name} ${e.from} \u2192 ${e.to} (${e.bump})`,content:s,weight:_i["semver-heuristic"]}),!e.from||!e.to)return o(r);let a=ca(e.name,e.ecosystem,e.from).catch(()=>null),c=await Wn(e.name,e.ecosystem,e.to),[l,u]=await Promise.all([a,ca(e.name,e.ecosystem,e.to).catch(()=>null)]);c?.deprecated&&r.push({id:St("ev",e.name,"deprecated",e.to),source:"registry-metadata",dependency:e.name,url:c.homepage??void 0,title:`${e.name}@${e.to} is deprecated`,content:c.deprecated,weight:_i["registry-metadata"]});let d=zNe(l?.runtime??null,u?.runtime??null);d&&r.push({id:St("ev",e.name,"runtime-metadata",e.to,d.runtime,d.requirement),source:"registry-metadata",dependency:e.name,url:c?.homepage??void 0,title:`${e.name}@${e.to} requires ${d.runtime} ${d.requirement}`,content:`${e.name}@${e.to} requires ${d.runtime} ${d.requirement}.`,weight:_i["registry-metadata"]});let p=c?.githubRepo,f=n.evidence.typeSurface?VNe(e,t):null,m=p&&n.evidence.githubReleases?_K(p,e.from,e.to,e.ecosystem,{token:t.githubToken,maxReleases:n.evidence.maxReleases}):null,g=n.evidence.changelog&&(c?.changelogUrl||p)?(async()=>{if(c?.changelogUrl){let y=await vK(c.changelogUrl,p??null,e.from,e.to,e.ecosystem);if(y.length>0)return y}return p?bK(p,e.from,e.to,e.ecosystem):[]})():null,h=p&&n.evidence.changelog?kK(p):null;for(let y of[f,m,g,h])y?.catch(()=>{});let b=f?await f:null;if(b&&r.push(b),!p&&!g)return i.debug(`No source repository or declared changelog resolved for ${e.name}; prose evidence unavailable`),o(r);if(m){let y=await m;for(let w of y){let k=Fg(w.body);t.onProseConsulted?.(e,{kind:"github-release",label:`${w.name??w.tag} release notes`,url:w.url,breaking:k.length>0}),k.length!==0&&r.push({id:St("ev",e.name,"release",w.tag),source:"github-release",dependency:e.name,url:w.url,title:`${e.name} ${w.name??w.tag} release notes`,content:k.join(` +`)}function zS(e){return e.replace(/\s+/g," ").replace(/\s*[{=;]\s*$/,"").trim()}var Cl="hex sources",aee=.8,uee={ecosystem:"hex",tool:Cl,weight:aee,async compute(e){let t=cee(e,e.from),n=cee(e,e.to);n.catch(()=>{});let r=await t;if(!r.ok)return r.failure;let i=await n;return i.ok?r.api.size===0&&i.api.size===0?ae(Cl,"no-public-surface",`${e.name} ships no Elixir or Erlang source Drift could read, so this upgrade rests on prose evidence.`):{available:!0,changes:Br(r.api,i.api),tool:Cl,weight:aee,locator:`${e.name} ${e.from} \u2192 ${e.to} (published sources)`}:i.failure}};async function cee(e,t){let n=`https://repo.hex.pm/tarballs/${encodeURIComponent(e.name)}-${encodeURIComponent(t)}.tar`,r;try{let o=await Jt(n,{timeoutMs:e.timeoutMs});if(!o.ok&&o.status===0)throw new Error(o.error??"the request failed");if(!o.ok)return{ok:!1,failure:ae(Cl,"version-unavailable",o.status===404?`Hex has no release for ${e.name} ${t}. It may have been retired, or published to a private repository.`:`Hex returned ${o.status} for ${e.name} ${t}.`)};r=Bn(o.bytes)}catch(o){return{ok:!1,failure:ae(Cl,"toolchain-failed",`Could not read ${e.name} ${t} from Hex: ${o.message}`)}}let i=r.find(o=>o.path==="contents.tar.gz"||o.path.endsWith("/contents.tar.gz"));if(!i)return{ok:!1,failure:ae(Cl,"parse-failed",`${e.name} ${t} is not in the layout Hex tarballs use, so Drift could not read its sources.`)};try{return{ok:!0,api:dee(Bn(i.read()))}}catch(o){return{ok:!1,failure:ae(Cl,"parse-failed",`Could not unpack ${e.name} ${t}: ${o.message}`)}}}function dee(e){let t=new Map;for(let n of e){if(!/^(lib|src)\//.test(n.path))continue;let r;try{r=n.read().toString("utf8")}catch{continue}if(/\.ex$/.test(n.path)){for(let[i,o]of pee(r))lee(t,i,o,`defmodule ${i}`);continue}if(/\.erl$/.test(n.path)){let i=/^\s*-module\(\s*'?([a-z][\w]*)'?\s*\)/m.exec(r)?.[1];i&&lee(t,i,fee(r),`-module(${i})`)}}return t}function lee(e,t,n,r){let i=e.get(t);if(i){i.members=[...new Set([...i.members,...n])];return}e.set(t,{name:t,kind:"class",signature:r,members:n,requiredMembers:[]})}function pee(e){let t=new Map,n=[],r=e.split(` +`),i=!1,o=(s,a)=>{for(;n.length>0&&n[n.length-1].indent>=s;)n.pop();n.push({indent:s,name:a})};for(let s=0;s0&&n[n.length-1].indent>=m;)n.pop();let g=n[n.length-1]?.name,h=g?`${g}.${l[2]}`:l[2];o(m,h),t.has(h)||t.set(h,[]);continue}let u=/^(\s*)defimpl\s+/.exec(a);if(u){o(u[1].length,null);continue}let d=/^(\s*)(?:def|defmacro|defguard|defdelegate)\s+([a-z_][\w]*[!?]?)\s*(\(|,|\s+when\b|\s+do\b|\s*$)/.exec(a);if(!d)continue;let p=d[1].length;for(;n.length>0&&n[n.length-1].indent>=p;)n.pop();let f=n[n.length-1]?.name;if(f)for(let m of dLe(r,s,d[3]==="("))t.get(f)?.push(`${d[2]}/${m}`)}for(let[s,a]of t)t.set(s,[...new Set(a)]);return t}function dLe(e,t,n){if(!n)return[0];let r=e[t].indexOf("("),i="",o=0,s=!1;e:for(let u=t;u=1&&(i+=f)}i+=" "}if(!s)return[0];let a=pLe(i);if(a.length===0)return[0];let c=a.filter(u=>!u.includes("\\\\")).length,l=a.length;return Array.from({length:l-c+1},(u,d)=>c+d)}function pLe(e){let t=e.trim();if(t==="")return[];let n=[],r=0,i="";for(let o of t){if(o==="("||o==="["||o==="{"||o==="<"?r+=1:(o===")"||o==="]"||o==="}"||o===">")&&(r-=1),o===","&&r===0){n.push(i),i="";continue}i+=o}return n.push(i),n.map(o=>o.trim()).filter(o=>o!=="")}function fee(e){let t=[];for(let n of e.matchAll(/-export\(\s*\[([\s\S]*?)\]\s*\)/g))for(let r of n[1].split(",")){let i=/([a-z_][\w]*)\s*\/\s*(\d+)/.exec(r);i&&t.push(`${i[1]}/${i[2]}`)}return[...new Set(t)]}var fLe=[NX,ZX,g7,O7,x7,E7,S7,J7,nee,uee];function mLe(e){return fLe.find(t=>t.ecosystem===e)}var gLe=18e4;async function hee(e,t){let n=mLe(e.ecosystem);if(!n)return ae("none","unsupported-ecosystem",`Drift has no computed API-surface diff for ${e.ecosystem}; this upgrade rests on prose evidence alone.`);if(!e.from||!e.to)return ae(n.tool,"version-unavailable",`${e.name} has no pair of versions to compare.`);let r=await(0,GS.mkdtemp)((0,gee.join)((0,mee.tmpdir)(),"drift-surface-"));try{return await Rn("surface",e.name,()=>n.compute({name:e.name,from:e.from,to:e.to,exec:t.exec??et,workdir:r,logger:t.logger,...t.env?{env:t.env}:{},timeoutMs:t.timeoutMs??gLe,...t.readRepoFile?{readRepoFile:t.readRepoFile}:{},...e.manifestPath?{manifestPath:e.manifestPath}:{},...t.autoInstall?{autoInstall:!0}:{}}),{ecosystem:e.ecosystem})}catch(i){return t.logger.debug(`Surface diff crashed for ${e.name}: ${i.message}`),ae(n.tool,"toolchain-failed",`Drift could not compare ${e.name}: ${i.message}`)}finally{await(0,GS.rm)(r,{recursive:!0,force:!0}).catch(()=>{})}}var wee=require("node:fs/promises"),kee=require("node:path"),zi={"type-surface-diff":1,...CQ,"migration-guide":.8,"github-release":.7,changelog:.65,"registry-metadata":.4,"semver-heuristic":.25};async function $ee(e,t){let n=await Yn(e,4,i=>See(i,t)),r=await $Le(t);return[...n.flat(),...r]}async function See(e,t){let{config:n,logger:r}=t,i=[],o=b=>e.workspace===void 0?b:b.map(_=>({..._,workspace:e.workspace})),s=TLe(e);if(s&&i.push({id:Pt("ev",e.name,"semver",e.from,e.to),source:"semver-heuristic",dependency:e.name,url:ELe(e),title:`${e.name} ${e.from} \u2192 ${e.to} (${e.bump})`,content:s,weight:zi["semver-heuristic"]}),!e.from||!e.to)return o(i);let a=Da(e.name,e.ecosystem,e.from).catch(()=>null),c=await Qn(e.name,e.ecosystem,e.to),[l,u]=await Promise.all([a,Da(e.name,e.ecosystem,e.to).catch(()=>null)]);c?.deprecated&&i.push({id:Pt("ev",e.name,"deprecated",e.to),source:"registry-metadata",dependency:e.name,url:c.homepage??void 0,title:`${e.name}@${e.to} is deprecated`,content:c.deprecated,weight:zi["registry-metadata"]});let d=hLe(l?.runtime??null,u?.runtime??null);d&&i.push({id:Pt("ev",e.name,"runtime-metadata",e.to,d.runtime,d.requirement),source:"registry-metadata",dependency:e.name,url:c?.homepage??void 0,title:`${e.name}@${e.to} requires ${d.runtime} ${d.requirement}`,content:`${e.name}@${e.to} requires ${d.runtime} ${d.requirement}.`,weight:zi["registry-metadata"]});let p=c?.githubRepo,f=n.evidence.typeSurface?bLe(e,t):null,m=p&&n.evidence.githubReleases?q8(p,e.from,e.to,e.ecosystem,{token:t.githubToken,maxReleases:n.evidence.maxReleases}):null,g=n.evidence.changelog&&(c?.changelogUrl||p)?(async()=>{if(c?.changelogUrl){let b=await z8(c.changelogUrl,p??null,e.from,e.to,e.ecosystem);if(b.length>0)return b}return p?j8(p,e.from,e.to,e.ecosystem):[]})():null,h=p&&n.evidence.changelog?B8(p):null;for(let b of[f,m,g,h])b?.catch(()=>{});let v=f?await f:null;if(v&&i.push(v),!p&&!g)return r.debug(`No source repository or declared changelog resolved for ${e.name}; prose evidence unavailable`),o(i);if(m){let b=await m;for(let _ of b){let w=Wh(_.body);t.onProseConsulted?.(e,{kind:"github-release",label:`${_.name??_.tag} release notes`,url:_.url,breaking:w.length>0}),w.length!==0&&i.push({id:Pt("ev",e.name,"release",_.tag),source:"github-release",dependency:e.name,url:_.url,title:`${e.name} ${_.name??_.tag} release notes`,content:w.join(` -`),weight:_i["github-release"]})}}if(g){let y=await g;for(let w of y){let k=DP(PP(w.content,e.ecosystem),e.from,e.to,e.ecosystem),_=k.some(S=>Fg(S.body).length>0);t.onProseConsulted?.(e,{kind:"changelog",label:w.path,url:w.url,breaking:_});for(let S of k){let x=Fg(S.body);x.length!==0&&r.push({id:St("ev",e.name,"changelog",w.path,S.version),source:"changelog",dependency:e.name,url:`${w.url}#L${S.line}`,locator:`${w.path}:${S.line}`,title:`${e.name} CHANGELOG \xA7 ${S.version}`,content:x.join(` +`),weight:zi["github-release"]})}}if(g){let b=await g;for(let _ of b){let w=xM(SM(_.content,e.ecosystem),e.from,e.to,e.ecosystem),k=w.some(x=>Wh(x.body).length>0);t.onProseConsulted?.(e,{kind:"changelog",label:_.path,url:_.url,breaking:k});for(let x of w){let A=Wh(x.body);A.length!==0&&i.push({id:Pt("ev",e.name,"changelog",_.path,x.version),source:"changelog",dependency:e.name,url:`${_.url}#L${x.line}`,locator:`${_.path}:${x.line}`,title:`${e.name} CHANGELOG \xA7 ${x.version}`,content:A.join(` -`),weight:_i.changelog})}}}if(h)for(let y of await h){let w=Fg(y.content);t.onProseConsulted?.(e,{kind:"migration-guide",label:y.path,url:y.url,breaking:w.length>0}),w.length!==0&&r.push({id:St("ev",e.name,"migration",y.path),source:"migration-guide",dependency:e.name,url:y.url,locator:y.path,title:`${e.name} migration guide (${y.path})`,content:w.slice(0,200).join(` +`),weight:zi.changelog})}}}if(h)for(let b of await h){let _=Wh(b.content);t.onProseConsulted?.(e,{kind:"migration-guide",label:b.path,url:b.url,breaking:_.length>0}),_.length!==0&&i.push({id:Pt("ev",e.name,"migration",b.path),source:"migration-guide",dependency:e.name,url:b.url,locator:b.path,title:`${e.name} migration guide (${b.path})`,content:_.slice(0,200).join(` -`),weight:_i["migration-guide"]})}return o(r)}async function UO(e,t){return n5(e,t)}var J9={node:"Node.js","node.js":"Node.js",nodejs:"Node.js",python:"Python",go:"Go",ruby:"Ruby",java:"Java",rust:"Rust"};function zNe(e,t){if(!t?.requirement)return null;let n=J9[t.name.toLowerCase()];if(!n)return null;let i=t.requirement.trim();if(!i)return null;if(!(e&&J9[e.name.toLowerCase()]===n))return{runtime:n,requirement:i};let o=c=>{let l=/(\d+(?:\.\d+)*)/.exec(c)?.[1];return l?l.split(".").map(u=>Number(u)):null},[s,a]=[o(e.requirement),o(i)];if(!s||!a)return null;for(let c=0;cu)return{runtime:n,requirement:i};if(l(n.debug(`Package module metadata diff failed for ${e.name}: ${l.message}`),[])),WNe(e.name,i,r,n)]);if(!a)return s.length>0?(t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name} publishes no TypeScript declarations Drift could compare, though its package.json changed between versions \u2014 that metadata-level change is counted below, but nothing about its public API could be verified.`)),Th(e,{changes:s,weight:_i["type-surface-diff"],locator:`${e.name}@${i}:package.json \u2192 ${e.name}@${r}:package.json`,url:$i(e.name,r,"package.json"),beforeUrl:$i(e.name,i,"package.json"),afterUrl:$i(e.name,r,"package.json")})):(t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name} publishes no TypeScript declarations Drift could compare, so this upgrade rests on prose evidence.`)),null);if(a.comparisonFailed){let l=`Comparing ${e.name}'s TypeScript declarations failed unexpectedly (${a.comparisonFailed}). This does not mean ${e.name} publishes no declarations.`;return s.length>0?(t.onUnavailableSurface?.(e,ne("TypeScript declarations","toolchain-failed",l)),Th(e,{changes:s,weight:_i["type-surface-diff"],locator:`${e.name}@${i}:package.json \u2192 ${e.name}@${r}:package.json`,url:$i(e.name,r,"package.json"),beforeUrl:$i(e.name,i,"package.json"),afterUrl:$i(e.name,r,"package.json")})):(t.onUnavailableSurface?.(e,ne("TypeScript declarations","toolchain-failed",l)),null)}if(a.artifactUnavailable){let l=`${a.artifactUnavailable} could not be obtained and inspected from either jsDelivr or the exact npm registry tarball. This is an artifact availability failure, not proof that the package publishes no declarations.`;return t.onUnavailableSurface?.(e,ne("TypeScript declarations","artifact-unavailable",l)),s.length>0?Th(e,{changes:s,weight:_i["type-surface-diff"],locator:`${e.name}@${i}:package.json \u2192 ${e.name}@${r}:package.json`,url:$i(e.name,r,"package.json"),beforeUrl:$i(e.name,i,"package.json"),afterUrl:$i(e.name,r,"package.json")}):null}if(a.unreachable)return t.onUnavailableSurface?.(e,ne("TypeScript declarations","version-unavailable",`${a.unreachable} could not be fetched, so nothing was compared. That version may have been unpublished, or the CDN may not carry it.`)),null;if(a.definitelyTyped)return t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name} ships no declarations of its own; its types live in @types/${e.name.replace(/^@/,"").replace("/","__")}, which versions separately and does not move with this upgrade. Nothing was compared.`)),null;let c=[...s,...a.changes];return c.length===0?(a.comparable?t.onSurfaceComputed?.(e,{available:!0,changes:[],tool:"jsdelivr-dts-diff",weight:_i["type-surface-diff"],locator:`${e.name}@${i}:${a.beforeEntryPath} \u2192 ${e.name}@${r}:${a.afterEntryPath}`}):t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name}'s public API is neither in its own declarations nor in any dependency Drift could follow, so comparing its declarations proves nothing about this upgrade.`)),null):Th(e,{changes:c,weight:GNe(a)?_i["type-surface-diff"]*.9:_i["type-surface-diff"],locator:`${e.name}@${i}:${a.beforeEntryPath} + package.json \u2192 ${e.name}@${r}:${a.afterEntryPath} + package.json`,url:$i(e.name,r,a.afterEntryPath),beforeUrl:$i(e.name,i,a.beforeEntryPath),afterUrl:$i(e.name,r,a.afterEntryPath)})}let o=await K9(e,{logger:n,exec:t.exec,env:t.env,readRepoFile:BNe(t),autoInstall:t.config.tools.autoInstall});return o.available?(t.onSurfaceComputed?.(e,o),o.changes.length===0?null:Th(e,{changes:o.changes,weight:o.weight,locator:`${o.locator} \xB7 computed by ${o.tool}`,...o.packageRole?{packageRole:o.packageRole}:{}})):(n.debug(`No computed surface for ${e.name}: ${o.detail}`),t.onUnavailableSurface?.(e,o),null)}function BNe(e){let{workspaceRoot:t,readRepoFile:n,afterSha:i}=e;if(t)return async r=>(0,X9.readFile)((0,e5.join)(t,r),"utf8").catch(()=>null);if(n&&i)return r=>n(r,i).catch(()=>null)}function Th(e,t){let n=t.beforeUrl||t.afterUrl?["Declaration sources:",t.beforeUrl?`- before: ${t.beforeUrl}`:"",t.afterUrl?`- after: ${t.afterUrl}`:"",""].filter(Boolean).join(` -`):"";return{id:St("ev",e.name,"surface",e.from??"",e.to??""),source:"type-surface-diff",dependency:e.name,url:t.url,locator:t.locator,title:`${t.changes.length} ${qNe(t.packageRole)} change(s) in ${e.name}`,content:`${n}${HNe(t.changes)}`,findings:t.changes.map(i=>({code:i.kind,symbol:i.symbol,detail:i.detail,before:i.before,after:i.after,...i.changed?{changed:i.changed}:{},...i.replacement?{replacement:i.replacement}:{},...i.fromKind?{fromKind:i.fromKind}:{},...i.toKind?{toKind:i.toKind}:{},...i.moduleSystem?{moduleSystem:{...i.moduleSystem,incompatibleUsage:[...i.moduleSystem.incompatibleUsage],...i.moduleSystem.affectedSpecifiers?{affectedSpecifiers:[...i.moduleSystem.affectedSpecifiers]}:{},...i.moduleSystem.affectedSpecifierPatterns?{affectedSpecifierPatterns:[...i.moduleSystem.affectedSpecifierPatterns]}:{}}}:{}})),weight:t.weight}}function qNe(e){switch(e){case"pom":return"Maven POM contract";case"analyzer":case"msbuild":case"tool":case"meta-package":return"NuGet package contract";case"asset":case"tooling":return"Pub package contract";default:return"API surface"}}var Z9=3;async function WNe(e,t,n,i){try{let[r,o]=await Promise.all([tl(e,t),tl(e,n)]);if(!r||!o)return null;(r.viaDependencies.length>0||o.viaDependencies.length>0)&&i.debug(`${e} surface includes ${[...new Set([...r.viaDependencies,...o.viaDependencies])].join(", ")}`);let s=Q8(e,r,o),a=Dr(r.api,o.api,{beforeComplete:!r.incomplete,afterComplete:!o.incomplete,packageName:e}),c=r.entryPath.startsWith("@types:")&&o.entryPath.startsWith("@types:")&&r.entryPath===o.entryPath;return{changes:s?[s,...a]:a,comparable:r.api.size>=Z9&&o.api.size>=Z9,beforeEntryPath:r.entryPath,afterEntryPath:o.entryPath,...c?{definitelyTyped:c}:{}}}catch(r){return i.debug(`Type surface diff failed for ${e}: ${r.message}`),r instanceof Y$?{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",unreachable:`${r.packageName}@${r.version}`}:r instanceof Kd?{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",artifactUnavailable:`${r.packageName}@${r.version}`}:{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",comparisonFailed:r.message}}}function $i(e,t,n){if(!(!n||n.startsWith("@types:")))return`https://cdn.jsdelivr.net/npm/${e}@${t}/${n}`}function Y9(e){return XNe(e.replace(/\s+/g," ").trim(),4e3)}function HNe(e){let n=e.slice(0,60).map(i=>{let r=[`- ${i.detail}`];return i.before&&i.after&&(r.push(` before: ${Y9(i.before)}`),r.push(` after: ${Y9(i.after)}`)),r.join(` +`),weight:zi["migration-guide"]})}return o(i)}async function RL(e,t){return See(e,t)}var yee={node:"Node.js","node.js":"Node.js",nodejs:"Node.js",python:"Python",go:"Go",ruby:"Ruby",java:"Java",rust:"Rust"};function hLe(e,t){if(!t?.requirement)return null;let n=yee[t.name.toLowerCase()];if(!n)return null;let r=t.requirement.trim();if(!r)return null;if(!(e&&yee[e.name.toLowerCase()]===n))return{runtime:n,requirement:r};let o=c=>{let l=/(\d+(?:\.\d+)*)/.exec(c)?.[1];return l?l.split(".").map(u=>Number(u)):null},[s,a]=[o(e.requirement),o(r)];if(!s||!a)return null;for(let c=0;cu)return{runtime:n,requirement:r};if(l(n.debug(`Package module metadata diff failed for ${e.name}: ${l.message}`),[])),wLe(e.name,r,i,n)]);if(!a)return s.length>0?(t.onUnavailableSurface?.(e,ae("TypeScript declarations","no-public-surface",`${e.name} publishes no TypeScript declarations Drift could compare, though its package.json changed between versions \u2014 that metadata-level change is counted below, but nothing about its public API could be verified.`)),Dy(e,{changes:s,weight:zi["type-surface-diff"],locator:`${e.name}@${r}:package.json \u2192 ${e.name}@${i}:package.json`,url:ji(e.name,i,"package.json"),beforeUrl:ji(e.name,r,"package.json"),afterUrl:ji(e.name,i,"package.json")})):(t.onUnavailableSurface?.(e,ae("TypeScript declarations","no-public-surface",`${e.name} publishes no TypeScript declarations Drift could compare, so this upgrade rests on prose evidence.`)),null);if(a.comparisonFailed){let l=`Comparing ${e.name}'s TypeScript declarations failed unexpectedly (${a.comparisonFailed}). This does not mean ${e.name} publishes no declarations.`;return s.length>0?(t.onUnavailableSurface?.(e,ae("TypeScript declarations","toolchain-failed",l)),Dy(e,{changes:s,weight:zi["type-surface-diff"],locator:`${e.name}@${r}:package.json \u2192 ${e.name}@${i}:package.json`,url:ji(e.name,i,"package.json"),beforeUrl:ji(e.name,r,"package.json"),afterUrl:ji(e.name,i,"package.json")})):(t.onUnavailableSurface?.(e,ae("TypeScript declarations","toolchain-failed",l)),null)}if(a.artifactUnavailable){let l=`${a.artifactUnavailable} could not be obtained and inspected from either jsDelivr or the exact npm registry tarball. This is an artifact availability failure, not proof that the package publishes no declarations.`;return t.onUnavailableSurface?.(e,ae("TypeScript declarations","artifact-unavailable",l)),s.length>0?Dy(e,{changes:s,weight:zi["type-surface-diff"],locator:`${e.name}@${r}:package.json \u2192 ${e.name}@${i}:package.json`,url:ji(e.name,i,"package.json"),beforeUrl:ji(e.name,r,"package.json"),afterUrl:ji(e.name,i,"package.json")}):null}if(a.unreachable)return t.onUnavailableSurface?.(e,ae("TypeScript declarations","version-unavailable",`${a.unreachable} could not be fetched, so nothing was compared. That version may have been unpublished, or the CDN may not carry it.`)),null;if(a.definitelyTyped)return t.onUnavailableSurface?.(e,ae("TypeScript declarations","no-public-surface",`${e.name} ships no declarations of its own; its types live in @types/${e.name.replace(/^@/,"").replace("/","__")}, which versions separately and does not move with this upgrade. Nothing was compared.`)),null;let c=[...s,...a.changes];return c.length===0?(a.comparable?t.onSurfaceComputed?.(e,{available:!0,changes:[],tool:"jsdelivr-dts-diff",weight:zi["type-surface-diff"],locator:`${e.name}@${r}:${a.beforeEntryPath} \u2192 ${e.name}@${i}:${a.afterEntryPath}`}):t.onUnavailableSurface?.(e,ae("TypeScript declarations","no-public-surface",`${e.name}'s public API is neither in its own declarations nor in any dependency Drift could follow, so comparing its declarations proves nothing about this upgrade.`)),null):Dy(e,{changes:c,weight:yLe(a)?zi["type-surface-diff"]*.9:zi["type-surface-diff"],locator:`${e.name}@${r}:${a.beforeEntryPath} + package.json \u2192 ${e.name}@${i}:${a.afterEntryPath} + package.json`,url:ji(e.name,i,a.afterEntryPath),beforeUrl:ji(e.name,r,a.beforeEntryPath),afterUrl:ji(e.name,i,a.afterEntryPath)})}let o=await hee(e,{logger:n,exec:t.exec,env:t.env,readRepoFile:vLe(t),autoInstall:t.config.tools.autoInstall});return o.available?(t.onSurfaceComputed?.(e,o),o.changes.length===0?null:Dy(e,{changes:o.changes,weight:o.weight,locator:`${o.locator} \xB7 computed by ${o.tool}`,...o.packageRole?{packageRole:o.packageRole}:{}})):(n.debug(`No computed surface for ${e.name}: ${o.detail}`),t.onUnavailableSurface?.(e,o),null)}function vLe(e){let{workspaceRoot:t,readRepoFile:n,afterSha:r}=e;if(t)return async i=>(0,wee.readFile)((0,kee.join)(t,i),"utf8").catch(()=>null);if(n&&r)return i=>n(i,r).catch(()=>null)}function Dy(e,t){let n=t.beforeUrl||t.afterUrl?["Declaration sources:",t.beforeUrl?`- before: ${t.beforeUrl}`:"",t.afterUrl?`- after: ${t.afterUrl}`:"",""].filter(Boolean).join(` +`):"";return{id:Pt("ev",e.name,"surface",e.from??"",e.to??""),source:"type-surface-diff",dependency:e.name,url:t.url,locator:t.locator,title:`${t.changes.length} ${_Le(t.packageRole)} change(s) in ${e.name}`,content:`${n}${kLe(t.changes)}`,findings:t.changes.map(r=>({code:r.kind,symbol:r.symbol,detail:r.detail,before:r.before,after:r.after,...r.changed?{changed:r.changed}:{},...r.replacement?{replacement:r.replacement}:{},...r.fromKind?{fromKind:r.fromKind}:{},...r.toKind?{toKind:r.toKind}:{},...r.moduleSystem?{moduleSystem:{...r.moduleSystem,incompatibleUsage:[...r.moduleSystem.incompatibleUsage],...r.moduleSystem.affectedSpecifiers?{affectedSpecifiers:[...r.moduleSystem.affectedSpecifiers]}:{},...r.moduleSystem.affectedSpecifierPatterns?{affectedSpecifierPatterns:[...r.moduleSystem.affectedSpecifierPatterns]}:{}}}:{}})),weight:t.weight}}function _Le(e){switch(e){case"pom":return"Maven POM contract";case"analyzer":case"msbuild":case"tool":case"meta-package":return"NuGet package contract";case"asset":case"tooling":return"Pub package contract";default:return"API surface"}}var bee=3;async function wLe(e,t,n,r){try{let[i,o]=await Promise.all([$l(e,t),$l(e,n)]);if(!i||!o)return null;(i.viaDependencies.length>0||o.viaDependencies.length>0)&&r.debug(`${e} surface includes ${[...new Set([...i.viaDependencies,...o.viaDependencies])].join(", ")}`);let s=_X(e,i,o),a=Br(i.api,o.api,{beforeComplete:!i.incomplete,afterComplete:!o.incomplete,packageName:e}),c=i.entryPath.startsWith("@types:")&&o.entryPath.startsWith("@types:")&&i.entryPath===o.entryPath;return{changes:s?[s,...a]:a,comparable:i.api.size>=bee&&o.api.size>=bee,beforeEntryPath:i.entryPath,afterEntryPath:o.entryPath,...c?{definitelyTyped:c}:{}}}catch(i){return r.debug(`Type surface diff failed for ${e}: ${i.message}`),i instanceof PS?{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",unreachable:`${i.packageName}@${i.version}`}:i instanceof bp?{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",artifactUnavailable:`${i.packageName}@${i.version}`}:{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",comparisonFailed:i.message}}}function ji(e,t,n){if(!(!n||n.startsWith("@types:")))return`https://cdn.jsdelivr.net/npm/${e}@${t}/${n}`}function vee(e){return ALe(e.replace(/\s+/g," ").trim(),4e3)}function kLe(e){let n=e.slice(0,60).map(r=>{let i=[`- ${r.detail}`];return r.before&&r.after&&(i.push(` before: ${vee(r.before)}`),i.push(` after: ${vee(r.after)}`)),i.join(` `)});return e.length>60&&n.push(`- \u2026and ${e.length-60} more`),n.join(` -`)}async function KNe(e){let{config:t,logger:n,readRepoFile:i,beforeSha:r,afterSha:o}=e;if(!i||!r||!o)return[];let s=[];for(let a of el){if(!p8(a,t))continue;let c=await JNe(f8(a,t),e);for(let u of c.unresolvable)e.onUnavailableSpec?.(u,{available:!1,reason:"toolchain-failed",detail:`Drift could not list the files in this repository, so the pattern \`${u}\` could not be expanded and the contracts it covers were not compared.`,remedy:"List the contract documents by literal path instead of by pattern.",tool:a.tool});let l=[];for(let u of c.paths){let[d,p]=await Promise.all([i(u,r),i(u,o)]);!d||!p||a.handles(u,p)&&l.push({path:u,before:d,after:p})}for(let u of l){let d=u.path;if(u.before===u.after)continue;let p=await m8(a,u,{logger:n,exec:e.exec,env:e.env,siblings:l.filter(f=>f.path!==d)});if(!p.available){n.debug(`No ${a.id} diff for ${d}: ${p.detail}`),e.onUnavailableSpec?.(d,p);continue}e.onSpecComputed?.(d,a),p.changes.length!==0&&s.push({id:St("ev",d,a.id,o),source:a.source,dependency:d,locator:d,title:`${p.changes.length} breaking change(s) in ${d}`,content:ZNe(p.changes),findings:p.changes.map(f=>({code:f.code,symbol:f.location,detail:f.detail,...f.before!==void 0?{before:f.before}:{},...f.after!==void 0?{after:f.after}:{}})),weight:p.weight})}}return s}async function JNe(e,t){let n=e.filter(Q9),i=e.filter(s=>!Q9(s));if(n.length===0)return{paths:i,unresolvable:[]};let r=t.listRepoFiles&&t.afterSha?await t.listRepoFiles(t.afterSha):null;if(!r)return{paths:i,unresolvable:n};let o=new Set(i);for(let s of n)for(let a of r)DC(s,a)&&o.add(a);return{paths:[...o].sort(),unresolvable:[]}}function Q9(e){return e.includes("*")||e.includes("?")}function ZNe(e){return e.map(t=>`- \`${t.location}\` \u2014 ${t.detail}`).join(` -`)}function YNe(e){return e.from&&e.to&&Ig(e.from,e.to,e.ecosystem)?"https://semver.org/#spec-item-4":e.bump==="major"?"https://semver.org/#spec-item-8":"https://semver.org/"}function QNe(e){if(!e.from||!e.to)return null;let t=[];return e.bump==="major"?t.push(`Major version bump ${e.from} \u2192 ${e.to}. Semver permits arbitrary breaking changes across a major boundary.`):Ig(e.from,e.to,e.ecosystem)?t.push(`0.x minor bump ${e.from} \u2192 ${e.to}. Under semver \xA74 the minor position carries breaking changes while the major version is 0.`):e.bump==="minor"?t.push(`Minor bump ${e.from} \u2192 ${e.to}. Semver says this should be additive, which is a convention rather than a guarantee \u2014 minor releases do break consumers, so the version number alone is not evidence either way.`):e.bump==="patch"&&t.push(`Patch bump ${e.from} \u2192 ${e.to}. Breakage here is usually accidental.`),Tg(e.from,e.to,e.ecosystem)&&t.push(`This is a DOWNGRADE. Code written against ${e.from} may rely on APIs that do not exist in ${e.to}.`),t.length>0?t.join(" "):null}function XNe(e,t){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}var rp=["","<","<=",">",">=","=","=="];function ip(e,t){return e==="="||e==="=="?t:e}var jO={node:{runtime:"node",acceptedOperators:[...rp,"^","~"],parserKind:"semver",supportsDisjunction:!0,normalizeOperator:e=>ip(e,"=")},python:{runtime:"python",acceptedOperators:[...rp,"~="],parserKind:"pep440",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"==")},ruby:{runtime:"ruby",acceptedOperators:rp,parserKind:"rubygems",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"=")},go:{runtime:"go",acceptedOperators:rp,parserKind:"simple",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"=")},java:{runtime:"java",acceptedOperators:rp,parserKind:"simple",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"=")},rust:{runtime:"rust",acceptedOperators:[...rp,"^","~"],parserKind:"cargo",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"=")}};function zO(e,t){let n=jO[e];if(!n.acceptedOperators.includes(t))return{status:"unknown",operator:t};let i=n.normalizeOperator(t);return i===null?{status:"unknown",operator:t}:{status:"parsed",operator:i}}function l_(e){let t=eO(e);if(t)return t.kind;switch(e){case"export-removed":return"removed-export";case"member-removed":return"removed-export";case"signature-changed":return"signature-change";case"constant-value-changed":return"signature-change";case"kind-changed":return"type-change";case"member-now-required":return"required-field-added";case"entry-point-moved":case"package-removed":return"moved-export";case"commonjs-entry-removed":case"exports-require-condition-removed":case"package-type-changed":return"module-system-change";case"runtime-requirement-raised":return"runtime-requirement";default:return"unknown"}}function o5(e,t){let{code:n,symbol:i}=e,r=eO(n);if(r)return r.remediation(e);let o=eCe(i);if(o&&(n==="export-removed"||n==="member-removed"))return`The published ${o} entry \`${i}\` was removed. Review the consuming manifest, build, asset, or tooling configuration and update it if it relies on this entry; assess this package-role contract independently of source call signatures.`;if(o&&n==="signature-changed")return`The published ${o} entry \`${i}\` changed. Review the consuming manifest, build, asset, or tooling configuration against the new contract; this is not an ordinary call-site signature change.`;switch(n){case"runtime-requirement-raised":return`\`${t}\` is now compiled for Java ${e.after??"a newer release"}. Raise this project's Java toolchain to match \u2014 the compiler release and target in the build (\`maven.compiler.release\`, \`sourceCompatibility\`/\`targetCompatibility\`), the JDK used in CI, and any runtime base image \u2014 or stay on the previous version. There is no source change that avoids this.`;case"export-removed":return`Every use of \`${i}\` from \`${t}\` must be replaced. Find the supported replacement in the new version's exports and migrate each call site. Do not stub \`${i}\` out or re-implement it locally unless no replacement exists \u2014 if none exists, say so in the PR description rather than inventing one.`;case"member-removed":return`The member \`${i}\` no longer exists in \`${t}\`. Update each access to use the replacement member, or restructure the calling code if the capability was removed outright.`;case"signature-changed":switch(e.changed){case"parameters":return`The parameters of \`${i}\` changed; its return type did not. Update every call site to pass arguments matching the new list \u2014 check argument order, argument count, and whether an options object replaced positional arguments. A call that only reads the result of \`${i}\` needs no change beyond its arguments.`;case"return-type":return`The return type of \`${i}\` changed; its parameters did not, so no call site needs its arguments touched. What changed is what a caller gets back. In a statically typed language, a call site that assigns or passes the result on will fail to compile and point you straight at the fix; nothing here needs a source change beyond letting the type checker find those. In a dynamically typed one (plain JavaScript, Python, Ruby), nothing will catch this automatically \u2014 search for call sites that store, destructure, or pass along the result of \`${i}\` and check each one against the new type by hand.`;case"both":return`Both the parameters and the return type of \`${i}\` changed. Update every call site's arguments to match the new parameter list, then separately check what each call site does with the result: a statically typed caller will have a mismatched return type caught by its own compiler, a dynamically typed one will not.`;default:return`The signature of \`${i}\` changed. Update every call site to match the new signature exactly. Pay attention to argument order, argument count, and whether an options object replaced positional arguments.`}case"constant-value-changed":return`\`${i}\` changed underlying value. This does not necessarily require a source change \u2014 most code that only refers to \`${i}\` by name keeps working. Review code in this repository that depends on the concrete value: a hard-coded copy of the old number, a value persisted or sent over the wire, or a comparison against zero or another literal.`;case"kind-changed":return tCe(i,e.fromKind,e.toKind);case"entry-point-moved":return`The import path changed, not the API. ${e.detail} Update the import specifier in every file that imports from \`${t}\`, and do not replace, stub, or re-implement the individual symbols \u2014 they still exist under the new entry point. If you cannot determine which entry point carries a symbol this repository uses, leave that import alone with a \`TODO(drift):\` comment naming the symbol.`;case"package-removed":return`The package \`${i}\` no longer exists in \`${t}\`. Update the import path in every file that imports it to whichever package now provides the same API. Do not re-implement or stub the symbols it exported \u2014 if you cannot determine the replacement package, leave the import in place with a \`TODO(drift):\` comment naming it rather than guessing.`;case"member-now-required":return`\`${i}\` is now required. Supply an explicit value at every construction site. Choose the value that preserves the previous default behaviour; if the previous default is not documented, leave a TODO and flag it in the PR description rather than guessing.`;case"commonjs-entry-removed":case"exports-require-condition-removed":case"package-type-changed":{let s=e.moduleSystem?.affectedSpecifiers,a=e.moduleSystem?.affectedSpecifierPatterns,c=s?.length&&a?.length?`the affected \`require()\` sites for ${[...s.map(l=>`\`${l}\``),...a.map(l=>`specifier pattern \`${l}\``)].join(", ")}`:s&&s.length===1?`\`require('${s[0]}')\``:s&&s.length>1?`the affected \`require()\` sites for ${s.map(l=>`\`${l}\``).join(", ")}`:a&&a.length===1?`\`require()\` sites whose specifier matches \`${a[0]}\``:a&&a.length>1?`the affected \`require()\` sites matching ${a.map(l=>`\`${l}\``).join(", ")}`:`each localized \`require('${t}')\` site`;return`\`${t}\` no longer exposes the CommonJS loading compatibility it exposed before. Update ${c} to use an ESM-compatible loading mechanism, usually a static \`import\` in an ESM module or a dynamic \`await import()\` where the surrounding CommonJS file cannot move. Do not downgrade the dependency, and do not convert the whole repository to ESM unless that is already the intended migration path.`}default:return`Review usages of \`${i}\` from \`${t}\` and update them for the new version.`}}function eCe(e){return e.startsWith("pom:")?"Maven POM contract":e.startsWith("nuget:")?"NuGet package contract":e.startsWith("pub:")?"Pub package contract":null}function tCe(e,t,n){return t==="class"&&n==="function"?`\`${e}\` is no longer a class \u2014 it is a function now. Remove \`new\` from every construction site (\`new ${e}(...)\` becomes \`${e}(...)\`); calling it without \`new\` on the old version would have thrown or behaved differently, so every call site necessarily used \`new\` and necessarily needs it removed. Anything that did \`instanceof ${e}\` on the result has no replacement to fall back on automatically \u2014 check what it was actually testing for.`:t==="function"&&n==="class"?`\`${e}\` is a class now, not a function. Add \`new\` at every call site (\`${e}(...)\` becomes \`new ${e}(...)\`); calling a class without \`new\` throws in JavaScript, so this is a hard requirement, not a style choice.`:(t==="interface"||t==="type")&&n==="class"?`\`${e}\` is a class now, not just a type. Nothing changes for code that only used it as a type annotation \u2014 but if this repository ever constructed a value shaped like it by hand (an object literal, a factory function), that code should now go through \`new ${e}(...)\` if the class provides real behaviour a plain object cannot.`:t==="class"&&(n==="interface"||n==="type")?`\`${e}\` is a plain type now, not a class. Replace every \`new ${e}(...)\` with however the package now wants this value built. Remove any \`instanceof ${e}\` check \u2014 there is no runtime class left to test against; if the value's presence still needs checking, do a structural check on its fields instead.`:t==="namespace"||n==="namespace"?`\`${e}\` moved between a namespace and a ${t==="namespace"?n:t}. Update every access through \`${e}.\` to match how its members are reached in the new form, and update any type position that named \`${e}\` directly.`:`\`${e}\` changed from a ${t??"previous form"} to a ${n??"different form"}. Update declarations, \`new\` expressions, and type positions accordingly.`}function nCe(...e){let t=e.flatMap(n=>{let[i,r]=n.split("|");return[i,r,`${i}s`]});return`(?:${[...new Set(t)].join("|")})`}var rCe=nCe("remove|removed","drop|dropped","delete|deleted"),op=String.raw`(node(?:\.js)?|python|go|ruby|java|rust)\b`,dl=String.raw`([<>=^~]*\s*v?\d+(?:\.\d+){0,3}(?:(?:\s*,\s*|\s*\|\|\s*|\s+)\s*[<>=^~]*\s*v?\d+(?:\.\d+){0,3})*)`,r5=String.raw`(?:versions?\s*)?(?:is\s+|:\s*)?`,i5=[{id:"prose-dropped-runtime-prefix",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(?:(?:dropped|drops?|removed)\s+support\s+for|no\s+longer\s+supports?)\s+${op}\s*${r5}${dl}`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-dropped-runtime-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b${op}\s*(?:versions?\s*)?${dl}\s+(?:is|are|was|were)\s+no\s+longer\s+supported`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-dropped-runtime-support-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\bsupport\s+for\s+${op}\s*(?:versions?\s*)?${dl}\s+(?:was|were|is|has\s+been)\s+removed`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-min-runtime-leading",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(?:requires?|required|now\s+requires?|minimum(?:\s+supported)?)\s+${op}\s*${r5}(?:raised\s+to\s*)?${dl}`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version raised to ${e[2]?.trim()}`},{id:"prose-min-runtime-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b${op}\s+v?${dl}\s+is\s+now\s+required`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version is ${e[2]?.trim()}`},{id:"prose-min-runtime-supported-version",kind:"runtime-requirement",pattern:new RegExp(String.raw`\bminimum\s+supported\s+${op}\s+version\s+is\s+(?:now\s+)?${dl}`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version is ${e[2]?.trim()}`},{id:"prose-min-runtime-msrv",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(rust)\b\s+MSRV\s+is\s+(?:now\s+)?${dl}`,"i"),symbolGroup:1,summarize:e=>`Minimum Rust version is ${e[2]?.trim()}`}],iCe=[...i5.filter(e=>e.id.startsWith("prose-dropped-runtime")),{id:"prose-removed",kind:"removed-export",pattern:/`([\w$.]+)`(?:\(\))?\s+(?:has been|have been|was|were|is|are)\s+removed\b/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` was removed`},{id:"prose-removed-passive",kind:"removed-export",pattern:new RegExp(`\\b${rCe}\\s+(?:the\\s+)?\`([\\w$.]+)\``,"i"),symbolGroup:1,summarize:e=>`\`${e[1]}\` was removed`},{id:"prose-renamed",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has been |was |is )?renamed\s+to\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` was renamed to \`${e[2]}\``},{id:"prose-replaced",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has been |was |is )?replaced\s+(?:by|with)\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` was replaced by \`${e[2]}\``},{id:"prose-deprecated-in-favour",kind:"renamed-export",pattern:/`([\w$.]+)`\s+is\s+deprecated\s+in\s+favou?r\s+of\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` is deprecated in favour of \`${e[2]}\``},{id:"prose-no-longer",kind:"behaviour-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+no\s+longer\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` no longer ${e[2]?.trim()}`},{id:"prose-now-requires",kind:"signature-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+now\s+(?:requires|takes|accepts|expects)\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` now requires ${e[2]?.trim()}`},{id:"prose-now-returns",kind:"type-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+now\s+returns\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` now returns ${e[2]?.trim()}`},{id:"prose-signature-of-symbol",kind:"signature-change",pattern:/\b(?:call|constructor|method|function|callback)?\s*signature\s+of\s+`([\w$.]+)`[^.\n]{0,40}?\b(?:changed|changes|change\b|different|new\b)/i,symbolGroup:1,summarize:e=>`the signature of \`${e[1]}\` changed`},{id:"prose-symbol-signature-changed",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?\s+(?:call|constructor|method)?\s*signature\s+(?:has\s+|have\s+|is\s+|was\s+|were\s+)?(?:been\s+)?\bchanged\b/i,symbolGroup:1,summarize:e=>`the signature of \`${e[1]}\` changed`},{id:"prose-nth-argument-of-symbol",kind:"signature-change",pattern:/\b(?:first|second|third|fourth|fifth|sixth|last|\d+(?:st|nd|rd|th))\s+(?:positional\s+)?(?:argument|parameter|param|arg)\s+(?:for|of|to|in|passed\s+to)\s+`([\w$.]+)`/i,symbolGroup:1,summarize:e=>`an argument of \`${e[1]}\` changed`},{id:"prose-symbol-no-longer-takes",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+no\s+longer\s+(?:takes|accepts|expects|requires)\s+(.{2,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` no longer takes ${e[2]?.trim()}`},{id:"prose-signature-changed-phrase",kind:"signature-change",pattern:/\b(?:call|constructor|method|function|callback)?\s*signature\s+(?:of\b[^.\n]{0,80}?)?\s*(?:has\s+|have\s+|is\s+|was\s+|were\s+)?(?:been\s+)?\bchanged\b|\bchanged\s+(?:the\s+)?(?:\w+\s+){0,3}signature\b/i,symbolGroup:0,summarize:()=>"a function signature changed"},{id:"prose-call-shape-rewrite",kind:"signature-change",pattern:/\b(?:refactor(?:ed|ing)?\s+)?([\w$.]+)\s*\((?:[^()]|\([^()]*\))*\)\s*(?:->|→|into)\s*\1\s*\(/i,symbolGroup:0,summarize:()=>"a call signature was rewritten"},{id:"prose-verb-signature",kind:"signature-change",refinement:!0,pattern:/\b(?:changed?|changing|updated?|updating|revamp(?:ed)?|rework(?:ed)?|adjust(?:ed)?|modif(?:y|ied)|switch(?:ed)?|new|different|generic\s+single)\s+(?:the\s+)?[\w`.$()/,&\s-]{0,45}?\bsignatures?\b|\bsignatures?\s+(?:of\b[^.\n]{0,60}?)?\s*(?:has\s+|have\s+|is\s+|was\s+|were\s+|now\s+|changed|change[ds]|updated?)\b|\b(?:two|multiple|separate|distinct|overloaded)\s+signatures?\b|\binterfaces?\s+(?:has\s+|have\s+)?changed\b/i,symbolGroup:0,summarize:()=>"a function signature changed"},{id:"prose-argument-list-changed",kind:"signature-change",refinement:!0,pattern:new RegExp([String.raw`\b(?:arg(?:ument)?|param(?:eter)?)s?\s+order\b`,String.raw`\bargs?\s+now\s+(?:given|passed|taken)\b`,String.raw`\b(?:standardi[sz]e|standardi[sz]ed)\s+(?:the\s+)?arg(?:ument)?s?\b`,String.raw`\barg(?:ument)?s?\s+(?:have\s+been\s+|were\s+|are\s+|been\s+)?(?:swapped|reordered|re-ordered)\b`,"\\b`?[\\w$.]+`?\\s+(?:arg(?:ument)?|param(?:eter)?)s?\\s+(?:(?:to|of|from|in|for)\\s+`?[\\w$.]+`?\\s+)?(?:have\\s+|has\\s+|have\\s+been\\s+|has\\s+been\\s+|is\\s+|are\\s+|was\\s+|were\\s+|been\\s+)?(?:removed|added|dropped|changed)\\b",String.raw`\breturn\s+types?\s+(?:has\s+|have\s+|now\s+)?(?:changed|change[ds])\b`,String.raw`\bupdate\s+[\w$.()]+\s+to\s+return\b`,String.raw`\btype\s+changed\s+from\b`,"\\breplaced?\\s+[\\w$.()`]{0,30}?\\s+args?\\s+w(?:ith|/)\\b","\\b(?:removed?|dropped?|added?)\\s+(?:the\\s+|a\\s+|an\\s+)?(?:deprecated\\s+|new\\s+|optional\\s+|required\\s+)?`?[\\w$.]+`?\\s+(?:arg(?:ument)?|param(?:eter)?)s?\\b",String.raw`\bno\s+longer\s+(?:accepts?|takes?|supports?|allows?|passes?)\b[^.\n]{0,45}?(?:arg(?:ument)?s?|param(?:eter)?s?|[Ss]elector|callbacks?|thisArg)\b`,String.raw`\bcall\s+pattern\s+is\s+no\s+longer\b`,String.raw`\bis\s+no\s+longer\s+(?:a\s+)?valid\s+call\b`,"\\b(?:`?thisArg`?|this\\s+argument)\\b[^.\\n]{0,40}?\\b(?:removed|no\\s+longer|default|undefined|dropped)\\b",String.raw`\b(?:requires?|required|takes?|needs?|accepts?|expects?)\s+(?:a\s+|an\s+|the\s+)?(?:new|additional|extra|second|third|fourth)\s+(?:constructor\s+)?(?:arg(?:ument)?|param(?:eter)?)s?\b`,String.raw`\b(?:constructor|function|method)\s+(?:signature\s+)?(?:now\s+)?(?:requires?|takes?|accepts?|expects?|required)\b`,String.raw`\bis\s+no\s+longer\s+(?:the\s+)?(?:first|second|third|fourth|fifth|last|\d+(?:st|nd|rd|th))\s+(?:arg(?:ument)?|param(?:eter)?)\b`,String.raw`\bnow\s+(?:have|has)\s+(?:two|three|multiple|several)\s+(?:arg(?:ument)?|param(?:eter)?)s?\b`,String.raw`\bnow\s+(?:two|three)\s+param(?:eter)?s\b`,"\\b(?:use|using|takes?|expects?|switch(?:ed)?\\s+`?[\\w$.]+`?(?:\\s+setting)?\\s+to|switch(?:ed)?\\s+to|pass(?:ing)?|is\\s+now|are\\s+now|it\\s+is\\s+now)\\s+(?:an?\\s+|two\\s+|the\\s+)?(?:object\\s+options?|options?\\s+(?:object|hash)|config(?:uration)?\\s+(?:object|hash)|`?[\\w$.]+`?\\s+option\\b)",String.raw`\b(?:options?|config(?:uration)?)\s+(?:object|hash)\s+(?:as\b|instead\b|for\b)`,String.raw`\bparam(?:eter)?s?\s+(?:are|is)\s+no\s+longer\s+optional\b`,String.raw`\bformerly\s+a\s+config\s+object\b`].join("|"),"i"),symbolGroup:0,summarize:()=>"an argument list changed"},{id:"prose-async-signature",kind:"signature-change",refinement:!0,pattern:/\b(?:make[s]?|made|turn(?:ed)?|change)\s+[\w`#.$()"\s]{1,40}?\s+(?:(?:in)?to\s+)?(?:be\s+)?(?:an?\s+)?a?sync(?:hronous)?(?:\s+function)?\b|\b(?:is|are|be)\s+(?:now\s+|an?\s+)*a?sync(?:hronous)?(?:\s+function|\s+now)?\b|\bnow\s+a?sync(?:hronous)?\b|\ba?sync\s+now\b|\basync\b[^.\n]{0,40}?\b(?:callback|promise|await|sync)\b|\b(?:callback|promise|sync)s?\b[^.\n]{0,40}?\basync\b|\bpromises?\s+instead\s+of\s+(?:using\s+)?callbacks?\b|\bnow\s+returns?\s+(?:a\s+|an\s+)?(?:promise|observable|thenable|query)\b|\bnow\s+return\s+promises\b|\breturns?\s+[\w"']+,?\s+not\s+(?:a\s+)?(?:promise|callback|query)\b|\b(?:needs?|has|have|dosnt\s+wait|doesn'?t\s+wait)\s+to\s+be\s+awaited\b|\bmust\s+(?:now\s+)?be\s+awaited\b|\b(?:update|change|updated)\s+(?:the\s+)?return\s+types?\b|\bdrop(?:ped|s)?\s+(?:support\s+for\s+)?callbacks?\b|\bremove[d]?\s+callback\s+support\b|\bno\s+(?:longer\s+)?(?:takes?|accepts?|using)\s+(?:a\s+|the\s+)?callbacks?\b/i,symbolGroup:0,summarize:()=>"a callback/return signature changed"},{id:"prose-symbol-now-required",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?\s+(?:is|are|becomes?|became)\s+now\s+(?:required|mandatory|non-optional)\b/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` is now required`},{id:"prose-is-now",kind:"behaviour-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+(?:is|are|must)\s+now\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` is now ${e[2]?.trim()}`},{id:"prose-moved",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has\s+)?moved\s+to\s+`([\w$./@-]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` moved to \`${e[2]}\``},...i5.filter(e=>e.id.startsWith("prose-min-runtime")),{id:"prose-esm-only",kind:"module-system-change",pattern:/\b(?:this|the)\s+(?:package|project|library|module)\s+(?:is\s+)?now\s+(?:pure\s+ESM|ESM[\s-]only|an?\s+ESM\s+package)\b|\b(?:migrated|converted|switched)\s+(?:this|the)\s+(?:package|project|library|module)\s+to\s+ESM\b/i,symbolGroup:0,summarize:()=>"The package is now ESM-only and no longer supports `require()`",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"]}},{id:"prose-dropped-commonjs",kind:"module-system-change",pattern:/\b(?:dropped|removed)\s+CommonJS\s+support\b|\b(?:dropped|removed|no longer (?:supports|provides))\s+CommonJS\b|\bCommonJS\s+(?:is\s+)?no\s+longer\s+supported\b|\brequire\(\)\s+(?:is\s+)?no\s+longer\s+supported\b/i,symbolGroup:0,summarize:()=>"CommonJS support was dropped",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"]}},{id:"prose-breaking-change-footer",kind:"behaviour-change",pattern:/^BREAKING[ -]CHANGES?:\s*(.{3,160}?)(?:[.;]|$)/i,symbolGroup:0,summarize:e=>`Declared as a breaking change: ${e[1]?.trim()}`},{id:"prose-breaking-change-marker",kind:"unknown",pattern:/^BREAKING[ -]CHANGES?\b\s*:?\s*(?:none|n\/a)?\s*$/i,symbolGroup:0,summarize:()=>"Declared as a breaking change (no detail given)"}];function s5(e){for(let t of e.split(` -`)){let n=t.replace(/\r$/,"").replace(/^\s*[-*>]+\s+/,"").replace(/\*{1,3}([^*\n]+?)\*{1,3}/g,"$1").replace(/\s*[-*=]{2,}\s*$/,"").trim();if(/^BREAKING[ -]CHANGES?\b[ \t]*(?::|[-–—][ \t]|$)/i.test(n)||/^#{1,6}[ \t].*\bbreaking\s+changes?\b/i.test(n))return!0}return!1}function a5(e,t={}){let n=[],i=e.replace(/^[-*+]\s+/,"").trim();if(!i)return n;for(let r of iCe){let o=r.pattern.exec(i);if(!o)continue;let s=r.symbolGroup===0?null:o[r.symbolGroup];if(r.symbolGroup!==0&&!s)continue;let a=r.kind==="runtime-requirement"?oCe(o,r.id):void 0;if(r.kind==="runtime-requirement"&&!a)continue;let c=r.replacementGroup?o[r.replacementGroup]:void 0;n.push({ruleId:r.id,kind:r.kind,summary:a?a.kind==="minimum-runtime"?a.requirement.includes("||")?`Supported ${a.runtime} versions are now ${a.requirement}`:`Minimum ${a.runtime} version is now ${a.requirement}`:`${a.runtime} ${a.requirement} is no longer supported`:r.summarize(o),symbols:s?[s]:[],...a?{runtime:a}:{},replacementSymbols:c?[c]:[],...r.moduleSystem?{moduleSystem:{...r.moduleSystem,incompatibleUsage:[...r.moduleSystem.incompatibleUsage]}}:{},...r.refinement?{refinement:!0}:{},passage:i})}return t.anchored||n.some(r=>!r.refinement)?n:n.filter(r=>!r.refinement)}function oCe(e,t){let n=e[1]?.toLowerCase().replace(/\.js$/,""),i=e[2]?.trim();if(!n||!i||!["node","python","go","ruby","java","rust"].includes(n))return null;if(i.includes("||"))return aCe(n,i,e[0].trim(),t);let r=/^(?:([<>=^~]+)\s*)?v?(\d+(?:\.\d+){0,3})(?:(?:\s*,\s*|\s+)(?:[<>=^~]+\s*)?v?\d+(?:\.\d+){0,3})*$/i.exec(i);if(!r)return null;let o=r[1]??"",s=r[2],a=i.replace(/v?(\d+(?:\.\d+){0,3})/gi,(p,f)=>n==="java"?f.replace(/^1\.(\d+)(?=$|\.|\s|,)/,"$1"):f),c=e[0].trim(),l=zO(n,o),u=l.status,d=a.replace(/^\s*[<>=^~]*\s*/,l.operator||">=");if(t.startsWith("prose-dropped-runtime")){if(o===""){let p=s.split(".");return{kind:"unsupported-runtime-range",runtime:n,requirement:i.includes(",")||/\s+[<>=^~]/.test(i)?d:p.length<3?`${s}.x`:s,sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}return{kind:"unsupported-runtime-range",runtime:n,requirement:d,...o==="<"?{derivedMinimum:`>=${s}`}:{},...o==="<="?{derivedMinimum:`>${s}`}:{},sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}return{kind:"minimum-runtime",runtime:n,requirement:d,sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}function sCe(e){let t=/^v?(\d+(?:\.\d+){0,3})$/i.exec(e.trim());if(!t)return e;let n=t[1];return n.split(".").length<3?`${n}.x`:n}function aCe(e,t,n,i){let r=t.split("||").map(c=>c.trim()).filter(Boolean);if(r.length<2)return null;let o=jO[e].supportsDisjunction?"parsed":"unknown",s=[];for(let c of r){let l=/^(?:([<>=^~]+)\s*)?v?(\d+(?:\.\d+){0,3})(?:(?:\s*,\s*|\s+)(?:[<>=^~]+\s*)?v?\d+(?:\.\d+){0,3})*$/i.exec(c);if(!l)return null;let u=l[1]??"",d=zO(e,u);d.status==="unknown"&&(o="unknown");let p=c.replace(/v?(\d+(?:\.\d+){0,3})/gi,(f,m)=>e==="java"?m.replace(/^1\.(\d+)(?=$|\.|\s|,)/,"$1"):m);s.push(u===""?sCe(p):p.replace(/^\s*[<>=^~]*\s*/,d.operator))}let a={runtime:e,requirement:s.join(" || "),sourceText:n,...o==="unknown"?{rangeParseStatus:"unknown"}:{}};return i.startsWith("prose-dropped-runtime")?{kind:"unsupported-runtime-range",...a}:{kind:"minimum-runtime",...a}}function c5(e,t){let n=e.symbols[0]??"the affected API",i=e.replacementSymbols[0];switch(e.kind){case"removed-export":return`\`${n}\` was removed from \`${t}\`. Replace every usage. Verify against the installed version's actual exports before choosing a replacement \u2014 the changelog may be incomplete.`;case"renamed-export":return i?`Replace every usage of \`${n}\` with \`${i}\`, checking that the new API's signature matches before assuming it is a drop-in rename.`:`\`${n}\` was replaced. Migrate every usage to the documented successor.`;case"signature-change":return`The way \`${n}\` is called changed: ${e.summary}. Update every call site and confirm against the installed type declarations.`;case"type-change":return`The type produced by \`${n}\` changed: ${e.summary}. Update consumers of its return value, including any local type declarations.`;case"behaviour-change":return`Behaviour changed: ${e.summary}. Review call sites for assumptions that no longer hold. Prefer making the assumption explicit over silently adapting to the new behaviour.`;case"runtime-requirement":return e.runtime?.kind==="unsupported-runtime-range"?e.runtime.derivedMinimum?`${e.runtime.runtime} ${e.runtime.requirement} is no longer supported. That unambiguously means a floor of ${e.runtime.derivedMinimum}; update the runtime version declared in CI workflows, engine fields, and container images accordingly.`:`${e.runtime.runtime} ${e.runtime.requirement} is no longer supported, but the release note does not establish a replacement minimum. Review the project's declared runtime against authoritative upstream compatibility guidance rather than inventing one.`:`${e.summary}. Update the runtime version declared in CI workflows, engine fields, and container images. Do not change application logic for this.`;case"module-system-change":return`\`${t}\` no longer exposes a CommonJS-compatible entry point. Update each localized \`require('${t}')\` site to use an ESM-compatible loading mechanism, usually a static \`import\` in an ESM module or a dynamic \`await import('${t}')\` where the surrounding CommonJS file cannot move. Do not downgrade the dependency, and do not convert the whole repository to ESM unless that is already the intended migration path.`;case"config-change":return`Configuration must change: ${e.summary}.`;default:return`Review usages of \`${n}\` and update them: ${e.summary}`}}var cCe=["api-shape","type-contract","behaviour","data-schema","configuration","runtime-environment","protocol","packaging"],lCe=["manifest","link-or-import","compile-time","static-semantic","test-time","runtime-only","external-observation"],uCe=["symbol","type","module","package","dependency-cohort","runtime","ecosystem"],dCe=["direct","transitive","wrapper-mediated","re-exported","reflection-or-dynamic","generated","unknown"];var pCe={"export-removed":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["direct"]},"member-removed":{nature:"api-shape",detectability:["compile-time"],scope:"symbol",visibility:["direct"]},"signature-changed":{nature:"type-contract",detectability:["compile-time","static-semantic"],scope:"symbol",visibility:["direct"]},"kind-changed":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["direct"]},"member-now-required":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["direct"]},"entry-point-moved":{nature:"packaging",detectability:["manifest","link-or-import"],scope:"package",visibility:["direct"]},"package-removed":{nature:"packaging",detectability:["manifest","link-or-import"],scope:"package",visibility:["direct"]},"commonjs-entry-removed":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"exports-require-condition-removed":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"package-type-changed":{nature:"packaging",detectability:["manifest","link-or-import","compile-time"],scope:"package",visibility:["direct"]},"constant-value-changed":{nature:"behaviour",detectability:["static-semantic","runtime-only"],scope:"symbol",visibility:["direct"]},...fCe()};function fCe(){let e={};for(let t of el)for(let[n,i]of Object.entries(t.codes))e[n]=i.taxonomy;return e}var mCe={"removed-export":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["unknown"]},"renamed-export":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["unknown"]},"moved-export":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"module",visibility:["unknown"]},"signature-change":{nature:"type-contract",detectability:["compile-time","static-semantic"],scope:"symbol",visibility:["unknown"]},"type-change":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["unknown"]},"behaviour-change":{nature:"behaviour",detectability:["test-time","runtime-only"],scope:"symbol",visibility:["unknown"]},"default-change":{nature:"behaviour",detectability:["test-time","runtime-only"],scope:"symbol",visibility:["unknown"]},"removed-endpoint":{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"module",visibility:["unknown"]},"changed-endpoint":{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},"required-field-added":{nature:"data-schema",detectability:["compile-time","runtime-only"],scope:"type",visibility:["unknown"]},"config-change":{nature:"configuration",detectability:["static-semantic","runtime-only"],scope:"module",visibility:["unknown"]},"module-system-change":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"runtime-requirement":{nature:"runtime-environment",detectability:["manifest","runtime-only"],scope:"runtime",visibility:["direct"]},unknown:{nature:"behaviour",detectability:["runtime-only"],scope:"module",visibility:["unknown"]}};function sp(e,t){let n=t?pCe[t]:void 0;if(n)return{...l5(n),origin:"computed"};let i=mCe[e];return{...l5(i),origin:e==="unknown"?"default":"rule"}}function l5(e){return{nature:e.nature,detectability:[...e.detectability],scope:e.scope,visibility:[...e.visibility]}}function Or(e){return e.taxonomy??sp(e.kind)}function p5(e,t){if(!e||typeof e!="object")return t;let n=e,i=u5(n.nature,cCe),r=u5(n.scope,uCe),o=d5(n.detectability,lCe),s=d5(n.visibility,dCe);return!i||!r?t:{nature:i,scope:r,detectability:o.length>0?o:[...t.detectability],visibility:s.length>0?s:["unknown"],origin:"llm-normalized"}}function u5(e,t){return typeof e=="string"&&t.includes(e)?e:null}function d5(e,t){if(!Array.isArray(e))return[];let n=new Set;for(let i of e)typeof i=="string"&&t.includes(i)&&n.add(i);return t.filter(i=>n.has(i))}function u_(e){let t=["manifest","link-or-import","compile-time","static-semantic"];return!e.detectability.some(n=>t.includes(n))}var OOe={type:"object",properties:{changes:{type:"array",items:{type:"object",properties:{summary:{type:"string",description:"One sentence stating what changed upstream and why it breaks consumers."},remediation:{type:"string",description:"Imperative instructions for fixing affected call sites."},symbols:{type:"array",items:{type:"string"},description:"Exact identifiers to search for in consumer code: export names, method names, option keys, endpoint paths. Empty if the evidence names none."},kind:{type:"string",enum:["removed-export","renamed-export","signature-change","type-change","behaviour-change","removed-endpoint","changed-endpoint","required-field-added","default-change","config-change","module-system-change","runtime-requirement","unknown"]},evidenceId:{type:"string",description:"The id of the evidence excerpt this was extracted from."},taxonomy:{type:"object",properties:{nature:{type:"string",enum:["api-shape","type-contract","behaviour","data-schema","configuration","runtime-environment","protocol","packaging"]},detectability:{type:"array",items:{type:"string",enum:["manifest","link-or-import","compile-time","static-semantic","test-time","runtime-only","external-observation"]},description:"What would have to run to notice this. Be honest: a change that only shows up at runtime must not be listed as compile-time."},scope:{type:"string",enum:["symbol","type","module","package","dependency-cohort","runtime","ecosystem"]},visibility:{type:"array",items:{type:"string",enum:["direct","transitive","wrapper-mediated","re-exported","reflection-or-dynamic","generated","unknown"]},description:"Use `unknown` when the evidence does not say. Do not guess `direct`."}},required:["nature","detectability","scope","visibility"],additionalProperties:!1}},required:["summary","remediation","symbols","kind","evidenceId"],additionalProperties:!1}}},required:["changes"],additionalProperties:!1},MOe=`You extract breaking changes from dependency release notes for an automated refactoring tool. +`)}async function $Le(e){let{config:t,logger:n,readRepoFile:r,beforeSha:i,afterSha:o}=e;if(!r||!i||!o)return[];let s=[];for(let a of kl){if(!OQ(a,t))continue;let c=await SLe(DQ(a,t),e);for(let u of c.unresolvable)e.onUnavailableSpec?.(u,{available:!1,reason:"toolchain-failed",detail:`Drift could not list the files in this repository, so the pattern \`${u}\` could not be expanded and the contracts it covers were not compared.`,remedy:"List the contract documents by literal path instead of by pattern.",tool:a.tool});let l=[];for(let u of c.paths){let[d,p]=await Promise.all([r(u,i),r(u,o)]);!d||!p||a.handles(u,p)&&l.push({path:u,before:d,after:p})}for(let u of l){let d=u.path;if(u.before===u.after)continue;let p=await MQ(a,u,{logger:n,exec:e.exec,env:e.env,siblings:l.filter(f=>f.path!==d)});if(!p.available){n.debug(`No ${a.id} diff for ${d}: ${p.detail}`),e.onUnavailableSpec?.(d,p);continue}e.onSpecComputed?.(d,a),p.changes.length!==0&&s.push({id:Pt("ev",d,a.id,o),source:a.source,dependency:d,locator:d,title:`${p.changes.length} breaking change(s) in ${d}`,content:xLe(p.changes),findings:p.changes.map(f=>({code:f.code,symbol:f.location,detail:f.detail,...f.before!==void 0?{before:f.before}:{},...f.after!==void 0?{after:f.after}:{}})),weight:p.weight})}}return s}async function SLe(e,t){let n=e.filter(_ee),r=e.filter(s=>!_ee(s));if(n.length===0)return{paths:r,unresolvable:[]};let i=t.listRepoFiles&&t.afterSha?await t.listRepoFiles(t.afterSha):null;if(!i)return{paths:r,unresolvable:n};let o=new Set(r);for(let s of n)for(let a of i)xD(s,a)&&o.add(a);return{paths:[...o].sort(),unresolvable:[]}}function _ee(e){return e.includes("*")||e.includes("?")}function xLe(e){return e.map(t=>`- \`${t.location}\` \u2014 ${t.detail}`).join(` +`)}function ELe(e){return e.from&&e.to&&Mh(e.from,e.to,e.ecosystem)?"https://semver.org/#spec-item-4":e.bump==="major"?"https://semver.org/#spec-item-8":"https://semver.org/"}function TLe(e){if(!e.from||!e.to)return null;let t=[];return e.bump==="major"?t.push(`Major version bump ${e.from} \u2192 ${e.to}. Semver permits arbitrary breaking changes across a major boundary.`):Mh(e.from,e.to,e.ecosystem)?t.push(`0.x minor bump ${e.from} \u2192 ${e.to}. Under semver \xA74 the minor position carries breaking changes while the major version is 0.`):e.bump==="minor"?t.push(`Minor bump ${e.from} \u2192 ${e.to}. Semver says this should be additive, which is a convention rather than a guarantee \u2014 minor releases do break consumers, so the version number alone is not evidence either way.`):e.bump==="patch"&&t.push(`Patch bump ${e.from} \u2192 ${e.to}. Breakage here is usually accidental.`),Dh(e.from,e.to,e.ecosystem)&&t.push(`This is a DOWNGRADE. Code written against ${e.from} may rely on APIs that do not exist in ${e.to}.`),t.length>0?t.join(" "):null}function ALe(e,t){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}var Tp=["","<","<=",">",">=","=","=="];function Ap(e,t){return e==="="||e==="=="?t:e}var PL={node:{runtime:"node",acceptedOperators:[...Tp,"^","~"],parserKind:"semver",supportsDisjunction:!0,normalizeOperator:e=>Ap(e,"=")},python:{runtime:"python",acceptedOperators:[...Tp,"~="],parserKind:"pep440",supportsDisjunction:!1,normalizeOperator:e=>Ap(e,"==")},ruby:{runtime:"ruby",acceptedOperators:Tp,parserKind:"rubygems",supportsDisjunction:!1,normalizeOperator:e=>Ap(e,"=")},go:{runtime:"go",acceptedOperators:Tp,parserKind:"simple",supportsDisjunction:!1,normalizeOperator:e=>Ap(e,"=")},java:{runtime:"java",acceptedOperators:Tp,parserKind:"simple",supportsDisjunction:!1,normalizeOperator:e=>Ap(e,"=")},rust:{runtime:"rust",acceptedOperators:[...Tp,"^","~"],parserKind:"cargo",supportsDisjunction:!1,normalizeOperator:e=>Ap(e,"=")}};function CL(e,t){let n=PL[e];if(!n.acceptedOperators.includes(t))return{status:"unknown",operator:t};let r=n.normalizeOperator(t);return r===null?{status:"unknown",operator:t}:{status:"parsed",operator:r}}function BS(e){let t=q1(e);if(t)return t.kind;switch(e){case"export-removed":return"removed-export";case"member-removed":return"removed-export";case"signature-changed":return"signature-change";case"constant-value-changed":return"signature-change";case"kind-changed":return"type-change";case"member-now-required":return"required-field-added";case"entry-point-moved":case"package-removed":return"moved-export";case"commonjs-entry-removed":case"exports-require-condition-removed":case"package-type-changed":return"module-system-change";case"runtime-requirement-raised":return"runtime-requirement";default:return"unknown"}}function Tee(e,t){let{code:n,symbol:r}=e,i=q1(n);if(i)return i.remediation(e);let o=ILe(r);if(o&&(n==="export-removed"||n==="member-removed"))return`The published ${o} entry \`${r}\` was removed. Review the consuming manifest, build, asset, or tooling configuration and update it if it relies on this entry; assess this package-role contract independently of source call signatures.`;if(o&&n==="signature-changed")return`The published ${o} entry \`${r}\` changed. Review the consuming manifest, build, asset, or tooling configuration against the new contract; this is not an ordinary call-site signature change.`;switch(n){case"runtime-requirement-raised":return`\`${t}\` is now compiled for Java ${e.after??"a newer release"}. Raise this project's Java toolchain to match \u2014 the compiler release and target in the build (\`maven.compiler.release\`, \`sourceCompatibility\`/\`targetCompatibility\`), the JDK used in CI, and any runtime base image \u2014 or stay on the previous version. There is no source change that avoids this.`;case"export-removed":return`Every use of \`${r}\` from \`${t}\` must be replaced. Find the supported replacement in the new version's exports and migrate each call site. Do not stub \`${r}\` out or re-implement it locally unless no replacement exists \u2014 if none exists, say so in the PR description rather than inventing one.`;case"member-removed":return`The member \`${r}\` no longer exists in \`${t}\`. Update each access to use the replacement member, or restructure the calling code if the capability was removed outright.`;case"signature-changed":switch(e.changed){case"parameters":return`The parameters of \`${r}\` changed; its return type did not. Update every call site to pass arguments matching the new list \u2014 check argument order, argument count, and whether an options object replaced positional arguments. A call that only reads the result of \`${r}\` needs no change beyond its arguments.`;case"return-type":return`The return type of \`${r}\` changed; its parameters did not, so no call site needs its arguments touched. What changed is what a caller gets back. In a statically typed language, a call site that assigns or passes the result on will fail to compile and point you straight at the fix; nothing here needs a source change beyond letting the type checker find those. In a dynamically typed one (plain JavaScript, Python, Ruby), nothing will catch this automatically \u2014 search for call sites that store, destructure, or pass along the result of \`${r}\` and check each one against the new type by hand.`;case"both":return`Both the parameters and the return type of \`${r}\` changed. Update every call site's arguments to match the new parameter list, then separately check what each call site does with the result: a statically typed caller will have a mismatched return type caught by its own compiler, a dynamically typed one will not.`;default:return`The signature of \`${r}\` changed. Update every call site to match the new signature exactly. Pay attention to argument order, argument count, and whether an options object replaced positional arguments.`}case"constant-value-changed":return`\`${r}\` changed underlying value. This does not necessarily require a source change \u2014 most code that only refers to \`${r}\` by name keeps working. Review code in this repository that depends on the concrete value: a hard-coded copy of the old number, a value persisted or sent over the wire, or a comparison against zero or another literal.`;case"kind-changed":return RLe(r,e.fromKind,e.toKind);case"entry-point-moved":return`The import path changed, not the API. ${e.detail} Update the import specifier in every file that imports from \`${t}\`, and do not replace, stub, or re-implement the individual symbols \u2014 they still exist under the new entry point. If you cannot determine which entry point carries a symbol this repository uses, leave that import alone with a \`TODO(drift):\` comment naming the symbol.`;case"package-removed":return`The package \`${r}\` no longer exists in \`${t}\`. Update the import path in every file that imports it to whichever package now provides the same API. Do not re-implement or stub the symbols it exported \u2014 if you cannot determine the replacement package, leave the import in place with a \`TODO(drift):\` comment naming it rather than guessing.`;case"member-now-required":return`\`${r}\` is now required. Supply an explicit value at every construction site. Choose the value that preserves the previous default behaviour; if the previous default is not documented, leave a TODO and flag it in the PR description rather than guessing.`;case"commonjs-entry-removed":case"exports-require-condition-removed":case"package-type-changed":{let s=e.moduleSystem?.affectedSpecifiers,a=e.moduleSystem?.affectedSpecifierPatterns,c=s?.length&&a?.length?`the affected \`require()\` sites for ${[...s.map(l=>`\`${l}\``),...a.map(l=>`specifier pattern \`${l}\``)].join(", ")}`:s&&s.length===1?`\`require('${s[0]}')\``:s&&s.length>1?`the affected \`require()\` sites for ${s.map(l=>`\`${l}\``).join(", ")}`:a&&a.length===1?`\`require()\` sites whose specifier matches \`${a[0]}\``:a&&a.length>1?`the affected \`require()\` sites matching ${a.map(l=>`\`${l}\``).join(", ")}`:`each localized \`require('${t}')\` site`;return`\`${t}\` no longer exposes the CommonJS loading compatibility it exposed before. Update ${c} to use an ESM-compatible loading mechanism, usually a static \`import\` in an ESM module or a dynamic \`await import()\` where the surrounding CommonJS file cannot move. Do not downgrade the dependency, and do not convert the whole repository to ESM unless that is already the intended migration path.`}default:return`Review usages of \`${r}\` from \`${t}\` and update them for the new version.`}}function ILe(e){return e.startsWith("pom:")?"Maven POM contract":e.startsWith("nuget:")?"NuGet package contract":e.startsWith("pub:")?"Pub package contract":null}function RLe(e,t,n){return t==="class"&&n==="function"?`\`${e}\` is no longer a class \u2014 it is a function now. Remove \`new\` from every construction site (\`new ${e}(...)\` becomes \`${e}(...)\`); calling it without \`new\` on the old version would have thrown or behaved differently, so every call site necessarily used \`new\` and necessarily needs it removed. Anything that did \`instanceof ${e}\` on the result has no replacement to fall back on automatically \u2014 check what it was actually testing for.`:t==="function"&&n==="class"?`\`${e}\` is a class now, not a function. Add \`new\` at every call site (\`${e}(...)\` becomes \`new ${e}(...)\`); calling a class without \`new\` throws in JavaScript, so this is a hard requirement, not a style choice.`:(t==="interface"||t==="type")&&n==="class"?`\`${e}\` is a class now, not just a type. Nothing changes for code that only used it as a type annotation \u2014 but if this repository ever constructed a value shaped like it by hand (an object literal, a factory function), that code should now go through \`new ${e}(...)\` if the class provides real behaviour a plain object cannot.`:t==="class"&&(n==="interface"||n==="type")?`\`${e}\` is a plain type now, not a class. Replace every \`new ${e}(...)\` with however the package now wants this value built. Remove any \`instanceof ${e}\` check \u2014 there is no runtime class left to test against; if the value's presence still needs checking, do a structural check on its fields instead.`:t==="namespace"||n==="namespace"?`\`${e}\` moved between a namespace and a ${t==="namespace"?n:t}. Update every access through \`${e}.\` to match how its members are reached in the new form, and update any type position that named \`${e}\` directly.`:`\`${e}\` changed from a ${t??"previous form"} to a ${n??"different form"}. Update declarations, \`new\` expressions, and type positions accordingly.`}function PLe(...e){let t=e.flatMap(n=>{let[r,i]=n.split("|");return[r,i,`${r}s`]});return`(?:${[...new Set(t)].join("|")})`}var CLe=PLe("remove|removed","drop|dropped","delete|deleted"),Ip=String.raw`(node(?:\.js)?|python|go|ruby|java|rust)\b`,Nl=String.raw`([<>=^~]*\s*v?\d+(?:\.\d+){0,3}(?:(?:\s*,\s*|\s*\|\|\s*|\s+)\s*[<>=^~]*\s*v?\d+(?:\.\d+){0,3})*)`,xee=String.raw`(?:versions?\s*)?(?:is\s+|:\s*)?`,Eee=[{id:"prose-dropped-runtime-prefix",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(?:(?:dropped|drops?|removed)\s+support\s+for|no\s+longer\s+supports?)\s+${Ip}\s*${xee}${Nl}`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-dropped-runtime-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b${Ip}\s*(?:versions?\s*)?${Nl}\s+(?:is|are|was|were)\s+no\s+longer\s+supported`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-dropped-runtime-support-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\bsupport\s+for\s+${Ip}\s*(?:versions?\s*)?${Nl}\s+(?:was|were|is|has\s+been)\s+removed`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-min-runtime-leading",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(?:requires?|required|now\s+requires?|minimum(?:\s+supported)?)\s+${Ip}\s*${xee}(?:raised\s+to\s*)?${Nl}`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version raised to ${e[2]?.trim()}`},{id:"prose-min-runtime-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b${Ip}\s+v?${Nl}\s+is\s+now\s+required`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version is ${e[2]?.trim()}`},{id:"prose-min-runtime-supported-version",kind:"runtime-requirement",pattern:new RegExp(String.raw`\bminimum\s+supported\s+${Ip}\s+version\s+is\s+(?:now\s+)?${Nl}`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version is ${e[2]?.trim()}`},{id:"prose-min-runtime-msrv",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(rust)\b\s+MSRV\s+is\s+(?:now\s+)?${Nl}`,"i"),symbolGroup:1,summarize:e=>`Minimum Rust version is ${e[2]?.trim()}`}],NLe=[...Eee.filter(e=>e.id.startsWith("prose-dropped-runtime")),{id:"prose-removed",kind:"removed-export",pattern:/`([\w$.]+)`(?:\(\))?\s+(?:has been|have been|was|were|is|are)\s+removed\b/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` was removed`},{id:"prose-removed-passive",kind:"removed-export",pattern:new RegExp(`\\b${CLe}\\s+(?:the\\s+)?\`([\\w$.]+)\``,"i"),symbolGroup:1,summarize:e=>`\`${e[1]}\` was removed`},{id:"prose-renamed",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has been |was |is )?renamed\s+to\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` was renamed to \`${e[2]}\``},{id:"prose-replaced",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has been |was |is )?replaced\s+(?:by|with)\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` was replaced by \`${e[2]}\``},{id:"prose-deprecated-in-favour",kind:"renamed-export",pattern:/`([\w$.]+)`\s+is\s+deprecated\s+in\s+favou?r\s+of\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` is deprecated in favour of \`${e[2]}\``},{id:"prose-no-longer",kind:"behaviour-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+no\s+longer\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` no longer ${e[2]?.trim()}`},{id:"prose-now-requires",kind:"signature-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+now\s+(?:requires|takes|accepts|expects)\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` now requires ${e[2]?.trim()}`},{id:"prose-now-returns",kind:"type-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+now\s+returns\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` now returns ${e[2]?.trim()}`},{id:"prose-signature-of-symbol",kind:"signature-change",pattern:/\b(?:call|constructor|method|function|callback)?\s*signature\s+of\s+`([\w$.]+)`[^.\n]{0,40}?\b(?:changed|changes|change\b|different|new\b)/i,symbolGroup:1,summarize:e=>`the signature of \`${e[1]}\` changed`},{id:"prose-symbol-signature-changed",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?\s+(?:call|constructor|method)?\s*signature\s+(?:has\s+|have\s+|is\s+|was\s+|were\s+)?(?:been\s+)?\bchanged\b/i,symbolGroup:1,summarize:e=>`the signature of \`${e[1]}\` changed`},{id:"prose-nth-argument-of-symbol",kind:"signature-change",pattern:/\b(?:first|second|third|fourth|fifth|sixth|last|\d+(?:st|nd|rd|th))\s+(?:positional\s+)?(?:argument|parameter|param|arg)\s+(?:for|of|to|in|passed\s+to)\s+`([\w$.]+)`/i,symbolGroup:1,summarize:e=>`an argument of \`${e[1]}\` changed`},{id:"prose-symbol-no-longer-takes",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+no\s+longer\s+(?:takes|accepts|expects|requires)\s+(.{2,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` no longer takes ${e[2]?.trim()}`},{id:"prose-signature-changed-phrase",kind:"signature-change",pattern:/\b(?:call|constructor|method|function|callback)?\s*signature\s+(?:of\b[^.\n]{0,80}?)?\s*(?:has\s+|have\s+|is\s+|was\s+|were\s+)?(?:been\s+)?\bchanged\b|\bchanged\s+(?:the\s+)?(?:\w+\s+){0,3}signature\b/i,symbolGroup:0,summarize:()=>"a function signature changed"},{id:"prose-call-shape-rewrite",kind:"signature-change",pattern:/\b(?:refactor(?:ed|ing)?\s+)?([\w$.]+)\s*\((?:[^()]|\([^()]*\))*\)\s*(?:->|→|into)\s*\1\s*\(/i,symbolGroup:0,summarize:()=>"a call signature was rewritten"},{id:"prose-verb-signature",kind:"signature-change",refinement:!0,pattern:/\b(?:changed?|changing|updated?|updating|revamp(?:ed)?|rework(?:ed)?|adjust(?:ed)?|modif(?:y|ied)|switch(?:ed)?|new|different|generic\s+single)\s+(?:the\s+)?[\w`.$()/,&\s-]{0,45}?\bsignatures?\b|\bsignatures?\s+(?:of\b[^.\n]{0,60}?)?\s*(?:has\s+|have\s+|is\s+|was\s+|were\s+|now\s+|changed|change[ds]|updated?)\b|\b(?:two|multiple|separate|distinct|overloaded)\s+signatures?\b|\binterfaces?\s+(?:has\s+|have\s+)?changed\b/i,symbolGroup:0,summarize:()=>"a function signature changed"},{id:"prose-argument-list-changed",kind:"signature-change",refinement:!0,pattern:new RegExp([String.raw`\b(?:arg(?:ument)?|param(?:eter)?)s?\s+order\b`,String.raw`\bargs?\s+now\s+(?:given|passed|taken)\b`,String.raw`\b(?:standardi[sz]e|standardi[sz]ed)\s+(?:the\s+)?arg(?:ument)?s?\b`,String.raw`\barg(?:ument)?s?\s+(?:have\s+been\s+|were\s+|are\s+|been\s+)?(?:swapped|reordered|re-ordered)\b`,"\\b`?[\\w$.]+`?\\s+(?:arg(?:ument)?|param(?:eter)?)s?\\s+(?:(?:to|of|from|in|for)\\s+`?[\\w$.]+`?\\s+)?(?:have\\s+|has\\s+|have\\s+been\\s+|has\\s+been\\s+|is\\s+|are\\s+|was\\s+|were\\s+|been\\s+)?(?:removed|added|dropped|changed)\\b",String.raw`\breturn\s+types?\s+(?:has\s+|have\s+|now\s+)?(?:changed|change[ds])\b`,String.raw`\bupdate\s+[\w$.()]+\s+to\s+return\b`,String.raw`\btype\s+changed\s+from\b`,"\\breplaced?\\s+[\\w$.()`]{0,30}?\\s+args?\\s+w(?:ith|/)\\b","\\b(?:removed?|dropped?|added?)\\s+(?:the\\s+|a\\s+|an\\s+)?(?:deprecated\\s+|new\\s+|optional\\s+|required\\s+)?`?[\\w$.]+`?\\s+(?:arg(?:ument)?|param(?:eter)?)s?\\b",String.raw`\bno\s+longer\s+(?:accepts?|takes?|supports?|allows?|passes?)\b[^.\n]{0,45}?(?:arg(?:ument)?s?|param(?:eter)?s?|[Ss]elector|callbacks?|thisArg)\b`,String.raw`\bcall\s+pattern\s+is\s+no\s+longer\b`,String.raw`\bis\s+no\s+longer\s+(?:a\s+)?valid\s+call\b`,"\\b(?:`?thisArg`?|this\\s+argument)\\b[^.\\n]{0,40}?\\b(?:removed|no\\s+longer|default|undefined|dropped)\\b",String.raw`\b(?:requires?|required|takes?|needs?|accepts?|expects?)\s+(?:a\s+|an\s+|the\s+)?(?:new|additional|extra|second|third|fourth)\s+(?:constructor\s+)?(?:arg(?:ument)?|param(?:eter)?)s?\b`,String.raw`\b(?:constructor|function|method)\s+(?:signature\s+)?(?:now\s+)?(?:requires?|takes?|accepts?|expects?|required)\b`,String.raw`\bis\s+no\s+longer\s+(?:the\s+)?(?:first|second|third|fourth|fifth|last|\d+(?:st|nd|rd|th))\s+(?:arg(?:ument)?|param(?:eter)?)\b`,String.raw`\bnow\s+(?:have|has)\s+(?:two|three|multiple|several)\s+(?:arg(?:ument)?|param(?:eter)?)s?\b`,String.raw`\bnow\s+(?:two|three)\s+param(?:eter)?s\b`,"\\b(?:use|using|takes?|expects?|switch(?:ed)?\\s+`?[\\w$.]+`?(?:\\s+setting)?\\s+to|switch(?:ed)?\\s+to|pass(?:ing)?|is\\s+now|are\\s+now|it\\s+is\\s+now)\\s+(?:an?\\s+|two\\s+|the\\s+)?(?:object\\s+options?|options?\\s+(?:object|hash)|config(?:uration)?\\s+(?:object|hash)|`?[\\w$.]+`?\\s+option\\b)",String.raw`\b(?:options?|config(?:uration)?)\s+(?:object|hash)\s+(?:as\b|instead\b|for\b)`,String.raw`\bparam(?:eter)?s?\s+(?:are|is)\s+no\s+longer\s+optional\b`,String.raw`\bformerly\s+a\s+config\s+object\b`].join("|"),"i"),symbolGroup:0,summarize:()=>"an argument list changed"},{id:"prose-async-signature",kind:"signature-change",refinement:!0,pattern:/\b(?:make[s]?|made|turn(?:ed)?|change)\s+[\w`#.$()"\s]{1,40}?\s+(?:(?:in)?to\s+)?(?:be\s+)?(?:an?\s+)?a?sync(?:hronous)?(?:\s+function)?\b|\b(?:is|are|be)\s+(?:now\s+|an?\s+)*a?sync(?:hronous)?(?:\s+function|\s+now)?\b|\bnow\s+a?sync(?:hronous)?\b|\ba?sync\s+now\b|\basync\b[^.\n]{0,40}?\b(?:callback|promise|await|sync)\b|\b(?:callback|promise|sync)s?\b[^.\n]{0,40}?\basync\b|\bpromises?\s+instead\s+of\s+(?:using\s+)?callbacks?\b|\bnow\s+returns?\s+(?:a\s+|an\s+)?(?:promise|observable|thenable|query)\b|\bnow\s+return\s+promises\b|\breturns?\s+[\w"']+,?\s+not\s+(?:a\s+)?(?:promise|callback|query)\b|\b(?:needs?|has|have|dosnt\s+wait|doesn'?t\s+wait)\s+to\s+be\s+awaited\b|\bmust\s+(?:now\s+)?be\s+awaited\b|\b(?:update|change|updated)\s+(?:the\s+)?return\s+types?\b|\bdrop(?:ped|s)?\s+(?:support\s+for\s+)?callbacks?\b|\bremove[d]?\s+callback\s+support\b|\bno\s+(?:longer\s+)?(?:takes?|accepts?|using)\s+(?:a\s+|the\s+)?callbacks?\b/i,symbolGroup:0,summarize:()=>"a callback/return signature changed"},{id:"prose-symbol-now-required",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?\s+(?:is|are|becomes?|became)\s+now\s+(?:required|mandatory|non-optional)\b/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` is now required`},{id:"prose-is-now",kind:"behaviour-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+(?:is|are|must)\s+now\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` is now ${e[2]?.trim()}`},{id:"prose-moved",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has\s+)?moved\s+to\s+`([\w$./@-]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` moved to \`${e[2]}\``},...Eee.filter(e=>e.id.startsWith("prose-min-runtime")),{id:"prose-esm-only",kind:"module-system-change",pattern:/\b(?:this|the)\s+(?:package|project|library|module)\s+(?:is\s+)?now\s+(?:pure\s+ESM|ESM[\s-]only|an?\s+ESM\s+package)\b|\b(?:migrated|converted|switched)\s+(?:this|the)\s+(?:package|project|library|module)\s+to\s+ESM\b/i,symbolGroup:0,summarize:()=>"The package is now ESM-only and no longer supports `require()`",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"]}},{id:"prose-dropped-commonjs",kind:"module-system-change",pattern:/\b(?:dropped|removed)\s+CommonJS\s+support\b|\b(?:dropped|removed|no longer (?:supports|provides))\s+CommonJS\b|\bCommonJS\s+(?:is\s+)?no\s+longer\s+supported\b|\brequire\(\)\s+(?:is\s+)?no\s+longer\s+supported\b/i,symbolGroup:0,summarize:()=>"CommonJS support was dropped",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"]}},{id:"prose-breaking-change-footer",kind:"behaviour-change",pattern:/^BREAKING[ -]CHANGES?:\s*(.{3,160}?)(?:[.;]|$)/i,symbolGroup:0,summarize:e=>`Declared as a breaking change: ${e[1]?.trim()}`},{id:"prose-breaking-change-marker",kind:"unknown",pattern:/^BREAKING[ -]CHANGES?\b\s*:?\s*(?:none|n\/a)?\s*$/i,symbolGroup:0,summarize:()=>"Declared as a breaking change (no detail given)"}];function Aee(e){for(let t of e.split(` +`)){let n=t.replace(/\r$/,"").replace(/^\s*[-*>]+\s+/,"").replace(/\*{1,3}([^*\n]+?)\*{1,3}/g,"$1").replace(/\s*[-*=]{2,}\s*$/,"").trim();if(/^BREAKING[ -]CHANGES?\b[ \t]*(?::|[-–—][ \t]|$)/i.test(n)||/^#{1,6}[ \t].*\bbreaking\s+changes?\b/i.test(n))return!0}return!1}function Iee(e,t={}){let n=[],r=e.replace(/^[-*+]\s+/,"").trim();if(!r)return n;for(let i of NLe){let o=i.pattern.exec(r);if(!o)continue;let s=i.symbolGroup===0?null:o[i.symbolGroup];if(i.symbolGroup!==0&&!s)continue;let a=i.kind==="runtime-requirement"?OLe(o,i.id):void 0;if(i.kind==="runtime-requirement"&&!a)continue;let c=i.replacementGroup?o[i.replacementGroup]:void 0;n.push({ruleId:i.id,kind:i.kind,summary:a?a.kind==="minimum-runtime"?a.requirement.includes("||")?`Supported ${a.runtime} versions are now ${a.requirement}`:`Minimum ${a.runtime} version is now ${a.requirement}`:`${a.runtime} ${a.requirement} is no longer supported`:i.summarize(o),symbols:s?[s]:[],...a?{runtime:a}:{},replacementSymbols:c?[c]:[],...i.moduleSystem?{moduleSystem:{...i.moduleSystem,incompatibleUsage:[...i.moduleSystem.incompatibleUsage]}}:{},...i.refinement?{refinement:!0}:{},passage:r})}return t.anchored||n.some(i=>!i.refinement)?n:n.filter(i=>!i.refinement)}function OLe(e,t){let n=e[1]?.toLowerCase().replace(/\.js$/,""),r=e[2]?.trim();if(!n||!r||!["node","python","go","ruby","java","rust"].includes(n))return null;if(r.includes("||"))return MLe(n,r,e[0].trim(),t);let i=/^(?:([<>=^~]+)\s*)?v?(\d+(?:\.\d+){0,3})(?:(?:\s*,\s*|\s+)(?:[<>=^~]+\s*)?v?\d+(?:\.\d+){0,3})*$/i.exec(r);if(!i)return null;let o=i[1]??"",s=i[2],a=r.replace(/v?(\d+(?:\.\d+){0,3})/gi,(p,f)=>n==="java"?f.replace(/^1\.(\d+)(?=$|\.|\s|,)/,"$1"):f),c=e[0].trim(),l=CL(n,o),u=l.status,d=a.replace(/^\s*[<>=^~]*\s*/,l.operator||">=");if(t.startsWith("prose-dropped-runtime")){if(o===""){let p=s.split(".");return{kind:"unsupported-runtime-range",runtime:n,requirement:r.includes(",")||/\s+[<>=^~]/.test(r)?d:p.length<3?`${s}.x`:s,sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}return{kind:"unsupported-runtime-range",runtime:n,requirement:d,...o==="<"?{derivedMinimum:`>=${s}`}:{},...o==="<="?{derivedMinimum:`>${s}`}:{},sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}return{kind:"minimum-runtime",runtime:n,requirement:d,sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}function DLe(e){let t=/^v?(\d+(?:\.\d+){0,3})$/i.exec(e.trim());if(!t)return e;let n=t[1];return n.split(".").length<3?`${n}.x`:n}function MLe(e,t,n,r){let i=t.split("||").map(c=>c.trim()).filter(Boolean);if(i.length<2)return null;let o=PL[e].supportsDisjunction?"parsed":"unknown",s=[];for(let c of i){let l=/^(?:([<>=^~]+)\s*)?v?(\d+(?:\.\d+){0,3})(?:(?:\s*,\s*|\s+)(?:[<>=^~]+\s*)?v?\d+(?:\.\d+){0,3})*$/i.exec(c);if(!l)return null;let u=l[1]??"",d=CL(e,u);d.status==="unknown"&&(o="unknown");let p=c.replace(/v?(\d+(?:\.\d+){0,3})/gi,(f,m)=>e==="java"?m.replace(/^1\.(\d+)(?=$|\.|\s|,)/,"$1"):m);s.push(u===""?DLe(p):p.replace(/^\s*[<>=^~]*\s*/,d.operator))}let a={runtime:e,requirement:s.join(" || "),sourceText:n,...o==="unknown"?{rangeParseStatus:"unknown"}:{}};return r.startsWith("prose-dropped-runtime")?{kind:"unsupported-runtime-range",...a}:{kind:"minimum-runtime",...a}}function Ree(e,t){let n=e.symbols[0]??"the affected API",r=e.replacementSymbols[0];switch(e.kind){case"removed-export":return`\`${n}\` was removed from \`${t}\`. Replace every usage. Verify against the installed version's actual exports before choosing a replacement \u2014 the changelog may be incomplete.`;case"renamed-export":return r?`Replace every usage of \`${n}\` with \`${r}\`, checking that the new API's signature matches before assuming it is a drop-in rename.`:`\`${n}\` was replaced. Migrate every usage to the documented successor.`;case"signature-change":return`The way \`${n}\` is called changed: ${e.summary}. Update every call site and confirm against the installed type declarations.`;case"type-change":return`The type produced by \`${n}\` changed: ${e.summary}. Update consumers of its return value, including any local type declarations.`;case"behaviour-change":return`Behaviour changed: ${e.summary}. Review call sites for assumptions that no longer hold. Prefer making the assumption explicit over silently adapting to the new behaviour.`;case"runtime-requirement":return e.runtime?.kind==="unsupported-runtime-range"?e.runtime.derivedMinimum?`${e.runtime.runtime} ${e.runtime.requirement} is no longer supported. That unambiguously means a floor of ${e.runtime.derivedMinimum}; update the runtime version declared in CI workflows, engine fields, and container images accordingly.`:`${e.runtime.runtime} ${e.runtime.requirement} is no longer supported, but the release note does not establish a replacement minimum. Review the project's declared runtime against authoritative upstream compatibility guidance rather than inventing one.`:`${e.summary}. Update the runtime version declared in CI workflows, engine fields, and container images. Do not change application logic for this.`;case"module-system-change":return`\`${t}\` no longer exposes a CommonJS-compatible entry point. Update each localized \`require('${t}')\` site to use an ESM-compatible loading mechanism, usually a static \`import\` in an ESM module or a dynamic \`await import('${t}')\` where the surrounding CommonJS file cannot move. Do not downgrade the dependency, and do not convert the whole repository to ESM unless that is already the intended migration path.`;case"config-change":return`Configuration must change: ${e.summary}.`;default:return`Review usages of \`${n}\` and update them: ${e.summary}`}}var LLe=["api-shape","type-contract","behaviour","data-schema","configuration","runtime-environment","protocol","packaging"],FLe=["manifest","link-or-import","compile-time","static-semantic","test-time","runtime-only","external-observation"],ULe=["symbol","type","module","package","dependency-cohort","runtime","ecosystem"],jLe=["direct","transitive","wrapper-mediated","re-exported","reflection-or-dynamic","generated","unknown"];var zLe={"export-removed":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["direct"]},"member-removed":{nature:"api-shape",detectability:["compile-time"],scope:"symbol",visibility:["direct"]},"signature-changed":{nature:"type-contract",detectability:["compile-time","static-semantic"],scope:"symbol",visibility:["direct"]},"kind-changed":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["direct"]},"member-now-required":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["direct"]},"entry-point-moved":{nature:"packaging",detectability:["manifest","link-or-import"],scope:"package",visibility:["direct"]},"package-removed":{nature:"packaging",detectability:["manifest","link-or-import"],scope:"package",visibility:["direct"]},"commonjs-entry-removed":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"exports-require-condition-removed":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"package-type-changed":{nature:"packaging",detectability:["manifest","link-or-import","compile-time"],scope:"package",visibility:["direct"]},"constant-value-changed":{nature:"behaviour",detectability:["static-semantic","runtime-only"],scope:"symbol",visibility:["direct"]},...GLe()};function GLe(){let e={};for(let t of kl)for(let[n,r]of Object.entries(t.codes))e[n]=r.taxonomy;return e}var BLe={"removed-export":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["unknown"]},"renamed-export":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["unknown"]},"moved-export":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"module",visibility:["unknown"]},"signature-change":{nature:"type-contract",detectability:["compile-time","static-semantic"],scope:"symbol",visibility:["unknown"]},"type-change":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["unknown"]},"behaviour-change":{nature:"behaviour",detectability:["test-time","runtime-only"],scope:"symbol",visibility:["unknown"]},"default-change":{nature:"behaviour",detectability:["test-time","runtime-only"],scope:"symbol",visibility:["unknown"]},"removed-endpoint":{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"module",visibility:["unknown"]},"changed-endpoint":{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},"required-field-added":{nature:"data-schema",detectability:["compile-time","runtime-only"],scope:"type",visibility:["unknown"]},"config-change":{nature:"configuration",detectability:["static-semantic","runtime-only"],scope:"module",visibility:["unknown"]},"module-system-change":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"runtime-requirement":{nature:"runtime-environment",detectability:["manifest","runtime-only"],scope:"runtime",visibility:["direct"]},unknown:{nature:"behaviour",detectability:["runtime-only"],scope:"module",visibility:["unknown"]}};function Rp(e,t){let n=t?zLe[t]:void 0;if(n)return{...Pee(n),origin:"computed"};let r=BLe[e];return{...Pee(r),origin:e==="unknown"?"default":"rule"}}function Pee(e){return{nature:e.nature,detectability:[...e.detectability],scope:e.scope,visibility:[...e.visibility]}}function Vr(e){return e.taxonomy??Rp(e.kind)}function Oee(e,t){if(!e||typeof e!="object")return t;let n=e,r=Cee(n.nature,LLe),i=Cee(n.scope,ULe),o=Nee(n.detectability,FLe),s=Nee(n.visibility,jLe);return!r||!i?t:{nature:r,scope:i,detectability:o.length>0?o:[...t.detectability],visibility:s.length>0?s:["unknown"],origin:"llm-normalized"}}function Cee(e,t){return typeof e=="string"&&t.includes(e)?e:null}function Nee(e,t){if(!Array.isArray(e))return[];let n=new Set;for(let r of e)typeof r=="string"&&t.includes(r)&&n.add(r);return t.filter(r=>n.has(r))}function VS(e){let t=["manifest","link-or-import","compile-time","static-semantic"];return!e.detectability.some(n=>t.includes(n))}var nBe={type:"object",properties:{changes:{type:"array",items:{type:"object",properties:{summary:{type:"string",description:"One sentence stating what changed upstream and why it breaks consumers."},remediation:{type:"string",description:"Imperative instructions for fixing affected call sites."},symbols:{type:"array",items:{type:"string"},description:"Exact identifiers to search for in consumer code: export names, method names, option keys, endpoint paths. Empty if the evidence names none."},kind:{type:"string",enum:["removed-export","renamed-export","signature-change","type-change","behaviour-change","removed-endpoint","changed-endpoint","required-field-added","default-change","config-change","module-system-change","runtime-requirement","unknown"]},evidenceId:{type:"string",description:"The id of the evidence excerpt this was extracted from."},taxonomy:{type:"object",properties:{nature:{type:"string",enum:["api-shape","type-contract","behaviour","data-schema","configuration","runtime-environment","protocol","packaging"]},detectability:{type:"array",items:{type:"string",enum:["manifest","link-or-import","compile-time","static-semantic","test-time","runtime-only","external-observation"]},description:"What would have to run to notice this. Be honest: a change that only shows up at runtime must not be listed as compile-time."},scope:{type:"string",enum:["symbol","type","module","package","dependency-cohort","runtime","ecosystem"]},visibility:{type:"array",items:{type:"string",enum:["direct","transitive","wrapper-mediated","re-exported","reflection-or-dynamic","generated","unknown"]},description:"Use `unknown` when the evidence does not say. Do not guess `direct`."}},required:["nature","detectability","scope","visibility"],additionalProperties:!1}},required:["summary","remediation","symbols","kind","evidenceId"],additionalProperties:!1}}},required:["changes"],additionalProperties:!1},rBe=`You extract breaking changes from dependency release notes for an automated refactoring tool. Rules you must follow: @@ -1416,70 +1394,70 @@ Rules you must follow: 3. \`symbols\` must be identifiers that would literally appear in consumer source code. Never put prose, descriptions, or package names there. If the evidence describes a change without naming an identifier, return an empty \`symbols\` array rather than inventing one. 4. \`evidenceId\` must be copied exactly from the evidence block the finding came from. 5. Do not restate a change that is already listed under "Already found" \u2014 those are handled. -6. Write \`remediation\` as instructions to an engineer, describing what to change. Do not speculate about replacements the evidence does not mention; say the replacement is unknown instead.`;async function h7(e,t,n,i){let{config:r,logger:o}=i,s=i.client??await RF(r,o);if(!s)return[];let a=t.filter(l=>!l.findings?.length&&l.source!=="semver-heuristic"&&l.source!=="registry-metadata");if(a.length===0)return[];let c=[];for(let l of e){let u=a.filter(d=>d.dependency===l.name&&d.workspace===l.workspace);if(u.length!==0)try{let d=await FOe(s,r,l,u,n,o);c.push(...UOe(d,l.name,l.workspace,u))}catch(d){o.warn(`LLM extraction failed for ${l.name}: ${d.message}`)}}return c}async function RF(e,t){let n=process.env[e.llm.apiKeyEnv];return n?LOe(n,t):(t.warn(`llm.enabled is true but ${e.llm.apiKeyEnv} is not set; skipping LLM extraction. The rule-based analyser still ran.`),null)}async function LOe(e,t){try{let n=await Promise.resolve().then(()=>(VM(),m7));return new n.default({apiKey:e})}catch{return t.warn("llm.enabled is true but @anthropic-ai/sdk is not installed. Run `npm install @anthropic-ai/sdk` or set llm.enabled: false."),null}}async function FOe(e,t,n,i,r,o){let s=r.filter(p=>p.dependency===n.name&&p.workspace===n.workspace).map(p=>`- ${p.summary}`).join(` -`),a=i.map(p=>` -${GOe(p.content,6e3)} +6. Write \`remediation\` as instructions to an engineer, describing what to change. Do not speculate about replacements the evidence does not mention; say the replacement is unknown instead.`;async function qoe(e,t,n,r){let{config:i,logger:o}=r,s=r.client??await Qz(i,o);if(!s)return[];let a=t.filter(l=>!l.findings?.length&&l.source!=="semver-heuristic"&&l.source!=="registry-metadata");if(a.length===0)return[];let c=[];for(let l of e){let u=a.filter(d=>d.dependency===l.name&&d.workspace===l.workspace);if(u.length!==0)try{let d=await oBe(s,i,l,u,n,o);c.push(...sBe(d,l.name,l.workspace,u))}catch(d){o.warn(`LLM extraction failed for ${l.name}: ${d.message}`)}}return c}async function Qz(e,t){let n=process.env[e.llm.apiKeyEnv];return n?iBe(n,t):(t.warn(`llm.enabled is true but ${e.llm.apiKeyEnv} is not set; skipping LLM extraction. The rule-based analyser still ran.`),null)}async function iBe(e,t){try{let n=await Promise.resolve().then(()=>(Boe(),Goe));return new n.default({apiKey:e})}catch{return t.warn("llm.enabled is true but @anthropic-ai/sdk is not installed. Run `npm install @anthropic-ai/sdk` or set llm.enabled: false."),null}}async function oBe(e,t,n,r,i,o){let s=i.filter(p=>p.dependency===n.name&&p.workspace===n.workspace).map(p=>`- ${p.summary}`).join(` +`),a=r.map(p=>` +${lBe(p.content,6e3)} `).join(` `),c=[`Dependency: ${n.name} (${n.ecosystem})`,`Version change: ${n.from} \u2192 ${n.to} (${n.bump})`,"",s?`Already found by deterministic rules \u2014 do not repeat these: ${s} `:"","Evidence:",a].filter(Boolean).join(` -`),l=await e.messages.create({model:t.llm.model,max_tokens:16e3,system:MOe,thinking:{type:"adaptive"},output_config:{effort:t.llm.effort,format:{type:"json_schema",schema:OOe}},messages:[{role:"user",content:c}]});if(l.stop_reason==="refusal")return o.warn(`The model declined to analyse the prose for ${n.name}, so nothing was extracted from it. The rule-based analyser still ran.`),[];let u=l.content.find(p=>p.type==="text")?.text;if(!u)return o.warn(`The model returned no text for ${n.name}${l.stop_reason?` (stop reason: ${l.stop_reason})`:""}, so nothing was extracted from its prose.`),[];let d;try{d=JSON.parse(u)}catch(p){return o.warn(`The model's answer for ${n.name} was not readable as JSON (${p.message}), so nothing was extracted from its prose.`),[]}return Array.isArray(d.changes)?d.changes:(o.warn(`The model's answer for ${n.name} carried no \`changes\` array, so nothing was extracted from its prose.`),[])}function UOe(e,t,n,i){let r=new Set(i.map(o=>o.id));return e.filter(o=>r.has(o.evidenceId)).filter(o=>o.summary?.trim()).map(o=>({id:St("bc",t,n,"llm",o.summary),dependency:t,workspace:n,kind:g7(o.kind),summary:o.summary.trim(),remediation:o.remediation?.trim()||`Review usages of ${t} and update them.`,symbols:(o.symbols??[]).filter(jOe),confidence:"medium",taxonomy:p5(o.taxonomy,sp(g7(o.kind))),citations:[o.evidenceId]}))}function jOe(e){let t=e.trim();return!t||t.length>80||/\s/.test(t)&&!t.startsWith("/")?!1:/^[/@]?[\w$][\w$./{}-]*$/.test(t)}var zOe=new Set(["removed-export","renamed-export","signature-change","type-change","behaviour-change","removed-endpoint","changed-endpoint","required-field-added","default-change","config-change","module-system-change","runtime-requirement"]);function g7(e){return zOe.has(e)?e:"unknown"}function GOe(e,t){return e.length<=t?e:`${e.slice(0,t)} -\u2026(truncated)`}function VOe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}var k7=require("node:crypto");var BOe=[{band:"high",min:.8},{band:"medium",min:.5},{band:"low",min:.2},{band:"none",min:0}];function NF(e){for(let t of BOe)if(e>=t.min)return t.band;return"none"}var y7={high:"Very confident",medium:"Fairly confident",low:"Not very confident",none:"Not enough evidence to say"};var Ql="drift-confidence-1",qOe={"type-surface-diff":"computed-artifact",...d8,changelog:"maintainer-narrative","github-release":"maintainer-narrative","migration-guide":"maintainer-guide","behavioural-diff":"dynamic-observation","registry-metadata":"registry","semver-heuristic":"heuristic"},WOe={"computed-artifact":.9,"maintainer-guide":.7,"maintainer-narrative":.6,"dynamic-observation":.5,registry:.4,heuristic:.2},b7=new WeakMap;function PF(e){let{change:t,evidence:n}=e,i=n.filter(d=>t.citations.includes(d.id)),r=[],o=[];if(i.length===0)return{score:0,band:"none",evidence:[],penalties:[{code:"no-citations",detail:"No evidence record backs this finding.",delta:0}],calibration:Ql};let s=HOe(i),a=0,c="";for(let d of s.keys()){let p=WOe[d]??.3;p>a&&(a=p,c=d)}r.push({code:`origin:${c}`,detail:`Strongest evidence class is ${CF(c)}.`,delta:a});let l=a,u=s.size-1;if(u>0){let d=Math.min(.15,.08*u);l+=d,r.push({code:"corroborated",detail:`Corroborated by ${u} other independent source class(es): ${[...s.keys()].filter(p=>p!==c).map(CF).join(", ")}.`,delta:d})}else i.length>1&&o.push({code:"single-origin",detail:`All ${i.length} citations trace to one source class (${CF(c)}), so they do not corroborate each other.`,delta:0});return s.size===1&&c==="heuristic"&&(l+=-.1,o.push({code:"heuristic-only",detail:"Only a semver heuristic supports this; no changelog, release note, or API diff was retrieved.",delta:-.1})),OF(l,r,o)}function HOe(e){let t=new Map,n=new Set;for(let i of e){let r=b7.get(i);if(r===void 0&&(r=(0,k7.createHash)("sha256").update(i.content.replace(/\s+/g," ").trim().toLowerCase()).digest("hex"),b7.set(i,r)),n.has(r))continue;n.add(r);let o=qOe[i.source]??"unknown",s=t.get(o);s?s.push(i):t.set(o,[i])}return t}function CF(e){switch(e){case"computed-artifact":return"a computed diff of the shipped artifact";case"maintainer-guide":return"a migration guide";case"maintainer-narrative":return"release notes or a changelog";case"registry":return"registry metadata";case"heuristic":return"a semver heuristic";default:return e}}function KOe(e){let{taxonomy:t,sites:n,localizationRan:i}=e,r=[],o=[];if(!i)return{score:0,band:"none",evidence:[],penalties:[{code:"localization-unavailable",detail:"No checkout was available, so Drift could not search this repository. This is not evidence that the change is unused.",delta:0}],calibration:Ql};if(t.scope==="runtime"&&e.runtimeState==="compatible")return{score:.85,band:"high",evidence:[{code:"runtime-compatible",detail:"The repository runtime declaration satisfies the requirement.",delta:.85}],penalties:[],calibration:Ql};if(n.length===0){let d=u_(t),p=e.localizationComplete===!1,f=t.scope==="runtime";return{score:0,band:"none",evidence:[],penalties:[{code:f?"runtime-compatibility-unresolved":p?"localization-incomplete":d?"not-locally-checkable":"no-usage-found",detail:f?"This is a requirement on the runtime this repository builds and deploys on, not on any code it calls. No source search can answer it; the repository's own declared runtime version is what decides.":p?"Drift searched the indexed source subset, but the file limit prevented an exhaustive absence claim.":d?"This change is only observable at runtime, so a source search cannot establish whether this repository is affected.":"Drift searched the files that import this dependency and found no usage of the affected symbols.",delta:0}],calibration:Ql}}let s=n.reduce((d,p)=>w7(p.confidence)>w7(d.confidence)?p:d),a=s.confidence==="high"?.85:s.confidence==="medium"?.6:.3;r.push({code:`site:${s.confidence}`,detail:s.confidence==="high"?`\`${s.matchedSymbol}\` is bound from an import of this dependency in ${s.file}.`:s.confidence==="medium"?`${s.file} imports this dependency and uses \`${s.matchedSymbol}\`, but the symbol was not traced to the import.`:`\`${s.matchedSymbol}\` appears in ${s.file}, but no import of this dependency was established \u2014 the match may be coincidental.`,delta:a});let c=a;if(n.length>1){let d=Math.min(.05,.01*(n.length-1));c+=d,r.push({code:"multiple-sites",detail:`${n.length} affected locations across ${new Set(n.map(p=>p.file)).size} file(s).`,delta:d})}let l=n.filter(d=>JOe(d.file));return l.length===n.length?(c+=-.25,o.push({code:"generated-only",detail:`Every affected location is in generated code (${l[0].file}). Editing it is usually wrong; the generator is the real site.`,delta:-.25})):l.length>0&&(c+=-.05,o.push({code:"some-generated",detail:`${l.length} affected location(s) are in generated code.`,delta:-.05})),t.visibility.includes("reflection-or-dynamic")&&(c+=-.2,o.push({code:"dynamic-access",detail:"Dynamic or reflective access was detected, so the affected set cannot be enumerated by search.",delta:-.2})),t.visibility.includes("wrapper-mediated")&&(c+=-.1,o.push({code:"wrapper-mediated",detail:"Usage is mediated by a local wrapper, so downstream callers of the wrapper are not enumerated here.",delta:-.1})),n.every(d=>d.confidence==="low")&&(c+=-.1,o.push({code:"textual-only",detail:"Every match is textual \u2014 no import edge was established for any of them.",delta:-.1})),OF(c,r,o)}function JOe(e){let t=e.toLowerCase();return/(^|\/)(generated|__generated__|gen|dist|build|out|vendor|node_modules)\//.test(t)||/\.(g|generated)\.[a-z]+$/.test(t)||/\.pb\.(go|ts|js|py)$/.test(t)||/_pb2?\.py$/.test(t)||/\.d\.ts$/.test(t)}function ZOe(e){let{outcomes:t,affectedFiles:n,taxonomy:i}=e;if(t.length===0)return{score:0,band:"none",evidence:[],penalties:[{code:"nothing-ran",detail:"No checks were run against this finding, so nothing confirms the change was understood correctly.",delta:0}],calibration:Ql};let r=[],o=[],s=t.filter(p=>p.status==="passed"),a=t.filter(p=>p.status==="failed"),c=t.filter(p=>p.status==="skipped"||p.status==="unavailable"||p.status==="timed-out");if(a.length>0)return{score:0,band:"none",evidence:[],penalties:[{code:"checks-failed",detail:`${a.length} check(s) failed: ${a.map(p=>p.name).join(", ")}.`,delta:0}],calibration:Ql};let l=0,u=i.detectability.some(p=>p==="compile-time"||p==="link-or-import"||p==="manifest");for(let p of s){let f=/type|compile|build|lint/i.test(p.name),g=/test|spec/i.test(p.name)?.45:f?u?.4:.15:.1;l+=g,r.push({code:`passed:${p.name}`,detail:f&&!u?`\`${p.name}\` passed, but this change is not detectable at compile time \u2014 it does not confirm the behaviour is right.`:`\`${p.name}\` passed.`,delta:g})}for(let p of c)o.push({code:`did-not-run:${p.name}`,detail:`\`${p.name}\` was ${p.status} and proves nothing.`,delta:0});let d=new Set(s.flatMap(p=>p.covers??[]));return d.size>0&&n.length>0?n.filter(f=>d.has(f)).length===0&&(l+=-.2,o.push({code:"no-coverage",detail:"The checks that passed do not cover any of the affected files.",delta:-.2})):n.length>0&&o.push({code:"coverage-unknown",detail:"Which code paths the passing checks cover could not be established.",delta:0}),OF(l,r,o)}function $7(e){let t=PF({change:e.change,evidence:e.evidence}),n=KOe({change:e.change,taxonomy:e.taxonomy,sites:e.sites,localizationRan:e.localizationRan,localizationComplete:e.localizationComplete,runtimeState:e.runtimeState}),i=ZOe({outcomes:e.outcomes??[],affectedFiles:[...new Set(e.sites.map(a=>a.file))],taxonomy:e.taxonomy}),r=[...e.gaps??[]],o=[];t.band==="high"&&n.band==="none"&&o.push({code:"upstream-only",detail:"The upstream change is well established, but nothing in this repository was shown to be affected. High upstream confidence is not a reason to edit code.",delta:0});let s=t.band==="high"&&(n.band==="high"||n.band==="medium")&&!r.some(a=>a.automaticExecution==="blocks");return{upstream:t,localImpact:n,verification:i,automaticExecutionEligible:s,reasons:o,checkedSurfaces:[...e.checkedSurfaces??[]],gaps:r}}function DF(e){let{upstream:t,localImpact:n,verification:i}=e,r=n.band==="none"?Math.min(t.score,.55):Math.min(t.score,n.score),o=i.score>0?Math.min(.1,i.score*.15):0,s=Math.round(Math.max(0,Math.min(1,r+o))*100),a=NF(s/100);return{score:s,band:a,label:y7[a]}}function _7(e){let t=e.upstream.band,n=e.localImpact.band;return n==="none"?t==="high"?"medium":v7(t):v7(YOe(t,n))}function v7(e){return e==="high"?"high":e==="medium"?"medium":"low"}function YOe(e,t){let n=["none","low","medium","high"];return n.indexOf(e)<=n.indexOf(t)?e:t}function w7(e){return e==="high"?2:e==="medium"?1:0}function OF(e,t,n){let i=Math.round(Math.max(0,Math.min(1,e))*100)/100;return{score:i,band:NF(i),evidence:t,penalties:n,calibration:Ql}}async function BS(e,t,n){let{config:i,logger:r}=n,o=QOe(t),s=[];for(let a of e){let c=o.get(zc(a))??[];s.push(...XOe(a.name,a.workspace,c))}for(let a of t)a8(a.source)&&s.push(...E7(a));if(i.llm.enabled){let a=await h7(e,t,s,{config:i,logger:r});s.push(...a)}return iMe(sMe(s),t)}function QOe(e){let t=new Map;for(let n of e){let i=zc({name:n.dependency,workspace:n.workspace}),r=t.get(i);r?r.push(n):t.set(i,[n])}return t}function XOe(e,t,n){let i=[];for(let r of n){if(r.findings?.length){i.push(...E7(r));continue}if(r.source!=="semver-heuristic"){if(r.source==="registry-metadata"){i.push(...x7(r,e,t).filter(o=>o.kind==="runtime-requirement"));continue}i.push(...x7(r,e,t))}}return i}function eMe(e,t){return e.replace(/`default\.([\w$]+)`/g,`\`${t}.$1\``).replace(/`default` is no longer exported/g,`\`${t}\` no longer has a default export`).replace(/`default`/g,`the default export of \`${t}\``)}function E7(e){return(e.findings??[]).map(t=>{let n=l_(t.code),i=n==="module-system-change"?t.moduleSystem??{from:"dual",to:"esm",incompatibleUsage:["require"]}:void 0;return{id:St("bc",e.dependency,e.workspace,t.code,t.symbol,i?.affectedSpecifiers?.join(",")??"",i?.affectedSpecifierPatterns?.join(",")??""),dependency:e.dependency,workspace:e.workspace,kind:n==="removed-export"&&t.replacement?"renamed-export":n,summary:eMe(t.detail,e.dependency),...t.replacement?{replacementSymbols:[t.replacement]}:{},...n==="runtime-requirement"&&t.after?{runtime:{kind:"minimum-runtime",runtime:"java",requirement:`>=${t.after}`,sourceText:t.detail}}:{},before:t.before,after:t.after,...t.fromKind?{fromKind:t.fromKind}:{},...t.toKind?{toKind:t.toKind}:{},remediation:o5(t,e.dependency),symbols:tMe(t),...i?{moduleSystem:{...i,incompatibleUsage:[...i.incompatibleUsage],...i.affectedSpecifiers?{affectedSpecifiers:[...i.affectedSpecifiers]}:{},...i.affectedSpecifierPatterns?{affectedSpecifierPatterns:[...i.affectedSpecifierPatterns]}:{}}}:{},confidence:"high",taxonomy:sp(n,t.code),citations:[e.id]}})}function tMe(e){if(l_(e.code)==="module-system-change")return[];let t=new Set([e.symbol]);if(e.symbol.includes(".")&&!/\s/.test(e.symbol)){let i=e.symbol.split("."),r=i[i.length-1];if(r&&!S7(r)&&t.add(r),i.length>2){let o=i[i.length-2];o&&t.add(`${o}.${r}`)}if(i.length>=2&&l_(e.code)==="required-field-added"){let o=i[i.length-2];o&&!S7(o)&&t.add(o)}}let n=/^[A-Z]+\s+(\/\S*)$/.exec(e.symbol);if(n?.[1]){t.add(n[1]);let i=n[1].split("{")[0]?.replace(/\/$/,"");i&&i.length>1&&t.add(i)}return[...t]}function S7(e){return/^__\w+__$/.test(e)?!0:nMe.has(e.toLowerCase())}var nMe=new Set(["add","all","any","append","apply","build","call","check","clear","clone","close","connect","copy","count","create","define","delete","each","emit","end","execute","exists","extend","fetch","filter","find","first","flush","format","get","handle","has","index","init","insert","is","items","iter","join","keys","last","length","list","load","log","main","map","match","new","next","open","parse","pop","push","put","query","read","remove","render","reset","resolve","run","save","send","set","size","sort","split","start","stop","update","wait","write","args","body","config","content","context","data","error","file","header","headers","host","id","key","name","options","params","path","port","result","root","status","text","type","url","value","values","and","or","not","if","elif","else","for","while","do","in","of","as","with","from","to","try","catch","finally","throw","raise","except","switch","case","break","continue","return","yield","class","def","function","lambda","const","let","var","this","self","super","null","nil","none","true","false","async","await","typeof","instanceof","void","enum","interface","extends","implements","export","import","static","public","private","protected","default","pass","then"]);function x7(e,t,n){let i=[],r=new Set,o=s5(e.content);for(let s of e.content.split(` -`))for(let a of a5(s,{anchored:o})){let c=`${a.kind}:${a.symbols.join(",")}`;if(r.has(c))continue;r.add(c);let l=a.symbols.length>0||a.kind==="module-system-change"?a.symbols:[t];i.push({id:St("bc",t,n,a.ruleId,a.symbols.join(",")),dependency:t,workspace:n,kind:a.kind,summary:a.summary,remediation:c5(a,t),symbols:l,...a.runtime?{runtime:a.runtime}:{},replacementSymbols:a.replacementSymbols.length?a.replacementSymbols:void 0,...a.moduleSystem?{moduleSystem:a.moduleSystem}:{},confidence:rMe(e),taxonomy:sp(a.kind),citations:[e.id]})}return i}function rMe(e){return e.weight>=.95?"high":e.weight>=.6?"medium":"low"}function iMe(e,t){return e.map(n=>{let i=PF({change:n,evidence:t});return{...n,confidence:oMe(i.band)}})}function oMe(e){return e==="high"?"high":e==="medium"?"medium":"low"}function sMe(e){let t=new Map;for(let i of e){let r=aMe(i),o=t.get(r);if(!o){t.set(r,{...i,citations:[...new Set(i.citations)]});continue}t.set(r,{...o,summary:o.summary.length>=i.summary.length?o.summary:i.summary,symbols:[...new Set([...o.symbols,...i.symbols])],replacementSymbols:[...new Set([...o.replacementSymbols??[],...i.replacementSymbols??[]])].filter(Boolean).length?[...new Set([...o.replacementSymbols??[],...i.replacementSymbols??[]])]:void 0,moduleSystem:cMe(o.moduleSystem,i.moduleSystem),confidence:uMe(o.confidence,i.confidence),taxonomy:lMe(Or(o),Or(i)),citations:[...new Set([...o.citations,...i.citations])]})}let n={high:0,medium:1,low:2};return[...t.values()].sort((i,r)=>n[i.confidence]-n[r.confidence]||i.dependency.localeCompare(r.dependency))}function aMe(e){let t=zc({name:e.dependency,workspace:e.workspace});return e.kind==="module-system-change"?[t,e.kind,[...e.moduleSystem?.incompatibleUsage??[]].sort().join(","),e.moduleSystem?.affectedSpecifiers?.length?[...e.moduleSystem.affectedSpecifiers].sort().join(","):"*",e.moduleSystem?.affectedSpecifierPatterns?.length?[...e.moduleSystem.affectedSpecifierPatterns].sort().join(","):"*"].join("|"):`${t}|${e.kind}|${[...e.symbols].sort().join(",")}`}function cMe(e,t){if(!e)return t;if(!t)return e;let n=[...new Set([...e.incompatibleUsage,...t.incompatibleUsage])],i=e.affectedSpecifiers||t.affectedSpecifiers?[...new Set([...e.affectedSpecifiers??[],...t.affectedSpecifiers??[]])]:void 0,r=e.affectedSpecifierPatterns||t.affectedSpecifierPatterns?[...new Set([...e.affectedSpecifierPatterns??[],...t.affectedSpecifierPatterns??[]])]:void 0;return{from:e.from??t.from,to:e.to??t.to,incompatibleUsage:n,...i?{affectedSpecifiers:i}:{},...r?{affectedSpecifierPatterns:r}:{}}}function lMe(e,t){let n={computed:3,rule:2,"llm-normalized":1,default:0};return n[e.origin]>=n[t.origin]?e:t}function uMe(e,t){let n={low:0,medium:1,high:2};return n[e]>=n[t]?e:t}function MF(e,t){let n={low:0,medium:1,high:2};return n[e]>=n[t]}function qS(e){return e.keys??[e.packageName]}function _f(e){let t=[],n=new Map,i=new Set(e.map(s=>s.path));for(let s of e){let a=dMe(s),c=VMe(s);t.push({path:s.path,language:s.language,lineCount:s.lineCount,imports:a,localImports:pMe(s),units:c,summary:JMe(s,c,a)});for(let l of new Set(a.flatMap(qS))){let u=n.get(l);u?u.push(s.path):n.set(l,[s.path])}}let r=new Map,o=hMe(i);for(let s of t)for(let a of s.localImports){let c=yMe(s.path,a.specifier,i,o);if(!c||c===s.path)continue;let l=r.get(c),u={from:s.path,bindings:a.bindings,reExport:a.reExport,line:a.line};l?l.push(u):r.set(c,[u])}return{files:t,importers:n,localImporters:r,stats:{fileCount:t.length,unitCount:t.reduce((s,a)=>s+a.units.length,0),totalLines:t.reduce((s,a)=>s+a.lineCount,0)}}}function FF(e,t){let n;for(let i of e.units)ti.endLine||(!n||i.endLine-i.startLine]+)>|"([^"]+)")/.exec(n[i]),o=r?.[1]??r?.[2];o&&t.push({specifier:o,line:i+1,bindings:[],reExport:!0})}return t}function hMe(e){let t=new Map,n=(i,r)=>{let o=t.get(i);o?o.push(r):t.set(i,[r])};for(let i of e){let r=i.split("/").pop()??i;n(r.toLowerCase(),i)}return t}var T7=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".py"];function yMe(e,t,n,i){if(t.startsWith(".")){let s=e.split("/").slice(0,-1),a=bMe([...s,...t.split("/")]);if(a===void 0)return;let l=/^\.+$/.test(t)||!t.includes("/")&&t.startsWith(".")?[`${I7(e,t)}.py`,`${I7(e,t)}/__init__.py`]:[a,...T7.map(u=>a+u),...T7.map(u=>`${a}/index${u}`),`${a}/__init__.py`];for(let u of l)if(u&&n.has(u))return u;return}let r=(t.split("/").pop()??t).toLowerCase(),o=(i.get(r)??[]).filter(s=>s.toLowerCase().endsWith(t.toLowerCase()));return o.length===1?o[0]:void 0}function bMe(e){let t=[];for(let n of e)if(!(n===""||n===".")){if(n===".."){if(t.length===0)return;t.pop();continue}t.push(n)}return t.join("/")}function I7(e,t){let n=/^\.+/.exec(t)?.[0].length??1,i=t.slice(n).split(".").filter(Boolean);return[...e.split("/").slice(0,-n),...i].join("/")}function vMe(e){let t=[],n=e.split(` -`);for(let i=0;i]+)>|"([^"]+)")/.exec(n[i]),o=r?.[1]??r?.[2];o&&(o.startsWith(".")||t.push({specifier:o,packageName:wMe(o),bindings:[],line:i+1,reExport:!0}))}return t}function wMe(e){return(e.split("/")[0]??e).replace(/\.(h|hpp|hh|hxx|inl|tpp|h\+\+)$/i,"").toLowerCase()}function kMe(e){let t=gO(e),n=[],i=P7(t),r=d=>D7(i,d),o=/\bimport\s+(?!\()(?:(?:type\s+)?([\w$]+)\s*,\s*)?(?:type\s+)?(?:\{([^}]+)\}|\*\s+as\s+([\w$]+)|([\w$]+))\s+from\s+['"]([^'"]+)['"]|\bimport\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(o)){let p=d[5]??d[6];if(!p||wf(p))continue;let f=LF(d[1],d[2],d[3],d[4]),m=d[1]??d[4];n.push({specifier:p,packageName:kf(p),bindings:f,...m?{defaultBinding:m}:{},line:r(d.index??0),loadStyle:"esm-static"})}let s=/\b(?:const|let|var)\s+(\{[^}]+\}|[\w$]+)\s*=\s*require\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of t.matchAll(s)){let p=d[2];if(wf(p))continue;let f=d[1],m=f.startsWith("{")?void 0:f;n.push({specifier:p,packageName:kf(p),bindings:$Me(f),...m?{defaultBinding:m}:{},line:r(d.index??0),loadStyle:"commonjs-require"})}let a=/\bimport\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of t.matchAll(a)){let p=d[1];wf(p)||n.push({specifier:p,packageName:kf(p),bindings:[],line:r(d.index??0),loadStyle:"esm-dynamic"})}let c=/\bexport\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(c)){let p=d[2];wf(p)||n.push({specifier:p,packageName:kf(p),bindings:LF(void 0,d[1],void 0,void 0),line:r(d.index??0),reExport:!0,loadStyle:"re-export"})}let l=/\bexport\s+\*\s+as\s+([\w$]+)\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(l)){let p=d[2];wf(p)||n.push({specifier:p,packageName:kf(p),bindings:["*",d[1]],line:r(d.index??0),reExport:!0,loadStyle:"re-export"})}let u=/\bexport\s+\*\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(u)){let p=d[1];wf(p)||n.push({specifier:p,packageName:kf(p),bindings:["*"],line:r(d.index??0),reExport:!0,loadStyle:"re-export"})}return n.sort((d,p)=>d.line-p.line||d.specifier.localeCompare(p.specifier))}function LF(e,t,n,i){let r=[];if(e&&r.push(e),i&&r.push(i),n&&r.push("*",n),t)for(let o of t.split(",")){let s=o.replace(/\btype\s+/g,"").trim();if(!s)continue;let[a,c]=s.split(/\s+as\s+/).map(l=>l.trim());a&&r.push(c||a,a)}return[...new Set(r)]}function $Me(e){let t=e.trim();return t.startsWith("{")?t.replace(/[{}]/g,"").split(",").flatMap(n=>{let[i,r]=n.split(":").map(o=>o.trim());return[i,r].filter(o=>!!o)}):[t]}function _Me(e,t){let n=[],i=e.split(` -`),r=t.endsWith("/__init__.py")||t==="__init__.py";for(let o=0;o{let n=/^\s*(\w+)(?:\s+as\s+(\w+))?/.exec(t);return n?[n[1],n[2]].filter(Boolean):[]}).flat()}function SMe(e){let t=[],n=e.split(` -`),i=!1;for(let r=0;r{let r=i.trim();if(!r)return;let o=r.indexOf("{");if(o!==-1){let c=r.lastIndexOf("}"),l=r.slice(o+1,c===-1?void 0:c);for(let u of TMe(l))n(u);return}let s=/\bas\s+([\w*]+)\s*$/.exec(r);if(s?.[1]){t.push(s[1]);return}let a=r.split("::").pop()?.trim();if(a&&(t.push(a==="*"?"*":a),a==="self")){let c=r.split("::").slice(-2,-1)[0]?.trim();c&&t.push(c)}};return n(e),[...new Set(t.filter(i=>i!=="self"))]}function TMe(e){let t=[],n=0,i="";for(let r of e){if(r==="{"?n+=1:r==="}"&&(n-=1),r===","&&n===0){t.push(i),i="";continue}i+=r}return t.push(i),t}function IMe(e){let t=[],n=e.split(` -`);for(let i=0;io.slice(0,a+1).join("\\")).reverse()}}function DMe(e){let t=[],n=new Set,i=e.split(` -`),r=(s,a,c,l=!1)=>{let u=s.split(".")[0];if(!/^[A-Z]/.test(u)||OMe.has(u)||n.has(s))return;n.add(s);let d=s.split(".");t.push({specifier:s,packageName:u,bindings:[...new Set([a,s])],line:c,keys:d.map((p,f)=>d.slice(0,f+1).join(".")).reverse(),...l?{synthetic:!0}:{}})},o=!1;for(let s=0;s{zMe.has(l)||n.has(l)||(n.add(l),t.push({specifier:l,packageName:l,bindings:[l],line:r+1,...u?{synthetic:!0}:{}}))},a=/^\s*open\s+([A-Z][\w']*)/.exec(o);if(a?.[1]){s(a[1]);continue}let c=/^\s*module\s+[A-Z][\w']*\s*=\s*([A-Z][\w']*)/.exec(o);if(c?.[1]){s(c[1]);continue}for(let l of o.matchAll(/\b([A-Z][\w']*)\.[a-z_]/g))s(l[1],!0)}return t}var zMe=new Set(["Stdlib","List","Array","String","Bytes","Char","Int","Int32","Int64","Float","Bool","Option","Result","Hashtbl","Map","Set","Buffer","Printf","Format","Sys","Unix","Filename","Sort","Queue","Stack","Lazy","Seq","Fun","Either","Printexc","Random","Digest","Obj"]);function GMe(e){let t=e.trim();if(!t)return["*"];let n=[],i=/\bshow\s+([\w\s,]+)/.exec(t);i?.[1]&&n.push(...i[1].split(",").map(o=>o.trim()).filter(Boolean));let r=/\bas\s+(\w+)/.exec(t);return r?.[1]&&n.push(r[1]),n.length===0&&n.push("*"),[...new Set(n)]}function wf(e){return e.startsWith(".")||e.startsWith("/")||e.startsWith("#")}function kf(e){let t=e.split("/");return e.startsWith("@")?t.slice(0,2).join("/"):t[0]??e}function VMe(e){return e.language==="typescript"||e.language==="javascript"?BMe(e.content,e.path):HMe(e.content,e.language)}function BMe(e,t){let n=[],i=e.split(` -`),r=WMe(i),o=(s,a,c,l,u,d)=>{n.push({name:s,kind:a,startLine:c,endLine:l,summary:L7(u),exported:d})};for(let s=0;s|^\s*=\s*(?:async\s*)?function\b/.test(h);o(m[1],b?"function":"variable",s+1,R7(i,s)+1,`${b?"const fn":"const"} ${m[1]}`,l);continue}let g=/^(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+([\w$]+)/.exec(c);g&&o(g[1],"module",s+1,$f(i,s)+1,`module ${g[1]}`,l)}return n}function qMe(e,t,n,i,r){let o=0;for(let s=t;s{let a=r.slice(s+1).find(c=>c.indent<=o.indent);return{name:o.name,kind:o.kind,startLine:o.line,endLine:a?a.line-1:i.length,summary:o.summary,exported:!0}})}var KMe={python:[{pattern:/^(?:async\s+)?def\s+(\w+)\s*\(/,kind:"function"},{pattern:/^class\s+(\w+)\s*[(:]/,kind:"class"}],go:[{pattern:/^func\s+(?:\([^)]*\)\s*)?(\w+)\s*[[(]/,kind:"function"},{pattern:/^type\s+(\w+)\s+(?:struct|interface)\s*\{/,kind:"type"}],rust:[{pattern:/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?fn\s+(\w+)/,kind:"function"},{pattern:/^(?:pub(?:\([^)]*\))?\s+)?struct\s+(\w+)/,kind:"class"},{pattern:/^(?:pub(?:\([^)]*\))?\s+)?(?:enum|trait)\s+(\w+)/,kind:"type"},{pattern:/^impl(?:<[^>]*>)?\s+(?:\w+\s+for\s+)?(\w+)/,kind:"class"}],java:[{pattern:/^(?:public|private|protected|abstract|final|static|\s)*(?:class|interface|enum|record)\s+(\w+)/,kind:"class"},{pattern:/^(?:public|private|protected|static|final|synchronized|abstract|\s)+[\w<>[\],.?\s]+\s+(\w+)\s*\(/,kind:"method"}],ruby:[{pattern:/^def\s+(?:self\.)?(\w+[?!=]?)/,kind:"method"},{pattern:/^(?:class|module)\s+([\w:]+)/,kind:"class"}],dotnet:[{pattern:/^(?:public|private|protected|internal|sealed|abstract|static|partial|\s)*(?:class|interface|struct|record|enum)\s+(\w+)/,kind:"class"},{pattern:/^(?:public|private|protected|internal|static|virtual|override|async|sealed|\s)+[\w<>[\],.?\s]+\s+(\w+)\s*\(/,kind:"method"}],php:[{pattern:/^(?:abstract\s+|final\s+|readonly\s+)*(?:class|interface|trait|enum)\s+(\w+)/,kind:"class"},{pattern:/^(?:public\s+|private\s+|protected\s+|static\s+|abstract\s+|final\s+)*function\s+&?(\w+)\s*\(/,kind:"function"}],elixir:[{pattern:/^\s*defmodule\s+([A-Z][\w.]*)/,kind:"module"},{pattern:/^\s*(?:def|defp|defmacro|defmacrop|defguard|defdelegate)\s+([a-z_]\w*[!?]?)/,kind:"function"},{pattern:/^\s*(?:defstruct|defexception|defprotocol|defimpl)\s+([A-Z][\w.]*)?/,kind:"type"}],erlang:[{pattern:/^([a-z]\w*)\s*\(.*\)\s*(?:when\b.*)?->/,kind:"function"},{pattern:/^-record\(\s*(\w+)/,kind:"type"}],swift:[{pattern:/^(?:public\s+|internal\s+|private\s+|fileprivate\s+|open\s+|final\s+|@\w+\s+)*(?:class|struct|enum|protocol|actor|extension)\s+(\w+)/,kind:"class"},{pattern:/^(?:public\s+|internal\s+|private\s+|fileprivate\s+|open\s+|static\s+|final\s+|override\s+|mutating\s+|@\w+\s+)*func\s+(\w+)/,kind:"function"}],dart:[{pattern:/^(?:abstract\s+|base\s+|final\s+|sealed\s+|interface\s+)*(?:class|mixin|enum|extension)\s+(\w+)/,kind:"class"},{pattern:/^typedef\s+(\w+)/,kind:"type"}],ocaml:[{pattern:/^let\s+(?:rec\s+)?([a-z_]\w*)/,kind:"function"},{pattern:/^(?:module|module\s+type)\s+([A-Z]\w*)/,kind:"module"},{pattern:/^type\s+(?:'\w+\s+)?([a-z_]\w*)/,kind:"type"}],c:N7(),cpp:[{pattern:/^(?:template\s*<[^>]*>\s*)?(?:class|struct)\s+(?:\w+_API\s+|\w+_EXPORT\s+)?(\w+)\s*(?::|\{|$)/,kind:"class"},{pattern:/^namespace\s+(\w+)/,kind:"module"},...N7()]};function N7(){return[{pattern:/^typedef\s+(?:struct|union|enum)?\s*[\w\s*]*?(\w+)\s*;/,kind:"type"},{pattern:/^(?:typedef\s+)?(?:struct|union|enum)\s+(\w+)\s*\{?\s*$/,kind:"class"},{pattern:/^(?!(?:return|if|while|for|switch|case|else|do|sizeof|typeof|delete|throw|catch|assert)\b)(?:(?:static|extern|inline|const|constexpr|virtual|explicit|friend|unsigned|signed|struct|enum|class|\w+_API|\w+_EXPORT)\s+)*[\w:<>,\s]*?[\w>]\s*[*&\s]\s*(\w+)\s*\([^;]*\)\s*(?:const\s*)?(?:noexcept\s*)?[{;]?\s*$/,kind:"function"},{pattern:/^#\s*define\s+(\w+)\s*\(/,kind:"function"}]}function JMe(e,t,n){let i=t.filter(a=>a.exported).map(a=>a.name),r=i.slice(0,8),o=[...new Set(n.map(a=>a.packageName))].slice(0,6),s=[`${e.path} (${e.language}, ${e.lineCount} lines)`];return r.length&&s.push(`defines ${r.join(", ")}${i.length>r.length?`, +${i.length-r.length} more`:""}`),o.length&&s.push(`imports ${o.join(", ")}`),s.join(" \u2014 ")}function L7(e){return e.replace(/\s+/g," ").trim().slice(0,200)}function GF(e,t){return`${e}|${t}`}var ZMe=2e4;async function WS(e,t){let n=new Map;for(let s of e){if(!zF[s.ecosystem])continue;let a=GF(s.ecosystem,s.name);n.has(a)||n.set(a,s)}let i=new Map;if(n.size===0)return i;let r=[...n.entries()],o=await qn(r,t.concurrency??6,async([s,a])=>{let c=a.to??a.from;if(!c)return[s,void 0];try{let l=await aLe(`${s}|${c}`,()=>zF[a.ecosystem](a.name,c,{timeoutMs:t.timeoutMs??ZMe}));return[s,l]}catch(l){return t.logger.debug(`Module map failed for ${s}: ${l.message}`),[s,void 0]}});for(let[s,a]of o)a&&a.names.length>0&&i.set(s,a);return t.logger.debug(`Resolved ${i.size} of ${n.size} module map(s) from published artefacts`),i}var YMe=async(e,t,{timeoutMs:n})=>{let r=(await $e(`https://pypi.org/pypi/${encodeURIComponent(e)}/${encodeURIComponent(t)}/json`,{timeoutMs:n,immutable:!0}))?.urls?.find(l=>l.packagetype==="bdist_wheel"&&l.url);if(!r?.url)return;let o=await Ty(r.url,n);if(!o)return;let s=o.find(l=>/(^|\/)[^/]+\.dist-info\/top_level\.txt$/.test(l.path));if(s){let l=Ey(s).split(` -`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));if(l.length>0)return{names:[...new Set(l)],source:`${r.filename??"wheel"} top_level.txt`}}let a=o.find(l=>/(^|\/)[^/]+\.dist-info\/RECORD$/.test(l.path));if(!a)return;let c=new Set;for(let l of Ey(a).split(` -`)){let u=l.split(",")[0]?.trim();if(!u)continue;let d=u.split("/")[0];!d||d.startsWith(".")||/\.(dist-info|data)$/.test(d)||c.add(d.endsWith(".py")?d.slice(0,-3):d)}return c.delete(""),c.size>0?{names:[...c],source:`${r.filename??"wheel"} RECORD`}:void 0},QMe=async(e,t,{timeoutMs:n})=>{let[i,r]=e.split(":");if(!i||!r)return;let s=`https://repo1.maven.org/maven2/${i.replace(/\./g,"/")}/${r}/${t}/${r}-${t}.jar`,a=await Ty(s,n);if(!a)return;let c=new Set;for(let l of a){if(!l.path.endsWith(".class")||l.path.startsWith("META-INF/"))continue;let u=l.path.split("/").slice(0,-1);u.length!==0&&c.add(u.join("."))}return c.size>0?{names:[...c],source:`${r}-${t}.jar`}:void 0},XMe=async(e,t,{timeoutMs:n})=>{let i=e.toLowerCase(),r=t.toLowerCase(),o=`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(i)}/${encodeURIComponent(r)}/${encodeURIComponent(i)}.${encodeURIComponent(r)}.nupkg`,s=await Ty(o,n);if(!s)return;let{readAssembly:a}=await Promise.resolve().then(()=>(MO(),$9)),c=new Set;for(let l of s){if(!/^lib\/.+\.dll$/i.test(l.path)&&!/^ref\/.+\.dll$/i.test(l.path))continue;let u;try{u=a(l.read())}catch{continue}for(let d of u??[]){let p=d.fullName.lastIndexOf(".");p>0&&c.add(d.fullName.slice(0,p))}if(c.size>0)break}return c.size>0?{names:[...c],source:`${e} ${t} assembly metadata`}:void 0},eLe=async(e,t,{timeoutMs:n})=>{let r=(await $e(`https://repo.packagist.org/p2/${e.toLowerCase()}.json`,{timeoutMs:n}))?.packages?.[e.toLowerCase()];if(!r?.length)return;let o=Gk(r),a=(Vk(o,t)??o[0])?.autoload??void 0,c=new Set;for(let l of[a?.["psr-4"],a?.["psr-0"]])for(let u of Object.keys(l??{})){let d=u.replace(/\\+$/,"");d&&c.add(d)}return c.size>0?{names:[...c],source:`${e} composer.json autoload`}:void 0},tLe=async(e,t,{timeoutMs:n})=>{let i=await Ty(`https://repo.hex.pm/tarballs/${encodeURIComponent(e)}-${encodeURIComponent(t)}.tar`,n);if(!i)return;let r=i.find(c=>c.path==="contents.tar.gz"||c.path.endsWith("/contents.tar.gz"));if(!r)return;let o;try{o=Fn(r.read())}catch{return}let s=new Set;for(let c of o)if(/^(lib|src)\//.test(c.path)){if(/\.(ex|exs)$/.test(c.path)){for(let l of nLe(Ey(c)))s.add(l);continue}if(/\.erl$/.test(c.path)){let l=/^\s*-module\(\s*'?([a-z][\w]*)'?\s*\)/m.exec(Ey(c));l?.[1]&&s.add(l[1])}}if(s.size===0)return;let a=new Set;for(let c of s)a.add(c.split(".")[0]);return{names:[...new Set([...s,...a])],source:`${e} ${t} hex tarball`}};function nLe(e){let t=[],n=[],i=!1;for(let r of e.split(` -`)){let o=(r.match(/"""/g)??[]).length;if(i){o%2===1&&(i=!1);continue}if(o%2===1){i=!0;continue}let s=/^(\s*)defmodule\s+([A-Z][\w.]*)/.exec(r);if(!s)continue;let a=s[1].length;for(;n.length>0&&n[n.length-1].indent>=a;)n.pop();let c=n[n.length-1]?.name,l=c?`${c}.${s[2]}`:s[2];n.push({indent:a,name:l}),t.push(l)}return t}var rLe=async(e,t,{timeoutMs:n})=>{let i=await Ty(`https://rubygems.org/downloads/${encodeURIComponent(e)}-${encodeURIComponent(t)}.gem`,n);if(!i)return;let r=i.find(c=>c.path==="data.tar.gz"||c.path.endsWith("/data.tar.gz"));if(!r)return;let o;try{o=Fn(r.read())}catch{return}let s=new Set,a=new Set;for(let c of o){let l=/^lib\/(.+)\.rb$/.exec(c.path);if(l?.[1]&&(s.add(l[1]),s.add(l[1].split("/")[0]),!(l[1].split("/").length>2)))for(let u of Ey(c).matchAll(/^(?:module|class)\s+([A-Z][\w:]*)/gm))a.add(u[1].split("::")[0])}if(!(s.size===0&&a.size===0))return{names:[...new Set([...s,...a])],source:`${e}-${t}.gem`}},iLe=async(e,t,{timeoutMs:n})=>{let[i,r]=e.split("/");if(!(!i||!r))for(let o of[t,`v${t}`]){let s=await rt(`https://raw.githubusercontent.com/${i}/${r}/${encodeURIComponent(o)}/Package.swift`,{timeoutMs:n,immutable:!0});if(!s)continue;let a=new Set;for(let c of s.matchAll(/\.(?:library|target|executableTarget)\s*\(\s*name:\s*"([^"]+)"/g))a.add(c[1]);for(let c of s.matchAll(/targets:\s*\[([^\]]*)\]/g))for(let l of c[1].matchAll(/"([^"]+)"/g))a.add(l[1]);if(a.size>0)return{names:[...a],source:`${e}@${o} Package.swift`}}},oLe=async(e,t,{timeoutMs:n})=>{let i=await jk(e,t,{timeoutMs:n});if(!i)return;let r=i.moduleName??(i.name??e).replace(/[-.]/g,"_");return{names:[...new Set([r,e])],source:`${e} ${t} podspec`}},zF={pypi:YMe,maven:QMe,nuget:XMe,packagist:eLe,hex:tLe,rubygems:rLe,swift:iLe,cocoapods:oLe},oyt=Object.keys(zF),sLe=64*1024*1024;async function Ty(e,t){try{let n=await Bt(e,{timeoutMs:t,retries:0,maxBytes:sLe});return n.ok?Fn(n.bytes):void 0}catch{return}}var UF=new Map,jF=new Map;function aLe(e,t){let n=UF.get(e);if(n!==void 0)return Promise.resolve(n??void 0);let i=jF.get(e);if(i)return i;let r=t().then(o=>(UF.set(e,o??null),o)).catch(()=>{UF.set(e,null)}).finally(()=>jF.delete(e));return jF.set(e,r),r}function Ey(e){try{return e.read().toString("utf8")}catch{return""}}var _s=gt(Dc(),1),_n=gt(gc(),1);function cLe(e){return e.split(".").map(t=>Number.parseInt(t,10))}function Sf(e,t){let n=Math.max(e.length,t.length);for(let i=0;i0}}function U7(e,t){if(!e)return t;if(!t)return e;let n=Sf(e.value,t.value);return n!==0?n>0?e:t:!e.inclusive||!t.inclusive?{value:e.value,inclusive:!1}:e}function j7(e,t){if(!e)return t;if(!t)return e;let n=Sf(e.value,t.value);return n!==0?n<0?e:t:!e.inclusive||!t.inclusive?{value:e.value,inclusive:!1}:e}function HS(e,t){return U7(e,t)}function Iy(e,t){return j7(e,t)}function z7(e){let t=e.split(",").map(o=>o.trim()).filter(Boolean);if(t.length===0)return{min:null,max:null,imprecise:!1};let n=null,i=null,r=!1;for(let o of t){let s=/^(===|~=|==|!=|<=|>=|<|>)?\s*v?(\d[\w.*]*)$/.exec(o);if(!s){r=!0;continue}let[,a,c]=s,l=!a,u=a??"==",d=lLe(c);if(d.imprecise){r=!0;continue}let{release:p,wildcard:f}=d;if(f&&u!=="=="&&u!=="!="){r=!0;continue}if(u==="~="&&p.length<2){r=!0;continue}let m=l||f;switch(u){case">=":n=HS(n,{value:p,inclusive:!0});break;case">":n=HS(n,{value:p,inclusive:!1});break;case"<=":i=Iy(i,{value:p,inclusive:!0});break;case"<":i=Iy(i,{value:p,inclusive:!1});break;case"==":n=HS(n,{value:p,inclusive:!0}),i=m?Iy(i,{value:F7(p),inclusive:!1}):Iy(i,{value:p,inclusive:!0});break;case"===":r=!0;break;case"~=":n=HS(n,{value:p,inclusive:!0}),i=Iy(i,{value:F7(p.slice(0,-1)),inclusive:!1});break;case"!=":r=!0;break;default:r=!0}}return!r&&uLe(n,i)?{min:n,max:i,imprecise:!0}:{min:n,max:i,imprecise:r}}function uLe(e,t){if(!e||!t)return!1;let n=Sf(e.value,t.value);return n>0?!0:n<0?!1:!(e.inclusive&&t.inclusive)}function dLe(e,t){if(!t)return!0;if(!e)return!1;let n=Sf(e.value,t.value);return n!==0?n>0:!(e.inclusive&&!t.inclusive)}function pLe(e,t){if(!t)return!0;if(!e)return!1;let n=Sf(e.value,t.value);return n!==0?n<0:!(e.inclusive&&!t.inclusive)}function VF(e,t){return e.imprecise||t.imprecise?!1:dLe(e.min,t.min)&&pLe(e.max,t.max)}function BF(e,t){if(e.imprecise||t.imprecise)return!0;let n=U7(e.min,t.min),i=j7(e.max,t.max);if(!n||!i)return!0;let r=Sf(n.value,i.value);return r!==0?r<0:n.inclusive&&i.inclusive}var B7=gt(Dc(),1);var fLe=/^nightly-(\d{4}-\d{2}-\d{2})$/,mLe=/^beta-(\d{4}-\d{2}-\d{2})$/;function JS(e){let t=e.trim().replace(/^rust-/i,"");if(!t)return{kind:"unknown"};let n=fLe.exec(G7(t,"nightly"));if(n)return{kind:"dated-nightly",date:n[1]};if(mLe.test(G7(t,"beta")))return{kind:"moving-beta"};if(/^stable$/i.test(t)||/^stable-/i.test(t))return{kind:"moving-stable"};if(/^beta$/i.test(t)||/^beta-/i.test(t))return{kind:"moving-beta"};if(/^nightly$/i.test(t)||/^nightly-/i.test(t))return{kind:"moving-nightly"};let i=gLe(t);return i?{kind:"exact",version:i}:{kind:"unknown"}}function G7(e,t){let n=new RegExp(`^(${t}(?:-\\d{4}-\\d{2}-\\d{2})?)`).exec(e);return n?n[1]:e}function gLe(e){let t=e.split(/-(?=[a-z])/i)[0].trim();return B7.default.valid(t)?t:/^\d+\.\d+$/.test(t)?`${t}.0`:null}var KS=new Map,hLe=e=>`https://static.rust-lang.org/dist/${e}/channel-rust-nightly.toml`,V7=e=>`rust-nightly-version:v1:${e}`;async function q7(e){let t=KS.get(e);if(t)return t;let n=await Na(V7(e));if(n?.version)return KS.set(e,n.version),n.version;let i=null;try{i=await rt(hLe(e),{immutable:!0,retries:1})}catch{i=null}let r=i?yLe(i):null;return r&&(KS.set(e,r),await Ca(V7(e),{version:r})),r}function W7(e){return KS.get(e)??null}function yLe(e){let t=/\[pkg\.rust\]([\s\S]*?)(?:\n\[|$)/.exec(e);if(!t)return null;let n=/(?:^|\n)\s*version\s*=\s*"([^"]+)"/.exec(t[1]);if(!n)return null;let i=/^\d+\.\d+\.\d+/.exec(n[1].trim());return i?i[0]:null}async function qF(e){let t=new Set;for(let n of e){let i=JS(n);i.kind==="dated-nightly"&&t.add(i.date)}await Promise.all([...t].map(n=>q7(n)))}function KF(e,t,n,i){return Ef(e,t,n,i).resolved}function Ef(e,t,n,i){let r=KLe(e,n,i),o={resolved:[],unresolved:[]};for(let{path:s,content:a}of r){if(!AP(s))continue;let c=(s.split("/").pop()??"").toLowerCase();if(bLe[t].includes(c)){vLe(s,c,a,t,o);continue}if(c===".tool-versions"){$Le(s,a,t,o);continue}if(c.startsWith("dockerfile")||c.startsWith("containerfile")){_Le(s,a,t,o);continue}if(t==="node"&&c==="package.json"){xLe(s,a,o);continue}if(t==="python"&&["pyproject.toml","setup.cfg","setup.py"].includes(c)){ELe(s,c,a,o);continue}if(t==="ruby")c==="gemfile"?TLe(s,a,o,r):c.endsWith(".gemspec")&&ILe(s,a,o);else if(t==="go"&&c==="go.mod")ALe(s,a,o);else if(t==="java")c==="pom.xml"?RLe(s,a,o):(c==="build.gradle"||c==="build.gradle.kts")&&CLe(s,a,o);else if(t==="rust"&&c==="cargo.toml"){let l=PLe(a,"rust-version");l&&tr(o,t,s,l.line,l.requirement,"manifest",l.requirement)}WF(s)&&LLe(s,a,t,o,n,i)}if(n!==void 0&&(i?.length??0)>1){for(let s of o.resolved)!s.scope&&!WF(s.file)&&(s.scope=K7(s.file,n,i));for(let s of o.unresolved)!s.scope&&!WF(s.file)&&(s.scope=K7(s.file,n,i))}if(n!==void 0&&(i?.length??0)>1){let s=c=>c==="member"?2:c==="ambiguous"?0:1,a=Math.max(0,...o.resolved.map(c=>s(c.scope)),...o.unresolved.map(c=>s(c.scope)));o.resolved=o.resolved.filter(c=>s(c.scope)===a),o.unresolved=o.unresolved.filter(c=>s(c.scope)===a)}return o.resolved=BLe(o.resolved),o.unresolved=qLe(o.unresolved),o}var bLe={node:[".nvmrc",".node-version"],python:[".python-version","runtime.txt"],ruby:[".ruby-version"],rust:["rust-toolchain","rust-toolchain.toml"],go:[],java:[]};function tr(e,t,n,i,r,o,s,a){s?e.resolved.push({file:n,line:i,requirement:s,...a?{scope:a}:{}}):e.unresolved.push({runtime:t,file:n,line:i,rawText:r,source:o,...a?{scope:a}:{}})}function ic(e){return/[$`%]|\{\{|\}\}/.test(e)}function vLe(e,t,n,i,r){if(t==="rust-toolchain.toml"){let a=VLe(n,/^\s*channel\s*=\s*['"]([^'"]+)['"]/);if(!a)return;tr(r,i,e,a.line,a.requirement,"version-file",rc(a.requirement));return}if(t===".python-version"){for(let[a,c]of n.split(` -`).entries()){let l=c.trim();if(!(!l||l.startsWith("#")))for(let u of l.split(/\s+/))tr(r,i,e,a+1,u,"version-file",rc(u))}return}let o=n.trim().split(` -`)[0]?.trim();if(!o)return;let s=t==="runtime.txt"?o.replace(/^python-/i,"").trim():o.replace(/^(?:ruby-|go|rust-)?v?/i,"").trim();s&&tr(r,i,e,1,o,"version-file",rc(s))}function rc(e){return ic(e)?null:e}function JF(e,t,n){if(e==="node")return X7(t,n);if(e==="python")return eee(t,n);let i=[],r=XS(YS(e,n).text);for(let o of t){let s=YS(e,o.requirement),a=XS(s.text),c=s.resolved?{resolvedRequirement:s.resolved}:{};if(!a||!r){i.push({...o,...c,verdict:"unknown"});continue}let l;try{_s.default.subset(a,r,{loose:!0})?l="compatible":_s.default.intersects(a,r,{loose:!0})?l="partial":l="incompatible"}catch{l="unknown"}i.push({...o,...c,verdict:l})}return i}function YS(e,t){if(e==="java")return{text:ex(t)??t};if(e==="rust"){let n=JS(t);if(n.kind==="exact")return{text:n.version,resolved:n.version};if(n.kind==="dated-nightly"){let i=W7(n.date);return i?{text:i,resolved:i}:{text:"\0unresolved-nightly"}}return n.kind!=="unknown"?{text:"\0moving-channel"}:{text:t}}return{text:t}}function J7(e,t,n){if(e==="python")return wLe(t,n);let i=XS(YS(e,n).text),r=[];for(let o of t){let s=YS(e,o.requirement),a=XS(s.text),c=s.resolved?{resolvedRequirement:s.resolved}:{};if(!a||!i){r.push({...o,...c,verdict:"unknown"});continue}let l;try{_s.default.subset(a,i,{loose:!0})?l="incompatible":_s.default.intersects(a,i,{loose:!0})?l="partial":l="compatible"}catch{l="unknown"}r.push({...o,...c,verdict:l})}return r}function xf(e,t="minimum"){let n=t==="unsupported"?e.replace(/\.x$/i,".*"):e;if(/^\s*(?:\^|~(?![=>]))/.test(n))return{status:"unknown",reason:"unsupported-grammar"};let i=z7(n);return i.imprecise||i.min===null&&i.max===null?{status:"unknown",reason:"unparseable"}:{status:"parsed",value:i}}function wLe(e,t){let n=xf(t,"unsupported"),i=[];for(let r of e){let o=xf(r.requirement),s;n.status==="unknown"||o.status==="unknown"?s="unknown":VF(o.value,n.value)?s="incompatible":BF(o.value,n.value)?s="partial":s="compatible",i.push({...r,verdict:s})}return i}var kLe={node:["node","nodejs"],python:["python","python3"],go:["go","golang"],ruby:["ruby"],java:["java"],rust:["rust"]};function $Le(e,t,n,i){for(let[r,o]of t.split(` -`).entries()){let s=/^\s*([\w-]+)\s+([^\s#]+)/.exec(o);if(!s||!kLe[n].includes(s[1].toLowerCase()))continue;let a=o.slice(s.index+s[0].length-s[2].length).split("#",1)[0].split(/\s+/).filter(Boolean);for(let c of a){let l=ic(c)||/^(?:system|path:|ref:)/i.test(c)?null:n==="java"?ex(c):c;tr(i,n,e,r+1,c,"tool-versions",l)}}}function _Le(e,t,n,i){for(let[r,o]of t.split(` -`).entries()){let s=/^\s*FROM\s+(?:--platform=\S+\s+)?(\S+)/i.exec(o)?.[1];s&&Z7(i,n,e,r+1,s,"container")}}function Z7(e,t,n,i,r,o,s){let a=Y7(r);if(!a||a.runtime!==t)return;let c=a.version;tr(e,t,n,i,r,o,c&&!ic(c)?QS(c):null,s)}var SLe={node:"node",python:"python",ruby:"ruby",golang:"go",openjdk:"java","eclipse-temurin":"java",amazoncorretto:"java",rust:"rust"};function Y7(e){let t=e.trim().replace(/^['"]|['"]$/g,"");if(!t||t.startsWith("$"))return null;let n=t.split("@",1)[0],i=n.lastIndexOf("/"),r=n.lastIndexOf(":"),o=r>i,s=(o?n.slice(0,r):n).split("/").at(-1)?.toLowerCase();if(!s)return null;let a=SLe[s];if(!a)return null;let c=o?n.slice(r+1):void 0;return c?{runtime:a,version:c}:{runtime:a}}function xLe(e,t,n){let i=JLe(t);i&&tr(n,"node",e,HF(t,/"node"\s*:/),i.raw,"manifest",i.requirement)}function ELe(e,t,n,i){if(t==="setup.py"){let o=QLe(n);o&&tr(i,"python",e,o.line,o.raw,"manifest",o.requirement);return}let r=t==="pyproject.toml"?ZLe(n):t==="setup.cfg"?nFe(n):null;r&&tr(i,"python",e,r.line,r.requirement,"manifest",rc(r.requirement))}function TLe(e,t,n,i){for(let[r,o]of t.split(` -`).entries()){let s=/^\s*ruby\s+(.+?)\s*(?:#.*)?$/.exec(o)?.[1]?.trim();if(!s)continue;let a=/^(['"])([^'"]+)\1/.exec(s)?.[2],c=/^file\s*:\s*(['"])([^'"]+)\1/.exec(s)?.[2];if(c){let l=i.find(u=>u.path===c||u.path.endsWith(`/${c}`));if(l){let u=l.content.trim().split(/\s+/)[0];if(u&&!ic(u))continue}}tr(n,"ruby",e,r+1,s,"manifest",a?rc(a):null)}}function ILe(e,t,n){for(let[i,r]of t.split(` -`).entries()){let o=/\.required_ruby_version\s*=\s*(.+?)\s*(?:#.*)?$/.exec(r)?.[1]?.trim();if(!o)continue;let s=/^(['"])([^'"]+)\1/.exec(o)?.[2];tr(n,"ruby",e,i+1,o,"manifest",s?rc(s):null)}}function ALe(e,t,n){for(let[i,r]of t.split(` -`).entries()){let o=/^\s*(go|toolchain)\s+(?:go)?(\d+(?:\.\d+){0,3})\s*(?:\/\/.*)?$/.exec(r);o?.[2]&&tr(n,"go",e,i+1,o[2],"manifest",o[2])}}function RLe(e,t,n){let i=[],r=/\s*([^<]+?)\s*<\//g;for(let s of t.matchAll(r))i.push({line:t.slice(0,s.index).split(` -`).length,raw:s[1]});let o=NLe(t);for(let{line:s,raw:a}of i){if(/^\s*\$\{[^}]+\}\s*$/.test(a)&&H7(t,a))continue;let c=H7(t,a),l=c?ex(c):null;tr(n,"java",e,s,a,"manifest",o?l:null)}}function NLe(e){return/\s*maven-toolchains?-plugin\s*<\/artifactId>/i.test(e)?/[\s\S]*?\s*\$\{java\.version\}\s*<\/version>[\s\S]*?<\/jdk>/i.test(e):!1}function H7(e,t){let n=/^\$\{([^}]+)\}$/.exec(t.trim())?.[1];if(!n)return ic(t)?null:t;let i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`<${i}>\\s*([^<]+?)\\s*`).exec(e)?.[1];return r&&!ic(r)?r:null}function CLe(e,t,n){let i=[/JavaLanguageVersion\.of\(\s*([^)]+?)\s*\)/];for(let[r,o]of t.split(` -`).entries())for(let s of i){let a=s.exec(o)?.[1];a&&tr(n,"java",e,r+1,a,"build-config",ic(a)?null:ex(a))}}function ex(e){let t=QS(e.replace(/_/g,"."));return t?.startsWith("1.")?t.slice(2):t}function PLe(e,t){let n=!1;for(let[i,r]of e.split(` -`).entries()){let o=/^\s*\[([^\]]+)\]\s*$/.exec(r);if(o){n=o[1]==="package";continue}if(!n)continue;let s=new RegExp(`^\\s*${t.replace("-","\\-")}\\s*=\\s*['"]([^'"]+)['"]`).exec(r);if(s?.[1])return{line:i+1,requirement:s[1]}}return null}function WF(e){return/^\.github\/workflows\/.+\.ya?ml$/i.test(e)||/^\.(?:gitlab-ci|circleci)(?:\/|\.|$)/i.test(e)}var DLe={node:"node-version",python:"python-version",ruby:"ruby-version",go:"go-version",java:"java-version",rust:"toolchain"};function OLe(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`^\\s*(?:-\\s*)?${n}\\s*:\\s*(.*?)\\s*$`,"i").exec(e);if(!i)return null;let r=i[1].replace(/\\s+#.*$/,"").trim();return{raw:/^(['"])(.*?)\1$/.exec(r)?.[2]??r}}function MLe(e){let t=Array.from({length:e.length},()=>!0),n=null,i=/(?:^\s*-\s*|:\s*)[>|](?:(?:[+-]?\d)|(?:\d[+-]?))?\s*(?:#.*)?$/;for(let[r,o]of e.entries()){let s=o.trim(),a=/^\s*/.exec(o)[0].length;if(n!==null){if(!s||a>n){t[r]=!1;continue}n=null}i.test(o)&&(n=a)}return t}function LLe(e,t,n,i,r,o){let s=t.split(` -`),a=MLe(s),{allowed:c,ambiguous:l,repositoryWide:u}=GLe(s,r,o),d=m=>l[m-1]?"ambiguous":u[m-1]?"repository":"member",p=/^\.github\/workflows\/.+\.ya?ml$/i.test(e)?jLe(t,s):null,f=(m,g,h,b)=>{tr(i,n,e,m,g,h,l[m-1]?null:b,d(m))};for(let[m,g]of s.entries()){if(!a[m]||!c[m]||p?.insideMatrix(m))continue;let h=OLe(g,DLe[n]);if(h){let w=h.raw,k=p&&ULe(w),_=p&&k?p.resolve(m,k):null;if(_?.ok)for(let S of _.values)f(S.line,S.value,"ci",QS(S.value));else f(m+1,w,"ci",ic(w)?null:QS(w))}if(/^\.github\/workflows\//i.test(e)){let w=/^\s*container\s*:\s*['"]?([^'"\s#]+)/i.exec(g)?.[1];if(w&&ZS(i,n,e,m+1,w,"ci",l,d(m+1)),/^\s*container\s*:\s*$/i.test(g)){let k=/^\s*/.exec(g)[0].length;for(let _=m+1;_/^[ \t]*/.exec(l)[0].length,n=l=>!l.trim()||/^\s*#/.test(l),i=e.findIndex(l=>/^[ \t]*jobs:\s*(#.*)?$/.test(l));if(i===-1)return null;let r=t(e[i]),o=null,s=[],a=[],c=e.length;for(let l=i+1;l({name:a[u],start:l,end:u+10||!(0,_n.isMap)(n.contents))return null;let i=Q7(t);if(!i)return null;let r=[];for(let a of i){let c=n.getIn(["jobs",a.name,"strategy","matrix"],!0);c?.range&&r.push([e.slice(0,c.range[0]).split(` +`),l=await e.messages.create({model:t.llm.model,max_tokens:16e3,system:rBe,thinking:{type:"adaptive"},output_config:{effort:t.llm.effort,format:{type:"json_schema",schema:nBe}},messages:[{role:"user",content:c}]});if(l.stop_reason==="refusal")return o.warn(`The model declined to analyse the prose for ${n.name}, so nothing was extracted from it. The rule-based analyser still ran.`),[];let u=l.content.find(p=>p.type==="text")?.text;if(!u)return o.warn(`The model returned no text for ${n.name}${l.stop_reason?` (stop reason: ${l.stop_reason})`:""}, so nothing was extracted from its prose.`),[];let d;try{d=JSON.parse(u)}catch(p){return o.warn(`The model's answer for ${n.name} was not readable as JSON (${p.message}), so nothing was extracted from its prose.`),[]}return Array.isArray(d.changes)?d.changes:(o.warn(`The model's answer for ${n.name} carried no \`changes\` array, so nothing was extracted from its prose.`),[])}function sBe(e,t,n,r){let i=new Set(r.map(o=>o.id));return e.filter(o=>i.has(o.evidenceId)).filter(o=>o.summary?.trim()).map(o=>({id:Pt("bc",t,n,"llm",o.summary),dependency:t,workspace:n,kind:Voe(o.kind),summary:o.summary.trim(),remediation:o.remediation?.trim()||`Review usages of ${t} and update them.`,symbols:(o.symbols??[]).filter(aBe),confidence:"medium",taxonomy:Oee(o.taxonomy,Rp(Voe(o.kind))),citations:[o.evidenceId]}))}function aBe(e){let t=e.trim();return!t||t.length>80||/\s/.test(t)&&!t.startsWith("/")?!1:/^[/@]?[\w$][\w$./{}-]*$/.test(t)}var cBe=new Set(["removed-export","renamed-export","signature-change","type-change","behaviour-change","removed-endpoint","changed-endpoint","required-field-added","default-change","config-change","module-system-change","runtime-requirement"]);function Voe(e){return cBe.has(e)?e:"unknown"}function lBe(e,t){return e.length<=t?e:`${e.slice(0,t)} +\u2026(truncated)`}function uBe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}var Zoe=require("node:crypto");var dBe=[{band:"high",min:.8},{band:"medium",min:.5},{band:"low",min:.2},{band:"none",min:0}];function Xz(e){for(let t of dBe)if(e>=t.min)return t.band;return"none"}var Woe={high:"Very confident",medium:"Fairly confident",low:"Not very confident",none:"Not enough evidence to say"};var ku="drift-confidence-1",pBe={"type-surface-diff":"computed-artifact",...NQ,changelog:"maintainer-narrative","github-release":"maintainer-narrative","migration-guide":"maintainer-guide","behavioural-diff":"dynamic-observation","registry-metadata":"registry","semver-heuristic":"heuristic"},fBe={"computed-artifact":.9,"maintainer-guide":.7,"maintainer-narrative":.6,"dynamic-observation":.5,registry:.4,heuristic:.2},Hoe=new WeakMap;function tG(e){let{change:t,evidence:n}=e,r=n.filter(d=>t.citations.includes(d.id)),i=[],o=[];if(r.length===0)return{score:0,band:"none",evidence:[],penalties:[{code:"no-citations",detail:"No evidence record backs this finding.",delta:0}],calibration:ku};let s=mBe(r),a=0,c="";for(let d of s.keys()){let p=fBe[d]??.3;p>a&&(a=p,c=d)}i.push({code:`origin:${c}`,detail:`Strongest evidence class is ${eG(c)}.`,delta:a});let l=a,u=s.size-1;if(u>0){let d=Math.min(.15,.08*u);l+=d,i.push({code:"corroborated",detail:`Corroborated by ${u} other independent source class(es): ${[...s.keys()].filter(p=>p!==c).map(eG).join(", ")}.`,delta:d})}else r.length>1&&o.push({code:"single-origin",detail:`All ${r.length} citations trace to one source class (${eG(c)}), so they do not corroborate each other.`,delta:0});return s.size===1&&c==="heuristic"&&(l+=-.1,o.push({code:"heuristic-only",detail:"Only a semver heuristic supports this; no changelog, release note, or API diff was retrieved.",delta:-.1})),rG(l,i,o)}function mBe(e){let t=new Map,n=new Set;for(let r of e){let i=Hoe.get(r);if(i===void 0&&(i=(0,Zoe.createHash)("sha256").update(r.content.replace(/\s+/g," ").trim().toLowerCase()).digest("hex"),Hoe.set(r,i)),n.has(i))continue;n.add(i);let o=pBe[r.source]??"unknown",s=t.get(o);s?s.push(r):t.set(o,[r])}return t}function eG(e){switch(e){case"computed-artifact":return"a computed diff of the shipped artifact";case"maintainer-guide":return"a migration guide";case"maintainer-narrative":return"release notes or a changelog";case"registry":return"registry metadata";case"heuristic":return"a semver heuristic";default:return e}}function gBe(e){let{taxonomy:t,sites:n,localizationRan:r}=e,i=[],o=[];if(!r)return{score:0,band:"none",evidence:[],penalties:[{code:"localization-unavailable",detail:"No checkout was available, so Drift could not search this repository. This is not evidence that the change is unused.",delta:0}],calibration:ku};if(t.scope==="runtime"&&e.runtimeState==="compatible")return{score:.85,band:"high",evidence:[{code:"runtime-compatible",detail:"The repository runtime declaration satisfies the requirement.",delta:.85}],penalties:[],calibration:ku};if(n.length===0){let d=VS(t),p=e.localizationComplete===!1,f=t.scope==="runtime";return{score:0,band:"none",evidence:[],penalties:[{code:f?"runtime-compatibility-unresolved":p?"localization-incomplete":d?"not-locally-checkable":"no-usage-found",detail:f?"This is a requirement on the runtime this repository builds and deploys on, not on any code it calls. No source search can answer it; the repository's own declared runtime version is what decides.":p?"Drift searched the indexed source subset, but the file limit prevented an exhaustive absence claim.":d?"This change is only observable at runtime, so a source search cannot establish whether this repository is affected.":"Drift searched the files that import this dependency and found no usage of the affected symbols.",delta:0}],calibration:ku}}let s=n.reduce((d,p)=>Joe(p.confidence)>Joe(d.confidence)?p:d),a=s.confidence==="high"?.85:s.confidence==="medium"?.6:.3;i.push({code:`site:${s.confidence}`,detail:s.confidence==="high"?`\`${s.matchedSymbol}\` is bound from an import of this dependency in ${s.file}.`:s.confidence==="medium"?`${s.file} imports this dependency and uses \`${s.matchedSymbol}\`, but the symbol was not traced to the import.`:`\`${s.matchedSymbol}\` appears in ${s.file}, but no import of this dependency was established \u2014 the match may be coincidental.`,delta:a});let c=a;if(n.length>1){let d=Math.min(.05,.01*(n.length-1));c+=d,i.push({code:"multiple-sites",detail:`${n.length} affected locations across ${new Set(n.map(p=>p.file)).size} file(s).`,delta:d})}let l=n.filter(d=>hBe(d.file));return l.length===n.length?(c+=-.25,o.push({code:"generated-only",detail:`Every affected location is in generated code (${l[0].file}). Editing it is usually wrong; the generator is the real site.`,delta:-.25})):l.length>0&&(c+=-.05,o.push({code:"some-generated",detail:`${l.length} affected location(s) are in generated code.`,delta:-.05})),t.visibility.includes("reflection-or-dynamic")&&(c+=-.2,o.push({code:"dynamic-access",detail:"Dynamic or reflective access was detected, so the affected set cannot be enumerated by search.",delta:-.2})),t.visibility.includes("wrapper-mediated")&&(c+=-.1,o.push({code:"wrapper-mediated",detail:"Usage is mediated by a local wrapper, so downstream callers of the wrapper are not enumerated here.",delta:-.1})),n.every(d=>d.confidence==="low")&&(c+=-.1,o.push({code:"textual-only",detail:"Every match is textual \u2014 no import edge was established for any of them.",delta:-.1})),rG(c,i,o)}function hBe(e){let t=e.toLowerCase();return/(^|\/)(generated|__generated__|gen|dist|build|out|vendor|node_modules)\//.test(t)||/\.(g|generated)\.[a-z]+$/.test(t)||/\.pb\.(go|ts|js|py)$/.test(t)||/_pb2?\.py$/.test(t)||/\.d\.ts$/.test(t)}function yBe(e){let{outcomes:t,affectedFiles:n,taxonomy:r}=e;if(t.length===0)return{score:0,band:"none",evidence:[],penalties:[{code:"nothing-ran",detail:"No checks were run against this finding, so nothing confirms the change was understood correctly.",delta:0}],calibration:ku};let i=[],o=[],s=t.filter(p=>p.status==="passed"),a=t.filter(p=>p.status==="failed"),c=t.filter(p=>p.status==="skipped"||p.status==="unavailable"||p.status==="timed-out");if(a.length>0)return{score:0,band:"none",evidence:[],penalties:[{code:"checks-failed",detail:`${a.length} check(s) failed: ${a.map(p=>p.name).join(", ")}.`,delta:0}],calibration:ku};let l=0,u=r.detectability.some(p=>p==="compile-time"||p==="link-or-import"||p==="manifest");for(let p of s){let f=/type|compile|build|lint/i.test(p.name),g=/test|spec/i.test(p.name)?.45:f?u?.4:.15:.1;l+=g,i.push({code:`passed:${p.name}`,detail:f&&!u?`\`${p.name}\` passed, but this change is not detectable at compile time \u2014 it does not confirm the behaviour is right.`:`\`${p.name}\` passed.`,delta:g})}for(let p of c)o.push({code:`did-not-run:${p.name}`,detail:`\`${p.name}\` was ${p.status} and proves nothing.`,delta:0});let d=new Set(s.flatMap(p=>p.covers??[]));return d.size>0&&n.length>0?n.filter(f=>d.has(f)).length===0&&(l+=-.2,o.push({code:"no-coverage",detail:"The checks that passed do not cover any of the affected files.",delta:-.2})):n.length>0&&o.push({code:"coverage-unknown",detail:"Which code paths the passing checks cover could not be established.",delta:0}),rG(l,i,o)}function Yoe(e){let t=tG({change:e.change,evidence:e.evidence}),n=gBe({change:e.change,taxonomy:e.taxonomy,sites:e.sites,localizationRan:e.localizationRan,localizationComplete:e.localizationComplete,runtimeState:e.runtimeState}),r=yBe({outcomes:e.outcomes??[],affectedFiles:[...new Set(e.sites.map(a=>a.file))],taxonomy:e.taxonomy}),i=[...e.gaps??[]],o=[];t.band==="high"&&n.band==="none"&&o.push({code:"upstream-only",detail:"The upstream change is well established, but nothing in this repository was shown to be affected. High upstream confidence is not a reason to edit code.",delta:0});let s=t.band==="high"&&(n.band==="high"||n.band==="medium")&&!i.some(a=>a.automaticExecution==="blocks");return{upstream:t,localImpact:n,verification:r,automaticExecutionEligible:s,reasons:o,checkedSurfaces:[...e.checkedSurfaces??[]],gaps:i}}function nG(e){let{upstream:t,localImpact:n,verification:r}=e,i=n.band==="none"?Math.min(t.score,.55):Math.min(t.score,n.score),o=r.score>0?Math.min(.1,r.score*.15):0,s=Math.round(Math.max(0,Math.min(1,i+o))*100),a=Xz(s/100);return{score:s,band:a,label:Woe[a]}}function Qoe(e){let t=e.upstream.band,n=e.localImpact.band;return n==="none"?t==="high"?"medium":Koe(t):Koe(bBe(t,n))}function Koe(e){return e==="high"?"high":e==="medium"?"medium":"low"}function bBe(e,t){let n=["none","low","medium","high"];return n.indexOf(e)<=n.indexOf(t)?e:t}function Joe(e){return e==="high"?2:e==="medium"?1:0}function rG(e,t,n){let r=Math.round(Math.max(0,Math.min(1,e))*100)/100;return{score:r,band:Xz(r),evidence:t,penalties:n,calibration:ku}}async function DT(e,t,n){let{config:r,logger:i}=n,o=vBe(t),s=[];for(let a of e){let c=o.get(ll(a))??[];s.push(..._Be(a.name,a.workspace,c))}for(let a of t)IQ(a.source)&&s.push(...tse(a));if(r.llm.enabled){let a=await qoe(e,t,s,{config:r,logger:i});s.push(...a)}return xBe(TBe(s),t)}function vBe(e){let t=new Map;for(let n of e){let r=ll({name:n.dependency,workspace:n.workspace}),i=t.get(r);i?i.push(n):t.set(r,[n])}return t}function _Be(e,t,n){let r=[];for(let i of n){if(i.findings?.length){r.push(...tse(i));continue}if(i.source!=="semver-heuristic"){if(i.source==="registry-metadata"){r.push(...ese(i,e,t).filter(o=>o.kind==="runtime-requirement"));continue}r.push(...ese(i,e,t))}}return r}function wBe(e,t){return e.replace(/`default\.([\w$]+)`/g,`\`${t}.$1\``).replace(/`default` is no longer exported/g,`\`${t}\` no longer has a default export`).replace(/`default`/g,`the default export of \`${t}\``)}function tse(e){return(e.findings??[]).map(t=>{let n=BS(t.code),r=n==="module-system-change"?t.moduleSystem??{from:"dual",to:"esm",incompatibleUsage:["require"]}:void 0;return{id:Pt("bc",e.dependency,e.workspace,t.code,t.symbol,r?.affectedSpecifiers?.join(",")??"",r?.affectedSpecifierPatterns?.join(",")??""),dependency:e.dependency,workspace:e.workspace,kind:n==="removed-export"&&t.replacement?"renamed-export":n,summary:wBe(t.detail,e.dependency),...t.replacement?{replacementSymbols:[t.replacement]}:{},...n==="runtime-requirement"&&t.after?{runtime:{kind:"minimum-runtime",runtime:"java",requirement:`>=${t.after}`,sourceText:t.detail}}:{},before:t.before,after:t.after,...t.fromKind?{fromKind:t.fromKind}:{},...t.toKind?{toKind:t.toKind}:{},remediation:Tee(t,e.dependency),symbols:kBe(t),...r?{moduleSystem:{...r,incompatibleUsage:[...r.incompatibleUsage],...r.affectedSpecifiers?{affectedSpecifiers:[...r.affectedSpecifiers]}:{},...r.affectedSpecifierPatterns?{affectedSpecifierPatterns:[...r.affectedSpecifierPatterns]}:{}}}:{},confidence:"high",taxonomy:Rp(n,t.code),citations:[e.id]}})}function kBe(e){if(BS(e.code)==="module-system-change")return[];let t=new Set([e.symbol]);if(e.symbol.includes(".")&&!/\s/.test(e.symbol)){let r=e.symbol.split("."),i=r[r.length-1];if(i&&!Xoe(i)&&t.add(i),r.length>2){let o=r[r.length-2];o&&t.add(`${o}.${i}`)}if(r.length>=2&&BS(e.code)==="required-field-added"){let o=r[r.length-2];o&&!Xoe(o)&&t.add(o)}}let n=/^[A-Z]+\s+(\/\S*)$/.exec(e.symbol);if(n?.[1]){t.add(n[1]);let r=n[1].split("{")[0]?.replace(/\/$/,"");r&&r.length>1&&t.add(r)}return[...t]}function Xoe(e){return/^__\w+__$/.test(e)?!0:$Be.has(e.toLowerCase())}var $Be=new Set(["add","all","any","append","apply","build","call","check","clear","clone","close","connect","copy","count","create","define","delete","each","emit","end","execute","exists","extend","fetch","filter","find","first","flush","format","get","handle","has","index","init","insert","is","items","iter","join","keys","last","length","list","load","log","main","map","match","new","next","open","parse","pop","push","put","query","read","remove","render","reset","resolve","run","save","send","set","size","sort","split","start","stop","update","wait","write","args","body","config","content","context","data","error","file","header","headers","host","id","key","name","options","params","path","port","result","root","status","text","type","url","value","values","and","or","not","if","elif","else","for","while","do","in","of","as","with","from","to","try","catch","finally","throw","raise","except","switch","case","break","continue","return","yield","class","def","function","lambda","const","let","var","this","self","super","null","nil","none","true","false","async","await","typeof","instanceof","void","enum","interface","extends","implements","export","import","static","public","private","protected","default","pass","then"]);function ese(e,t,n){let r=[],i=new Set,o=Aee(e.content);for(let s of e.content.split(` +`))for(let a of Iee(s,{anchored:o})){let c=`${a.kind}:${a.symbols.join(",")}`;if(i.has(c))continue;i.add(c);let l=a.symbols.length>0||a.kind==="module-system-change"?a.symbols:[t];r.push({id:Pt("bc",t,n,a.ruleId,a.symbols.join(",")),dependency:t,workspace:n,kind:a.kind,summary:a.summary,remediation:Ree(a,t),symbols:l,...a.runtime?{runtime:a.runtime}:{},replacementSymbols:a.replacementSymbols.length?a.replacementSymbols:void 0,...a.moduleSystem?{moduleSystem:a.moduleSystem}:{},confidence:SBe(e),taxonomy:Rp(a.kind),citations:[e.id]})}return r}function SBe(e){return e.weight>=.95?"high":e.weight>=.6?"medium":"low"}function xBe(e,t){return e.map(n=>{let r=tG({change:n,evidence:t});return{...n,confidence:EBe(r.band)}})}function EBe(e){return e==="high"?"high":e==="medium"?"medium":"low"}function TBe(e){let t=new Map;for(let r of e){let i=ABe(r),o=t.get(i);if(!o){t.set(i,{...r,citations:[...new Set(r.citations)]});continue}t.set(i,{...o,summary:o.summary.length>=r.summary.length?o.summary:r.summary,symbols:[...new Set([...o.symbols,...r.symbols])],replacementSymbols:[...new Set([...o.replacementSymbols??[],...r.replacementSymbols??[]])].filter(Boolean).length?[...new Set([...o.replacementSymbols??[],...r.replacementSymbols??[]])]:void 0,moduleSystem:IBe(o.moduleSystem,r.moduleSystem),confidence:PBe(o.confidence,r.confidence),taxonomy:RBe(Vr(o),Vr(r)),citations:[...new Set([...o.citations,...r.citations])]})}let n={high:0,medium:1,low:2};return[...t.values()].sort((r,i)=>n[r.confidence]-n[i.confidence]||r.dependency.localeCompare(i.dependency))}function ABe(e){let t=ll({name:e.dependency,workspace:e.workspace});return e.kind==="module-system-change"?[t,e.kind,[...e.moduleSystem?.incompatibleUsage??[]].sort().join(","),e.moduleSystem?.affectedSpecifiers?.length?[...e.moduleSystem.affectedSpecifiers].sort().join(","):"*",e.moduleSystem?.affectedSpecifierPatterns?.length?[...e.moduleSystem.affectedSpecifierPatterns].sort().join(","):"*"].join("|"):`${t}|${e.kind}|${[...e.symbols].sort().join(",")}`}function IBe(e,t){if(!e)return t;if(!t)return e;let n=[...new Set([...e.incompatibleUsage,...t.incompatibleUsage])],r=e.affectedSpecifiers||t.affectedSpecifiers?[...new Set([...e.affectedSpecifiers??[],...t.affectedSpecifiers??[]])]:void 0,i=e.affectedSpecifierPatterns||t.affectedSpecifierPatterns?[...new Set([...e.affectedSpecifierPatterns??[],...t.affectedSpecifierPatterns??[]])]:void 0;return{from:e.from??t.from,to:e.to??t.to,incompatibleUsage:n,...r?{affectedSpecifiers:r}:{},...i?{affectedSpecifierPatterns:i}:{}}}function RBe(e,t){let n={computed:3,rule:2,"llm-normalized":1,default:0};return n[e.origin]>=n[t.origin]?e:t}function PBe(e,t){let n={low:0,medium:1,high:2};return n[e]>=n[t]?e:t}function iG(e,t){let n={low:0,medium:1,high:2};return n[e]>=n[t]}function MT(e){return e.keys??[e.packageName]}function Pm(e){let t=[],n=new Map,r=new Set(e.map(s=>s.path));for(let s of e){let a=CBe(s),c=uVe(s);t.push({path:s.path,language:s.language,lineCount:s.lineCount,imports:a,localImports:NBe(s),units:c,summary:hVe(s,c,a)});for(let l of new Set(a.flatMap(MT))){let u=n.get(l);u?u.push(s.path):n.set(l,[s.path])}}let i=new Map,o=LBe(r);for(let s of t)for(let a of s.localImports){let c=FBe(s.path,a.specifier,r,o);if(!c||c===s.path)continue;let l=i.get(c),u={from:s.path,bindings:a.bindings,reExport:a.reExport,line:a.line};l?l.push(u):i.set(c,[u])}return{files:t,importers:n,localImporters:i,stats:{fileCount:t.length,unitCount:t.reduce((s,a)=>s+a.units.length,0),totalLines:t.reduce((s,a)=>s+a.lineCount,0)}}}function sG(e,t){let n;for(let r of e.units)tr.endLine||(!n||r.endLine-r.startLine]+)>|"([^"]+)")/.exec(n[r]),o=i?.[1]??i?.[2];o&&t.push({specifier:o,line:r+1,bindings:[],reExport:!0})}return t}function LBe(e){let t=new Map,n=(r,i)=>{let o=t.get(r);o?o.push(i):t.set(r,[i])};for(let r of e){let i=r.split("/").pop()??r;n(i.toLowerCase(),r)}return t}var nse=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".py"];function FBe(e,t,n,r){if(t.startsWith(".")){let s=e.split("/").slice(0,-1),a=UBe([...s,...t.split("/")]);if(a===void 0)return;let l=/^\.+$/.test(t)||!t.includes("/")&&t.startsWith(".")?[`${rse(e,t)}.py`,`${rse(e,t)}/__init__.py`]:[a,...nse.map(u=>a+u),...nse.map(u=>`${a}/index${u}`),`${a}/__init__.py`];for(let u of l)if(u&&n.has(u))return u;return}let i=(t.split("/").pop()??t).toLowerCase(),o=(r.get(i)??[]).filter(s=>s.toLowerCase().endsWith(t.toLowerCase()));return o.length===1?o[0]:void 0}function UBe(e){let t=[];for(let n of e)if(!(n===""||n===".")){if(n===".."){if(t.length===0)return;t.pop();continue}t.push(n)}return t.join("/")}function rse(e,t){let n=/^\.+/.exec(t)?.[0].length??1,r=t.slice(n).split(".").filter(Boolean);return[...e.split("/").slice(0,-n),...r].join("/")}function jBe(e){let t=[],n=e.split(` +`);for(let r=0;r]+)>|"([^"]+)")/.exec(n[r]),o=i?.[1]??i?.[2];o&&(o.startsWith(".")||t.push({specifier:o,packageName:zBe(o),bindings:[],line:r+1,reExport:!0}))}return t}function zBe(e){return(e.split("/")[0]??e).replace(/\.(h|hpp|hh|hxx|inl|tpp|h\+\+)$/i,"").toLowerCase()}function GBe(e){let t=sL(e),n=[],r=cse(t),i=d=>lse(r,d),o=/\bimport\s+(?!\()(?:(?:type\s+)?([\w$]+)\s*,\s*)?(?:type\s+)?(?:\{([^}]+)\}|\*\s+as\s+([\w$]+)|([\w$]+))\s+from\s+['"]([^'"]+)['"]|\bimport\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(o)){let p=d[5]??d[6];if(!p||Am(p))continue;let f=oG(d[1],d[2],d[3],d[4]),m=d[1]??d[4];n.push({specifier:p,packageName:Im(p),bindings:f,...m?{defaultBinding:m}:{},line:i(d.index??0),loadStyle:"esm-static"})}let s=/\b(?:const|let|var)\s+(\{[^}]+\}|[\w$]+)\s*=\s*require\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of t.matchAll(s)){let p=d[2];if(Am(p))continue;let f=d[1],m=f.startsWith("{")?void 0:f;n.push({specifier:p,packageName:Im(p),bindings:BBe(f),...m?{defaultBinding:m}:{},line:i(d.index??0),loadStyle:"commonjs-require"})}let a=/\bimport\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of t.matchAll(a)){let p=d[1];Am(p)||n.push({specifier:p,packageName:Im(p),bindings:[],line:i(d.index??0),loadStyle:"esm-dynamic"})}let c=/\bexport\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(c)){let p=d[2];Am(p)||n.push({specifier:p,packageName:Im(p),bindings:oG(void 0,d[1],void 0,void 0),line:i(d.index??0),reExport:!0,loadStyle:"re-export"})}let l=/\bexport\s+\*\s+as\s+([\w$]+)\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(l)){let p=d[2];Am(p)||n.push({specifier:p,packageName:Im(p),bindings:["*",d[1]],line:i(d.index??0),reExport:!0,loadStyle:"re-export"})}let u=/\bexport\s+\*\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(u)){let p=d[1];Am(p)||n.push({specifier:p,packageName:Im(p),bindings:["*"],line:i(d.index??0),reExport:!0,loadStyle:"re-export"})}return n.sort((d,p)=>d.line-p.line||d.specifier.localeCompare(p.specifier))}function oG(e,t,n,r){let i=[];if(e&&i.push(e),r&&i.push(r),n&&i.push("*",n),t)for(let o of t.split(",")){let s=o.replace(/\btype\s+/g,"").trim();if(!s)continue;let[a,c]=s.split(/\s+as\s+/).map(l=>l.trim());a&&i.push(c||a,a)}return[...new Set(i)]}function BBe(e){let t=e.trim();return t.startsWith("{")?t.replace(/[{}]/g,"").split(",").flatMap(n=>{let[r,i]=n.split(":").map(o=>o.trim());return[r,i].filter(o=>!!o)}):[t]}function VBe(e,t){let n=[],r=e.split(` +`),i=t.endsWith("/__init__.py")||t==="__init__.py";for(let o=0;o{let n=/^\s*(\w+)(?:\s+as\s+(\w+))?/.exec(t);return n?[n[1],n[2]].filter(Boolean):[]}).flat()}function qBe(e){let t=[],n=e.split(` +`),r=!1;for(let i=0;i{let i=r.trim();if(!i)return;let o=i.indexOf("{");if(o!==-1){let c=i.lastIndexOf("}"),l=i.slice(o+1,c===-1?void 0:c);for(let u of KBe(l))n(u);return}let s=/\bas\s+([\w*]+)\s*$/.exec(i);if(s?.[1]){t.push(s[1]);return}let a=i.split("::").pop()?.trim();if(a&&(t.push(a==="*"?"*":a),a==="self")){let c=i.split("::").slice(-2,-1)[0]?.trim();c&&t.push(c)}};return n(e),[...new Set(t.filter(r=>r!=="self"))]}function KBe(e){let t=[],n=0,r="";for(let i of e){if(i==="{"?n+=1:i==="}"&&(n-=1),i===","&&n===0){t.push(r),r="";continue}r+=i}return t.push(r),t}function JBe(e){let t=[],n=e.split(` +`);for(let r=0;ro.slice(0,a+1).join("\\")).reverse()}}function tVe(e){let t=[],n=new Set,r=e.split(` +`),i=(s,a,c,l=!1)=>{let u=s.split(".")[0];if(!/^[A-Z]/.test(u)||nVe.has(u)||n.has(s))return;n.add(s);let d=s.split(".");t.push({specifier:s,packageName:u,bindings:[...new Set([a,s])],line:c,keys:d.map((p,f)=>d.slice(0,f+1).join(".")).reverse(),...l?{synthetic:!0}:{}})},o=!1;for(let s=0;s{cVe.has(l)||n.has(l)||(n.add(l),t.push({specifier:l,packageName:l,bindings:[l],line:i+1,...u?{synthetic:!0}:{}}))},a=/^\s*open\s+([A-Z][\w']*)/.exec(o);if(a?.[1]){s(a[1]);continue}let c=/^\s*module\s+[A-Z][\w']*\s*=\s*([A-Z][\w']*)/.exec(o);if(c?.[1]){s(c[1]);continue}for(let l of o.matchAll(/\b([A-Z][\w']*)\.[a-z_]/g))s(l[1],!0)}return t}var cVe=new Set(["Stdlib","List","Array","String","Bytes","Char","Int","Int32","Int64","Float","Bool","Option","Result","Hashtbl","Map","Set","Buffer","Printf","Format","Sys","Unix","Filename","Sort","Queue","Stack","Lazy","Seq","Fun","Either","Printexc","Random","Digest","Obj"]);function lVe(e){let t=e.trim();if(!t)return["*"];let n=[],r=/\bshow\s+([\w\s,]+)/.exec(t);r?.[1]&&n.push(...r[1].split(",").map(o=>o.trim()).filter(Boolean));let i=/\bas\s+(\w+)/.exec(t);return i?.[1]&&n.push(i[1]),n.length===0&&n.push("*"),[...new Set(n)]}function Am(e){return e.startsWith(".")||e.startsWith("/")||e.startsWith("#")}function Im(e){let t=e.split("/");return e.startsWith("@")?t.slice(0,2).join("/"):t[0]??e}function uVe(e){return e.language==="typescript"||e.language==="javascript"?dVe(e.content,e.path):mVe(e.content,e.language)}function dVe(e,t){let n=[],r=e.split(` +`),i=fVe(r),o=(s,a,c,l,u,d)=>{n.push({name:s,kind:a,startLine:c,endLine:l,summary:pse(u),exported:d})};for(let s=0;s|^\s*=\s*(?:async\s*)?function\b/.test(h);o(m[1],v?"function":"variable",s+1,ose(r,s)+1,`${v?"const fn":"const"} ${m[1]}`,l);continue}let g=/^(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+([\w$]+)/.exec(c);g&&o(g[1],"module",s+1,Rm(r,s)+1,`module ${g[1]}`,l)}return n}function pVe(e,t,n,r,i){let o=0;for(let s=t;s{let a=i.slice(s+1).find(c=>c.indent<=o.indent);return{name:o.name,kind:o.kind,startLine:o.line,endLine:a?a.line-1:r.length,summary:o.summary,exported:!0}})}var gVe={python:[{pattern:/^(?:async\s+)?def\s+(\w+)\s*\(/,kind:"function"},{pattern:/^class\s+(\w+)\s*[(:]/,kind:"class"}],go:[{pattern:/^func\s+(?:\([^)]*\)\s*)?(\w+)\s*[[(]/,kind:"function"},{pattern:/^type\s+(\w+)\s+(?:struct|interface)\s*\{/,kind:"type"}],rust:[{pattern:/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?fn\s+(\w+)/,kind:"function"},{pattern:/^(?:pub(?:\([^)]*\))?\s+)?struct\s+(\w+)/,kind:"class"},{pattern:/^(?:pub(?:\([^)]*\))?\s+)?(?:enum|trait)\s+(\w+)/,kind:"type"},{pattern:/^impl(?:<[^>]*>)?\s+(?:\w+\s+for\s+)?(\w+)/,kind:"class"}],java:[{pattern:/^(?:public|private|protected|abstract|final|static|\s)*(?:class|interface|enum|record)\s+(\w+)/,kind:"class"},{pattern:/^(?:public|private|protected|static|final|synchronized|abstract|\s)+[\w<>[\],.?\s]+\s+(\w+)\s*\(/,kind:"method"}],ruby:[{pattern:/^def\s+(?:self\.)?(\w+[?!=]?)/,kind:"method"},{pattern:/^(?:class|module)\s+([\w:]+)/,kind:"class"}],dotnet:[{pattern:/^(?:public|private|protected|internal|sealed|abstract|static|partial|\s)*(?:class|interface|struct|record|enum)\s+(\w+)/,kind:"class"},{pattern:/^(?:public|private|protected|internal|static|virtual|override|async|sealed|\s)+[\w<>[\],.?\s]+\s+(\w+)\s*\(/,kind:"method"}],php:[{pattern:/^(?:abstract\s+|final\s+|readonly\s+)*(?:class|interface|trait|enum)\s+(\w+)/,kind:"class"},{pattern:/^(?:public\s+|private\s+|protected\s+|static\s+|abstract\s+|final\s+)*function\s+&?(\w+)\s*\(/,kind:"function"}],elixir:[{pattern:/^\s*defmodule\s+([A-Z][\w.]*)/,kind:"module"},{pattern:/^\s*(?:def|defp|defmacro|defmacrop|defguard|defdelegate)\s+([a-z_]\w*[!?]?)/,kind:"function"},{pattern:/^\s*(?:defstruct|defexception|defprotocol|defimpl)\s+([A-Z][\w.]*)?/,kind:"type"}],erlang:[{pattern:/^([a-z]\w*)\s*\(.*\)\s*(?:when\b.*)?->/,kind:"function"},{pattern:/^-record\(\s*(\w+)/,kind:"type"}],swift:[{pattern:/^(?:public\s+|internal\s+|private\s+|fileprivate\s+|open\s+|final\s+|@\w+\s+)*(?:class|struct|enum|protocol|actor|extension)\s+(\w+)/,kind:"class"},{pattern:/^(?:public\s+|internal\s+|private\s+|fileprivate\s+|open\s+|static\s+|final\s+|override\s+|mutating\s+|@\w+\s+)*func\s+(\w+)/,kind:"function"}],dart:[{pattern:/^(?:abstract\s+|base\s+|final\s+|sealed\s+|interface\s+)*(?:class|mixin|enum|extension)\s+(\w+)/,kind:"class"},{pattern:/^typedef\s+(\w+)/,kind:"type"}],ocaml:[{pattern:/^let\s+(?:rec\s+)?([a-z_]\w*)/,kind:"function"},{pattern:/^(?:module|module\s+type)\s+([A-Z]\w*)/,kind:"module"},{pattern:/^type\s+(?:'\w+\s+)?([a-z_]\w*)/,kind:"type"}],c:sse(),cpp:[{pattern:/^(?:template\s*<[^>]*>\s*)?(?:class|struct)\s+(?:\w+_API\s+|\w+_EXPORT\s+)?(\w+)\s*(?::|\{|$)/,kind:"class"},{pattern:/^namespace\s+(\w+)/,kind:"module"},...sse()]};function sse(){return[{pattern:/^typedef\s+(?:struct|union|enum)?\s*[\w\s*]*?(\w+)\s*;/,kind:"type"},{pattern:/^(?:typedef\s+)?(?:struct|union|enum)\s+(\w+)\s*\{?\s*$/,kind:"class"},{pattern:/^(?!(?:return|if|while|for|switch|case|else|do|sizeof|typeof|delete|throw|catch|assert)\b)(?:(?:static|extern|inline|const|constexpr|virtual|explicit|friend|unsigned|signed|struct|enum|class|\w+_API|\w+_EXPORT)\s+)*[\w:<>,\s]*?[\w>]\s*[*&\s]\s*(\w+)\s*\([^;]*\)\s*(?:const\s*)?(?:noexcept\s*)?[{;]?\s*$/,kind:"function"},{pattern:/^#\s*define\s+(\w+)\s*\(/,kind:"function"}]}function hVe(e,t,n){let r=t.filter(a=>a.exported).map(a=>a.name),i=r.slice(0,8),o=[...new Set(n.map(a=>a.packageName))].slice(0,6),s=[`${e.path} (${e.language}, ${e.lineCount} lines)`];return i.length&&s.push(`defines ${i.join(", ")}${r.length>i.length?`, +${r.length-i.length} more`:""}`),o.length&&s.push(`imports ${o.join(", ")}`),s.join(" \u2014 ")}function pse(e){return e.replace(/\s+/g," ").trim().slice(0,200)}function uG(e,t){return`${e}|${t}`}var yVe=2e4;async function LT(e,t){let n=new Map;for(let s of e){if(!lG[s.ecosystem])continue;let a=uG(s.ecosystem,s.name);n.has(a)||n.set(a,s)}let r=new Map;if(n.size===0)return r;let i=[...n.entries()],o=await Yn(i,t.concurrency??6,async([s,a])=>{let c=a.to??a.from;if(!c)return[s,void 0];try{let l=await AVe(`${s}|${c}`,()=>lG[a.ecosystem](a.name,c,{timeoutMs:t.timeoutMs??yVe}));return[s,l]}catch(l){return t.logger.debug(`Module map failed for ${s}: ${l.message}`),[s,void 0]}});for(let[s,a]of o)a&&a.names.length>0&&r.set(s,a);return t.logger.debug(`Resolved ${r.size} of ${n.size} module map(s) from published artefacts`),r}var bVe=async(e,t,{timeoutMs:n})=>{let i=(await Ie(`https://pypi.org/pypi/${encodeURIComponent(e)}/${encodeURIComponent(t)}/json`,{timeoutMs:n,immutable:!0}))?.urls?.find(l=>l.packagetype==="bdist_wheel"&&l.url);if(!i?.url)return;let o=await av(i.url,n);if(!o)return;let s=o.find(l=>/(^|\/)[^/]+\.dist-info\/top_level\.txt$/.test(l.path));if(s){let l=sv(s).split(` +`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));if(l.length>0)return{names:[...new Set(l)],source:`${i.filename??"wheel"} top_level.txt`}}let a=o.find(l=>/(^|\/)[^/]+\.dist-info\/RECORD$/.test(l.path));if(!a)return;let c=new Set;for(let l of sv(a).split(` +`)){let u=l.split(",")[0]?.trim();if(!u)continue;let d=u.split("/")[0];!d||d.startsWith(".")||/\.(dist-info|data)$/.test(d)||c.add(d.endsWith(".py")?d.slice(0,-3):d)}return c.delete(""),c.size>0?{names:[...c],source:`${i.filename??"wheel"} RECORD`}:void 0},vVe=async(e,t,{timeoutMs:n})=>{let[r,i]=e.split(":");if(!r||!i)return;let s=`https://repo1.maven.org/maven2/${r.replace(/\./g,"/")}/${i}/${t}/${i}-${t}.jar`,a=await av(s,n);if(!a)return;let c=new Set;for(let l of a){if(!l.path.endsWith(".class")||l.path.startsWith("META-INF/"))continue;let u=l.path.split("/").slice(0,-1);u.length!==0&&c.add(u.join("."))}return c.size>0?{names:[...c],source:`${i}-${t}.jar`}:void 0},_Ve=async(e,t,{timeoutMs:n})=>{let r=e.toLowerCase(),i=t.toLowerCase(),o=`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(r)}/${encodeURIComponent(i)}/${encodeURIComponent(r)}.${encodeURIComponent(i)}.nupkg`,s=await av(o,n);if(!s)return;let{readAssembly:a}=await Promise.resolve().then(()=>(TL(),V7)),c=new Set;for(let l of s){if(!/^lib\/.+\.dll$/i.test(l.path)&&!/^ref\/.+\.dll$/i.test(l.path))continue;let u;try{u=a(l.read())}catch{continue}for(let d of u??[]){let p=d.fullName.lastIndexOf(".");p>0&&c.add(d.fullName.slice(0,p))}if(c.size>0)break}return c.size>0?{names:[...c],source:`${e} ${t} assembly metadata`}:void 0},wVe=async(e,t,{timeoutMs:n})=>{let i=(await Ie(`https://repo.packagist.org/p2/${e.toLowerCase()}.json`,{timeoutMs:n}))?.packages?.[e.toLowerCase()];if(!i?.length)return;let o=k$(i),a=($$(o,t)??o[0])?.autoload??void 0,c=new Set;for(let l of[a?.["psr-4"],a?.["psr-0"]])for(let u of Object.keys(l??{})){let d=u.replace(/\\+$/,"");d&&c.add(d)}return c.size>0?{names:[...c],source:`${e} composer.json autoload`}:void 0},kVe=async(e,t,{timeoutMs:n})=>{let r=await av(`https://repo.hex.pm/tarballs/${encodeURIComponent(e)}-${encodeURIComponent(t)}.tar`,n);if(!r)return;let i=r.find(c=>c.path==="contents.tar.gz"||c.path.endsWith("/contents.tar.gz"));if(!i)return;let o;try{o=Bn(i.read())}catch{return}let s=new Set;for(let c of o)if(/^(lib|src)\//.test(c.path)){if(/\.(ex|exs)$/.test(c.path)){for(let l of $Ve(sv(c)))s.add(l);continue}if(/\.erl$/.test(c.path)){let l=/^\s*-module\(\s*'?([a-z][\w]*)'?\s*\)/m.exec(sv(c));l?.[1]&&s.add(l[1])}}if(s.size===0)return;let a=new Set;for(let c of s)a.add(c.split(".")[0]);return{names:[...new Set([...s,...a])],source:`${e} ${t} hex tarball`}};function $Ve(e){let t=[],n=[],r=!1;for(let i of e.split(` +`)){let o=(i.match(/"""/g)??[]).length;if(r){o%2===1&&(r=!1);continue}if(o%2===1){r=!0;continue}let s=/^(\s*)defmodule\s+([A-Z][\w.]*)/.exec(i);if(!s)continue;let a=s[1].length;for(;n.length>0&&n[n.length-1].indent>=a;)n.pop();let c=n[n.length-1]?.name,l=c?`${c}.${s[2]}`:s[2];n.push({indent:a,name:l}),t.push(l)}return t}var SVe=async(e,t,{timeoutMs:n})=>{let r=await av(`https://rubygems.org/downloads/${encodeURIComponent(e)}-${encodeURIComponent(t)}.gem`,n);if(!r)return;let i=r.find(c=>c.path==="data.tar.gz"||c.path.endsWith("/data.tar.gz"));if(!i)return;let o;try{o=Bn(i.read())}catch{return}let s=new Set,a=new Set;for(let c of o){let l=/^lib\/(.+)\.rb$/.exec(c.path);if(l?.[1]&&(s.add(l[1]),s.add(l[1].split("/")[0]),!(l[1].split("/").length>2)))for(let u of sv(c).matchAll(/^(?:module|class)\s+([A-Z][\w:]*)/gm))a.add(u[1].split("::")[0])}if(!(s.size===0&&a.size===0))return{names:[...new Set([...s,...a])],source:`${e}-${t}.gem`}},xVe=async(e,t,{timeoutMs:n})=>{let[r,i]=e.split("/");if(!(!r||!i))for(let o of[t,`v${t}`]){let s=await ot(`https://raw.githubusercontent.com/${r}/${i}/${encodeURIComponent(o)}/Package.swift`,{timeoutMs:n,immutable:!0});if(!s)continue;let a=new Set;for(let c of s.matchAll(/\.(?:library|target|executableTarget)\s*\(\s*name:\s*"([^"]+)"/g))a.add(c[1]);for(let c of s.matchAll(/targets:\s*\[([^\]]*)\]/g))for(let l of c[1].matchAll(/"([^"]+)"/g))a.add(l[1]);if(a.size>0)return{names:[...a],source:`${e}@${o} Package.swift`}}},EVe=async(e,t,{timeoutMs:n})=>{let r=await _$(e,t,{timeoutMs:n});if(!r)return;let i=r.moduleName??(r.name??e).replace(/[-.]/g,"_");return{names:[...new Set([i,e])],source:`${e} ${t} podspec`}},lG={pypi:bVe,maven:vVe,nuget:_Ve,packagist:wVe,hex:kVe,rubygems:SVe,swift:xVe,cocoapods:EVe},zCt=Object.keys(lG),TVe=64*1024*1024;async function av(e,t){try{let n=await Jt(e,{timeoutMs:t,retries:0,maxBytes:TVe});return n.ok?Bn(n.bytes):void 0}catch{return}}var aG=new Map,cG=new Map;function AVe(e,t){let n=aG.get(e);if(n!==void 0)return Promise.resolve(n??void 0);let r=cG.get(e);if(r)return r;let i=t().then(o=>(aG.set(e,o??null),o)).catch(()=>{aG.set(e,null)}).finally(()=>cG.delete(e));return cG.set(e,i),i}function sv(e){try{return e.read().toString("utf8")}catch{return""}}var Zs=$t(nl(),1),Tn=$t(Lc(),1);function IVe(e){return e.split(".").map(t=>Number.parseInt(t,10))}function Cm(e,t){let n=Math.max(e.length,t.length);for(let r=0;r0}}function mse(e,t){if(!e)return t;if(!t)return e;let n=Cm(e.value,t.value);return n!==0?n>0?e:t:!e.inclusive||!t.inclusive?{value:e.value,inclusive:!1}:e}function gse(e,t){if(!e)return t;if(!t)return e;let n=Cm(e.value,t.value);return n!==0?n<0?e:t:!e.inclusive||!t.inclusive?{value:e.value,inclusive:!1}:e}function FT(e,t){return mse(e,t)}function cv(e,t){return gse(e,t)}function hse(e){let t=e.split(",").map(o=>o.trim()).filter(Boolean);if(t.length===0)return{min:null,max:null,imprecise:!1};let n=null,r=null,i=!1;for(let o of t){let s=/^(===|~=|==|!=|<=|>=|<|>)?\s*v?(\d[\w.*]*)$/.exec(o);if(!s){i=!0;continue}let[,a,c]=s,l=!a,u=a??"==",d=RVe(c);if(d.imprecise){i=!0;continue}let{release:p,wildcard:f}=d;if(f&&u!=="=="&&u!=="!="){i=!0;continue}if(u==="~="&&p.length<2){i=!0;continue}let m=l||f;switch(u){case">=":n=FT(n,{value:p,inclusive:!0});break;case">":n=FT(n,{value:p,inclusive:!1});break;case"<=":r=cv(r,{value:p,inclusive:!0});break;case"<":r=cv(r,{value:p,inclusive:!1});break;case"==":n=FT(n,{value:p,inclusive:!0}),r=m?cv(r,{value:fse(p),inclusive:!1}):cv(r,{value:p,inclusive:!0});break;case"===":i=!0;break;case"~=":n=FT(n,{value:p,inclusive:!0}),r=cv(r,{value:fse(p.slice(0,-1)),inclusive:!1});break;case"!=":i=!0;break;default:i=!0}}return!i&&PVe(n,r)?{min:n,max:r,imprecise:!0}:{min:n,max:r,imprecise:i}}function PVe(e,t){if(!e||!t)return!1;let n=Cm(e.value,t.value);return n>0?!0:n<0?!1:!(e.inclusive&&t.inclusive)}function CVe(e,t){if(!t)return!0;if(!e)return!1;let n=Cm(e.value,t.value);return n!==0?n>0:!(e.inclusive&&!t.inclusive)}function NVe(e,t){if(!t)return!0;if(!e)return!1;let n=Cm(e.value,t.value);return n!==0?n<0:!(e.inclusive&&!t.inclusive)}function dG(e,t){return e.imprecise||t.imprecise?!1:CVe(e.min,t.min)&&NVe(e.max,t.max)}function pG(e,t){if(e.imprecise||t.imprecise)return!0;let n=mse(e.min,t.min),r=gse(e.max,t.max);if(!n||!r)return!0;let i=Cm(n.value,r.value);return i!==0?i<0:n.inclusive&&r.inclusive}var vse=$t(nl(),1);var OVe=/^nightly-(\d{4}-\d{2}-\d{2})$/,DVe=/^beta-(\d{4}-\d{2}-\d{2})$/;function jT(e){let t=e.trim().replace(/^rust-/i,"");if(!t)return{kind:"unknown"};let n=OVe.exec(yse(t,"nightly"));if(n)return{kind:"dated-nightly",date:n[1]};if(DVe.test(yse(t,"beta")))return{kind:"moving-beta"};if(/^stable$/i.test(t)||/^stable-/i.test(t))return{kind:"moving-stable"};if(/^beta$/i.test(t)||/^beta-/i.test(t))return{kind:"moving-beta"};if(/^nightly$/i.test(t)||/^nightly-/i.test(t))return{kind:"moving-nightly"};let r=MVe(t);return r?{kind:"exact",version:r}:{kind:"unknown"}}function yse(e,t){let n=new RegExp(`^(${t}(?:-\\d{4}-\\d{2}-\\d{2})?)`).exec(e);return n?n[1]:e}function MVe(e){let t=e.split(/-(?=[a-z])/i)[0].trim();return vse.default.valid(t)?t:/^\d+\.\d+$/.test(t)?`${t}.0`:null}var UT=new Map,LVe=e=>`https://static.rust-lang.org/dist/${e}/channel-rust-nightly.toml`,bse=e=>`rust-nightly-version:v1:${e}`;async function _se(e){let t=UT.get(e);if(t)return t;let n=await ic(bse(e));if(n?.version)return UT.set(e,n.version),n.version;let r=null;try{r=await ot(LVe(e),{immutable:!0,retries:1})}catch{r=null}let i=r?FVe(r):null;return i&&(UT.set(e,i),await oc(bse(e),{version:i})),i}function wse(e){return UT.get(e)??null}function FVe(e){let t=/\[pkg\.rust\]([\s\S]*?)(?:\n\[|$)/.exec(e);if(!t)return null;let n=/(?:^|\n)\s*version\s*=\s*"([^"]+)"/.exec(t[1]);if(!n)return null;let r=/^\d+\.\d+\.\d+/.exec(n[1].trim());return r?r[0]:null}async function fG(e){let t=new Set;for(let n of e){let r=jT(n);r.kind==="dated-nightly"&&t.add(r.date)}await Promise.all([...t].map(n=>_se(n)))}function hG(e,t,n,r){return Om(e,t,n,r).resolved}function Om(e,t,n,r){let i=gqe(e,n,r),o={resolved:[],unresolved:[]};for(let{path:s,content:a}of i){if(!_M(s))continue;let c=(s.split("/").pop()??"").toLowerCase();if(UVe[t].includes(c)){jVe(s,c,a,t,o);continue}if(c===".tool-versions"){BVe(s,a,t,o);continue}if(c.startsWith("dockerfile")||c.startsWith("containerfile")){VVe(s,a,t,o);continue}if(t==="node"&&c==="package.json"){WVe(s,a,o);continue}if(t==="python"&&["pyproject.toml","setup.cfg","setup.py"].includes(c)){HVe(s,c,a,o);continue}if(t==="ruby")c==="gemfile"?KVe(s,a,o,i):c.endsWith(".gemspec")&&JVe(s,a,o);else if(t==="go"&&c==="go.mod")ZVe(s,a,o);else if(t==="java")c==="pom.xml"?YVe(s,a,o):(c==="build.gradle"||c==="build.gradle.kts")&&XVe(s,a,o);else if(t==="rust"&&c==="cargo.toml"){let l=eqe(a,"rust-version");l&&lr(o,t,s,l.line,l.requirement,"manifest",l.requirement)}mG(s)&&iqe(s,a,t,o,n,r)}if(n!==void 0&&(r?.length??0)>1){for(let s of o.resolved)!s.scope&&!mG(s.file)&&(s.scope=$se(s.file,n,r));for(let s of o.unresolved)!s.scope&&!mG(s.file)&&(s.scope=$se(s.file,n,r))}if(n!==void 0&&(r?.length??0)>1){let s=c=>c==="member"?2:c==="ambiguous"?0:1,a=Math.max(0,...o.resolved.map(c=>s(c.scope)),...o.unresolved.map(c=>s(c.scope)));o.resolved=o.resolved.filter(c=>s(c.scope)===a),o.unresolved=o.unresolved.filter(c=>s(c.scope)===a)}return o.resolved=dqe(o.resolved),o.unresolved=pqe(o.unresolved),o}var UVe={node:[".nvmrc",".node-version"],python:[".python-version","runtime.txt"],ruby:[".ruby-version"],rust:["rust-toolchain","rust-toolchain.toml"],go:[],java:[]};function lr(e,t,n,r,i,o,s,a){s?e.resolved.push({file:n,line:r,requirement:s,...a?{scope:a}:{}}):e.unresolved.push({runtime:t,file:n,line:r,rawText:i,source:o,...a?{scope:a}:{}})}function Ec(e){return/[$`%]|\{\{|\}\}/.test(e)}function jVe(e,t,n,r,i){if(t==="rust-toolchain.toml"){let a=uqe(n,/^\s*channel\s*=\s*['"]([^'"]+)['"]/);if(!a)return;lr(i,r,e,a.line,a.requirement,"version-file",xc(a.requirement));return}if(t===".python-version"){for(let[a,c]of n.split(` +`).entries()){let l=c.trim();if(!(!l||l.startsWith("#")))for(let u of l.split(/\s+/))lr(i,r,e,a+1,u,"version-file",xc(u))}return}let o=n.trim().split(` +`)[0]?.trim();if(!o)return;let s=t==="runtime.txt"?o.replace(/^python-/i,"").trim():o.replace(/^(?:ruby-|go|rust-)?v?/i,"").trim();s&&lr(i,r,e,1,o,"version-file",xc(s))}function xc(e){return Ec(e)?null:e}function yG(e,t,n){if(e==="node")return Ase(t,n);if(e==="python")return Ise(t,n);let r=[],i=VT(GT(e,n).text);for(let o of t){let s=GT(e,o.requirement),a=VT(s.text),c=s.resolved?{resolvedRequirement:s.resolved}:{};if(!a||!i){r.push({...o,...c,verdict:"unknown"});continue}let l;try{Zs.default.subset(a,i,{loose:!0})?l="compatible":Zs.default.intersects(a,i,{loose:!0})?l="partial":l="incompatible"}catch{l="unknown"}r.push({...o,...c,verdict:l})}return r}function GT(e,t){if(e==="java")return{text:qT(t)??t};if(e==="rust"){let n=jT(t);if(n.kind==="exact")return{text:n.version,resolved:n.version};if(n.kind==="dated-nightly"){let r=wse(n.date);return r?{text:r,resolved:r}:{text:"\0unresolved-nightly"}}return n.kind!=="unknown"?{text:"\0moving-channel"}:{text:t}}return{text:t}}function Sse(e,t,n){if(e==="python")return zVe(t,n);let r=VT(GT(e,n).text),i=[];for(let o of t){let s=GT(e,o.requirement),a=VT(s.text),c=s.resolved?{resolvedRequirement:s.resolved}:{};if(!a||!r){i.push({...o,...c,verdict:"unknown"});continue}let l;try{Zs.default.subset(a,r,{loose:!0})?l="incompatible":Zs.default.intersects(a,r,{loose:!0})?l="partial":l="compatible"}catch{l="unknown"}i.push({...o,...c,verdict:l})}return i}function Nm(e,t="minimum"){let n=t==="unsupported"?e.replace(/\.x$/i,".*"):e;if(/^\s*(?:\^|~(?![=>]))/.test(n))return{status:"unknown",reason:"unsupported-grammar"};let r=hse(n);return r.imprecise||r.min===null&&r.max===null?{status:"unknown",reason:"unparseable"}:{status:"parsed",value:r}}function zVe(e,t){let n=Nm(t,"unsupported"),r=[];for(let i of e){let o=Nm(i.requirement),s;n.status==="unknown"||o.status==="unknown"?s="unknown":dG(o.value,n.value)?s="incompatible":pG(o.value,n.value)?s="partial":s="compatible",r.push({...i,verdict:s})}return r}var GVe={node:["node","nodejs"],python:["python","python3"],go:["go","golang"],ruby:["ruby"],java:["java"],rust:["rust"]};function BVe(e,t,n,r){for(let[i,o]of t.split(` +`).entries()){let s=/^\s*([\w-]+)\s+([^\s#]+)/.exec(o);if(!s||!GVe[n].includes(s[1].toLowerCase()))continue;let a=o.slice(s.index+s[0].length-s[2].length).split("#",1)[0].split(/\s+/).filter(Boolean);for(let c of a){let l=Ec(c)||/^(?:system|path:|ref:)/i.test(c)?null:n==="java"?qT(c):c;lr(r,n,e,i+1,c,"tool-versions",l)}}}function VVe(e,t,n,r){for(let[i,o]of t.split(` +`).entries()){let s=/^\s*FROM\s+(?:--platform=\S+\s+)?(\S+)/i.exec(o)?.[1];s&&xse(r,n,e,i+1,s,"container")}}function xse(e,t,n,r,i,o,s){let a=Ese(i);if(!a||a.runtime!==t)return;let c=a.version;lr(e,t,n,r,i,o,c&&!Ec(c)?BT(c):null,s)}var qVe={node:"node",python:"python",ruby:"ruby",golang:"go",openjdk:"java","eclipse-temurin":"java",amazoncorretto:"java",rust:"rust"};function Ese(e){let t=e.trim().replace(/^['"]|['"]$/g,"");if(!t||t.startsWith("$"))return null;let n=t.split("@",1)[0],r=n.lastIndexOf("/"),i=n.lastIndexOf(":"),o=i>r,s=(o?n.slice(0,i):n).split("/").at(-1)?.toLowerCase();if(!s)return null;let a=qVe[s];if(!a)return null;let c=o?n.slice(i+1):void 0;return c?{runtime:a,version:c}:{runtime:a}}function WVe(e,t,n){let r=hqe(t);r&&lr(n,"node",e,gG(t,/"node"\s*:/),r.raw,"manifest",r.requirement)}function HVe(e,t,n,r){if(t==="setup.py"){let o=vqe(n);o&&lr(r,"python",e,o.line,o.raw,"manifest",o.requirement);return}let i=t==="pyproject.toml"?yqe(n):t==="setup.cfg"?$qe(n):null;i&&lr(r,"python",e,i.line,i.requirement,"manifest",xc(i.requirement))}function KVe(e,t,n,r){for(let[i,o]of t.split(` +`).entries()){let s=/^\s*ruby\s+(.+?)\s*(?:#.*)?$/.exec(o)?.[1]?.trim();if(!s)continue;let a=/^(['"])([^'"]+)\1/.exec(s)?.[2],c=/^file\s*:\s*(['"])([^'"]+)\1/.exec(s)?.[2];if(c){let l=r.find(u=>u.path===c||u.path.endsWith(`/${c}`));if(l){let u=l.content.trim().split(/\s+/)[0];if(u&&!Ec(u))continue}}lr(n,"ruby",e,i+1,s,"manifest",a?xc(a):null)}}function JVe(e,t,n){for(let[r,i]of t.split(` +`).entries()){let o=/\.required_ruby_version\s*=\s*(.+?)\s*(?:#.*)?$/.exec(i)?.[1]?.trim();if(!o)continue;let s=/^(['"])([^'"]+)\1/.exec(o)?.[2];lr(n,"ruby",e,r+1,o,"manifest",s?xc(s):null)}}function ZVe(e,t,n){for(let[r,i]of t.split(` +`).entries()){let o=/^\s*(go|toolchain)\s+(?:go)?(\d+(?:\.\d+){0,3})\s*(?:\/\/.*)?$/.exec(i);o?.[2]&&lr(n,"go",e,r+1,o[2],"manifest",o[2])}}function YVe(e,t,n){let r=[],i=/\s*([^<]+?)\s*<\//g;for(let s of t.matchAll(i))r.push({line:t.slice(0,s.index).split(` +`).length,raw:s[1]});let o=QVe(t);for(let{line:s,raw:a}of r){if(/^\s*\$\{[^}]+\}\s*$/.test(a)&&kse(t,a))continue;let c=kse(t,a),l=c?qT(c):null;lr(n,"java",e,s,a,"manifest",o?l:null)}}function QVe(e){return/\s*maven-toolchains?-plugin\s*<\/artifactId>/i.test(e)?/[\s\S]*?\s*\$\{java\.version\}\s*<\/version>[\s\S]*?<\/jdk>/i.test(e):!1}function kse(e,t){let n=/^\$\{([^}]+)\}$/.exec(t.trim())?.[1];if(!n)return Ec(t)?null:t;let r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`<${r}>\\s*([^<]+?)\\s*`).exec(e)?.[1];return i&&!Ec(i)?i:null}function XVe(e,t,n){let r=[/JavaLanguageVersion\.of\(\s*([^)]+?)\s*\)/];for(let[i,o]of t.split(` +`).entries())for(let s of r){let a=s.exec(o)?.[1];a&&lr(n,"java",e,i+1,a,"build-config",Ec(a)?null:qT(a))}}function qT(e){let t=BT(e.replace(/_/g,"."));return t?.startsWith("1.")?t.slice(2):t}function eqe(e,t){let n=!1;for(let[r,i]of e.split(` +`).entries()){let o=/^\s*\[([^\]]+)\]\s*$/.exec(i);if(o){n=o[1]==="package";continue}if(!n)continue;let s=new RegExp(`^\\s*${t.replace("-","\\-")}\\s*=\\s*['"]([^'"]+)['"]`).exec(i);if(s?.[1])return{line:r+1,requirement:s[1]}}return null}function mG(e){return/^\.github\/workflows\/.+\.ya?ml$/i.test(e)||/^\.(?:gitlab-ci|circleci)(?:\/|\.|$)/i.test(e)}var tqe={node:"node-version",python:"python-version",ruby:"ruby-version",go:"go-version",java:"java-version",rust:"toolchain"};function nqe(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`^\\s*(?:-\\s*)?${n}\\s*:\\s*(.*?)\\s*$`,"i").exec(e);if(!r)return null;let i=r[1].replace(/\\s+#.*$/,"").trim();return{raw:/^(['"])(.*?)\1$/.exec(i)?.[2]??i}}function rqe(e){let t=Array.from({length:e.length},()=>!0),n=null,r=/(?:^\s*-\s*|:\s*)[>|](?:(?:[+-]?\d)|(?:\d[+-]?))?\s*(?:#.*)?$/;for(let[i,o]of e.entries()){let s=o.trim(),a=/^\s*/.exec(o)[0].length;if(n!==null){if(!s||a>n){t[i]=!1;continue}n=null}r.test(o)&&(n=a)}return t}function iqe(e,t,n,r,i,o){let s=t.split(` +`),a=rqe(s),{allowed:c,ambiguous:l,repositoryWide:u}=lqe(s,i,o),d=m=>l[m-1]?"ambiguous":u[m-1]?"repository":"member",p=/^\.github\/workflows\/.+\.ya?ml$/i.test(e)?aqe(t,s):null,f=(m,g,h,v)=>{lr(r,n,e,m,g,h,l[m-1]?null:v,d(m))};for(let[m,g]of s.entries()){if(!a[m]||!c[m]||p?.insideMatrix(m))continue;let h=nqe(g,tqe[n]);if(h){let _=h.raw,w=p&&sqe(_),k=p&&w?p.resolve(m,w):null;if(k?.ok)for(let x of k.values)f(x.line,x.value,"ci",BT(x.value));else f(m+1,_,"ci",Ec(_)?null:BT(_))}if(/^\.github\/workflows\//i.test(e)){let _=/^\s*container\s*:\s*['"]?([^'"\s#]+)/i.exec(g)?.[1];if(_&&zT(r,n,e,m+1,_,"ci",l,d(m+1)),/^\s*container\s*:\s*$/i.test(g)){let w=/^\s*/.exec(g)[0].length;for(let k=m+1;k/^[ \t]*/.exec(l)[0].length,n=l=>!l.trim()||/^\s*#/.test(l),r=e.findIndex(l=>/^[ \t]*jobs:\s*(#.*)?$/.test(l));if(r===-1)return null;let i=t(e[r]),o=null,s=[],a=[],c=e.length;for(let l=r+1;l({name:a[u],start:l,end:u+10||!(0,Tn.isMap)(n.contents))return null;let r=Tse(t);if(!r)return null;let i=[];for(let a of r){let c=n.getIn(["jobs",a.name,"strategy","matrix"],!0);c?.range&&i.push([e.slice(0,c.range[0]).split(` `).length,e.slice(0,c.range[2]).split(` -`).length])}let o=new Map;return{resolve:(a,c)=>{let l=i.find(p=>a>=p.start&&a{let c=a+1;return r.some(([l,u])=>c>=l&&c<=u)}}}function zLe(e,t,n,i){let r=e.getIn(["jobs",n,"strategy","matrix"],!0);if(!(0,_n.isMap)(r))return{ok:!1};let o=g=>{let h=g?.range;return h?t.slice(0,h[0]).split(` -`).length:1},s=g=>{if(!(0,_n.isScalar)(g))return null;let h=g.value;if(typeof h!="string"&&typeof h!="number"&&typeof h!="boolean")return null;let b=String(h);return/\$\{\{/.test(b)?null:{value:b,line:o(g)}},a=[],c=new Map;for(let g of r.items){let h=(0,_n.isScalar)(g.key)?String(g.key.value):null;if(h===null||h==="include"||h==="exclude")continue;if(a.push(h),(0,_n.isScalar)(g.value)){let y=s(g.value);if(!y)return{ok:!1};c.set(h,[y]);continue}if(!(0,_n.isSeq)(g.value))return{ok:!1};let b=[];for(let y of g.value.items){let w=s(y);if(!w)return{ok:!1};b.push(w)}c.set(h,b)}let l=a.length>0?[new Map]:[];for(let g of a){let h=[];for(let b of l)for(let y of c.get(g)??[]){let w=new Map(b);w.set(g,y),h.push(w)}l=h}let u=new Set(a),d=r.get("exclude",!0);if(r.has("exclude")&&!(0,_n.isSeq)(d))return{ok:!1};if((0,_n.isSeq)(d))for(let g of d.items){if(!(0,_n.isMap)(g))return{ok:!1};let h=[];for(let b of g.items){let y=(0,_n.isScalar)(b.key)?String(b.key.value):null,w=s(b.value);if(y===null||!w)return{ok:!1};h.push({k:y,value:w.value})}l=l.filter(b=>!h.every(y=>b.get(y.k)?.value===y.value))}let p=r.get("include",!0);if(r.has("include")&&!(0,_n.isSeq)(p))return{ok:!1};if((0,_n.isSeq)(p)){let g=l.slice();for(let h of p.items){if(!(0,_n.isMap)(h))return{ok:!1};let b=[];for(let w of h.items){let k=(0,_n.isScalar)(w.key)?String(w.key.value):null;if(k===null)return{ok:!1};let _=s(w.value);if(!_){if(k===i||u.has(k))return{ok:!1};continue}b.push({k,value:_.value,line:_.line})}let y=!1;for(let w of g)if(!b.some(_=>u.has(_.k)&&w.has(_.k)&&w.get(_.k).value!==_.value)){for(let _ of b)w.set(_.k,{value:_.value,line:_.line});y=!0}y||l.push(new Map(b.map(w=>[w.k,{value:w.value,line:w.line}])))}}if(l.length===0)return{ok:!1};let f=[],m=new Set;for(let g of l){let h=g.get(i);if(!h)return{ok:!1};m.has(h.value)||(m.add(h.value),f.push({value:h.value,line:h.line}))}return{ok:!0,values:f}}function GLe(e,t,n){let i=Array.from({length:e.length},()=>!0),r=Array.from({length:e.length},()=>!1),o=Array.from({length:e.length},()=>!0);if(t===void 0)return{allowed:i,ambiguous:r,repositoryWide:o};let s=(n?.length??0)>1,a=()=>(s&&(r.fill(!0),o.fill(!1)),{allowed:i,ambiguous:r,repositoryWide:o}),c=T=>/^[ \t]*/.exec(T)[0].length,l=Q7(e);if(!l)return a();o.fill(!1);let u=t.replace(/\\/g,"/"),d=0,p=u.length;for(;dd&&u[p-1]==="/";)p--;let f=u.slice(d,p),m=f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g=f?new RegExp(m,"i"):null,h=/(?:working-directory\s*:|paths(?!-ignore)\s*:)/i,b=/paths-ignore\s*:/i,y=f?new RegExp(`(?:working-directory|paths(?!-ignore)|run)\\s*:[^\\n]*${m}(?:[/\\s"']|$)`,"i"):null,w=f?new RegExp(`paths-ignore\\s*:[^\\n]*${m}(?:[/\\s"']|$)`,"i"):null,k=/^([ \t]*)(?:-\s*)?paths(?!-ignore)\s*:\s*(#.*)?$/i,_=/^([ \t]*)(?:-\s*)?paths-ignore\s*:\s*(#.*)?$/i,S=(T,A)=>{if(!g)return!1;let L=T.split(` -`);for(let F=0;F(y?.test(T)??!1)||S(T,k),E=T=>(w?.test(T)??!1)||S(T,_);i.fill(!1);for(let T of l){let A=e.slice(T.start,T.end).join(` -`);if(!(b.test(A)&&E(A))){if(h.test(A)){if(x(A))for(let L=T.start;L{let i=`${n.file}:${n.line}:${n.requirement}`;return t.has(i)?!1:(t.add(i),!0)})}function qLe(e){let t=new Set;return e.filter(n=>{let i=`${n.file}:${n.line}:${n.rawText}`;return t.has(i)?!1:(t.add(i),!0)})}function Tf(e,t,n){return KF(e,"node",t,n)}var WLe=new Set(["package.json","pyproject.toml","setup.cfg","setup.py","gemfile","go.mod","pom.xml","build.gradle","build.gradle.kts","cargo.toml"]),HLe=new Set([".nvmrc",".node-version",".ruby-version",".python-version","runtime.txt",".tool-versions","rust-toolchain","rust-toolchain.toml"]);function K7(e,t,n){return t===void 0||(n?.length??0)<=1?"repository":Fc(e,n??[])===t?"member":"repository"}function KLe(e,t,n){if(t===void 0)return e;let i=n??[],r=s=>(s.split("/").pop()??"").toLowerCase(),o=new Set(e.filter(s=>HLe.has(r(s.path))&&Fc(s.path,i)===t).map(s=>r(s.path)));return e.filter(s=>{let a=Fc(s.path,i);if(a===t)return!0;let c=r(s.path);return o.has(c)?!1:a===null?!0:a===""?!WLe.has(c)&&!c.endsWith(".gemspec"):!1})}function JLe(e){try{let t=JSON.parse(e);if(!t.engines||!Object.prototype.hasOwnProperty.call(t.engines,"node"))return null;let n=t.engines.node;return typeof n=="string"?{raw:n,requirement:rc(n)}:{raw:JSON.stringify(n),requirement:null}}catch{return null}}function HF(e,t){let n=e.split(` -`).findIndex(i=>t.test(i));return n>=0?n+1:1}function X7(e,t){let n=[];for(let i of e){if(!_s.default.validRange(i.requirement,{loose:!0})){n.push({...i,verdict:"unknown"});continue}let r;try{_s.default.subset(i.requirement,t,{loose:!0})?r="compatible":_s.default.intersects(i.requirement,t,{loose:!0})?r="partial":r="incompatible"}catch{r="unknown"}n.push({...i,verdict:r})}return n}function If(e,t,n){return KF(e,"python",t,n)}function ZLe(e){let t=e.split(` -`),n=!1;for(let i=0;i{let l=r.find(p=>a>=p.start&&a{let c=a+1;return i.some(([l,u])=>c>=l&&c<=u)}}}function cqe(e,t,n,r){let i=e.getIn(["jobs",n,"strategy","matrix"],!0);if(!(0,Tn.isMap)(i))return{ok:!1};let o=g=>{let h=g?.range;return h?t.slice(0,h[0]).split(` +`).length:1},s=g=>{if(!(0,Tn.isScalar)(g))return null;let h=g.value;if(typeof h!="string"&&typeof h!="number"&&typeof h!="boolean")return null;let v=String(h);return/\$\{\{/.test(v)?null:{value:v,line:o(g)}},a=[],c=new Map;for(let g of i.items){let h=(0,Tn.isScalar)(g.key)?String(g.key.value):null;if(h===null||h==="include"||h==="exclude")continue;if(a.push(h),(0,Tn.isScalar)(g.value)){let b=s(g.value);if(!b)return{ok:!1};c.set(h,[b]);continue}if(!(0,Tn.isSeq)(g.value))return{ok:!1};let v=[];for(let b of g.value.items){let _=s(b);if(!_)return{ok:!1};v.push(_)}c.set(h,v)}let l=a.length>0?[new Map]:[];for(let g of a){let h=[];for(let v of l)for(let b of c.get(g)??[]){let _=new Map(v);_.set(g,b),h.push(_)}l=h}let u=new Set(a),d=i.get("exclude",!0);if(i.has("exclude")&&!(0,Tn.isSeq)(d))return{ok:!1};if((0,Tn.isSeq)(d))for(let g of d.items){if(!(0,Tn.isMap)(g))return{ok:!1};let h=[];for(let v of g.items){let b=(0,Tn.isScalar)(v.key)?String(v.key.value):null,_=s(v.value);if(b===null||!_)return{ok:!1};h.push({k:b,value:_.value})}l=l.filter(v=>!h.every(b=>v.get(b.k)?.value===b.value))}let p=i.get("include",!0);if(i.has("include")&&!(0,Tn.isSeq)(p))return{ok:!1};if((0,Tn.isSeq)(p)){let g=l.slice();for(let h of p.items){if(!(0,Tn.isMap)(h))return{ok:!1};let v=[];for(let _ of h.items){let w=(0,Tn.isScalar)(_.key)?String(_.key.value):null;if(w===null)return{ok:!1};let k=s(_.value);if(!k){if(w===r||u.has(w))return{ok:!1};continue}v.push({k:w,value:k.value,line:k.line})}let b=!1;for(let _ of g)if(!v.some(k=>u.has(k.k)&&_.has(k.k)&&_.get(k.k).value!==k.value)){for(let k of v)_.set(k.k,{value:k.value,line:k.line});b=!0}b||l.push(new Map(v.map(_=>[_.k,{value:_.value,line:_.line}])))}}if(l.length===0)return{ok:!1};let f=[],m=new Set;for(let g of l){let h=g.get(r);if(!h)return{ok:!1};m.has(h.value)||(m.add(h.value),f.push({value:h.value,line:h.line}))}return{ok:!0,values:f}}function lqe(e,t,n){let r=Array.from({length:e.length},()=>!0),i=Array.from({length:e.length},()=>!1),o=Array.from({length:e.length},()=>!0);if(t===void 0)return{allowed:r,ambiguous:i,repositoryWide:o};let s=(n?.length??0)>1,a=()=>(s&&(i.fill(!0),o.fill(!1)),{allowed:r,ambiguous:i,repositoryWide:o}),c=R=>/^[ \t]*/.exec(R)[0].length,l=Tse(e);if(!l)return a();o.fill(!1);let u=t.replace(/\\/g,"/"),d=0,p=u.length;for(;dd&&u[p-1]==="/";)p--;let f=u.slice(d,p),m=f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g=f?new RegExp(m,"i"):null,h=/(?:working-directory\s*:|paths(?!-ignore)\s*:)/i,v=/paths-ignore\s*:/i,b=f?new RegExp(`(?:working-directory|paths(?!-ignore)|run)\\s*:[^\\n]*${m}(?:[/\\s"']|$)`,"i"):null,_=f?new RegExp(`paths-ignore\\s*:[^\\n]*${m}(?:[/\\s"']|$)`,"i"):null,w=/^([ \t]*)(?:-\s*)?paths(?!-ignore)\s*:\s*(#.*)?$/i,k=/^([ \t]*)(?:-\s*)?paths-ignore\s*:\s*(#.*)?$/i,x=(R,C)=>{if(!g)return!1;let j=R.split(` +`);for(let z=0;z(b?.test(R)??!1)||x(R,w),I=R=>(_?.test(R)??!1)||x(R,k);r.fill(!1);for(let R of l){let C=e.slice(R.start,R.end).join(` +`);if(!(v.test(C)&&I(C))){if(h.test(C)){if(A(C))for(let j=R.start;j{let r=`${n.file}:${n.line}:${n.requirement}`;return t.has(r)?!1:(t.add(r),!0)})}function pqe(e){let t=new Set;return e.filter(n=>{let r=`${n.file}:${n.line}:${n.rawText}`;return t.has(r)?!1:(t.add(r),!0)})}function Dm(e,t,n){return hG(e,"node",t,n)}var fqe=new Set(["package.json","pyproject.toml","setup.cfg","setup.py","gemfile","go.mod","pom.xml","build.gradle","build.gradle.kts","cargo.toml"]),mqe=new Set([".nvmrc",".node-version",".ruby-version",".python-version","runtime.txt",".tool-versions","rust-toolchain","rust-toolchain.toml"]);function $se(e,t,n){return t===void 0||(n?.length??0)<=1?"repository":sl(e,n??[])===t?"member":"repository"}function gqe(e,t,n){if(t===void 0)return e;let r=n??[],i=s=>(s.split("/").pop()??"").toLowerCase(),o=new Set(e.filter(s=>mqe.has(i(s.path))&&sl(s.path,r)===t).map(s=>i(s.path)));return e.filter(s=>{let a=sl(s.path,r);if(a===t)return!0;let c=i(s.path);return o.has(c)?!1:a===null?!0:a===""?!fqe.has(c)&&!c.endsWith(".gemspec"):!1})}function hqe(e){try{let t=JSON.parse(e);if(!t.engines||!Object.prototype.hasOwnProperty.call(t.engines,"node"))return null;let n=t.engines.node;return typeof n=="string"?{raw:n,requirement:xc(n)}:{raw:JSON.stringify(n),requirement:null}}catch{return null}}function gG(e,t){let n=e.split(` +`).findIndex(r=>t.test(r));return n>=0?n+1:1}function Ase(e,t){let n=[];for(let r of e){if(!Zs.default.validRange(r.requirement,{loose:!0})){n.push({...r,verdict:"unknown"});continue}let i;try{Zs.default.subset(r.requirement,t,{loose:!0})?i="compatible":Zs.default.intersects(r.requirement,t,{loose:!0})?i="partial":i="incompatible"}catch{i="unknown"}n.push({...r,verdict:i})}return n}function Mm(e,t,n){return hG(e,"python",t,n)}function yqe(e){let t=e.split(` +`),n=!1;for(let r=0;r/^\s*#/.test(s)?"":s).join(` -`),i=[...t.matchAll(YLe)].at(-1);if(!i)return null;let r=i.index+i[0].length-1,o=eFe(t,r);return o===null?null:t.slice(r,o+1)}function eFe(e,t){let n=0,i=t;for(;io.kind==="runtime-requirement"&&o.runtime?.runtime),i=new Set(n.map(o=>o.id)),r=new Map;for(let o of t){if(!i.has(o.changeId))continue;let s=r.get(o.changeId);s?s.push(o):r.set(o.changeId,[o])}return n.map(o=>{let s=r.get(o.id)??[];if(s.length===1&&s[0].runtime===o.runtime?.runtime)return s[0];let a=o.runtime?.runtime;return a?{changeId:o.id,runtime:a,requirement:o.runtime?.requirement??"",state:"unknown",reason:"not-analyzed",declarations:[],unresolved:[],sites:[],statement:`Drift could not complete runtime compatibility analysis for this ${a} requirement.`}:s[0]})}function ZF(e,t,n,i){let r=e.runtime;if(!r?.runtime||!r.requirement)return null;let o=r.runtime,s=o==="python"?xf(r.requirement,r.kind==="unsupported-runtime-range"?"unsupported":"minimum"):null;if(r.rangeParseStatus==="unknown"||s?.status==="unknown")return{changeId:e.id,runtime:o,requirement:r.requirement,state:"unknown",reason:"unparseable",declarations:[],unresolved:[],sites:[],statement:`${nee(r)}; Drift could not interpret that version range for ${YF[o]}, so it could not determine compatibility.`};let a=Ef(t,o,n,i),c=r.kind==="unsupported-runtime-range"?J7(o,a.resolved,r.requirement):JF(o,a.resolved,r.requirement),l=rFe(c,a.unresolved),u=iFe(l,c,a.unresolved);return{changeId:e.id,runtime:o,requirement:r.requirement,state:l,reason:u,declarations:c,unresolved:a.unresolved,sites:oFe(e,o,c,a.unresolved,t),statement:sFe(r,o,l,u,c,a.unresolved)}}function rFe(e,t){return e.some(n=>n.verdict==="incompatible")?"incompatible":e.some(n=>n.verdict==="partial")?"partial":e.some(n=>n.verdict==="unknown")||t.length>0?"unknown":e.length>0?"compatible":"unknown"}function iFe(e,t,n){return e==="incompatible"?"violates":e==="partial"?"overlaps":e==="compatible"?"satisfies":t.some(i=>i.verdict==="unknown")?"unparseable":n.length>0?"dynamic":"no-declaration"}function oFe(e,t,n,i,r){let o=(c,l)=>r.find(u=>u.path===c)?.content.split(` -`)[l-1]?.trim().slice(0,200)??"",s=new Map,a=c=>{let l=`${c.file}:${c.line}`,u=s.get(l);(!u||tee(c.runtimeVerdict)>tee(u.runtimeVerdict))&&s.set(l,c)};for(let c of n)c.verdict!=="compatible"&&a({breakingChangeId:e.id,file:c.file,line:c.line,excerpt:o(c.file,c.line),matchedSymbol:t,confidence:c.verdict==="unknown"?"low":"high",runtimeVerdict:c.verdict,siteKind:"runtime-declaration"});for(let c of i)a({breakingChangeId:e.id,file:c.file,line:c.line,excerpt:o(c.file,c.line),matchedSymbol:t,confidence:"low",runtimeVerdict:"unknown",siteKind:"runtime-declaration"});return[...s.values()]}function tee(e){return e==="incompatible"?3:e==="partial"?2:1}var YF={node:"Node",python:"Python",ruby:"Ruby",go:"Go",java:"Java",rust:"Rust"};function nee(e){let t=YF[e.runtime];return e.kind==="minimum-runtime"?`Upstream requires ${t} ${e.requirement}`:`Upstream no longer supports ${t} ${e.requirement}`}function sFe(e,t,n,i,r,o){let s=YF[t],a=nee(e),c=l=>[...new Set(l.map(u=>`${u.requirement} in ${u.file}`))].join(", ");if(n==="compatible")return`${a}; this repository declares ${s} ${c(r)}, which satisfies it.`;if(n==="incompatible"){let l=r.filter(u=>u.verdict==="incompatible");return`${a}; this repository declares ${s} ${c(l)}.`}if(n==="partial"){let l=r.filter(u=>u.verdict==="partial");return`${a}; this repository allows ${c(l)}, so its declared range includes versions this requirement rejects.`}if(i==="dynamic")return`${a}; ${cFe(o)} ${o.length===1?"declares":"declare"} ${s} through a dynamic value, so Drift could not determine compatibility.`;if(i==="unparseable"){let l=r.filter(u=>u.verdict==="unknown");return`${a}; this repository's ${s} declaration (${c(l)}) is not a version range Drift could evaluate, so it could not determine compatibility.`}return i==="not-analyzed"?`${a}; Drift did not complete localization, so runtime compatibility remains unknown.`:`${a}; Drift could not find an authoritative ${s} version declaration for this workspace.`}var aFe={"version-file":"a version file",manifest:"the package manifest",container:"a container image",ci:"CI configuration","tool-versions":"`.tool-versions`","build-config":"the build configuration"};function cFe(e){let t=[...new Set(e.map(n=>`${aFe[n.source]} (${n.file})`))];return t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`}function QF(e){return!e||e.length===0?void 0:["incompatible","partial","unknown","compatible"].find(n=>e.some(i=>i.state===n))}function XF(e){return e==="unknown"||e==="partial"}function nx(e,t,n,i,r){let{logger:o,maxSitesPerChange:s=100,member:a,members:c,moduleMaps:l,maxReExportDepth:u=3}=r,d=new Map(i.map(w=>[w.path,w.content])),p=new Map(n.files.map(w=>[w.path,w])),f=new Map;for(let w of t){let k=f.get(w.name);k?k.includes(w.ecosystem)||k.push(w.ecosystem):f.set(w.name,[w.ecosystem])}let m=[],g=[],h=new Map,b=(w,k)=>{let _=h.get(w.dependency)??{dependency:w.dependency,ecosystem:(f.get(w.dependency)??[])[0]??"npm",importerCandidateFiles:0,changesSearched:0,sitesFound:0};k.importerCandidateFiles!==void 0&&(_.importerCandidateFiles=Math.max(_.importerCandidateFiles,k.importerCandidateFiles)),k.searched&&(_.changesSearched+=1),k.sitesFound&&(_.sitesFound+=k.sitesFound),_.importerCandidateFiles=Math.max(_.importerCandidateFiles,_.sitesFound),h.set(w.dependency,_)},y=new Map;for(let w of e){if(w.kind==="runtime-requirement"){let L=mFe(w,d,a,c);L&&(g.push(L),m.push(...L.sites));continue}if(w.kind==="module-system-change"){let L=fFe(lFe(w,n,d,f.get(w.dependency)??[],l),a);m.push(...L),b(w,{searched:!0,sitesFound:L.length});continue}let k=w.kind==="removed-endpoint"||w.kind==="changed-endpoint",_=k?void 0:y.get(w.dependency),{files:S,names:x,reach:E}=_??hFe(w,n,f.get(w.dependency)??[],l,u,p);!k&&!_&&y.set(w.dependency,{files:S,names:x,reach:E});let T=S.filter(L=>a===void 0||xP(L.path,a));if(b(w,{importerCandidateFiles:T.length,searched:!0}),T.length===0){o.debug(`No importers found for ${w.dependency}; ${w.id} has no impact sites`);continue}let A=_Fe(w,T,d,p,s,x,E);m.push(...A),b(w,{sitesFound:A.length}),A.length>=s&&o.warn(`${w.dependency}: ${w.summary} matched at least ${s} locations; the plan lists the first ${s}.`)}return{sites:m,runtimeAnalyses:g,diagnostics:[...h.values()]}}function lFe(e,t,n,i,r){let o=e.moduleSystem?.incompatibleUsage??[];if(o.length===0)return[];let s=e.moduleSystem?.affectedSpecifiers,a=e.moduleSystem?.affectedSpecifierPatterns,{names:c,exact:l}=lee(e.dependency,i,r),u=new Set;for(let p of c)for(let f of t.importers.get(p)??[])u.add(f);if(u.size===0&&!l){for(let[p,f]of t.importers)if(eu(p,c))for(let m of f)u.add(m)}let d=[];for(let p of t.files){if(!u.has(p.path))continue;let f=n.get(p.path);if(!f)continue;let m=f.split(` -`);for(let g of p.imports){if(!eu(g,c)||!uFe(g.specifier,s,a)||!pFe(g,o))continue;let h=m[g.line-1]??"",b=FF(p,g.line),y=h.indexOf(g.specifier);d.push({breakingChangeId:e.id,file:p.path,line:g.line,excerpt:h.trim().slice(0,200),enclosingSymbol:b?.name,matchedSymbol:g.loadStyle==="commonjs-require"?"require":g.specifier,...y>=0?{column:y,matchedText:g.specifier}:{},confidence:"high"})}}return gee(d)}function uFe(e,t,n){return!t?.length&&!n?.length||t?.includes(e)?!0:n?.some(i=>dFe(e,i))??!1}function dFe(e,t){if([...t.matchAll(/\*/g)].length!==1)return!1;let[i,r]=t.split("*");return!e.startsWith(i)||!e.endsWith(r)?!1:e.length>i.length+r.length}function pFe(e,t){switch(e.loadStyle){case"commonjs-require":return t.includes("require");case"esm-static":return t.includes("static-import");case"esm-dynamic":return t.includes("dynamic-import");case"re-export":return t.includes("re-export");default:return!1}}function fFe(e,t){return t===void 0?[...e]:e.filter(n=>xP(n.file,t))}function mFe(e,t,n,i){let r=[...t].map(([o,s])=>({path:o,content:s}));return ZF(e,r,n,i)}function gFe(e){let t=new Set;for(let n of e){let i=n.trim(),r=i.search(/[(<]/),o=r===-1?i:i.slice(0,r);if(!o.includes("."))continue;let s=o.split(".").filter(Boolean),a=-1;for(let c=s.length-1;c>=0;c--)if(/^[A-Z]/.test(s[c])){a=c;break}a<1||(t.add(s.slice(0,a+1).join(".")),t.add(s.slice(0,a).join(".")))}return[...t].filter(Boolean)}function hFe(e,t,n,i,r,o){if(e.kind==="removed-endpoint"||e.kind==="changed-endpoint")return{files:t.files,names:[],reach:new Map};let a=lee(e.dependency,n,i),c=n.includes("maven")?[...new Set([...a.names,...gFe(e.symbols)])]:a.names,l=a.exact,u=new Set;for(let p of c)for(let f of t.importers.get(p)??[])u.add(f);if(u.size===0&&!l){for(let[p,f]of t.importers)if(eu(p,c))for(let m of f)u.add(m)}let d=new Map;for(let p of u)d.set(p,{direct:!0,inherited:new Set});return r>0&&yFe(t,c,d,r,o),{files:t.files.filter(p=>d.has(p.path)),names:c,reach:d}}function lee(e,t,n){let i=new Set;for(let o of t){let s=n?.get(GF(o,e));for(let a of s?.names??[])i.add(a)}return i.size>0?{names:[...new Set([...i,e])],exact:!0}:{names:t.length>0?[...new Set(t.flatMap(o=>iee(e,o)))]:iee(e,void 0),exact:!1}}function yFe(e,t,n,i,r){let o=[...n.keys()].filter(s=>vFe(r.get(s),t));for(let s=0;s0;s++){let a=[];for(let c of o)for(let l of e.localImporters.get(c)??[]){if(n.size>=bFe)return;let u=n.get(l.from);if(u){for(let d of l.bindings)u.inherited.add(d);continue}n.set(l.from,{direct:!1,inherited:new Set(l.bindings)}),l.reExport&&a.push(l.from)}o=a}}var bFe=400;function vFe(e,t){return e?e.imports.some(n=>n.reExport===!0&&(t.length===0||eu(n,t))):!1}function eu(e,t){return(typeof e=="string"?[e]:qS(e)).some(i=>t.some(r=>ree(i,r)||ree(r,i)))}function ree(e,t){if(e===t)return!0;if(!e.startsWith(t))return!1;let n=e[t.length];return n==="/"||n==="."||n===":"||n==="\\"}function iee(e,t){let n=new Set([e]);switch(t){case"pypi":{let i=e.toLowerCase().replace(/-/g,"_");n.add(i);let r=kFe[e.toLowerCase()];r&&n.add(r);break}case"maven":{let[i]=e.split(":");i&&n.add(i);break}case"cargo":n.add(e.replace(/-/g,"_"));break;case"conan":case"vcpkg":case"arduino":{let i=e.toLowerCase();n.add(i),n.add(i.replace(/[-_]/g,"")),n.add(i.replace(/[-_]/g,"/"));let r=wFe[i];r&&n.add(r),i.startsWith("lib")&&i.length>4&&n.add(i.slice(3));break}case"packagist":{let[i,r]=e.split("/");i&&r&&(n.add(`${Xl(i)}\\${Xl(r)}`),n.add(Xl(i)));break}case"hex":{n.add(Xl(e)),n.add(e.toLowerCase());break}case"swift":{let i=e.split("/").pop()??e;n.add(i),n.add(Xl(i)),i.toLowerCase().startsWith("swift-")&&n.add(Xl(i.slice(6)));break}case"cocoapods":n.add(e.replace(/[-.]/g,"_"));break;case"opam":n.add(Xl(e.replace(/\./g,"_"))),n.add(uee(e.replace(/\./g,"_")));break;default:break}return[...n]}function Xl(e){return e.split(/[-_.]/).filter(Boolean).map(t=>uee(t)).join("")}function uee(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}var wFe={nlohmann_json:"nlohmann","libjpeg-turbo":"jpeglib",libxml2:"libxml",sdl:"sdl2",protobuf:"google",grpc:"grpcpp",abseil:"absl","ms-gsl":"gsl",gtest:"gtest"},kFe={beautifulsoup4:"bs4",pillow:"PIL",pyyaml:"yaml","python-dateutil":"dateutil","msgpack-python":"msgpack",attrs:"attr","scikit-learn":"sklearn","opencv-python":"cv2","python-dotenv":"dotenv",protobuf:"google","google-cloud-storage":"google","psycopg2-binary":"psycopg2",mysqlclient:"MySQLdb","django-cors-headers":"corsheaders",djangorestframework:"rest_framework","pytest-cov":"pytest_cov","typing-extensions":"typing_extensions"},oee=new WeakMap;function $Fe(e,t){let n=oee.get(e);if(n)return n;let i=t.split(` -`),r,o,s={lines:i,withStrings:()=>r??=cee(i,{blankStrings:!1}),withoutStrings:()=>o??=cee(i,{blankStrings:!0})};return oee.set(e,s),s}function _Fe(e,t,n,i,r,o,s){let a=[];for(let c of t){if(a.length>=r)break;let l=n.get(c.path);if(!l)continue;let u=i.get(c.path),d=o.length===0?c.imports:c.imports.filter(A=>eu(A,o)),p=new Set(d.flatMap(A=>A.bindings)),f=d.length>0,m=s.get(c.path),g=m!==void 0&&!m.direct,h=new Set(c.imports.filter(A=>!eu(A,o)).flatMap(A=>A.bindings).filter(A=>A!=="*")),b=new Set(c.units.filter(A=>A.kind!=="method").map(A=>A.name)),y=new Set(c.units.filter(A=>A.kind==="method").map(A=>A.name.split(".").pop()??A.name)),w=new Map;for(let A of c.units){if(A.kind==="variable")continue;let L=A.name.split(".").pop()??A.name,F=w.get(A.startLine)??new Set;F.add(A.name),F.add(L),w.set(A.startLine,F)}let k=FFe.has(c.language)&&f&&!g&&d.every(A=>A.synthetic!==!0&&!A.bindings.includes("*")),_=new Set(c.imports.filter(A=>A.synthetic!==!0).map(A=>A.line)),S=SFe(e.kind),x=xFe(e.kind)&&EFe(c.language),E=$Fe(c,l),{lines:T}=E;for(let A of e.symbols){let L=zFe(e,A),F=L?BFe(L,d,l,m?.inherited):new Set,K=L?qFe(l,F):new Set,te=new Set([...F,...K]),D=L?GFe(e,A,d):p.has(A),X=L?VFe(e,A,o):!1,re=x?IFe(A):pee(A);if(!re||jFe(A,p,h)||WFe(A,p,b))continue;let ie=see(A),ke=ie?E.withStrings():E.withoutStrings(),We=S||ie;for(let ye=0;yeF.has(sn)));if(!Mt&&!vt)continue;zn=vt}if(!Ci&&Cn!==void 0&&LFe.has(Cn)||!Ci&&Cn!==void 0&&y.has(A)||w.get(ye+1)?.has(A))continue;let Pi=p.has(A)||p.has(A.split(".")[0]??A)||p.has("*"),fe=!A.includes(".")&&!see(A);if(k&&fe&&!Pi&&!Ci&&!zn||x&&AFe(e,ke,ye,pt))continue;let ae=u?FF(u,ye+1):void 0,be=Cn!==void 0&&!Ci&&!zn;a.push({breakingChangeId:e.id,file:c.path,line:ye+1,excerpt:xt.trim().slice(0,200),enclosingSymbol:ae?.name,matchedSymbol:A,...pt?{column:pt.index,matchedText:pt[0]}:{},confidence:HFe(A,p,f,g,m?.inherited,be,zn)})}}}return gee(a)}function SFe(e){return e==="removed-export"||e==="renamed-export"||e==="moved-export"||e==="unknown"}function xFe(e){return e==="signature-change"}function EFe(e){return!TFe.has(e)}var TFe=new Set(["ruby","elixir","erlang","ocaml","other","config"]);function IFe(e){let t=e.trim();if(!t||t.length<2)return null;if(t.startsWith("/")||t.startsWith("@"))return pee(t);let n=t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&").replace(/\\\./g,"(?:\\.|::)"),i=/^\w/.test(t)?"\\b":"(?)?";return new RegExp(`(?:new\\s+)?${i}${n}${r}\\s*\\(|(?1&&(o=!0);continue}if(l===")"||l==="]"||l==="}"){if(i-=1,i<0)return null;if(i===0)return l!==")"?null:o?r+1:0;continue}if(i===1&&l===","){r+=1,o=!0;continue}if(l==="`")return null;/\s/.test(l)||(o=!0)}}return null}var NFe=200;function CFe(e,t,n){if(n===void 0||!/^\s*\(/.test(n))return!1;let i=e.trim(),r=i.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&"),o=/^\w/.test(i)?"\\b":"(?)\s*$/:/([A-Za-z_$][\w$]*)\s*(?:\.|::)\s*$/,r=[],o=e.slice(0,t);for(let s=0;s<8;s++){let a=i.exec(o);if(!a)break;r.unshift(a[1]),o=o.slice(0,a.index)}return r.length>0?r:void 0}function MFe(e,t,n){if(n!=="c"&&n!=="cpp")return!1;let i=e.slice(0,t).trim(),r=e.slice(t);return!i||!/^\w+\s*\(/.test(r)||/(?:\.|::|->)\s*$/.test(i)||/^(?:return|co_return|throw|case|delete|new)$/.test(i)?!1:/^(?:(?:virtual|static|inline|constexpr|consteval|constinit|explicit|friend|extern)\s+)*(?:const\s+)?(?:(?:unsigned|signed|long|short)\s+)*[\w:<>]+(?:\s*[*&])?$/.test(i)}var LFe=new Set(["this","$this","self","Self","super","cls","me"]),FFe=new Set(["typescript","javascript","python","go","rust","java"]);function UFe(e,t,n){return n!=="elixir"&&n!=="erlang"&&n!=="ruby"?!1:e[t-1]===":"&&e[t-2]!==":"}function jFe(e,t,n){let i=e.split(".")[0]??e;return t.has(e)||t.has(i)||t.has("*")?!1:n.has(e)||n.has(i)}function pee(e){let t=e.trim();if(!t||t.length<2)return null;let n=t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&").replace(/\\\./g,"(?:\\.|::)");if(t.startsWith("/"))return new RegExp(n);let i=/^\w/.test(t)?"\\b":"(?=2)return i.at(-2)}}function mee(e,t){return e.symbols.filter(n=>n===t||!n.includes(".")&&!n.includes("::")?!1:n.split(/[.:]+/).filter(Boolean).at(-1)===t)}function Ay(e){return e.replace(/^@/,"").replace(/::|[\\/]/g,".").replace(/\.+/g,".").replace(/^\.|\.$/g,"").toLowerCase()}function GFe(e,t,n){for(let i of mee(e,t)){let r=i.split(/[.:]+/).filter(Boolean),o=Ay(r.slice(0,-1).join("."));if(o)for(let s of n){if(!s.bindings.includes(t))continue;if(new Set([s.specifier,s.packageName,...qS(s)].map(Ay)).has(o))return!0;for(let c of[Ay(s.specifier)]){if(!o.startsWith(`${c}.`))continue;if(o.slice(c.length+1).split(".").every(u=>/^[a-z_][a-z0-9_]*$/.test(u)))return!0}}}return!1}function VFe(e,t,n){let i=new Set(n.map(Ay));return mee(e,t).some(r=>{let o=r.split(/[.:]+/).filter(Boolean);return i.has(Ay(o.slice(0,-1).join(".")))})}function BFe(e,t,n,i){let r=new Set;i?.has(e)&&r.add(e);let o=n.split(` -`);for(let s of t){(s.bindings.includes(e)||s.bindings.includes("*"))&&r.add(e),e==="default"&&s.defaultBinding&&r.add(s.defaultBinding);let a=e.includes("."),c=e.split(".").pop();a&&c&&(s.specifier===e&&r.add(c),s.bindings.includes("*")&&e.startsWith(`${s.specifier}.`)&&r.add(c));let l=o[s.line-1]??"",u=new RegExp(`\\b${fee(e)}\\s+as\\s+([A-Za-z_$][\\w$]*)`).exec(l)?.[1];u&&r.add(u)}return r}function qFe(e,t){let n=new Set;for(let i of t){let r=fee(i),o=[new RegExp(`\\b(?:const|let|var|val|final|auto|let(?:\\s+mut)?)\\s+([A-Za-z_$][\\w$]*)\\s*(?::\\s*[^=]+)?=\\s*(?:new\\s+)?${r}(?:::new)?\\s*[({]`,"g"),new RegExp(`\\b(?:new\\s+)?${r}\\s*\\(.*?\\)\\s*as\\s+([A-Za-z_$][\\w$]*)`,"g"),new RegExp(`^\\s*([A-Za-z_$][\\w$]*)\\s*=\\s*${r}\\s*\\(`,"gm"),new RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${r}\\s*\\(`,"g"),new RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*=\\s*${r}::new\\s*\\(`,"g"),new RegExp(`(?)?(?:\\s*\\[\\])?\\s+([A-Za-z_$][\\w$]*)\\s*(?:[({;=,)]|:(?!:))`,"g"),new RegExp(`([A-Za-z_$][\\w$]*)\\s*:\\s*(?:readonly\\s+)?${r}\\b(?!\\s*\\.)`,"g")];for(let s of o)for(let a of e.matchAll(s))a[1]&&n.add(a[1])}return n}function see(e){let t=e.trim();return t.startsWith("/")||t.startsWith("@")||t.includes("/")}function WFe(e,t,n){if(t.has(e)||t.has("*"))return!1;let i=e.split(".")[0]??e;return t.has(i)?!1:n.has(e)||e!==i&&n.has(i)}function HFe(e,t,n,i,r,o,s=!1){let a=e.split(".")[0]??e;return i?r&&(r.has(e)||r.has(a))?"medium":"low":t.has(e)||t.has(a)||t.has("*")||s?"high":o?"low":n?"medium":"low"}function gee(e){let t=new Map;for(let n of e){let i=`${n.breakingChangeId}|${n.file}|${n.line}`,r=t.get(i);(!r||aee(n.confidence)>aee(r.confidence))&&t.set(i,n)}return[...t.values()].sort((n,i)=>n.file.localeCompare(i.file)||n.line-i.line)}function aee(e){return e==="high"?2:e==="medium"?1:0}function KFe(e){let t=e.trim();return t.startsWith("#")?!JFe.test(t):t.startsWith("%")||t.startsWith("(*")?!0:t.startsWith("//")||t.startsWith("*")||t.startsWith("/*")}var JFe=/^#\s*(include|define|undef|if|ifdef|ifndef|elif|else|endif|pragma|error|warning|line)\b/;function cee(e,t){let n=[],i=!1,r=null;for(let o of e){let s="",a=0,c=null;for(;ah.has(b.line-1)).length)}return c.length===0?null:{transform:{ruleId:"rename-identifier",from:r,to:o,anchors:l},edits:c,sitesResolved:u}}function YFe(e,t,n){let i=e.replacementSymbols?.[0];if(!i||!rx.test(i))return null;let o=e.symbols.find(d=>/^[\w$]+\.[\w$]+$/.test(d))?.split(".")[1];if(!o||!rx.test(o)||o===i)return null;let s=e.dependency,a=[],c=[],l=0,u=new Map;for(let d of t)u.set(d.file,[...u.get(d.file)??[],d]);for(let[d,p]of u){let f=n.get(d);if(f===void 0)continue;let m=yee(f,s,o,i);if(m){a.push({file:d,before:f,after:m.content});for(let g of m.touched)c.push({file:d,line:g.text,lineNumber:g.number});l+=p.filter(g=>m.touched.some(h=>h.number===g.line)).length}}return a.length===0||l===0?null:{transform:{ruleId:"namespace-member-to-named-import",from:o,to:i,packageName:s,anchors:c},edits:a,sitesResolved:l}}var QFe=e=>{let t=ro(e);return[new RegExp(`^(\\s*)import\\s+(?:\\*\\s+as\\s+)?([A-Za-z_$][\\w$]*)\\s+from\\s+(['"\`])${t}\\3(\\s*;?)\\s*$`),new RegExp(`^(\\s*)(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\(\\s*(['"\`])${t}\\3\\s*\\)(\\s*;?)\\s*$`)]};function yee(e,t,n,i){let r=e.split(` -`),o=QFe(t),s=-1,a="",c="";for(let[f,m]of r.entries()){for(let[g,h]of o.entries()){let b=h.exec(m);if(!b)continue;s=f,a=b[2];let[y,,,w,k]=[b[1],b[2],"",b[3],b[4]??""];c=g===0?`${y}import { ${i} } from ${w}${t}${w}${k}`:`${y}const { ${i} } = require(${w}${t}${w})${k}`;break}if(s>=0)break}if(s<0||!a)return null;let l=new RegExp(`(?r.file===n))return e;let i=yee(e,t.packageName,t.from,t.to);return i?i.content:e}default:return e}}function XFe(e,t,n,i,r){let o=i.filter(u=>u.file===r);if(o.length===0)return e;let s=e.split(` -`),a=new Map;for(let u of s)a.set(u,(a.get(u)??0)+1);let c=new Set;for(let u of o){let d=u.lineNumber-1;if(s[d]===u.line){c.add(d);continue}if((a.get(u.line)??0)===1){let p=s.indexOf(u.line);p!==-1&&c.add(p)}}if(c.size===0)return e;let l=new RegExp(`(?c.has(d)?vee(u,l,n):u).join(` -`)}function vee(e,t,n){return t1(e,t,n)}function wee(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return"proven";case"insert-argument":case"wrap-call":return"checked"}}var e1e={type:"array",minItems:1,maxItems:8,items:{type:"object",oneOf:[{type:"object",properties:{kind:{const:"rename-identifier"},from:{type:"string",description:"The old bare identifier, exactly as it appears in code."},to:{type:"string",description:"The new bare identifier."}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"rename-member"},from:{type:"string",description:"The old member name, without the dot or the receiver."},to:{type:"string"}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"replace-import-path"},from:{type:"string",description:"The old module specifier, exactly as written between the quotes."},to:{type:"string"}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"insert-argument"},callee:{type:"string",description:"The function being called, e.g. `connect` or `client.connect`."},index:{type:"integer",minimum:0,maximum:8,description:"0-based position in the argument list."},text:{type:"string",description:"A literal only: a quoted string, a number, a boolean, null, or a flat object literal. Never a function call or an expression."}},required:["kind","callee","index","text"],additionalProperties:!1},{type:"object",properties:{kind:{const:"wrap-call"},callee:{type:"string"},wrapper:{type:"string",enum:["await","new"]}},required:["kind","callee","wrapper"],additionalProperties:!1}]}},t1e={type:"object",properties:{applicable:{type:"boolean",description:"False when this migration cannot be expressed as the listed operations. Answering false is correct and common."},migration:{type:"string",description:"One sentence stating the migration, for a human reviewer."},rationale:{type:"string",description:"Why this is the correct fix, quoting the evidence. Two sentences at most."},citations:{type:"array",items:{type:"string"},description:"Ids of the evidence blocks that state this replacement. Copy them exactly."},ops:e1e},required:["applicable","migration","rationale","citations","ops"],additionalProperties:!1},n1e=`You write migration rules for an automated refactoring tool. +`),r=[...t.matchAll(bqe)].at(-1);if(!r)return null;let i=r.index+r[0].length-1,o=wqe(t,i);return o===null?null:t.slice(i,o+1)}function wqe(e,t){let n=0,r=t;for(;ro.kind==="runtime-requirement"&&o.runtime?.runtime),r=new Set(n.map(o=>o.id)),i=new Map;for(let o of t){if(!r.has(o.changeId))continue;let s=i.get(o.changeId);s?s.push(o):i.set(o.changeId,[o])}return n.map(o=>{let s=i.get(o.id)??[];if(s.length===1&&s[0].runtime===o.runtime?.runtime)return s[0];let a=o.runtime?.runtime;return a?{changeId:o.id,runtime:a,requirement:o.runtime?.requirement??"",state:"unknown",reason:"not-analyzed",declarations:[],unresolved:[],sites:[],statement:`Drift could not complete runtime compatibility analysis for this ${a} requirement.`}:s[0]})}function bG(e,t,n,r){let i=e.runtime;if(!i?.runtime||!i.requirement)return null;let o=i.runtime,s=o==="python"?Nm(i.requirement,i.kind==="unsupported-runtime-range"?"unsupported":"minimum"):null;if(i.rangeParseStatus==="unknown"||s?.status==="unknown")return{changeId:e.id,runtime:o,requirement:i.requirement,state:"unknown",reason:"unparseable",declarations:[],unresolved:[],sites:[],statement:`${Pse(i)}; Drift could not interpret that version range for ${vG[o]}, so it could not determine compatibility.`};let a=Om(t,o,n,r),c=i.kind==="unsupported-runtime-range"?Sse(o,a.resolved,i.requirement):yG(o,a.resolved,i.requirement),l=Sqe(c,a.unresolved),u=xqe(l,c,a.unresolved);return{changeId:e.id,runtime:o,requirement:i.requirement,state:l,reason:u,declarations:c,unresolved:a.unresolved,sites:Eqe(e,o,c,a.unresolved,t),statement:Tqe(i,o,l,u,c,a.unresolved)}}function Sqe(e,t){return e.some(n=>n.verdict==="incompatible")?"incompatible":e.some(n=>n.verdict==="partial")?"partial":e.some(n=>n.verdict==="unknown")||t.length>0?"unknown":e.length>0?"compatible":"unknown"}function xqe(e,t,n){return e==="incompatible"?"violates":e==="partial"?"overlaps":e==="compatible"?"satisfies":t.some(r=>r.verdict==="unknown")?"unparseable":n.length>0?"dynamic":"no-declaration"}function Eqe(e,t,n,r,i){let o=(c,l)=>i.find(u=>u.path===c)?.content.split(` +`)[l-1]?.trim().slice(0,200)??"",s=new Map,a=c=>{let l=`${c.file}:${c.line}`,u=s.get(l);(!u||Rse(c.runtimeVerdict)>Rse(u.runtimeVerdict))&&s.set(l,c)};for(let c of n)c.verdict!=="compatible"&&a({breakingChangeId:e.id,file:c.file,line:c.line,excerpt:o(c.file,c.line),matchedSymbol:t,confidence:c.verdict==="unknown"?"low":"high",runtimeVerdict:c.verdict,siteKind:"runtime-declaration"});for(let c of r)a({breakingChangeId:e.id,file:c.file,line:c.line,excerpt:o(c.file,c.line),matchedSymbol:t,confidence:"low",runtimeVerdict:"unknown",siteKind:"runtime-declaration"});return[...s.values()]}function Rse(e){return e==="incompatible"?3:e==="partial"?2:1}var vG={node:"Node",python:"Python",ruby:"Ruby",go:"Go",java:"Java",rust:"Rust"};function Pse(e){let t=vG[e.runtime];return e.kind==="minimum-runtime"?`Upstream requires ${t} ${e.requirement}`:`Upstream no longer supports ${t} ${e.requirement}`}function Tqe(e,t,n,r,i,o){let s=vG[t],a=Pse(e),c=l=>[...new Set(l.map(u=>`${u.requirement} in ${u.file}`))].join(", ");if(n==="compatible")return`${a}; this repository declares ${s} ${c(i)}, which satisfies it.`;if(n==="incompatible"){let l=i.filter(u=>u.verdict==="incompatible");return`${a}; this repository declares ${s} ${c(l)}.`}if(n==="partial"){let l=i.filter(u=>u.verdict==="partial");return`${a}; this repository allows ${c(l)}, so its declared range includes versions this requirement rejects.`}if(r==="dynamic")return`${a}; ${Iqe(o)} ${o.length===1?"declares":"declare"} ${s} through a dynamic value, so Drift could not determine compatibility.`;if(r==="unparseable"){let l=i.filter(u=>u.verdict==="unknown");return`${a}; this repository's ${s} declaration (${c(l)}) is not a version range Drift could evaluate, so it could not determine compatibility.`}return r==="not-analyzed"?`${a}; Drift did not complete localization, so runtime compatibility remains unknown.`:`${a}; Drift could not find an authoritative ${s} version declaration for this workspace.`}var Aqe={"version-file":"a version file",manifest:"the package manifest",container:"a container image",ci:"CI configuration","tool-versions":"`.tool-versions`","build-config":"the build configuration"};function Iqe(e){let t=[...new Set(e.map(n=>`${Aqe[n.source]} (${n.file})`))];return t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`}function _G(e){return!e||e.length===0?void 0:["incompatible","partial","unknown","compatible"].find(n=>e.some(r=>r.state===n))}function wG(e){return e==="unknown"||e==="partial"}function HT(e,t,n,r,i){let{logger:o,maxSitesPerChange:s=100,member:a,members:c,moduleMaps:l,maxReExportDepth:u=3}=i,d=new Map(r.map(_=>[_.path,_.content])),p=new Map(n.files.map(_=>[_.path,_])),f=new Map;for(let _ of t){let w=f.get(_.name);w?w.includes(_.ecosystem)||w.push(_.ecosystem):f.set(_.name,[_.ecosystem])}let m=[],g=[],h=new Map,v=(_,w)=>{let k=h.get(_.dependency)??{dependency:_.dependency,ecosystem:(f.get(_.dependency)??[])[0]??"npm",importerCandidateFiles:0,changesSearched:0,sitesFound:0};w.importerCandidateFiles!==void 0&&(k.importerCandidateFiles=Math.max(k.importerCandidateFiles,w.importerCandidateFiles)),w.searched&&(k.changesSearched+=1),w.sitesFound&&(k.sitesFound+=w.sitesFound),k.importerCandidateFiles=Math.max(k.importerCandidateFiles,k.sitesFound),h.set(_.dependency,k)},b=new Map;for(let _ of e){if(_.kind==="runtime-requirement"){let j=Dqe(_,d,a,c);j&&(g.push(j),m.push(...j.sites));continue}if(_.kind==="module-system-change"){let j=Oqe(Rqe(_,n,d,f.get(_.dependency)??[],l),a);m.push(...j),v(_,{searched:!0,sitesFound:j.length});continue}let w=_.kind==="removed-endpoint"||_.kind==="changed-endpoint",k=w?void 0:b.get(_.dependency),{files:x,names:A,reach:I}=k??Lqe(_,n,f.get(_.dependency)??[],l,u,p);!w&&!k&&b.set(_.dependency,{files:x,names:A,reach:I});let R=x.filter(j=>a===void 0||hM(j.path,a));if(v(_,{importerCandidateFiles:R.length,searched:!0}),R.length===0){o.debug(`No importers found for ${_.dependency}; ${_.id} has no impact sites`);continue}let C=Vqe(_,R,d,p,s,A,I);m.push(...C),v(_,{sitesFound:C.length}),C.length>=s&&o.warn(`${_.dependency}: ${_.summary} matched at least ${s} locations; the plan lists the first ${s}.`)}return{sites:m,runtimeAnalyses:g,diagnostics:[...h.values()]}}function Rqe(e,t,n,r,i){let o=e.moduleSystem?.incompatibleUsage??[];if(o.length===0)return[];let s=e.moduleSystem?.affectedSpecifiers,a=e.moduleSystem?.affectedSpecifierPatterns,{names:c,exact:l}=Fse(e.dependency,r,i),u=new Set;for(let p of c)for(let f of t.importers.get(p)??[])u.add(f);if(u.size===0&&!l){for(let[p,f]of t.importers)if(Su(p,c))for(let m of f)u.add(m)}let d=[];for(let p of t.files){if(!u.has(p.path))continue;let f=n.get(p.path);if(!f)continue;let m=f.split(` +`);for(let g of p.imports){if(!Su(g,c)||!Pqe(g.specifier,s,a)||!Nqe(g,o))continue;let h=m[g.line-1]??"",v=sG(p,g.line),b=h.indexOf(g.specifier);d.push({breakingChangeId:e.id,file:p.path,line:g.line,excerpt:h.trim().slice(0,200),enclosingSymbol:v?.name,matchedSymbol:g.loadStyle==="commonjs-require"?"require":g.specifier,...b>=0?{column:b,matchedText:g.specifier}:{},confidence:"high"})}}return Vse(d)}function Pqe(e,t,n){return!t?.length&&!n?.length||t?.includes(e)?!0:n?.some(r=>Cqe(e,r))??!1}function Cqe(e,t){if([...t.matchAll(/\*/g)].length!==1)return!1;let[r,i]=t.split("*");return!e.startsWith(r)||!e.endsWith(i)?!1:e.length>r.length+i.length}function Nqe(e,t){switch(e.loadStyle){case"commonjs-require":return t.includes("require");case"esm-static":return t.includes("static-import");case"esm-dynamic":return t.includes("dynamic-import");case"re-export":return t.includes("re-export");default:return!1}}function Oqe(e,t){return t===void 0?[...e]:e.filter(n=>hM(n.file,t))}function Dqe(e,t,n,r){let i=[...t].map(([o,s])=>({path:o,content:s}));return bG(e,i,n,r)}function Mqe(e){let t=new Set;for(let n of e){let r=n.trim(),i=r.search(/[(<]/),o=i===-1?r:r.slice(0,i);if(!o.includes("."))continue;let s=o.split(".").filter(Boolean),a=-1;for(let c=s.length-1;c>=0;c--)if(/^[A-Z]/.test(s[c])){a=c;break}a<1||(t.add(s.slice(0,a+1).join(".")),t.add(s.slice(0,a).join(".")))}return[...t].filter(Boolean)}function Lqe(e,t,n,r,i,o){if(e.kind==="removed-endpoint"||e.kind==="changed-endpoint")return{files:t.files,names:[],reach:new Map};let a=Fse(e.dependency,n,r),c=n.includes("maven")?[...new Set([...a.names,...Mqe(e.symbols)])]:a.names,l=a.exact,u=new Set;for(let p of c)for(let f of t.importers.get(p)??[])u.add(f);if(u.size===0&&!l){for(let[p,f]of t.importers)if(Su(p,c))for(let m of f)u.add(m)}let d=new Map;for(let p of u)d.set(p,{direct:!0,inherited:new Set});return i>0&&Fqe(t,c,d,i,o),{files:t.files.filter(p=>d.has(p.path)),names:c,reach:d}}function Fse(e,t,n){let r=new Set;for(let o of t){let s=n?.get(uG(o,e));for(let a of s?.names??[])r.add(a)}return r.size>0?{names:[...new Set([...r,e])],exact:!0}:{names:t.length>0?[...new Set(t.flatMap(o=>Nse(e,o)))]:Nse(e,void 0),exact:!1}}function Fqe(e,t,n,r,i){let o=[...n.keys()].filter(s=>jqe(i.get(s),t));for(let s=0;s0;s++){let a=[];for(let c of o)for(let l of e.localImporters.get(c)??[]){if(n.size>=Uqe)return;let u=n.get(l.from);if(u){for(let d of l.bindings)u.inherited.add(d);continue}n.set(l.from,{direct:!1,inherited:new Set(l.bindings)}),l.reExport&&a.push(l.from)}o=a}}var Uqe=400;function jqe(e,t){return e?e.imports.some(n=>n.reExport===!0&&(t.length===0||Su(n,t))):!1}function Su(e,t){return(typeof e=="string"?[e]:MT(e)).some(r=>t.some(i=>Cse(r,i)||Cse(i,r)))}function Cse(e,t){if(e===t)return!0;if(!e.startsWith(t))return!1;let n=e[t.length];return n==="/"||n==="."||n===":"||n==="\\"}function Nse(e,t){let n=new Set([e]);switch(t){case"pypi":{let r=e.toLowerCase().replace(/-/g,"_");n.add(r);let i=Gqe[e.toLowerCase()];i&&n.add(i);break}case"maven":{let[r]=e.split(":");r&&n.add(r);break}case"cargo":n.add(e.replace(/-/g,"_"));break;case"conan":case"vcpkg":case"arduino":{let r=e.toLowerCase();n.add(r),n.add(r.replace(/[-_]/g,"")),n.add(r.replace(/[-_]/g,"/"));let i=zqe[r];i&&n.add(i),r.startsWith("lib")&&r.length>4&&n.add(r.slice(3));break}case"packagist":{let[r,i]=e.split("/");r&&i&&(n.add(`${$u(r)}\\${$u(i)}`),n.add($u(r)));break}case"hex":{n.add($u(e)),n.add(e.toLowerCase());break}case"swift":{let r=e.split("/").pop()??e;n.add(r),n.add($u(r)),r.toLowerCase().startsWith("swift-")&&n.add($u(r.slice(6)));break}case"cocoapods":n.add(e.replace(/[-.]/g,"_"));break;case"opam":n.add($u(e.replace(/\./g,"_"))),n.add(Use(e.replace(/\./g,"_")));break;default:break}return[...n]}function $u(e){return e.split(/[-_.]/).filter(Boolean).map(t=>Use(t)).join("")}function Use(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}var zqe={nlohmann_json:"nlohmann","libjpeg-turbo":"jpeglib",libxml2:"libxml",sdl:"sdl2",protobuf:"google",grpc:"grpcpp",abseil:"absl","ms-gsl":"gsl",gtest:"gtest"},Gqe={beautifulsoup4:"bs4",pillow:"PIL",pyyaml:"yaml","python-dateutil":"dateutil","msgpack-python":"msgpack",attrs:"attr","scikit-learn":"sklearn","opencv-python":"cv2","python-dotenv":"dotenv",protobuf:"google","google-cloud-storage":"google","psycopg2-binary":"psycopg2",mysqlclient:"MySQLdb","django-cors-headers":"corsheaders",djangorestframework:"rest_framework","pytest-cov":"pytest_cov","typing-extensions":"typing_extensions"},Ose=new WeakMap;function Bqe(e,t){let n=Ose.get(e);if(n)return n;let r=t.split(` +`),i,o,s={lines:r,withStrings:()=>i??=Lse(r,{blankStrings:!1}),withoutStrings:()=>o??=Lse(r,{blankStrings:!0})};return Ose.set(e,s),s}function Vqe(e,t,n,r,i,o,s){let a=[];for(let c of t){if(a.length>=i)break;let l=n.get(c.path);if(!l)continue;let u=r.get(c.path),d=o.length===0?c.imports:c.imports.filter(C=>Su(C,o)),p=new Set(d.flatMap(C=>C.bindings)),f=d.length>0,m=s.get(c.path),g=m!==void 0&&!m.direct,h=new Set(c.imports.filter(C=>!Su(C,o)).flatMap(C=>C.bindings).filter(C=>C!=="*")),v=new Set(c.units.filter(C=>C.kind!=="method").map(C=>C.name)),b=new Set(c.units.filter(C=>C.kind==="method").map(C=>C.name.split(".").pop()??C.name)),_=new Map;for(let C of c.units){if(C.kind==="variable")continue;let j=C.name.split(".").pop()??C.name,z=_.get(C.startLine)??new Set;z.add(C.name),z.add(j),_.set(C.startLine,z)}let w=o2e.has(c.language)&&f&&!g&&d.every(C=>C.synthetic!==!0&&!C.bindings.includes("*")),k=new Set(c.imports.filter(C=>C.synthetic!==!0).map(C=>C.line)),x=qqe(e.kind),A=Wqe(e.kind)&&Hqe(c.language),I=Bqe(c,l),{lines:R}=I;for(let C of e.symbols){let j=c2e(e,C),z=j?d2e(j,d,l,m?.inherited):new Set,Y=j?p2e(l,z):new Set,se=new Set([...z,...Y]),L=j?l2e(e,C,d):p.has(C),ee=j?u2e(e,C,o):!1,ce=A?Jqe(C):zse(C);if(!ce||a2e(C,p,h)||f2e(C,p,v))continue;let le=Dse(C),Ae=le?I.withStrings():I.withoutStrings(),Ke=x||le;for(let ke=0;kez.has(dn)));if(!Gt&&!At)continue;Hn=At}if(!Ki&&Ln!==void 0&&i2e.has(Ln)||!Ki&&Ln!==void 0&&b.has(C)||_.get(ke+1)?.has(C))continue;let Ji=p.has(C)||p.has(C.split(".")[0]??C)||p.has("*"),be=!C.includes(".")&&!Dse(C);if(w&&be&&!Ji&&!Ki&&!Hn||A&&Zqe(e,Ae,ke,yt))continue;let pe=u?sG(u,ke+1):void 0,Se=Ln!==void 0&&!Ki&&!Hn;a.push({breakingChangeId:e.id,file:c.path,line:ke+1,excerpt:Ct.trim().slice(0,200),enclosingSymbol:pe?.name,matchedSymbol:C,...yt?{column:yt.index,matchedText:yt[0]}:{},confidence:m2e(C,p,f,g,m?.inherited,Se,Hn)})}}}return Vse(a)}function qqe(e){return e==="removed-export"||e==="renamed-export"||e==="moved-export"||e==="unknown"}function Wqe(e){return e==="signature-change"}function Hqe(e){return!Kqe.has(e)}var Kqe=new Set(["ruby","elixir","erlang","ocaml","other","config"]);function Jqe(e){let t=e.trim();if(!t||t.length<2)return null;if(t.startsWith("/")||t.startsWith("@"))return zse(t);let n=t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&").replace(/\\\./g,"(?:\\.|::)"),r=/^\w/.test(t)?"\\b":"(?)?";return new RegExp(`(?:new\\s+)?${r}${n}${i}\\s*\\(|(?1&&(o=!0);continue}if(l===")"||l==="]"||l==="}"){if(r-=1,r<0)return null;if(r===0)return l!==")"?null:o?i+1:0;continue}if(r===1&&l===","){i+=1,o=!0;continue}if(l==="`")return null;/\s/.test(l)||(o=!0)}}return null}var Qqe=200;function Xqe(e,t,n){if(n===void 0||!/^\s*\(/.test(n))return!1;let r=e.trim(),i=r.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&"),o=/^\w/.test(r)?"\\b":"(?)\s*$/:/([A-Za-z_$][\w$]*)\s*(?:\.|::)\s*$/,i=[],o=e.slice(0,t);for(let s=0;s<8;s++){let a=r.exec(o);if(!a)break;i.unshift(a[1]),o=o.slice(0,a.index)}return i.length>0?i:void 0}function r2e(e,t,n){if(n!=="c"&&n!=="cpp")return!1;let r=e.slice(0,t).trim(),i=e.slice(t);return!r||!/^\w+\s*\(/.test(i)||/(?:\.|::|->)\s*$/.test(r)||/^(?:return|co_return|throw|case|delete|new)$/.test(r)?!1:/^(?:(?:virtual|static|inline|constexpr|consteval|constinit|explicit|friend|extern)\s+)*(?:const\s+)?(?:(?:unsigned|signed|long|short)\s+)*[\w:<>]+(?:\s*[*&])?$/.test(r)}var i2e=new Set(["this","$this","self","Self","super","cls","me"]),o2e=new Set(["typescript","javascript","python","go","rust","java"]);function s2e(e,t,n){return n!=="elixir"&&n!=="erlang"&&n!=="ruby"?!1:e[t-1]===":"&&e[t-2]!==":"}function a2e(e,t,n){let r=e.split(".")[0]??e;return t.has(e)||t.has(r)||t.has("*")?!1:n.has(e)||n.has(r)}function zse(e){let t=e.trim();if(!t||t.length<2)return null;let n=t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&").replace(/\\\./g,"(?:\\.|::)");if(t.startsWith("/"))return new RegExp(n);let r=/^\w/.test(t)?"\\b":"(?=2)return r.at(-2)}}function Bse(e,t){return e.symbols.filter(n=>n===t||!n.includes(".")&&!n.includes("::")?!1:n.split(/[.:]+/).filter(Boolean).at(-1)===t)}function lv(e){return e.replace(/^@/,"").replace(/::|[\\/]/g,".").replace(/\.+/g,".").replace(/^\.|\.$/g,"").toLowerCase()}function l2e(e,t,n){for(let r of Bse(e,t)){let i=r.split(/[.:]+/).filter(Boolean),o=lv(i.slice(0,-1).join("."));if(o)for(let s of n){if(!s.bindings.includes(t))continue;if(new Set([s.specifier,s.packageName,...MT(s)].map(lv)).has(o))return!0;for(let c of[lv(s.specifier)]){if(!o.startsWith(`${c}.`))continue;if(o.slice(c.length+1).split(".").every(u=>/^[a-z_][a-z0-9_]*$/.test(u)))return!0}}}return!1}function u2e(e,t,n){let r=new Set(n.map(lv));return Bse(e,t).some(i=>{let o=i.split(/[.:]+/).filter(Boolean);return r.has(lv(o.slice(0,-1).join(".")))})}function d2e(e,t,n,r){let i=new Set;r?.has(e)&&i.add(e);let o=n.split(` +`);for(let s of t){(s.bindings.includes(e)||s.bindings.includes("*"))&&i.add(e),e==="default"&&s.defaultBinding&&i.add(s.defaultBinding);let a=e.includes("."),c=e.split(".").pop();a&&c&&(s.specifier===e&&i.add(c),s.bindings.includes("*")&&e.startsWith(`${s.specifier}.`)&&i.add(c));let l=o[s.line-1]??"",u=new RegExp(`\\b${Gse(e)}\\s+as\\s+([A-Za-z_$][\\w$]*)`).exec(l)?.[1];u&&i.add(u)}return i}function p2e(e,t){let n=new Set;for(let r of t){let i=Gse(r),o=[new RegExp(`\\b(?:const|let|var|val|final|auto|let(?:\\s+mut)?)\\s+([A-Za-z_$][\\w$]*)\\s*(?::\\s*[^=]+)?=\\s*(?:new\\s+)?${i}(?:::new)?\\s*[({]`,"g"),new RegExp(`\\b(?:new\\s+)?${i}\\s*\\(.*?\\)\\s*as\\s+([A-Za-z_$][\\w$]*)`,"g"),new RegExp(`^\\s*([A-Za-z_$][\\w$]*)\\s*=\\s*${i}\\s*\\(`,"gm"),new RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${i}\\s*\\(`,"g"),new RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*=\\s*${i}::new\\s*\\(`,"g"),new RegExp(`(?)?(?:\\s*\\[\\])?\\s+([A-Za-z_$][\\w$]*)\\s*(?:[({;=,)]|:(?!:))`,"g"),new RegExp(`([A-Za-z_$][\\w$]*)\\s*:\\s*(?:readonly\\s+)?${i}\\b(?!\\s*\\.)`,"g")];for(let s of o)for(let a of e.matchAll(s))a[1]&&n.add(a[1])}return n}function Dse(e){let t=e.trim();return t.startsWith("/")||t.startsWith("@")||t.includes("/")}function f2e(e,t,n){if(t.has(e)||t.has("*"))return!1;let r=e.split(".")[0]??e;return t.has(r)?!1:n.has(e)||e!==r&&n.has(r)}function m2e(e,t,n,r,i,o,s=!1){let a=e.split(".")[0]??e;return r?i&&(i.has(e)||i.has(a))?"medium":"low":t.has(e)||t.has(a)||t.has("*")||s?"high":o?"low":n?"medium":"low"}function Vse(e){let t=new Map;for(let n of e){let r=`${n.breakingChangeId}|${n.file}|${n.line}`,i=t.get(r);(!i||Mse(n.confidence)>Mse(i.confidence))&&t.set(r,n)}return[...t.values()].sort((n,r)=>n.file.localeCompare(r.file)||n.line-r.line)}function Mse(e){return e==="high"?2:e==="medium"?1:0}function g2e(e){let t=e.trim();return t.startsWith("#")?!h2e.test(t):t.startsWith("%")||t.startsWith("(*")?!0:t.startsWith("//")||t.startsWith("*")||t.startsWith("/*")}var h2e=/^#\s*(include|define|undef|if|ifdef|ifndef|elif|else|endif|pragma|error|warning|line)\b/;function Lse(e,t){let n=[],r=!1,i=null;for(let o of e){let s="",a=0,c=null;for(;ah.has(v.line-1)).length)}return c.length===0?null:{transform:{ruleId:"rename-identifier",from:i,to:o,anchors:l},edits:c,sitesResolved:u}}function b2e(e,t,n){let r=e.replacementSymbols?.[0];if(!r||!KT.test(r))return null;let o=e.symbols.find(d=>/^[\w$]+\.[\w$]+$/.test(d))?.split(".")[1];if(!o||!KT.test(o)||o===r)return null;let s=e.dependency,a=[],c=[],l=0,u=new Map;for(let d of t)u.set(d.file,[...u.get(d.file)??[],d]);for(let[d,p]of u){let f=n.get(d);if(f===void 0)continue;let m=Wse(f,s,o,r);if(m){a.push({file:d,before:f,after:m.content});for(let g of m.touched)c.push({file:d,line:g.text,lineNumber:g.number});l+=p.filter(g=>m.touched.some(h=>h.number===g.line)).length}}return a.length===0||l===0?null:{transform:{ruleId:"namespace-member-to-named-import",from:o,to:r,packageName:s,anchors:c},edits:a,sitesResolved:l}}var v2e=e=>{let t=bo(e);return[new RegExp(`^(\\s*)import\\s+(?:\\*\\s+as\\s+)?([A-Za-z_$][\\w$]*)\\s+from\\s+(['"\`])${t}\\3(\\s*;?)\\s*$`),new RegExp(`^(\\s*)(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\(\\s*(['"\`])${t}\\3\\s*\\)(\\s*;?)\\s*$`)]};function Wse(e,t,n,r){let i=e.split(` +`),o=v2e(t),s=-1,a="",c="";for(let[f,m]of i.entries()){for(let[g,h]of o.entries()){let v=h.exec(m);if(!v)continue;s=f,a=v[2];let[b,,,_,w]=[v[1],v[2],"",v[3],v[4]??""];c=g===0?`${b}import { ${r} } from ${_}${t}${_}${w}`:`${b}const { ${r} } = require(${_}${t}${_})${w}`;break}if(s>=0)break}if(s<0||!a)return null;let l=new RegExp(`(?i.file===n))return e;let r=Wse(e,t.packageName,t.from,t.to);return r?r.content:e}default:return e}}function _2e(e,t,n,r,i){let o=r.filter(u=>u.file===i);if(o.length===0)return e;let s=e.split(` +`),a=new Map;for(let u of s)a.set(u,(a.get(u)??0)+1);let c=new Set;for(let u of o){let d=u.lineNumber-1;if(s[d]===u.line){c.add(d);continue}if((a.get(u.line)??0)===1){let p=s.indexOf(u.line);p!==-1&&c.add(p)}}if(c.size===0)return e;let l=new RegExp(`(?c.has(d)?Kse(u,l,n):u).join(` +`)}function Kse(e,t,n){return $G(e,t,n)}function Jse(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return"proven";case"insert-argument":case"wrap-call":return"checked"}}var w2e={type:"array",minItems:1,maxItems:8,items:{type:"object",oneOf:[{type:"object",properties:{kind:{const:"rename-identifier"},from:{type:"string",description:"The old bare identifier, exactly as it appears in code."},to:{type:"string",description:"The new bare identifier."}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"rename-member"},from:{type:"string",description:"The old member name, without the dot or the receiver."},to:{type:"string"}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"replace-import-path"},from:{type:"string",description:"The old module specifier, exactly as written between the quotes."},to:{type:"string"}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"insert-argument"},callee:{type:"string",description:"The function being called, e.g. `connect` or `client.connect`."},index:{type:"integer",minimum:0,maximum:8,description:"0-based position in the argument list."},text:{type:"string",description:"A literal only: a quoted string, a number, a boolean, null, or a flat object literal. Never a function call or an expression."}},required:["kind","callee","index","text"],additionalProperties:!1},{type:"object",properties:{kind:{const:"wrap-call"},callee:{type:"string"},wrapper:{type:"string",enum:["await","new"]}},required:["kind","callee","wrapper"],additionalProperties:!1}]}},k2e={type:"object",properties:{applicable:{type:"boolean",description:"False when this migration cannot be expressed as the listed operations. Answering false is correct and common."},migration:{type:"string",description:"One sentence stating the migration, for a human reviewer."},rationale:{type:"string",description:"Why this is the correct fix, quoting the evidence. Two sentences at most."},citations:{type:"array",items:{type:"string"},description:"Ids of the evidence blocks that state this replacement. Copy them exactly."},ops:w2e},required:["applicable","migration","rationale","citations","ops"],additionalProperties:!1},$2e=`You write migration rules for an automated refactoring tool. You are given one breaking change in a dependency, the evidence that documents it, and a sample of the real lines in a repository that use the affected API. You return a small set of mechanical operations that, applied to those lines, complete the migration. @@ -1493,230 +1471,230 @@ Rules you must follow: 4. \`rename-identifier\` matches bare identifiers only and never a member after a dot. \`rename-member\` matches members after a dot only. Choose based on how the sample lines actually read; if both forms appear, return both operations. 5. \`insert-argument\` text must be a literal. Never a function call, never an expression, never a lambda. 6. Operations are applied in the order you list them, to each line, and must converge: applying them twice must give the same result as applying them once. -7. Prefer fewer operations. A migration needing more than about three is usually not mechanical, and \`applicable: false\` is the better answer.`,r1e=24;async function kee(e){let{change:t,evidence:n,sites:i,fileContents:r,config:o,logger:s}=e,a=e.client;if(!a)return null;let c=o1e(t,i,r);if(c.length===0)return s.debug(`No readable call sites for ${t.id}; not authoring a fix plan.`),null;let l=n.filter(m=>t.citations.includes(m.id));if(l.length===0)return s.debug(`${t.id} cites no retrievable evidence; not authoring a fix plan.`),null;let u;try{u=await a.messages.create({model:o.llm.model,max_tokens:8e3,system:n1e,thinking:{type:"adaptive"},output_config:{effort:o.llm.effort,format:{type:"json_schema",schema:t1e}},messages:[{role:"user",content:s1e(t,e.dependencyChange,l,c)}]})}catch(m){return s.warn(`Could not author a fix plan for ${t.dependency}: ${m.message}`),null}if(u.stop_reason==="refusal")return s.warn(`The model declined to author a fix plan for ${t.dependency}.`),null;let d=u.content.find(m=>m.type==="text")?.text;if(!d)return s.warn(`The model returned no text when asked for a fix plan for ${t.dependency}${u.stop_reason?` (stop reason: ${u.stop_reason})`:""}.`),null;let p;try{p=JSON.parse(d)}catch(m){return s.warn(`The model's fix plan for ${t.dependency} was not readable as JSON (${m.message}).`),null}if(p.applicable===!1)return s.info(`No mechanical fix plan for ${t.dependency}: ${p.rationale?.trim()||"the model judged this migration not expressible as a rule"}. Falling back to a per-site agent.`),null;let f=i1e(p.ops??[]);return f.length===0?(s.info(`The model proposed no usable operations for ${t.dependency}; falling back to a per-site agent.`),null):n1({change:t,dependencyChange:e.dependencyChange,migration:p.migration?.trim()||t.summary,rationale:p.rationale?.trim()||"",citations:(p.citations??[]).filter(m=>typeof m=="string"),ops:f,provenance:{author:"model",model:o.llm.model,authoredAt:new Date().toISOString()}})}function n1(e){let{change:t,dependencyChange:n,ops:i}=e,r=n?.from??null,o=n?.to??null;return{schemaVersion:2,id:St("fp",t.dependency,r??"",o??"",t.kind,[...t.symbols].sort().join(","),JSON.stringify(i)),breakingChangeId:t.id,dependency:t.dependency,fromVersion:r,toVersion:o,changeKind:t.kind,migration:e.migration,rationale:e.rationale,ops:i,citations:e.citations,provenance:e.provenance}}function i1e(e){let t=[];for(let n of e){if(typeof n!="object"||n===null)continue;let i=n;switch(i.kind){case"rename-identifier":case"rename-member":case"replace-import-path":typeof i.from=="string"&&typeof i.to=="string"&&t.push({kind:i.kind,from:i.from.trim(),to:i.to.trim()});break;case"insert-argument":typeof i.callee=="string"&&typeof i.text=="string"&&Number.isInteger(i.index)&&t.push({kind:"insert-argument",callee:i.callee.trim(),index:i.index,text:i.text.trim()});break;case"wrap-call":typeof i.callee=="string"&&(i.wrapper==="await"||i.wrapper==="new")&&t.push({kind:"wrap-call",callee:i.callee.trim(),wrapper:i.wrapper});break;default:break}}return t}function o1e(e,t,n){let i=new Set,r=[];for(let o of t){if(o.breakingChangeId!==e.id)continue;if(r.length>=r1e)break;let s=n.get(o.file);if(s===void 0)continue;let a=s.split(` -`)[o.line-1];if(a===void 0)continue;let c=a.trim();!c||i.has(c)||(i.add(c),r.push({file:o.file,line:o.line,text:a}))}return r}function s1e(e,t,n,i){let r=n.map(s=>` -${a1e(s.content,4e3)} +7. Prefer fewer operations. A migration needing more than about three is usually not mechanical, and \`applicable: false\` is the better answer.`,S2e=24;async function Zse(e){let{change:t,evidence:n,sites:r,fileContents:i,config:o,logger:s}=e,a=e.client;if(!a)return null;let c=E2e(t,r,i);if(c.length===0)return s.debug(`No readable call sites for ${t.id}; not authoring a fix plan.`),null;let l=n.filter(m=>t.citations.includes(m.id));if(l.length===0)return s.debug(`${t.id} cites no retrievable evidence; not authoring a fix plan.`),null;let u;try{u=await a.messages.create({model:o.llm.model,max_tokens:8e3,system:$2e,thinking:{type:"adaptive"},output_config:{effort:o.llm.effort,format:{type:"json_schema",schema:k2e}},messages:[{role:"user",content:T2e(t,e.dependencyChange,l,c)}]})}catch(m){return s.warn(`Could not author a fix plan for ${t.dependency}: ${m.message}`),null}if(u.stop_reason==="refusal")return s.warn(`The model declined to author a fix plan for ${t.dependency}.`),null;let d=u.content.find(m=>m.type==="text")?.text;if(!d)return s.warn(`The model returned no text when asked for a fix plan for ${t.dependency}${u.stop_reason?` (stop reason: ${u.stop_reason})`:""}.`),null;let p;try{p=JSON.parse(d)}catch(m){return s.warn(`The model's fix plan for ${t.dependency} was not readable as JSON (${m.message}).`),null}if(p.applicable===!1)return s.info(`No mechanical fix plan for ${t.dependency}: ${p.rationale?.trim()||"the model judged this migration not expressible as a rule"}. Falling back to a per-site agent.`),null;let f=x2e(p.ops??[]);return f.length===0?(s.info(`The model proposed no usable operations for ${t.dependency}; falling back to a per-site agent.`),null):SG({change:t,dependencyChange:e.dependencyChange,migration:p.migration?.trim()||t.summary,rationale:p.rationale?.trim()||"",citations:(p.citations??[]).filter(m=>typeof m=="string"),ops:f,provenance:{author:"model",model:o.llm.model,authoredAt:new Date().toISOString()}})}function SG(e){let{change:t,dependencyChange:n,ops:r}=e,i=n?.from??null,o=n?.to??null;return{schemaVersion:2,id:Pt("fp",t.dependency,i??"",o??"",t.kind,[...t.symbols].sort().join(","),JSON.stringify(r)),breakingChangeId:t.id,dependency:t.dependency,fromVersion:i,toVersion:o,changeKind:t.kind,migration:e.migration,rationale:e.rationale,ops:r,citations:e.citations,provenance:e.provenance}}function x2e(e){let t=[];for(let n of e){if(typeof n!="object"||n===null)continue;let r=n;switch(r.kind){case"rename-identifier":case"rename-member":case"replace-import-path":typeof r.from=="string"&&typeof r.to=="string"&&t.push({kind:r.kind,from:r.from.trim(),to:r.to.trim()});break;case"insert-argument":typeof r.callee=="string"&&typeof r.text=="string"&&Number.isInteger(r.index)&&t.push({kind:"insert-argument",callee:r.callee.trim(),index:r.index,text:r.text.trim()});break;case"wrap-call":typeof r.callee=="string"&&(r.wrapper==="await"||r.wrapper==="new")&&t.push({kind:"wrap-call",callee:r.callee.trim(),wrapper:r.wrapper});break;default:break}}return t}function E2e(e,t,n){let r=new Set,i=[];for(let o of t){if(o.breakingChangeId!==e.id)continue;if(i.length>=S2e)break;let s=n.get(o.file);if(s===void 0)continue;let a=s.split(` +`)[o.line-1];if(a===void 0)continue;let c=a.trim();!c||r.has(c)||(r.add(c),i.push({file:o.file,line:o.line,text:a}))}return i}function T2e(e,t,n,r){let i=n.map(s=>` +${A2e(s.content,4e3)} `).join(` -`),o=i.map(s=>`${s.file}:${s.line} +`),o=r.map(s=>`${s.file}:${s.line} ${s.text}`).join(` -`);return[`Dependency: ${e.dependency}`,t?`Version change: ${t.from} \u2192 ${t.to}`:"",`Breaking change (${e.kind}): ${e.summary}`,e.before?`Declaration before: ${e.before}`:"",e.after?`Declaration after: ${e.after}`:"",e.symbols.length?`Affected symbols: ${e.symbols.join(", ")}`:"",e.replacementSymbols?.length?`Known replacements: ${e.replacementSymbols.join(", ")}`:"","","Evidence:",r,"",`Real lines in this repository that use the affected API (${i.length} distinct shapes):`,o].filter(Boolean).join(` -`)}function a1e(e,t){return e.length<=t?e:`${e.slice(0,t)} -\u2026(truncated)`}function c1e(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}var Ss=require("node:fs/promises"),$ee=require("node:os"),Af=require("node:path");function _ee(e,t){return St("mig",String(2),e.dependency,t?.from??"",t?.to??"",e.kind,[...e.symbols].sort().join(","))}function r1(){if(process.env.DRIFT_NO_CACHE==="1")return null;let e=process.env.DRIFT_CACHE_DIR||(0,Af.join)((0,$ee.homedir)(),".drift","cache");return(0,Af.join)(e,"fixplans")}function See(e){return{async get(t){try{let n=await(0,Ss.readFile)((0,Af.join)(e,`${t}.json`),"utf8"),i=JSON.parse(n);return i.schemaVersion!==2?null:i}catch{return null}},async put(t,n){try{await(0,Ss.mkdir)(e,{recursive:!0}),await(0,Ss.writeFile)((0,Af.join)(e,`${t}.json`),`${JSON.stringify(n,null,2)} -`,"utf8")}catch{}},async all(){try{let t=await(0,Ss.readdir)(e),n=[];for(let i of t)if(i.endsWith(".json"))try{let r=JSON.parse(await(0,Ss.readFile)((0,Af.join)(e,i),"utf8"));r.schemaVersion===2&&n.push(r)}catch{}return n.sort((i,r)=>i.dependency.localeCompare(r.dependency)||i.id.localeCompare(r.id))}catch{return[]}}}}function Cy(){return{async get(){return null},async put(){},async all(){return[]}}}function xee(e){return{...e,provenance:{...e.provenance,author:"cache",sourceId:e.id}}}function Tee(e,t,n){let i=n.column,r=i+n.matchedText.length;if(i<0||r>e.length||e.slice(i,r)!==n.matchedText)return null;switch(t.kind){case"rename-identifier":return Eee(e,t.from,t.to,i,r,"bare");case"rename-member":return Eee(e,t.from,t.to,i,r,"member");case"replace-import-path":return u1e(e,t.from,t.to,i,r);case"insert-argument":return p1e(e,t.callee,t.index,t.text,i,r);case"wrap-call":return f1e(e,t.callee,t.wrapper,i,r)}}function Eee(e,t,n,i,r,o){let s=Ry(e),a=new RegExp(`(?r||l1e(s,l.index)===(o==="member")&&c.push(l.index);return c.length!==1?null:{start:c[0],end:c[0]+t.length,text:n}}function l1e(e,t){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n-=1;return n>=0&&e[n]==="."}function u1e(e,t,n,i,r){if(!d1e.test(e))return null;let o=e1(e).filter(c=>c.content===t);if(o.length===0)return null;let s=o.filter(c=>c.start=r),a=s.length===1?s[0]:o.length===1?o[0]:null;return a?{start:a.start+1,end:a.end,text:n}:null}var d1e=/(^|[^\w$])(import|export|require|from|use|include|using|open|extern|source|load)([^\w$]|$)/;function p1e(e,t,n,i,r,o){let s=Ry(e),a=Iee(s,t,r,o);if(!a)return null;let c=g1e(s,a.open,a.close);if(c===null||n>c.length)return null;let l=c[n];if(l&&s.slice(l.start,l.end).trim()===i.trim())return null;if(c.length===0)return{start:a.open+1,end:a.open+1,text:i};if(n===c.length){let u=c[c.length-1];return{start:u.end,end:u.end,text:`, ${i}`}}return{start:c[n].start,end:c[n].start,text:`${i}, `}}function f1e(e,t,n,i,r){let o=Ry(e),s=Iee(o,t,i,r);return!s||new RegExp(`\\b${n}\\s+$`).test(o.slice(0,s.start))?null:{start:s.start,end:s.start,text:`${n} `}}function Iee(e,t,n,i){let r=new RegExp(`(?=i)continue;let a=s.index+s[0].length-1,c=m1e(e,a);c!==-1&&o.push({start:s.index,open:a,close:c})}return o.length===1?o[0]:null}function m1e(e,t){let n=0;for(let i=t;ie[o]===t.line&&e[o].slice(t.column,t.column+t.matchedText.length)===t.matchedText,i=t.lineNumber-1;if(i>=0&&ia.file===i);if(r.length===0)return e;let o=e.split(` -`),s=new Map;for(let a of r){let c=h1e(o,a);if(c===null)continue;let l=ix(o[c],t,{column:a.column,matchedText:a.matchedText});if(!l)continue;let u=s.get(c);u?u.push(l.edit):s.set(c,[l.edit])}for(let[a,c]of s){let l=o[a],u=[...c].sort((p,f)=>f.start-p.start),d=Number.POSITIVE_INFINITY;for(let p of u)p.end>d||(l=l.slice(0,p.start)+p.text+l.slice(p.end),d=p.start);o[a]=l}return o.join(` -`)}function y1e(e){let t=[];for(let n of e.matchAll(/[A-Za-z_$][\w$]*/g)){t.push({column:n.index,matchedText:n[0]});let i=e.slice(n.index+n[0].length),r=/^\s*\(/.exec(i);r&&t.push({column:n.index,matchedText:n[0]+r[0]})}for(let n of e1(e))t.push({column:n.start+1,matchedText:n.content});return t}function Ree(e,t){for(let n of y1e(e)){let i=Tee(e,t,n);if(!i)continue;let r=e.slice(0,i.start)+i.text+e.slice(i.end);if(r!==e)return r}return e}var Nee=/^[A-Za-z_$][\w$]*$/,Cee=/^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*)*$/,Pee=/^[\w@.][\w@.:/+-]*$/,b1e=/^(?!.*=>)(?!.*\blambda\b)(?!.*\bfunction\b)[\w$]*\s*[:=]?\s*(?:"[^"\\]*"|'[^'\\]*'|-?\d+(?:\.\d+)?|true|false|True|False|null|None|nil|nullptr|undefined|\{[^{}()`]*\}|\[[^\[\]()`]*\])$/,i1=8;function Dee(e){let{plan:t,change:n,sites:i,fileContents:r,evidence:o}=e,s=[];if(t.schemaVersion!==2)return s.push(`The plan declares schema version ${t.schemaVersion}; this build of Drift reads version ${2}.`),Rf(t,s);if(t.ops.length===0)return s.push("The plan contains no operations, so there is nothing it could deterministically change."),Rf(t,s);if(t.ops.length>i1)return s.push(`The plan contains ${t.ops.length} operations; ${i1} is the most Drift will apply as a single migration. A migration needing more than that is not one rule, and should be split into separate findings.`),Rf(t,s);for(let g of t.ops){let h=w1e(g);h&&s.push(h)}for(let g of t.ops){let h=k1e(g,n);h&&s.push(h)}let a=o.filter(g=>t.citations.includes(g.id)),c=t.citations.filter(g=>!o.some(h=>h.id===g));c.length>0&&s.push(`The plan cites evidence Drift did not gather (${c.join(", ")}), so its provenance cannot be checked.`),t.provenance.author==="recipe"&&!t.provenance.recipe&&s.push("The plan claims to come from a community recipe but names none, so there is nothing to audit it against."),t.provenance.author==="model"&&a.length===0&&s.push("The plan cites no retrievable evidence. A migration Drift cannot trace back to something it actually read is not one it will apply to every call site.");let l=S1e(n,a,t);for(let g of t.ops)for(let h of $1e(g))x1e(l,h)||s.push(`Nothing in the cited evidence mentions \`${h}\`, which this plan would introduce at every call site. Drift will not apply a replacement it cannot find stated upstream.`);if(s.length>0)return Rf(t,s);let u=v1e(t.ops,n,i,r),d=u.map(g=>g.outcome);for(let{outcome:g,anchor:h}of u){if(g.status!=="covered"||g.after===void 0||!h)continue;if(g.after.includes(` -`)){s.push(`Applying this plan to ${g.file}:${g.line} would split one line into several. Every operation Drift executes is line-preserving, so this plan cannot be one of Drift's.`);continue}ix(g.after,t.ops,{column:h.column,matchedText:h.matchedText})&&s.push(`Applying this plan twice to ${g.file}:${g.line} does not give the same result as applying it once. A rule that keeps changing its own output cannot be safely re-applied, and Drift re-applies every rule against live file contents rather than a snapshot.`)}if(s.length>0)return Rf(t,s);let p=u.filter(g=>g.outcome.status==="covered");if(p.length===0)return s.push("No operation in the plan matched any of the call sites Drift localized for this finding. The plan may be correct about the upstream change and wrong about how this repository uses it."),Rf(t,s);let f=new Set(p.map(g=>g.outcome.op)),m=t.ops.some(g=>f.has(g.kind)&&wee(g)==="checked")?"checked":"proven";return{plan:t,verdict:p.length===d.length?"accepted":"partial",assurance:m,sites:d,covered:p.length,residual:d.length-p.length,rejections:[],anchors:p.map(g=>g.anchor)}}function v1e(e,t,n,i){let r=[],o=new Set;for(let s of n){if(s.breakingChangeId!==t.id)continue;let a=`${s.file}\0${s.line}\0${s.column??"line"}`;if(o.has(a))continue;o.add(a);let c=(m,g)=>r.push({outcome:{file:s.file,line:s.line,before:m,status:"residual",reason:g}}),l=i.get(s.file);if(l===void 0){c(s.excerpt,"Drift no longer has this file\u2019s contents, so it could not check the rule against the real line.");continue}let u=l.split(` -`)[s.line-1];if(u===void 0){c(s.excerpt,"The file no longer has a line here.");continue}if(Ny(u)){c(u,"This line is a comment. Drift does not rewrite prose, even prose that names the changed symbol.");continue}if(s.column===void 0||s.matchedText===void 0){c(u,"Drift matched this line but not a specific occurrence on it, so there is no exact position a deterministic rule could edit. An agent can read the surrounding code; a line-based rule cannot.");continue}let d={column:s.column,matchedText:s.matchedText};if(u.slice(d.column,d.column+d.matchedText.length)!==d.matchedText){c(u,"The line no longer reads the way it did when this occurrence was localized, so Drift cannot confirm it would edit the right one.");continue}let p=ix(u,e,d);if(!p){c(u,"No operation in the plan applies at the exact occurrence Drift localized, so this call site is shaped differently from the ones the plan describes.");continue}let f=u.slice(0,p.edit.start)+p.edit.text+u.slice(p.edit.end);r.push({outcome:{file:s.file,line:s.line,before:u,after:f,status:"covered",op:p.op},anchor:{file:s.file,line:u,lineNumber:s.line,column:d.column,matchedText:d.matchedText}})}return r}function w1e(e){switch(e.kind){case"rename-identifier":case"rename-member":return Nee.test(e.from)?Nee.test(e.to)?e.from===e.to?`\`${e.kind}\` was given the same name on both sides, which would change nothing.`:null:`\`${e.to}\` is not a plain identifier, so \`${e.kind}\` cannot produce it.`:`\`${e.from}\` is not a plain identifier, so \`${e.kind}\` cannot act on it.`;case"replace-import-path":return Pee.test(e.from)?Pee.test(e.to)?e.from===e.to?"The import path rule was given the same path on both sides, which would change nothing.":null:`\`${e.to}\` is not a module path Drift can write.`:`\`${e.from}\` is not a module path Drift can match on.`;case"insert-argument":return Cee.test(e.callee)?!Number.isInteger(e.index)||e.index<0||e.index>i1?`Argument position ${e.index} is out of range.`:b1e.test(e.text.trim())?null:`\`${e.text}\` is not a literal. Drift only inserts literal arguments, because an expression could call something and a rule whose effect depends on running code is not a rule Drift can state in advance.`:`\`${e.callee}\` is not a callable name Drift can locate.`;case"wrap-call":return Cee.test(e.callee)?null:`\`${e.callee}\` is not a callable name Drift can locate.`}}function k1e(e,t){let n=new Set;for(let o of t.symbols){n.add(o);for(let s of o.split(/[./]/))s&&n.add(s)}let i=e.kind==="insert-argument"||e.kind==="wrap-call"?e.callee:(e.kind==="replace-import-path",e.from);if(e.kind==="replace-import-path")return i===t.dependency||i.startsWith(`${t.dependency}/`)||n.has(i)?null:`The plan rewrites imports of \`${i}\`, which is neither \`${t.dependency}\` nor a symbol this finding names.`;let r=i.split(".");return n.has(i)||r.some(o=>n.has(o))?null:`The plan acts on \`${i}\`, which this finding never mentions. Drift will not apply a rule about one symbol to sites localized for another.`}function $1e(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return[e.to];case"insert-argument":return(e.text.match(/[A-Za-z_$][\w$]*/g)??[]).filter(n=>!_1e.has(n));case"wrap-call":return[]}}var _1e=new Set(["true","false","True","False","null","None","nil","nullptr","undefined"]);function S1e(e,t,n){return[...e.replacementSymbols??[],e.before??"",e.after??"",e.summary,e.remediation,...t.map(i=>`${i.title} -${i.content}`),...t.flatMap(i=>(i.findings??[]).map(r=>`${r.symbol} ${r.detail} ${r.before??""} ${r.after??""}`)),n.provenance.recipe?`${n.provenance.recipe.name} +`);return[`Dependency: ${e.dependency}`,t?`Version change: ${t.from} \u2192 ${t.to}`:"",`Breaking change (${e.kind}): ${e.summary}`,e.before?`Declaration before: ${e.before}`:"",e.after?`Declaration after: ${e.after}`:"",e.symbols.length?`Affected symbols: ${e.symbols.join(", ")}`:"",e.replacementSymbols?.length?`Known replacements: ${e.replacementSymbols.join(", ")}`:"","","Evidence:",i,"",`Real lines in this repository that use the affected API (${r.length} distinct shapes):`,o].filter(Boolean).join(` +`)}function A2e(e,t){return e.length<=t?e:`${e.slice(0,t)} +\u2026(truncated)`}function I2e(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}var Ys=require("node:fs/promises"),Yse=require("node:os"),Lm=require("node:path");function Qse(e,t){return Pt("mig",String(2),e.dependency,t?.from??"",t?.to??"",e.kind,[...e.symbols].sort().join(","))}function xG(){if(process.env.DRIFT_NO_CACHE==="1")return null;let e=process.env.DRIFT_CACHE_DIR||(0,Lm.join)((0,Yse.homedir)(),".drift","cache");return(0,Lm.join)(e,"fixplans")}function Xse(e){return{async get(t){try{let n=await(0,Ys.readFile)((0,Lm.join)(e,`${t}.json`),"utf8"),r=JSON.parse(n);return r.schemaVersion!==2?null:r}catch{return null}},async put(t,n){try{await(0,Ys.mkdir)(e,{recursive:!0}),await(0,Ys.writeFile)((0,Lm.join)(e,`${t}.json`),`${JSON.stringify(n,null,2)} +`,"utf8")}catch{}},async all(){try{let t=await(0,Ys.readdir)(e),n=[];for(let r of t)if(r.endsWith(".json"))try{let i=JSON.parse(await(0,Ys.readFile)((0,Lm.join)(e,r),"utf8"));i.schemaVersion===2&&n.push(i)}catch{}return n.sort((r,i)=>r.dependency.localeCompare(i.dependency)||r.id.localeCompare(i.id))}catch{return[]}}}}function pv(){return{async get(){return null},async put(){},async all(){return[]}}}function eae(e){return{...e,provenance:{...e.provenance,author:"cache",sourceId:e.id}}}function nae(e,t,n){let r=n.column,i=r+n.matchedText.length;if(r<0||i>e.length||e.slice(r,i)!==n.matchedText)return null;switch(t.kind){case"rename-identifier":return tae(e,t.from,t.to,r,i,"bare");case"rename-member":return tae(e,t.from,t.to,r,i,"member");case"replace-import-path":return P2e(e,t.from,t.to,r,i);case"insert-argument":return N2e(e,t.callee,t.index,t.text,r,i);case"wrap-call":return O2e(e,t.callee,t.wrapper,r,i)}}function tae(e,t,n,r,i,o){let s=uv(e),a=new RegExp(`(?i||R2e(s,l.index)===(o==="member")&&c.push(l.index);return c.length!==1?null:{start:c[0],end:c[0]+t.length,text:n}}function R2e(e,t){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n-=1;return n>=0&&e[n]==="."}function P2e(e,t,n,r,i){if(!C2e.test(e))return null;let o=kG(e).filter(c=>c.content===t);if(o.length===0)return null;let s=o.filter(c=>c.start=i),a=s.length===1?s[0]:o.length===1?o[0]:null;return a?{start:a.start+1,end:a.end,text:n}:null}var C2e=/(^|[^\w$])(import|export|require|from|use|include|using|open|extern|source|load)([^\w$]|$)/;function N2e(e,t,n,r,i,o){let s=uv(e),a=rae(s,t,i,o);if(!a)return null;let c=M2e(s,a.open,a.close);if(c===null||n>c.length)return null;let l=c[n];if(l&&s.slice(l.start,l.end).trim()===r.trim())return null;if(c.length===0)return{start:a.open+1,end:a.open+1,text:r};if(n===c.length){let u=c[c.length-1];return{start:u.end,end:u.end,text:`, ${r}`}}return{start:c[n].start,end:c[n].start,text:`${r}, `}}function O2e(e,t,n,r,i){let o=uv(e),s=rae(o,t,r,i);return!s||new RegExp(`\\b${n}\\s+$`).test(o.slice(0,s.start))?null:{start:s.start,end:s.start,text:`${n} `}}function rae(e,t,n,r){let i=new RegExp(`(?=r)continue;let a=s.index+s[0].length-1,c=D2e(e,a);c!==-1&&o.push({start:s.index,open:a,close:c})}return o.length===1?o[0]:null}function D2e(e,t){let n=0;for(let r=t;re[o]===t.line&&e[o].slice(t.column,t.column+t.matchedText.length)===t.matchedText,r=t.lineNumber-1;if(r>=0&&ra.file===r);if(i.length===0)return e;let o=e.split(` +`),s=new Map;for(let a of i){let c=L2e(o,a);if(c===null)continue;let l=JT(o[c],t,{column:a.column,matchedText:a.matchedText});if(!l)continue;let u=s.get(c);u?u.push(l.edit):s.set(c,[l.edit])}for(let[a,c]of s){let l=o[a],u=[...c].sort((p,f)=>f.start-p.start),d=Number.POSITIVE_INFINITY;for(let p of u)p.end>d||(l=l.slice(0,p.start)+p.text+l.slice(p.end),d=p.start);o[a]=l}return o.join(` +`)}function F2e(e){let t=[];for(let n of e.matchAll(/[A-Za-z_$][\w$]*/g)){t.push({column:n.index,matchedText:n[0]});let r=e.slice(n.index+n[0].length),i=/^\s*\(/.exec(r);i&&t.push({column:n.index,matchedText:n[0]+i[0]})}for(let n of kG(e))t.push({column:n.start+1,matchedText:n.content});return t}function oae(e,t){for(let n of F2e(e)){let r=nae(e,t,n);if(!r)continue;let i=e.slice(0,r.start)+r.text+e.slice(r.end);if(i!==e)return i}return e}var sae=/^[A-Za-z_$][\w$]*$/,aae=/^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*)*$/,cae=/^[\w@.][\w@.:/+-]*$/,U2e=/^(?!.*=>)(?!.*\blambda\b)(?!.*\bfunction\b)[\w$]*\s*[:=]?\s*(?:"[^"\\]*"|'[^'\\]*'|-?\d+(?:\.\d+)?|true|false|True|False|null|None|nil|nullptr|undefined|\{[^{}()`]*\}|\[[^\[\]()`]*\])$/,EG=8;function lae(e){let{plan:t,change:n,sites:r,fileContents:i,evidence:o}=e,s=[];if(t.schemaVersion!==2)return s.push(`The plan declares schema version ${t.schemaVersion}; this build of Drift reads version ${2}.`),Fm(t,s);if(t.ops.length===0)return s.push("The plan contains no operations, so there is nothing it could deterministically change."),Fm(t,s);if(t.ops.length>EG)return s.push(`The plan contains ${t.ops.length} operations; ${EG} is the most Drift will apply as a single migration. A migration needing more than that is not one rule, and should be split into separate findings.`),Fm(t,s);for(let g of t.ops){let h=z2e(g);h&&s.push(h)}for(let g of t.ops){let h=G2e(g,n);h&&s.push(h)}let a=o.filter(g=>t.citations.includes(g.id)),c=t.citations.filter(g=>!o.some(h=>h.id===g));c.length>0&&s.push(`The plan cites evidence Drift did not gather (${c.join(", ")}), so its provenance cannot be checked.`),t.provenance.author==="recipe"&&!t.provenance.recipe&&s.push("The plan claims to come from a community recipe but names none, so there is nothing to audit it against."),t.provenance.author==="model"&&a.length===0&&s.push("The plan cites no retrievable evidence. A migration Drift cannot trace back to something it actually read is not one it will apply to every call site.");let l=q2e(n,a,t);for(let g of t.ops)for(let h of B2e(g))W2e(l,h)||s.push(`Nothing in the cited evidence mentions \`${h}\`, which this plan would introduce at every call site. Drift will not apply a replacement it cannot find stated upstream.`);if(s.length>0)return Fm(t,s);let u=j2e(t.ops,n,r,i),d=u.map(g=>g.outcome);for(let{outcome:g,anchor:h}of u){if(g.status!=="covered"||g.after===void 0||!h)continue;if(g.after.includes(` +`)){s.push(`Applying this plan to ${g.file}:${g.line} would split one line into several. Every operation Drift executes is line-preserving, so this plan cannot be one of Drift's.`);continue}JT(g.after,t.ops,{column:h.column,matchedText:h.matchedText})&&s.push(`Applying this plan twice to ${g.file}:${g.line} does not give the same result as applying it once. A rule that keeps changing its own output cannot be safely re-applied, and Drift re-applies every rule against live file contents rather than a snapshot.`)}if(s.length>0)return Fm(t,s);let p=u.filter(g=>g.outcome.status==="covered");if(p.length===0)return s.push("No operation in the plan matched any of the call sites Drift localized for this finding. The plan may be correct about the upstream change and wrong about how this repository uses it."),Fm(t,s);let f=new Set(p.map(g=>g.outcome.op)),m=t.ops.some(g=>f.has(g.kind)&&Jse(g)==="checked")?"checked":"proven";return{plan:t,verdict:p.length===d.length?"accepted":"partial",assurance:m,sites:d,covered:p.length,residual:d.length-p.length,rejections:[],anchors:p.map(g=>g.anchor)}}function j2e(e,t,n,r){let i=[],o=new Set;for(let s of n){if(s.breakingChangeId!==t.id)continue;let a=`${s.file}\0${s.line}\0${s.column??"line"}`;if(o.has(a))continue;o.add(a);let c=(m,g)=>i.push({outcome:{file:s.file,line:s.line,before:m,status:"residual",reason:g}}),l=r.get(s.file);if(l===void 0){c(s.excerpt,"Drift no longer has this file\u2019s contents, so it could not check the rule against the real line.");continue}let u=l.split(` +`)[s.line-1];if(u===void 0){c(s.excerpt,"The file no longer has a line here.");continue}if(dv(u)){c(u,"This line is a comment. Drift does not rewrite prose, even prose that names the changed symbol.");continue}if(s.column===void 0||s.matchedText===void 0){c(u,"Drift matched this line but not a specific occurrence on it, so there is no exact position a deterministic rule could edit. An agent can read the surrounding code; a line-based rule cannot.");continue}let d={column:s.column,matchedText:s.matchedText};if(u.slice(d.column,d.column+d.matchedText.length)!==d.matchedText){c(u,"The line no longer reads the way it did when this occurrence was localized, so Drift cannot confirm it would edit the right one.");continue}let p=JT(u,e,d);if(!p){c(u,"No operation in the plan applies at the exact occurrence Drift localized, so this call site is shaped differently from the ones the plan describes.");continue}let f=u.slice(0,p.edit.start)+p.edit.text+u.slice(p.edit.end);i.push({outcome:{file:s.file,line:s.line,before:u,after:f,status:"covered",op:p.op},anchor:{file:s.file,line:u,lineNumber:s.line,column:d.column,matchedText:d.matchedText}})}return i}function z2e(e){switch(e.kind){case"rename-identifier":case"rename-member":return sae.test(e.from)?sae.test(e.to)?e.from===e.to?`\`${e.kind}\` was given the same name on both sides, which would change nothing.`:null:`\`${e.to}\` is not a plain identifier, so \`${e.kind}\` cannot produce it.`:`\`${e.from}\` is not a plain identifier, so \`${e.kind}\` cannot act on it.`;case"replace-import-path":return cae.test(e.from)?cae.test(e.to)?e.from===e.to?"The import path rule was given the same path on both sides, which would change nothing.":null:`\`${e.to}\` is not a module path Drift can write.`:`\`${e.from}\` is not a module path Drift can match on.`;case"insert-argument":return aae.test(e.callee)?!Number.isInteger(e.index)||e.index<0||e.index>EG?`Argument position ${e.index} is out of range.`:U2e.test(e.text.trim())?null:`\`${e.text}\` is not a literal. Drift only inserts literal arguments, because an expression could call something and a rule whose effect depends on running code is not a rule Drift can state in advance.`:`\`${e.callee}\` is not a callable name Drift can locate.`;case"wrap-call":return aae.test(e.callee)?null:`\`${e.callee}\` is not a callable name Drift can locate.`}}function G2e(e,t){let n=new Set;for(let o of t.symbols){n.add(o);for(let s of o.split(/[./]/))s&&n.add(s)}let r=e.kind==="insert-argument"||e.kind==="wrap-call"?e.callee:(e.kind==="replace-import-path",e.from);if(e.kind==="replace-import-path")return r===t.dependency||r.startsWith(`${t.dependency}/`)||n.has(r)?null:`The plan rewrites imports of \`${r}\`, which is neither \`${t.dependency}\` nor a symbol this finding names.`;let i=r.split(".");return n.has(r)||i.some(o=>n.has(o))?null:`The plan acts on \`${r}\`, which this finding never mentions. Drift will not apply a rule about one symbol to sites localized for another.`}function B2e(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return[e.to];case"insert-argument":return(e.text.match(/[A-Za-z_$][\w$]*/g)??[]).filter(n=>!V2e.has(n));case"wrap-call":return[]}}var V2e=new Set(["true","false","True","False","null","None","nil","nullptr","undefined"]);function q2e(e,t,n){return[...e.replacementSymbols??[],e.before??"",e.after??"",e.summary,e.remediation,...t.map(r=>`${r.title} +${r.content}`),...t.flatMap(r=>(r.findings??[]).map(i=>`${i.symbol} ${i.detail} ${i.before??""} ${i.after??""}`)),n.provenance.recipe?`${n.provenance.recipe.name} ${n.migration}`:""].join(` -`)}function x1e(e,t){return new RegExp(`(^|[^\\w$])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}([^\\w$]|$)`).test(e)}function Rf(e,t){return{plan:e,verdict:"rejected",assurance:"checked",sites:[],covered:0,residual:0,rejections:t,anchors:[]}}async function Oee(e){let{changes:t,sites:n,evidence:i,config:r,logger:o}=e,s=e.cache??Cy(),a=new Map,c=new Map,l=new Map;for(let d of n){let p=l.get(d.breakingChangeId);p?p.push(d):l.set(d.breakingChangeId,[d])}let u=new Map(e.dependencyChanges.map(d=>[`${d.workspace??""}::${d.name}`,d]));for(let d of t){let p=l.get(d.id);if(!p||p.length===0)continue;let f=u.get(`${d.workspace??""}::${d.dependency}`),m=_ee(d,f),g=null;for(let h of E1e(e,d,f,m,s)){let b=await h();if(!b)continue;let y=Dee({plan:b,change:d,sites:p,fileContents:e.fileContents,evidence:i});if(y.verdict==="rejected"){o.info(`Rejected a ${b.provenance.author}-proposed fix plan for ${d.dependency}: ${y.rejections[0]}`),g=y;continue}let w=y.covered+y.residual,k=w===0?0:y.covered/w;if(k0||c.size>0)&&o.info(`Fix plans: ${a.size} accepted, ${c.size} rejected. ${r.remediation.fixPlans.enabled?"":"(authoring disabled)"}`.trim()),{accepted:a,rejected:c}}function E1e(e,t,n,i,r){let o=[];return o.push(async()=>{let s=await r.get(i);return s?xee(s):null}),e.proposeFromRecipe&&o.push(()=>e.proposeFromRecipe(t)),e.client&&o.push(()=>kee({change:t,dependencyChange:n,evidence:e.evidence,sites:e.sites,fileContents:e.fileContents,config:e.config,logger:e.logger,client:e.client})),o}var on=require("node:fs/promises"),Nn=require("node:path"),s1=require("node:os"),Nf=require("node:crypto");async function ax(e,t,n={}){let i=n.exec??Xe,r=n.env??process.env,o=n.at??"HEAD",s=await i("git",["rev-parse","--git-common-dir"],{cwd:e,env:r});if(s.code!==0){if(n.at!==void 0&&n.at!=="HEAD")throw new Error(`\`${e}\` is not a git repository, so \`${n.at}\` cannot be checked out to test an upgrade.`);return A1e(e,t,n.runId??Lee)}let a=s.stdout.trim()||".git",c=(0,Nn.isAbsolute)(a)?a:(0,Nn.join)(e,a),l=n.runId??Lee,u=(0,Nn.join)((0,s1.tmpdir)(),"drift-worktrees",(0,Nf.createHash)("sha256").update(c).digest("hex").slice(0,12)),d=(0,Nn.join)(u,sx(l),sx(t));I1e(u),await Mee(e,d,i,r);let p=await i("git",["worktree","add","--detach",d,o],{cwd:e,env:r});if(p.code!==0)throw new Error(`Could not create a worktree to test upgrades in: ${p.stderr.trim()||p.stdout.trim()||"git failed"}`);let{copied:f,oversized:m,secrets:g}=n.copyIgnoredFiles===!1?{copied:[],oversized:[],secrets:[]}:await D1e(e,d,i,r,void 0,n.allowedGlobs),[h,b,y]=await Promise.all([o1(e,f,i,r),o1(e,m,i,r),o1(e,g,i,r)]),w=!1;return{path:d,copiedFiles:f,copiedRules:h,oversizedFiles:m,oversizedRules:b,skippedSecrets:g,skippedSecretRules:y,async dispose(){w||(w=!0,await Mee(e,d,i,r))}}}async function Mee(e,t,n,i){let r=`${t}.trash-${(0,Nf.randomUUID)().slice(0,8)}`;await(0,on.rename)(t,r).then(()=>!0,()=>!1)?T1e(r):await(0,on.rm)(t,{recursive:!0,force:!0}).then(()=>!0,()=>!1)||await n("git",["worktree","remove","--force",t],{cwd:e,env:i}).catch(()=>{}),await n("git",["worktree","prune"],{cwd:e,env:i}).catch(()=>{})}var ox=new Set;function T1e(e){let t=(0,on.rm)(e,{recursive:!0,force:!0}).catch(()=>{}).then(()=>{ox.delete(t)});ox.add(t)}async function a1(){for(;ox.size>0;)await Promise.all([...ox])}function I1e(e){(0,on.readdir)(e,{withFileTypes:!0}).then(t=>Promise.all(t.filter(n=>n.isDirectory()).map(n=>(0,on.readdir)((0,Nn.join)(e,n.name),{withFileTypes:!0}).then(i=>Promise.all(i.filter(r=>r.name.includes(".trash-")).map(r=>(0,on.rm)((0,Nn.join)(e,n.name,r.name),{recursive:!0,force:!0}).catch(()=>{}))),()=>{})))).catch(()=>{})}async function A1e(e,t,n){let i=(0,Nn.join)((0,s1.tmpdir)(),"drift-worktrees",sx(n),sx(t));await(0,on.rm)(i,{recursive:!0,force:!0}).catch(()=>{}),await(0,on.mkdir)(i,{recursive:!0});let r=[];try{await(0,on.cp)(e,i,{recursive:!0,filter:s=>{let a=(0,Nn.relative)(e,s);if(a==="")return!0;let c=a.split(Nn.sep).join("/");return a.split(Nn.sep).some(l=>jee.has(l))?!1:zee(c)?(r.push(c),!1):!0}})}catch(s){throw await(0,on.rm)(i,{recursive:!0,force:!0}).catch(()=>{}),new Error(`Could not copy \`${e}\` into a temp checkout to test an upgrade: ${s instanceof Error?s.message:String(s)}`)}let o=!1;return{path:i,copiedFiles:[],copiedRules:[],oversizedFiles:[],oversizedRules:[],skippedSecrets:r.sort(),skippedSecretRules:[],async dispose(){o||(o=!0,await(0,on.rm)(i,{recursive:!0,force:!0}).catch(()=>{}))}}}var Lee=`${process.pid}-${(0,Nf.randomBytes)(4).toString("hex")}`;async function Uee(e,t,n,i={}){let r=await ax(e,t,i);try{return await n(r)}finally{await r.dispose()}}var jee=new Set(["node_modules",".git","dist","build","out",".next",".nuxt",".output",".svelte-kit",".cache",".parcel-cache",".turbo",".angular","coverage","target","vendor",".venv","venv","__pycache__",".pytest_cache",".gradle",".idea",".vscode","tmp",".tmp"]),R1e=25*1024*1024,N1e=[/(^|\/)\.env(\..*)?$/i,/(^|\/)\.npmrc$/i,/(^|\/)\.yarnrc(\.yml)?$/i,/(^|\/)\.netrc$/i,/(^|\/)\.pgpass$/i,/(^|\/)\.git-credentials$/i,/(^|\/)\.dockercfg$/i,/(^|\/)\.docker\/config\.json$/i,/(^|\/)id_(rsa|dsa|ecdsa|ed25519)(\.pub)?$/i,/\.(pem|key|p12|pfx|jks|keystore|ppk)$/i,/(^|\/)(\.aws\/credentials|\.aws\/config)$/i,/(^|\/)application_default_credentials\.json$/i,/(service[-_]?account|credentials?|secrets?)[^/]*\.(json|ya?ml|txt)$/i];function zee(e){return N1e.some(t=>t.test(e))}function C1e(e){let t="";for(let n=0;nC1e(n).test(e))}async function D1e(e,t,n,i,r=R1e,o){let s=await n("git",["ls-files","--others","--ignored","--exclude-standard","-z"],{cwd:e,env:i});if(s.code!==0||!s.stdout)return{copied:[],oversized:[],secrets:[]};let a=s.stdout.split("\0").filter(d=>d.length>0&&!d.split("/").some(p=>jee.has(p))),c=[],l=[],u=[];for(let d of a){if(zee(d)){u.push(d);continue}if(o&&o.length>0&&!P1e(d,o))continue;let p=(0,Nn.join)(e,d),f=await(0,on.stat)(p).catch(()=>null);if(!f||!f.isFile())continue;if(f.size>r){l.push(d);continue}let m=(0,Nn.join)(t,d);await(0,on.mkdir)((0,Nn.dirname)(m),{recursive:!0}),await(0,on.copyFile)(p,m).catch(()=>{}),c.push(d)}return{copied:c,oversized:l,secrets:u}}var Fee=200;async function o1(e,t,n,i){if(t.length===0)return[];let r=new Set;for(let o=0;o0?t.slice(0,80):"probe"}var Zee=require("node:fs/promises"),Yee=require("node:path");async function Vee(e,t,n={}){let i=n.exec??Xe,r=await i("git",["status","--porcelain"],{cwd:t});if(r.failure)return{status:"failed",changedFiles:[],message:"Could not inspect the worktree before running the recipe."};let o=Bee(r.stdout||""),s=await qee(t,[...o.keys()],i),a=M1e(e);if(!a)return{status:"failed",changedFiles:[],message:`Drift does not know how to run a "${e.provider}" recipe.`};n.logger?.info(`Running community recipe ${e.name}@${e.version} (${e.provider})`);let c=await i(a.bin,a.args,{cwd:t,timeoutMs:3e5});if(c.failure||c.code!==0){let u=c.failure==="not-found"?`${a.bin} is not installed`:c.stderr.trim()||c.stdout.trim();return{status:"failed",changedFiles:await Gee(t,o,s,i),message:`Recipe ${e.name}@${e.version} failed: ${u||`exit code ${c.code}`}`.trim()}}let l=await Gee(t,o,s,i);return l.length===0?{status:"no-changes",changedFiles:[],message:`Recipe ${e.name}@${e.version} made no changes here.`}:{status:"applied",changedFiles:l,message:`Applied community recipe ${e.name}@${e.version} from ${e.publisher} \u2014 no agent call was made.`}}function Bee(e){let t=new Map;for(let n of e.split(` -`)){let i=n.trimEnd();if(!i.trim())continue;let r=i.slice(0,2),o=i.slice(2).trim(),s=o.indexOf(" -> ");s!==-1&&(o=o.slice(s+4).trim()),o.startsWith('"')&&o.endsWith('"')&&(o=o.slice(1,-1)),o&&t.set(o,r)}return t}async function qee(e,t,n){let i=new Map;for(let r of t){let o=await n("git",["hash-object","--",r],{cwd:e});!o.failure&&o.code===0&&i.set(r,o.stdout.trim())}return i}async function Gee(e,t,n,i){let r=await i("git",["status","--porcelain"],{cwd:e}),o=Bee(r.stdout||""),s=new Set,a=[];for(let[l,u]of o)t.get(l)!==u?s.add(l):a.push(l);let c=await qee(e,a,i);for(let l of a)n.get(l)!==c.get(l)&&s.add(l);return[...s]}function M1e(e){switch(e.provider){case"codemod.com":return{bin:"npx",args:["--yes","codemod@latest","run",`${e.name}@${e.version}`]};case"openrewrite":return{bin:"mvn",args:["-q","org.openrewrite.maven:rewrite-maven-plugin:run",`-Drewrite.activeRecipes=${e.name}`,`-Drewrite.recipeArtifactCoordinates=${e.source}:${e.version}`]};default:return null}}var L1e=8;function Jee(e){let t=e.filter(r=>r.before!==r.after);if(t.length===0)return{ops:[],unexplained:[]};let n=[];for(;n.lengthcx(n,a.before)!==a.after);if(r.length===0)break;let o=new Map;for(let a of r){let c=cx(n,a.before);for(let l of F1e({...a,before:c}))o.set(JSON.stringify(l),l)}let s=null;for(let[a,c]of o){let l=[...n,c],u=r.filter(d=>cx(l,d.before)===d.after).length;u!==0&&(!s||u>s.score||u===s.score&&acx(n,r.before)!==r.after);return{ops:n,unexplained:i}}function cx(e,t){let n=t;for(let i of e)n=Ree(n,i);return n}function F1e(e){let t=[],n=Wee(e.before),i=Wee(e.after),r=n.filter(c=>!i.includes(c)),o=i.filter(c=>!n.includes(c));for(let c of new Set(r))for(let l of new Set(o))t.push({kind:"rename-identifier",from:c,to:l}),t.push({kind:"rename-member",from:c,to:l}),t.push({kind:"replace-import-path",from:c,to:l});let s=Hee(e.before),a=Hee(e.after);for(let c of s.filter(l=>!a.includes(l)))for(let l of a.filter(u=>!s.includes(u)))t.push({kind:"replace-import-path",from:c,to:l});for(let c of["await","new"])if(!(e.before.includes(`${c} `)||!e.after.includes(`${c} `)))for(let l of Kee(e.after))t.push({kind:"wrap-call",callee:l,wrapper:c});for(let c of Kee(e.before))for(let l of U1e(e.before,e.after))for(let u=0;u<=4;u++)t.push({kind:"insert-argument",callee:c,index:u,text:l});return t}function Wee(e){return e.match(/[A-Za-z_$][\w$]*/g)??[]}function Hee(e){return[...e.matchAll(/"([^"\\]*)"|'([^'\\]*)'/g)].map(t=>t[1]??t[2]??"")}function Kee(e){return[...e.matchAll(/([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\(/g)].map(t=>t[1])}function U1e(e,t){let n=[...t.match(/\{[^{}]*\}/g)??[],...t.match(/"[^"\\]*"|'[^'\\]*'/g)??[],...t.match(/\b(?:true|false|null|None|nil)\b/g)??[]];return[...new Set(n.filter(i=>!e.includes(i)))]}async function Qee(e){let{candidate:t,change:n,sandbox:i,relevantFiles:r,logger:o}=e,s=e.exec??Xe,a=await Vee(t,i,{exec:s,logger:o});if(a.status!=="applied"||a.changedFiles.length===0)return o.debug(`${t.name}@${t.version} changed nothing Drift could learn a rule from.`),null;let c=[],l=!1;for(let d of a.changedFiles){if(!r.has(d)){l=!0;continue}let p=await j1e(i,d,s);if(!p){l=!0;continue}let f=p.before.split(` +`)}function W2e(e,t){return new RegExp(`(^|[^\\w$])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}([^\\w$]|$)`).test(e)}function Fm(e,t){return{plan:e,verdict:"rejected",assurance:"checked",sites:[],covered:0,residual:0,rejections:t,anchors:[]}}async function uae(e){let{changes:t,sites:n,evidence:r,config:i,logger:o}=e,s=e.cache??pv(),a=new Map,c=new Map,l=new Map;for(let d of n){let p=l.get(d.breakingChangeId);p?p.push(d):l.set(d.breakingChangeId,[d])}let u=new Map(e.dependencyChanges.map(d=>[`${d.workspace??""}::${d.name}`,d]));for(let d of t){let p=l.get(d.id);if(!p||p.length===0)continue;let f=u.get(`${d.workspace??""}::${d.dependency}`),m=Qse(d,f),g=null;for(let h of H2e(e,d,f,m,s)){let v=await h();if(!v)continue;let b=lae({plan:v,change:d,sites:p,fileContents:e.fileContents,evidence:r});if(b.verdict==="rejected"){o.info(`Rejected a ${v.provenance.author}-proposed fix plan for ${d.dependency}: ${b.rejections[0]}`),g=b;continue}let _=b.covered+b.residual,w=_===0?0:b.covered/_;if(w0||c.size>0)&&o.info(`Fix plans: ${a.size} accepted, ${c.size} rejected. ${i.remediation.fixPlans.enabled?"":"(authoring disabled)"}`.trim()),{accepted:a,rejected:c}}function H2e(e,t,n,r,i){let o=[];return o.push(async()=>{let s=await i.get(r);return s?eae(s):null}),e.proposeFromRecipe&&o.push(()=>e.proposeFromRecipe(t)),e.client&&o.push(()=>Zse({change:t,dependencyChange:n,evidence:e.evidence,sites:e.sites,fileContents:e.fileContents,config:e.config,logger:e.logger,client:e.client})),o}var un=require("node:fs/promises"),Mn=require("node:path"),AG=require("node:os"),Um=require("node:crypto");async function QT(e,t,n={}){let r=n.exec??et,i=n.env??process.env,o=n.at??"HEAD",s=await r("git",["rev-parse","--git-common-dir"],{cwd:e,env:i});if(s.code!==0){if(n.at!==void 0&&n.at!=="HEAD")throw new Error(`\`${e}\` is not a git repository, so \`${n.at}\` cannot be checked out to test an upgrade.`);return Z2e(e,t,n.runId??pae)}let a=s.stdout.trim()||".git",c=(0,Mn.isAbsolute)(a)?a:(0,Mn.join)(e,a),l=n.runId??pae,u=(0,Mn.join)((0,AG.tmpdir)(),"drift-worktrees",(0,Um.createHash)("sha256").update(c).digest("hex").slice(0,12)),d=(0,Mn.join)(u,YT(l),YT(t));J2e(u),await dae(e,d,r,i);let p=await r("git",["worktree","add","--detach",d,o],{cwd:e,env:i});if(p.code!==0)throw new Error(`Could not create a worktree to test upgrades in: ${p.stderr.trim()||p.stdout.trim()||"git failed"}`);let{copied:f,oversized:m,secrets:g}=n.copyIgnoredFiles===!1?{copied:[],oversized:[],secrets:[]}:await t4e(e,d,r,i,void 0,n.allowedGlobs),[h,v,b]=await Promise.all([TG(e,f,r,i),TG(e,m,r,i),TG(e,g,r,i)]),_=!1;return{path:d,copiedFiles:f,copiedRules:h,oversizedFiles:m,oversizedRules:v,skippedSecrets:g,skippedSecretRules:b,async dispose(){_||(_=!0,await dae(e,d,r,i))}}}async function dae(e,t,n,r){let i=`${t}.trash-${(0,Um.randomUUID)().slice(0,8)}`;await(0,un.rename)(t,i).then(()=>!0,()=>!1)?K2e(i):await(0,un.rm)(t,{recursive:!0,force:!0}).then(()=>!0,()=>!1)||await n("git",["worktree","remove","--force",t],{cwd:e,env:r}).catch(()=>{}),await n("git",["worktree","prune"],{cwd:e,env:r}).catch(()=>{})}var ZT=new Set;function K2e(e){let t=(0,un.rm)(e,{recursive:!0,force:!0}).catch(()=>{}).then(()=>{ZT.delete(t)});ZT.add(t)}async function IG(){for(;ZT.size>0;)await Promise.all([...ZT])}function J2e(e){(0,un.readdir)(e,{withFileTypes:!0}).then(t=>Promise.all(t.filter(n=>n.isDirectory()).map(n=>(0,un.readdir)((0,Mn.join)(e,n.name),{withFileTypes:!0}).then(r=>Promise.all(r.filter(i=>i.name.includes(".trash-")).map(i=>(0,un.rm)((0,Mn.join)(e,n.name,i.name),{recursive:!0,force:!0}).catch(()=>{}))),()=>{})))).catch(()=>{})}async function Z2e(e,t,n){let r=(0,Mn.join)((0,AG.tmpdir)(),"drift-worktrees",YT(n),YT(t));await(0,un.rm)(r,{recursive:!0,force:!0}).catch(()=>{}),await(0,un.mkdir)(r,{recursive:!0});let i=[];try{await(0,un.cp)(e,r,{recursive:!0,filter:s=>{let a=(0,Mn.relative)(e,s);if(a==="")return!0;let c=a.split(Mn.sep).join("/");return a.split(Mn.sep).some(l=>gae.has(l))?!1:hae(c)?(i.push(c),!1):!0}})}catch(s){throw await(0,un.rm)(r,{recursive:!0,force:!0}).catch(()=>{}),new Error(`Could not copy \`${e}\` into a temp checkout to test an upgrade: ${s instanceof Error?s.message:String(s)}`)}let o=!1;return{path:r,copiedFiles:[],copiedRules:[],oversizedFiles:[],oversizedRules:[],skippedSecrets:i.sort(),skippedSecretRules:[],async dispose(){o||(o=!0,await(0,un.rm)(r,{recursive:!0,force:!0}).catch(()=>{}))}}}var pae=`${process.pid}-${(0,Um.randomBytes)(4).toString("hex")}`;async function mae(e,t,n,r={}){let i=await QT(e,t,r);try{return await n(i)}finally{await i.dispose()}}var gae=new Set(["node_modules",".git","dist","build","out",".next",".nuxt",".output",".svelte-kit",".cache",".parcel-cache",".turbo",".angular","coverage","target","vendor",".venv","venv","__pycache__",".pytest_cache",".gradle",".idea",".vscode","tmp",".tmp"]),Y2e=25*1024*1024,Q2e=[/(^|\/)\.env(\..*)?$/i,/(^|\/)\.npmrc$/i,/(^|\/)\.yarnrc(\.yml)?$/i,/(^|\/)\.netrc$/i,/(^|\/)\.pgpass$/i,/(^|\/)\.git-credentials$/i,/(^|\/)\.dockercfg$/i,/(^|\/)\.docker\/config\.json$/i,/(^|\/)id_(rsa|dsa|ecdsa|ed25519)(\.pub)?$/i,/\.(pem|key|p12|pfx|jks|keystore|ppk)$/i,/(^|\/)(\.aws\/credentials|\.aws\/config)$/i,/(^|\/)application_default_credentials\.json$/i,/(service[-_]?account|credentials?|secrets?)[^/]*\.(json|ya?ml|txt)$/i];function hae(e){return Q2e.some(t=>t.test(e))}function X2e(e){let t="";for(let n=0;nX2e(n).test(e))}async function t4e(e,t,n,r,i=Y2e,o){let s=await n("git",["ls-files","--others","--ignored","--exclude-standard","-z"],{cwd:e,env:r});if(s.code!==0||!s.stdout)return{copied:[],oversized:[],secrets:[]};let a=s.stdout.split("\0").filter(d=>d.length>0&&!d.split("/").some(p=>gae.has(p))),c=[],l=[],u=[];for(let d of a){if(hae(d)){u.push(d);continue}if(o&&o.length>0&&!e4e(d,o))continue;let p=(0,Mn.join)(e,d),f=await(0,un.stat)(p).catch(()=>null);if(!f||!f.isFile())continue;if(f.size>i){l.push(d);continue}let m=(0,Mn.join)(t,d);await(0,un.mkdir)((0,Mn.dirname)(m),{recursive:!0}),await(0,un.copyFile)(p,m).catch(()=>{}),c.push(d)}return{copied:c,oversized:l,secrets:u}}var fae=200;async function TG(e,t,n,r){if(t.length===0)return[];let i=new Set;for(let o=0;o0?t.slice(0,80):"probe"}var xae=require("node:fs/promises"),Eae=require("node:path");async function bae(e,t,n={}){let r=n.exec??et,i=await r("git",["status","--porcelain"],{cwd:t});if(i.failure)return{status:"failed",changedFiles:[],message:"Could not inspect the worktree before running the recipe."};let o=vae(i.stdout||""),s=await _ae(t,[...o.keys()],r),a=r4e(e);if(!a)return{status:"failed",changedFiles:[],message:`Drift does not know how to run a "${e.provider}" recipe.`};n.logger?.info(`Running community recipe ${e.name}@${e.version} (${e.provider})`);let c=await r(a.bin,a.args,{cwd:t,timeoutMs:3e5});if(c.failure||c.code!==0){let u=c.failure==="not-found"?`${a.bin} is not installed`:c.stderr.trim()||c.stdout.trim();return{status:"failed",changedFiles:await yae(t,o,s,r),message:`Recipe ${e.name}@${e.version} failed: ${u||`exit code ${c.code}`}`.trim()}}let l=await yae(t,o,s,r);return l.length===0?{status:"no-changes",changedFiles:[],message:`Recipe ${e.name}@${e.version} made no changes here.`}:{status:"applied",changedFiles:l,message:`Applied community recipe ${e.name}@${e.version} from ${e.publisher} \u2014 no agent call was made.`}}function vae(e){let t=new Map;for(let n of e.split(` +`)){let r=n.trimEnd();if(!r.trim())continue;let i=r.slice(0,2),o=r.slice(2).trim(),s=o.indexOf(" -> ");s!==-1&&(o=o.slice(s+4).trim()),o.startsWith('"')&&o.endsWith('"')&&(o=o.slice(1,-1)),o&&t.set(o,i)}return t}async function _ae(e,t,n){let r=new Map;for(let i of t){let o=await n("git",["hash-object","--",i],{cwd:e});!o.failure&&o.code===0&&r.set(i,o.stdout.trim())}return r}async function yae(e,t,n,r){let i=await r("git",["status","--porcelain"],{cwd:e}),o=vae(i.stdout||""),s=new Set,a=[];for(let[l,u]of o)t.get(l)!==u?s.add(l):a.push(l);let c=await _ae(e,a,r);for(let l of a)n.get(l)!==c.get(l)&&s.add(l);return[...s]}function r4e(e){switch(e.provider){case"codemod.com":return{bin:"npx",args:["--yes","codemod@latest","run",`${e.name}@${e.version}`]};case"openrewrite":return{bin:"mvn",args:["-q","org.openrewrite.maven:rewrite-maven-plugin:run",`-Drewrite.activeRecipes=${e.name}`,`-Drewrite.recipeArtifactCoordinates=${e.source}:${e.version}`]};default:return null}}var i4e=8;function Sae(e){let t=e.filter(i=>i.before!==i.after);if(t.length===0)return{ops:[],unexplained:[]};let n=[];for(;n.lengthXT(n,a.before)!==a.after);if(i.length===0)break;let o=new Map;for(let a of i){let c=XT(n,a.before);for(let l of o4e({...a,before:c}))o.set(JSON.stringify(l),l)}let s=null;for(let[a,c]of o){let l=[...n,c],u=i.filter(d=>XT(l,d.before)===d.after).length;u!==0&&(!s||u>s.score||u===s.score&&aXT(n,i.before)!==i.after);return{ops:n,unexplained:r}}function XT(e,t){let n=t;for(let r of e)n=oae(n,r);return n}function o4e(e){let t=[],n=wae(e.before),r=wae(e.after),i=n.filter(c=>!r.includes(c)),o=r.filter(c=>!n.includes(c));for(let c of new Set(i))for(let l of new Set(o))t.push({kind:"rename-identifier",from:c,to:l}),t.push({kind:"rename-member",from:c,to:l}),t.push({kind:"replace-import-path",from:c,to:l});let s=kae(e.before),a=kae(e.after);for(let c of s.filter(l=>!a.includes(l)))for(let l of a.filter(u=>!s.includes(u)))t.push({kind:"replace-import-path",from:c,to:l});for(let c of["await","new"])if(!(e.before.includes(`${c} `)||!e.after.includes(`${c} `)))for(let l of $ae(e.after))t.push({kind:"wrap-call",callee:l,wrapper:c});for(let c of $ae(e.before))for(let l of s4e(e.before,e.after))for(let u=0;u<=4;u++)t.push({kind:"insert-argument",callee:c,index:u,text:l});return t}function wae(e){return e.match(/[A-Za-z_$][\w$]*/g)??[]}function kae(e){return[...e.matchAll(/"([^"\\]*)"|'([^'\\]*)'/g)].map(t=>t[1]??t[2]??"")}function $ae(e){return[...e.matchAll(/([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\(/g)].map(t=>t[1])}function s4e(e,t){let n=[...t.match(/\{[^{}]*\}/g)??[],...t.match(/"[^"\\]*"|'[^'\\]*'/g)??[],...t.match(/\b(?:true|false|null|None|nil)\b/g)??[]];return[...new Set(n.filter(r=>!e.includes(r)))]}async function Tae(e){let{candidate:t,change:n,sandbox:r,relevantFiles:i,logger:o}=e,s=e.exec??et,a=await bae(t,r,{exec:s,logger:o});if(a.status!=="applied"||a.changedFiles.length===0)return o.debug(`${t.name}@${t.version} changed nothing Drift could learn a rule from.`),null;let c=[],l=!1;for(let d of a.changedFiles){if(!i.has(d)){l=!0;continue}let p=await a4e(r,d,s);if(!p){l=!0;continue}let f=p.before.split(` `),m=p.after.split(` -`);if(f.length!==m.length)return o.debug(`${t.name} changed the line count of ${d}; that is not expressible as a Drift operation.`),null;for(let g=0;g0?(o.info(`Drift could not re-derive what ${t.name}@${t.version} did to ${u.unexplained.length||c.length} line(s), so it will not apply it. This finding falls through to an agent.`),null):(l&&o.info(`${t.name}@${t.version} also changed files outside this finding's call sites; those edits were not learned from and will not be applied.`),n1({change:n,dependencyChange:e.dependencyChange,migration:t.migration,rationale:`Inferred from ${c.length} edit(s) made by ${t.name}@${t.version} in an isolated worktree, then re-derived as Drift operations. The recipe's own output was discarded.`,citations:[],ops:u.ops,provenance:{author:"recipe",recipe:{name:t.name,version:t.version,publisher:t.publisher,source:t.source},authoredAt:new Date().toISOString()}}))}async function j1e(e,t,n){let i=await n("git",["show",`HEAD:${t}`],{cwd:e});if(i.code!==0)return null;try{return{before:i.stdout,after:await(0,Zee.readFile)((0,Yee.join)(e,t),"utf8")}}catch{return null}}async function Xee(e){let{change:t,candidate:n,sites:i,workspace:r,headSha:o,logger:s}=e;if(!n)return null;let a=new Set(i.filter(c=>c.breakingChangeId===t.id).map(c=>c.file));if(a.size===0)return null;try{return await Uee(r,`fixplan-${n.provider}`,c=>Qee({candidate:n,change:t,dependencyChange:e.dependencyChange,sandbox:c.path,relevantFiles:a,logger:s}),{at:o,...e.env?{env:e.env}:{},copyIgnoredFiles:!1})}catch(c){return s.warn(`Could not observe ${n.name}@${n.version} in an isolated worktree (${c.message}); this finding gets no recipe-derived fix plan.`),null}}var z1e="https://api.codemod.com",l1="https://search.maven.org",u1=6e3;async function tte(e,t){if(!t)return null;let n=rte(t.name),i=t.name.toLowerCase(),r=`${z1e}/registry?search=${encodeURIComponent(n)}`,o=await $e(r,{timeoutMs:u1,cacheTtlMs:3600*1e3});if(!o)return null;let s=Array.isArray(o)?o:o.entries??o.results??o.data??[];if(!Array.isArray(s))return null;let a=s.map(p=>({entry:p,confidence:G1e(p,i,n)})).filter(p=>p.confidence!=="none");if(a.length===0)return null;let c={exact:2,"base-name":1,text:0};a.sort((p,f)=>c[f.confidence]-c[p.confidence]||Number(c1(f.entry))-Number(c1(p.entry)));let l=a[0].entry,u=l.slug??l.name,d=l.version??l.latestVersion;return!u||!d?null:{provider:"codemod.com",name:u,version:d,publisher:l.owner?.name??l.author??l.publisher??"Codemod.com",source:`https://app.codemod.com/registry/${encodeURIComponent(l.slug??u)}`,migration:l.description??l.summary??`Migrates ${t.name} usages.`,official:c1(l)}}function G1e(e,t,n){let i=e.applicability?.flatMap(s=>s.packages??[])??[];if(i.some(s=>s.toLowerCase()===t))return"exact";if(i.some(s=>!s.includes("/")&&s.toLowerCase()===n))return"base-name";let r=`${e.slug??""} ${e.name??""} ${e.description??""} ${e.summary??""}`.toLowerCase(),o=new RegExp(`(?:^|[^a-z0-9])${V1e(n)}(?:$|[^a-z0-9])`);return n&&o.test(r)?"text":"none"}function V1e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function c1(e){if(e.verified||e.official)return!0;let t=(e.owner?.name??e.owner?.slug??e.author??e.publisher??"").toLowerCase();return t==="codemod"||t==="codemod.com"}var B1e=/\borg\.openrewrite\.[a-zA-Z0-9_.]*[A-Z][a-zA-Z0-9_]*\b/;async function nte(e,t){if(!t||t.ecosystem!=="maven")return null;let n=rte(t.name).replace(/[^a-z0-9]/g,"-"),i=await ete(`rewrite-${n}`)??await ete(n);if(!i?.latestVersion)return null;let r=await q1e(i.g,i.a,i.latestVersion),o=r?B1e.exec(r)?.[0]:void 0;return o?{provider:"openrewrite",name:o,version:i.latestVersion,publisher:"OpenRewrite",source:`${l1}/artifact/${i.g}/${i.a}/${i.latestVersion}`,migration:r??`Runs ${o} from ${i.g}:${i.a}.`,official:!0}:null}async function ete(e){let t=encodeURIComponent(`g:org.openrewrite.recipe AND a:${e}`),n=`${l1}/solrsearch/select?q=${t}&core=gav&rows=1&wt=json`,r=(await $e(n,{timeoutMs:u1,cacheTtlMs:3600*1e3}))?.response?.docs?.[0];return r?.g==="org.openrewrite.recipe"?r:null}async function q1e(e,t,n){let i=e.replace(/\./g,"/"),r=`${l1}/remotecontent?filepath=${i}/${t}/${n}/${t}-${n}.pom`,o=await rt(r,{timeoutMs:u1,cacheTtlMs:1440*60*1e3,immutable:!0});if(!o)return null;let s=/([\s\S]*?)<\/description>/.exec(o);return s?s[1].trim():null}function rte(e){return e.replace(/^@[^/]+\//,"").toLowerCase()}var W1e=[tte,nte];async function ite(e,t,n=W1e){let r=(await Promise.all(n.map(o=>o(e,t).catch(()=>null)))).filter(o=>o!==null);return r.length===0?null:(r.sort((o,s)=>Number(s.official)-Number(o.official)),r[0])}var ste={branch:"{prefix}upgrade-{summary}-{date}",title:"chore(deps): upgrade {summary}",prefix:"drift/"};function ate(e,t){let{changes:n}=e,i=e.now??new Date,r=n[0],o=r?n.length===1?`${r.name}-${r.from??"unknown"}-to-${r.to??"unknown"}`:`${n.length}-packages`:"dependencies",s=r?n.length===1?`${r.name} to ${r.to??"a new version"}`:`${n.length} packages`:"dependencies";return{prefix:t,summary:o,"summary-text":s,name:r?.name??"dependencies",from:r?.from??"",to:r?.to??"",count:String(n.length),date:i.toISOString().slice(0,10)}}function cte(e,t){return e.replace(/\{([a-z-]+)\}/g,(n,i)=>t[i]??n)}function ote(e){return(e.toLowerCase().replace(/[^a-z0-9/_.-]+/g,"-").replace(/(?<=[^/])\/(?=[^/])/g,"-").replace(/\.{2,}/g,".").replace(/-{2,}/g,"-").replace(/^[-./]+|[-./]+$/g,"").replace(/\.lock$/,"-lock")||"drift-upgrade").slice(0,200).replace(/[-./]+$/,"")}function lte(e,t={}){let n={...ste,...t},i=n.prefix?`${n.prefix.replace(/\/+$/,"")}/`:"",r=cte(n.branch,ate(e,i));return r.startsWith(i)&&i?`${i}${ote(r.slice(i.length))}`:ote(r)}function ute(e,t={}){let n={...ste,...t},i=ate(e,n.prefix);return cte(n.title,{...i,summary:i["summary-text"]}).trim()}var dte={"runtime-requirement":0,"config-change":1,"module-system-change":1,"moved-export":1,"removed-export":2,"renamed-export":2,"removed-endpoint":3,"changed-endpoint":3,"signature-change":4,"type-change":4,"required-field-added":5,"default-change":5,"behaviour-change":6,unknown:7};function H1e(e){switch(e){case"runtime-requirement":case"config-change":case"module-system-change":return"build";case"behaviour-change":case"default-change":return"fix";default:return"refactor"}}function hte({breakingChanges:e,impactSites:t,dispositions:n,config:i,changes:r=[],codemods:o,recipes:s,fixPlans:a}){let c=K1e(t),l=new Map((n??[]).map(k=>[k.changeId,k.actionableSites])),u=new Map(n?.map(k=>[k.changeId,k])),d=e.filter(k=>{let _=u.get(k.id);return _?_.state==="actionable"&&_.actionableSites.length>0:(c.get(k.id)??[]).some(S=>S.confidence==="high"&&S.runtimeVerdict===void 0)});if(d.length===0)return{commits:[],edges:[],cohorts:mte(r),blockers:[]};let f=[...i.remediation.commitGranularity==="single"?[d]:i.remediation.commitGranularity==="per-dependency"?J1e(d):d.map(k=>[k])].sort(Z1e),m=mte(r),g=new Map;for(let k of m)for(let _ of k.dependencies)g.set(_,k);let h=f.map((k,_)=>Y1e(k,_+1,l,f.length,o,s,a)),b=tUe(h,e,t,g),y=oUe(h,b),w=y.cycle.length>0?sUe(y.cycle,b):void 0;return{commits:y.commits,edges:b,cohorts:m,blockers:w?[w]:[]}}function K1e(e){let t=new Map;for(let n of e){let i=t.get(n.breakingChangeId);i?i.push(n):t.set(n.breakingChangeId,[n])}return t}function J1e(e){let t=new Map;for(let n of e){let i=t.get(n.dependency);i?i.push(n):t.set(n.dependency,[n])}return[...t.values()]}function Z1e(e,t){let n=Math.min(...e.map(s=>dte[s.kind])),i=Math.min(...t.map(s=>dte[s.kind]));if(n!==i)return n-i;let r=e[0]?.dependency??"",o=t[0]?.dependency??"";return r.localeCompare(o)}function Y1e(e,t,n,i,r,o,s){let a=e.flatMap(f=>n.get(f.id)??[]),c=[...new Set(a.map(f=>f.file))].sort(),l=e[0],u=r?eUe(e,n,r):void 0,d=!u&&s?Q1e(e,n,s):void 0,p=!u&&o?X1e(e,o):void 0;return{id:St("unit",e.map(f=>f.id).sort().join(","),c.join(","),l.dependency,l.kind),order:t,message:dUe(e,c.length),body:mUe(e,a,u,p),breakingChangeIds:e.map(f=>f.id),files:c,allowedFiles:c,allowedSymbols:[...new Set(e.flatMap(f=>f.symbols))].sort(),instructions:gUe(e,a,t,i),dependsOn:[],dependencyReasons:[],executionLayer:0,expectedChecks:aUe(e,c),invalidationTriggers:cUe(e,c),...u?{codemod:u}:{},...d?{fixPlan:d}:{},...p?{recipe:p}:{}}}function Q1e(e,t,n){let i=e.map(a=>n.get(a.id)).filter(a=>!!a);if(i.length===0)return;let r=e.filter(a=>!n.has(a.id)).flatMap(a=>(t.get(a.id)??[]).map(c=>({file:c.file,line:c.line,reason:`No fix plan was accepted for "${a.summary}", so this site needs an agent.`}))),o=i[0],s=i.flatMap(a=>a.anchors);return{plan:o.plan,assurance:i.some(a=>a.assurance==="checked")?"checked":"proven",files:[...new Set(s.map(a=>a.file))].sort(),anchors:s,covered:i.reduce((a,c)=>a+c.covered,0),residual:i.reduce((a,c)=>a+c.residual,0)+r.length,residualSites:[...i.flatMap(a=>a.sites.filter(c=>c.status==="residual").map(c=>({file:c.file,line:c.line,reason:c.reason??"No rule matched."}))),...r]}}function X1e(e,t){let n=[];for(let i of e){let r=t.get(i.id);if(!r)return;n.push(r)}return n.length>0?n:void 0}function eUe(e,t,n){let i=new Set,r=[];for(let o of e){let s=t.get(o.id)??[],a=n.get(o.id);if(!a||a.sitesResolvedl.file))];if(c.some(l=>i.has(l)))return;for(let l of c)i.add(l);r.push({...a.transform,files:c})}return r.length>0?r:void 0}function tUe(e,t,n,i){let r=new Map,o=new Map(t.map(c=>[c.id,c])),s=new Map;for(let c of n){let l=s.get(c.file);l?l.push(c):s.set(c.file,[c])}let a=(c,l,u,d)=>{if(c.id===l.id)return;let p=`${c.id}\0${l.id}\0${u}`;r.has(p)||r.set(p,{from:c.id,to:l.id,reason:u,evidence:[...new Set(d)].sort()})};for(let c=0;cf.dependency)),p=new Set(l.allowedFiles);for(let f=c+1;fk.dependency)),b=m.allowedFiles.filter(k=>p.has(k));b.length>0&&a(l,m,"same-file-conflict",b),u.some(k=>k.kind==="runtime-requirement")&&a(l,m,"runtime-prerequisite",u.map(k=>k.summary)),u.some(k=>k.kind==="config-change"||k.kind==="module-system-change")&&g.some(k=>d.has(k.dependency))&&a(l,m,"configuration-prerequisite",u.map(k=>k.summary)),u.some(k=>k.kind==="moved-export")&&rUe(u,g)&&a(l,m,"import-prerequisite",u.flatMap(k=>k.symbols)),l.allowedFiles.some(d1)&&!m.allowedFiles.every(d1)&&nUe(d,h)&&a(l,m,"generated-output",l.allowedFiles.filter(d1));let y=[...d].map(k=>i.get(k)).filter(k=>!!k).filter(k=>g.some(_=>k.dependencies.includes(_.dependency)));for(let k of y)a(l,m,"package-cohort",[`${k.id}: ${k.reason}`]);let w=iUe(l,m,s);w.length>0&&a(l,m,"symbol-dependency",w)}}return[...r.values()].sort(yte)}function pte(e,t){return e.breakingChangeIds.map(n=>t.get(n)).filter(n=>!!n)}function nUe(e,t){for(let n of e)if(t.has(n))return!0;return!1}function rUe(e,t){let n=e.filter(i=>i.kind==="moved-export");if(n.length===0)return!1;for(let i of n){let r=new Set([...i.symbols,...i.replacementSymbols??[]]);if(t.some(o=>o.dependency===i.dependency&&o.symbols.some(s=>r.has(s))))return!0}return!1}function d1(e){return/(^|\/)(__generated__|generated|gen)\//i.test(e)||/\.(generated|gen)\./i.test(e)}function iUe(e,t,n){let i=new Set(e.allowedSymbols??[]);if(i.size===0)return[];let r=[];for(let o of t.allowedFiles)for(let s of n.get(o)??[])s.enclosingSymbol&&i.has(s.enclosingSymbol)&&r.push(`${o}:${s.line} is inside ${s.enclosingSymbol}`);return r}function yte(e,t){return e.from.localeCompare(t.from)||e.to.localeCompare(t.to)||e.reason.localeCompare(t.reason)||e.evidence.join("\0").localeCompare(t.evidence.join("\0"))}function oUe(e,t){let n=new Map(e.map(a=>[a.id,a])),i=new Map;for(let a of e)i.set(a.id,new Set);for(let a of t)!n.has(a.from)||!n.has(a.to)||i.get(a.to).add(a.from);let r=new Set(e.map(a=>a.id)),o=new Map,s=0;for(;r.size>0;){let a=[...r].filter(c=>[...i.get(c)??[]].every(l=>!r.has(l))).map(c=>n.get(c)).sort((c,l)=>c.order-l.order||c.id.localeCompare(l.id));if(a.length===0)return{commits:fte(e,t,o),cycle:[...r].sort()};for(let c of a)o.set(c.id,s),r.delete(c.id);s+=1}return{commits:fte(e,t,o),cycle:[]}}function fte(e,t,n){let i=new Map;for(let r of t){let o=i.get(r.to);o?o.push(r):i.set(r.to,[r])}return e.map(r=>{let o=[...i.get(r.id)??[]].sort(yte);return{...r,dependsOn:o.map(s=>s.from).sort(),dependencyReasons:o,executionLayer:n.get(r.id)??0}}).sort((r,o)=>r.executionLayer-o.executionLayer||r.order-o.order||r.id.localeCompare(o.id)).map((r,o)=>({...r,order:o+1}))}function sUe(e,t){let n=t.filter(i=>e.includes(i.from)&&e.includes(i.to)).slice(0,5).map(i=>`${i.from} -> ${i.to} (${i.reason})`).join("; ");return`The remediation graph contains a dependency cycle across ${e.length} commit unit(s): ${n}. Drift cannot automatically execute this plan until the inseparable work is combined or reviewed manually.`}function aUe(e,t){let n=[];return e.some(i=>i.kind==="signature-change"||i.kind==="type-change"||i.kind==="removed-export"||i.kind==="renamed-export"||i.kind==="moved-export")&&n.push({id:St("check","typecheck",e.map(i=>i.id).sort().join(",")),kind:"typecheck",reason:"API-shape and type-contract migrations should be checked by the repository type checker when available."}),e.some(i=>i.kind==="behaviour-change"||i.kind==="default-change")&&n.push({id:St("check","test",e.map(i=>i.id).sort().join(",")),kind:"test",reason:"Behavioural and default changes need tests because compilation can still succeed with wrong behaviour."}),t.some(i=>/(^|\/)(package\.json|tsconfig\.json|vite\.config|webpack\.config|rollup\.config)/.test(i))&&n.push({id:St("check","build",t.join(",")),kind:"build",reason:"Configuration and package-entry changes can alter the build graph."}),n}function cUe(e,t){let n=[...t.map(i=>`file:${i}`),...e.flatMap(i=>i.symbols.map(r=>`symbol:${r}`)),...e.map(i=>`dependency:${i.dependency}`)];return[...new Set(n)].sort()}function mte(e){let t=[],n=new Map;for(let i of e){let r=n.get(i.ecosystem);r?r.push(i):n.set(i.ecosystem,[i])}for(let[i,r]of n)for(let o of lUe(r)){if(o.length<2)continue;let s=o.map(a=>a.name).sort();t.push({id:St("cohort",i,s.join(",")),ecosystem:o[0].ecosystem,dependencies:s,constraints:o.map(a=>({dependency:a.name,ecosystem:a.ecosystem,range:a.rawTo??a.to??"*",source:"workspace-family"})),candidatePaths:[...new Set(o.map(a=>a.manifestPath))].sort(),reason:`These ${i} packages appear to be part of the same ${uUe(o[0].name)} upgrade family and should be reviewed together.`})}return t.sort((i,r)=>i.id.localeCompare(r.id))}function lUe(e){let t=new Map;for(let n of e){let i=bte(n.name);if(!i)continue;let r=t.get(i);r?r.push(n):t.set(i,[n])}return[...t.values()]}function bte(e){let t=[/^(@angular)\//,/^(@babel)\//,/^(@nestjs)\//,/^(@types)\//,/^(@vue)\//,/^(react)(?:$|-)/,/^(next)(?:$|-)/,/^(eslint)(?:$|-)/,/^(jest)(?:$|-)/,/^(webpack)(?:$|-)/,/^(vite)(?:$|-)/];for(let n of t){let i=n.exec(e);if(i?.[1])return i[1]}if(e.startsWith("@")){let n=e.split("/")[0];return n&&n!==e?n:null}return null}function uUe(e){return pK(bte(e)??e,32)}function dUe(e,t){let n=e[0],i=H1e(n.kind),r=fUe(e);return e.length===1?gte(`${i}(${r}): ${pUe(n)}`):gte(`${i}(${r}): update ${e.length} usages for the new ${n.dependency} API`)}function pUe(e){let t=e.symbols[0],n=e.replacementSymbols?.[0];switch(e.kind){case"removed-export":return t?`replace removed \`${t}\``:"replace removed API";case"renamed-export":return t&&n?`migrate \`${t}\` to \`${n}\``:`migrate renamed \`${t??"API"}\``;case"moved-export":return`import ${t?`\`${t}\``:"the API"} from its new entry point`;case"signature-change":return t?`update \`${t}\` call sites for the new signature`:"update call sites for new signatures";case"type-change":return t?`adapt to the new \`${t}\` type`:"adapt to changed types";case"removed-endpoint":return t?`migrate calls to removed endpoint \`${t}\``:"migrate removed endpoint calls";case"changed-endpoint":return t?`update requests to \`${t}\``:"update API requests";case"required-field-added":return t?`supply now-required \`${t}\``:"supply newly-required fields";case"default-change":return t?`pin previous default for \`${t}\``:"account for changed defaults";case"runtime-requirement":return e.summary.toLowerCase().startsWith("minimum")?e.summary.charAt(0).toLowerCase()+e.summary.slice(1):"raise the minimum runtime version";case"config-change":return"update configuration for the new version";case"module-system-change":return/commonjs/i.test(e.summary)?"replace dropped CommonJS usage":"migrate incompatible module loading";case"behaviour-change":return t?`handle changed \`${t}\` behaviour`:"handle changed behaviour";default:return`update usage of \`${e.dependency}\``}}function fUe(e){let t=[...new Set(e.map(n=>n.dependency))];if(t.length===1){let n=t[0];return n.startsWith("@")?n.split("/")[1]??n:n.split(":").pop()??n}return"deps"}function gte(e){return e.length<=72?e:`${e.slice(0,69)}...`}function mUe(e,t,n,i){let r=[];for(let s of e)r.push(s.summary),r.push(""),r.push(s.remediation),r.push("");let o=[...new Set(t.map(s=>s.file))];if(r.push(`Affects ${t.length} location(s) across ${o.length} file(s).`),r.push(""),n){let s=new Set(n.flatMap(a=>a.files)).size;r.push(`Resolved deterministically by Drift's codemod engine across ${s} file(s) \u2014 no model call was made for this commit.`)}else if(i&&i.length>0){let s=[...new Map(i.map(c=>[`${c.provider}:${c.name}@${c.version}`,c])).values()],a=s.map(c=>`${c.name}@${c.version} (${c.provider}, published by ${c.publisher})`).join(", ");r.push(`Community recipe available: ${a}. Not applied without an explicit choice \u2014 see ${s[0].source}.`)}else r.push("Identified by Drift from upstream evidence; see the pull request"),r.push("description for the citations behind this change.");return r.join(` -`).trim()}function gUe(e,t,n,i){let r=[];r.push(`## Commit ${n} of ${i}`),r.push("");for(let o of e){r.push(`### ${o.summary}`),r.push(""),r.push(`- Dependency: \`${o.dependency}\``),r.push(`- Change type: ${o.kind}`),r.push(`- Confidence: ${o.confidence}`),r.push(""),r.push(o.remediation),r.push("");let s=t.filter(a=>a.breakingChangeId===o.id);if(s.length>0){r.push("Known locations (verify each; there may be others):"),r.push("");for(let a of s.slice(0,40)){let c=a.enclosingSymbol?` in \`${a.enclosingSymbol}\``:"";r.push(`- \`${a.file}:${a.line}\`${c} \u2014 \`${a.excerpt}\``)}s.length>40&&r.push(`- \u2026and ${s.length-40} more matches of the same symbols`),r.push("")}}return r.join(` -`).trim()}var vte=["detect","evidence","surface","static-analysis","upgrade-discovery","upgrade-install","verify","fix","pull-request"],m1={detect:"Detect",evidence:"Evidence",surface:"API surface","static-analysis":"Static analysis","upgrade-discovery":"Find upgrades","upgrade-install":"Install a version",verify:"Verify",fix:"Fix","pull-request":"Automated PR"},ge=()=>({level:"full"}),he=(e,t)=>({level:"partial",note:e,...t?{requires:t}:{}}),tu=e=>({level:"none",note:e}),sc="Resolves imports against the module names the published package declares, follows re-exports inside your repository, and matches references to symbols named in the evidence. Cannot see through reflection, dynamic dispatch, or generated code.",hUe="Matches imports and references to symbols named in the evidence, using the ecosystem's own module-naming convention where no published module list exists. Cannot see through reflection, dynamic dispatch, or generated code.",p1="Compares the declarations in both versions' public headers, which is what a consumer compiles against. Declarations behind preprocessor conditionals are read as written, not per build configuration.",f1="Matches `#include` directives and references to symbols named in the evidence, following includes through your own headers so a library reached indirectly still counts. A macro-generated call site is invisible.",yUe={npm:{ecosystem:"npm",localizationBasis:"declared",label:"JavaScript / TypeScript",files:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","npm-shrinkwrap.json"],managers:["npm","pnpm","Yarn (classic)","Yarn (berry)","Bun"],support:{detect:ge(),evidence:ge(),surface:he("Diffs published TypeScript declarations. A package that ships no declarations of its own falls back to prose evidence rather than reporting a clean comparison."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs the typecheck, test, and build scripts the project's package.json actually declares."),fix:ge(),"pull-request":ge()}},pypi:{ecosystem:"pypi",localizationBasis:"published",label:"Python",files:["pyproject.toml","requirements.in","requirements.txt","setup.py","poetry.lock","uv.lock","Pipfile"],managers:["pip","Poetry","uv"],support:{detect:ge(),evidence:ge(),surface:he("Compares the public surface reconstructed from published type stubs. Packages without stubs fall back to prose evidence.","a local Python interpreter"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs mypy/pyright and pytest when the project declares them."),fix:ge(),"pull-request":ge()}},go:{ecosystem:"go",localizationBasis:"declared",label:"Go",files:["go.mod","go.sum"],managers:["Go modules"],support:{detect:ge(),evidence:ge(),surface:he("Compares the exported API of both module versions.","the Go toolchain"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `go vet`, `go test`, and `go build`.","the Go toolchain"),fix:ge(),"pull-request":ge()}},cargo:{ecosystem:"cargo",localizationBasis:"declared",label:"Rust",files:["Cargo.toml","Cargo.lock"],managers:["Cargo"],support:{detect:ge(),evidence:ge(),surface:he("Compares the public API of both crate versions.","cargo-public-api"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `cargo check`, `cargo test`, and `cargo build`.","the Rust toolchain"),fix:ge(),"pull-request":ge()}},maven:{ecosystem:"maven",localizationBasis:"published",label:"Java / Kotlin / Scala",files:["pom.xml","build.gradle","build.gradle.kts","gradle/libs.versions.toml","build.sbt"],managers:["Maven","Gradle","sbt"],support:{detect:he("Reads pom.xml, Gradle build files and version catalogs, and sbt coordinates. Gradle versions computed at configuration time are not visible without running Gradle."),evidence:ge(),surface:he("Compares both published JARs.","japicmp"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs Maven or Gradle. sbt projects verify through sbt when it is installed."),fix:he("Maven and sbt are edited through the build file; Gradle versions declared outside a version catalog may need a manual edit."),"pull-request":ge()}},rubygems:{ecosystem:"rubygems",localizationBasis:"published",label:"Ruby",files:["Gemfile","Gemfile.lock","*.gemspec"],managers:["Bundler"],support:{detect:ge(),evidence:ge(),surface:tu("Ruby has no static public API surface to compare, so upgrades rest on release notes, changelogs, and advisories."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs RSpec or Rake when the Gemfile declares them.","Bundler"),fix:ge(),"pull-request":ge()}},nuget:{ecosystem:"nuget",localizationBasis:"published",label:".NET",files:["*.csproj","*.fsproj","*.vbproj","Directory.Packages.props","packages.lock.json"],managers:["NuGet"],support:{detect:ge(),evidence:he("Registry metadata, published versions, deprecation, and OSV advisories. Release notes depend on the package declaring a GitHub repository."),surface:he("Compares the public types and member signatures in both versions' published assemblies, preferring the reference assembly and a common target framework. A package that ships only native binaries, analyzers, or nothing at all has no surface to compare."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `dotnet build` and `dotnet test`.","the .NET SDK"),fix:ge(),"pull-request":ge()}},packagist:{ecosystem:"packagist",localizationBasis:"published",label:"PHP",files:["composer.json","composer.lock"],managers:["Composer"],support:{detect:ge(),evidence:he("Registry metadata, published versions, abandonment notices, and OSV advisories. Release notes depend on the package declaring a source repository."),surface:tu("PHP publishes no machine-comparable API artefact; upgrades rest on release notes, changelogs, and advisories."),"static-analysis":he("Resolves `use` statements against the PSR-4 and PSR-0 roots the package declares in its own composer.json, read from Packagist. A package that autoloads only by classmap declares no namespace root and is not localized."),"upgrade-discovery":ge(),verify:he("Runs PHPUnit when composer.json declares it.","Composer"),fix:ge(),"pull-request":ge()}},hex:{ecosystem:"hex",localizationBasis:"published",label:"Elixir / Erlang",files:["mix.exs","mix.lock"],managers:["Mix"],support:{detect:ge(),evidence:he("Registry metadata, published versions, retirement notices, and OSV advisories."),surface:he("Compares the public modules and their functions, by name and arity, in both versions' published sources \u2014 `def` and `defmacro` in Elixir, `-export` in Erlang. A function a macro generates at compile time is not visible without compiling."),"static-analysis":he("Resolves module references against every module the released tarball defines, so a fully qualified call needs no `alias` to be found. Cannot see through `apply/3` or a module name computed at runtime."),"upgrade-discovery":ge(),verify:he("Runs `mix compile --warnings-as-errors` and `mix test`.","Elixir and Mix"),fix:ge(),"pull-request":ge()}},pub:{ecosystem:"pub",localizationBasis:"declared",label:"Dart / Flutter",files:["pubspec.yaml","pubspec.lock"],managers:["Dart pub","Flutter"],support:{detect:ge(),evidence:he("Registry metadata, published versions, retraction, and OSV advisories. Release notes depend on the package declaring a repository."),surface:he("Compares the public declarations of both versions' published libraries, following each `export` out of the private `lib/src` tree the way a consumer's import does. Read from source rather than from a compiled artefact."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `dart analyze` and `dart test`, or their Flutter equivalents.","the Dart or Flutter SDK"),fix:ge(),"pull-request":ge()}},swift:{ecosystem:"swift",localizationBasis:"published",label:"Swift",files:["Package.swift","Package.resolved"],managers:["Swift Package Manager"],support:{detect:he("Reads literal `.package(...)` declarations and Package.resolved. Versions computed by Swift code at manifest-evaluation time are not visible without running SwiftPM."),evidence:he("Source repository, releases, and changelogs, because SwiftPM identifies packages by git URL. There is no central registry to query for deprecation."),surface:tu("Comparing two Swift module interfaces needs a local toolchain and a built artefact Drift does not produce; upgrades rest on prose evidence."),"static-analysis":he("Resolves `import` statements against the library and target names declared in the dependency's own Package.swift at the resolved version. A module name a manifest computes at evaluation time is not visible without running SwiftPM."),"upgrade-discovery":he("Versions are git tags, since SwiftPM has no package registry to ask. Drift lists them for packages hosted on GitHub; anything on another git host is reported as unchecked rather than up to date."),verify:he("Runs `swift build` and `swift test`.","the Swift toolchain"),fix:ge(),"pull-request":ge()}},cocoapods:{ecosystem:"cocoapods",localizationBasis:"published",label:"CocoaPods",files:["Podfile","Podfile.lock","*.podspec"],managers:["CocoaPods"],support:{detect:ge(),evidence:he("Release notes and changelogs when the pod declares a GitHub source. CocoaPods publishes no queryable metadata API, so there is no deprecation or advisory signal."),surface:tu("Drift does not compare compiled iOS frameworks; upgrades rest on prose evidence."),"static-analysis":he("Resolves `import` statements against the `module_name` the pod declares in its podspec, read from the CocoaPods CDN. A pod that builds its module name in Ruby at podspec-evaluation time is not visible without running CocoaPods."),"upgrade-discovery":ge(),verify:tu("Building an iOS target needs Xcode and a scheme Drift cannot infer; verification stays with the developer."),fix:ge(),"pull-request":ge()}},opam:{ecosystem:"opam",localizationBasis:"convention",label:"OCaml",files:["*.opam","dune-project","*.opam.locked"],managers:["opam"],support:{detect:ge(),evidence:he("Release notes and changelogs when the package declares a GitHub source. opam has no JSON metadata API, so there is no registry deprecation signal."),surface:tu("Comparing two OCaml module interfaces needs a built switch Drift does not create; upgrades rest on prose evidence."),"static-analysis":he(hUe),"upgrade-discovery":he("opam publishes no version API, so releases are read from the package directories in the opam-repository index. A package published only in a custom repository is reported as unchecked rather than up to date."),verify:he("Runs `dune build` and `dune runtest`.","opam and dune"),fix:ge(),"pull-request":ge()}},conan:{ecosystem:"conan",localizationBasis:"convention",label:"C / C++ (Conan)",files:["conanfile.txt","conanfile.py","conan.lock"],managers:["Conan"],support:{detect:he("Reads conanfile.txt, conan.lock, and the literal `requires` declarations in conanfile.py. A reference a recipe builds at evaluation time is not visible without running Python."),evidence:he("Versions from the ConanCenter recipe index, and releases and changelogs from the upstream project the recipe builds \u2014 not from the recipe itself. ConanCenter publishes no deprecation signal, and OSV has no Conan ecosystem."),surface:he(p1),"static-analysis":he(f1),"upgrade-discovery":he("Conan version schemes are package-defined, so Drift can analyze exact version changes but does not invent an ordering to select a newer release automatically."),verify:he("Runs `conan build`, which is the compiler \u2014 in C and C++ an incompatible header change is a build failure rather than a runtime surprise.","Conan"),fix:ge(),"pull-request":ge()}},vcpkg:{ecosystem:"vcpkg",localizationBasis:"convention",label:"C / C++ (vcpkg)",files:["vcpkg.json","vcpkg-configuration.json"],managers:["vcpkg"],support:{detect:he("Reads declared dependencies, `version>=` floors, and `overrides`. A registry baseline moving changes every unpinned version at once; Drift reports the baseline move rather than resolving it to versions."),evidence:he("Versions from the vcpkg versions database, and releases and changelogs from the port's upstream project. vcpkg publishes no deprecation signal, and OSV has no vcpkg ecosystem."),surface:he(p1),"static-analysis":he(f1),"upgrade-discovery":he("vcpkg versions are port-defined and baseline resolution can change every dependency, so Drift analyzes exact overrides but does not invent an ordering or resolve baseline moves automatically."),verify:he("Runs the project's CMake build, which is where an incompatible header change surfaces.","CMake"),fix:ge(),"pull-request":ge()}},arduino:{ecosystem:"arduino",localizationBasis:"convention",label:"Arduino / PlatformIO",files:["library.properties","platformio.ini"],managers:["Arduino CLI","PlatformIO"],support:{detect:ge(),evidence:he("Versions and repositories from the Arduino Library Manager index, plus releases and changelogs from the library's own repository. A library published only to PlatformIO has metadata but no version history, because that registry serves only the current release."),surface:he(p1),"static-analysis":he(f1),"upgrade-discovery":ge(),verify:he("Runs `arduino-cli compile` or `pio run`, and `pio test` where the project has tests.","Arduino CLI or PlatformIO"),fix:ge(),"pull-request":ge()}}};function bUe(e){let t=ua.filter(s=>s.ecosystem===e),n={name:"example",version:"1.0.0",kind:"runtime"},i=t.filter(s=>s.upgrade(n)!==null),r=t.filter(s=>s.upgrade(n)===null);if(r.length===0)return ge();let o=s=>s.map(a=>a.label).join(", ");return i.length===0?tu(`${o(r)} ${r.length===1?"has":"have"} no command that pins a version \u2014 the coordinate lives in a build file the tool will not rewrite. Drift reports the version to set and where, and leaves the edit to you.`):he(`${o(i)} can install a chosen version directly. ${o(r)} cannot: the version lives in a build file the tool will not rewrite, so Drift tells you what to change instead of running something that silently changes nothing.`)}var vUe=Object.values(yUe).map(e=>({...e,support:{...e.support,"upgrade-install":bUe(e.ecosystem)}})),wUe=Object.fromEntries(vUe.map(e=>[e.ecosystem,e]));function wte(e){return wUe[e]}var g1=require("node:crypto");var Cf=3,h1=[Cf];function ri(e){return e===null||typeof e!="object"?JSON.stringify(e??null)??"null":Array.isArray(e)?`[${e.map(n=>ri(n)).join(",")}]`:`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>ni?1:0).map(([n,i])=>`${JSON.stringify(n)}:${ri(i)}`).join(",")}}`}function kUe(e){return{id:e.id,source:e.source,dependency:e.dependency,url:e.url??null,locator:e.locator??null,title:e.title,contentHash:(0,g1.createHash)("sha256").update(e.content).digest("hex"),weight:e.weight,findings:(e.findings??[]).map(t=>({code:t.code,symbol:t.symbol,detail:t.detail,before:t.before??null,after:t.after??null}))}}function $Ue(e){return{nature:e.nature,detectability:[...e.detectability].sort(),scope:e.scope,visibility:[...e.visibility].sort(),origin:e.origin}}function _Ue(e){return{schemaVersion:Cf,id:e.id,baseBranch:e.baseBranch,headSha:e.headSha,risk:e.risk,blockers:[...e.blockers],warnings:[...e.warnings],changes:e.changes.map(t=>({name:t.name,ecosystem:t.ecosystem,from:t.from,to:t.to,kind:t.kind,bump:t.bump,manifestPath:t.manifestPath,workspace:t.workspace??null})),breakingChanges:e.breakingChanges.map(t=>({id:t.id,dependency:t.dependency,kind:t.kind,summary:t.summary,remediation:t.remediation,symbols:[...t.symbols].sort(),replacementSymbols:[...t.replacementSymbols??[]].sort(),confidence:t.confidence,taxonomy:$Ue(Or(t)),assessment:t.assessment?{upstream:t.assessment.upstream.score,localImpact:t.assessment.localImpact.score,verification:t.assessment.verification.score,automaticExecutionEligible:t.assessment.automaticExecutionEligible,calibration:t.assessment.upstream.calibration}:null,citations:[...t.citations].sort()})),impactSites:e.impactSites.map(t=>({breakingChangeId:t.breakingChangeId,file:t.file,line:t.line,matchedSymbol:t.matchedSymbol,enclosingSymbol:t.enclosingSymbol??null,confidence:t.confidence})),commits:e.commits.map(t=>({id:t.id,order:t.order,message:t.message,body:t.body,breakingChangeIds:[...t.breakingChangeIds].sort(),files:[...t.files].sort(),allowedFiles:[...t.allowedFiles].sort(),allowedSymbols:[...t.allowedSymbols??[]].sort(),instructions:t.instructions,dependsOn:[...t.dependsOn].sort(),dependencyReasons:[...t.dependencyReasons].map(n=>({from:n.from,to:n.to,reason:n.reason,evidence:[...n.evidence].sort()})).sort((n,i)=>ri(n).localeCompare(ri(i))),executionLayer:t.executionLayer,expectedChecks:[...t.expectedChecks].map(n=>({id:n.id,kind:n.kind,command:n.command??null,reason:n.reason})).sort((n,i)=>ri(n).localeCompare(ri(i))),invalidationTriggers:[...t.invalidationTriggers].sort()})),planEdges:[...e.planEdges].map(t=>({from:t.from,to:t.to,reason:t.reason,evidence:[...t.evidence].sort()})).sort((t,n)=>ri(t).localeCompare(ri(n))),upgradeCohorts:[...e.upgradeCohorts].map(t=>({id:t.id,ecosystem:t.ecosystem,dependencies:[...t.dependencies].sort(),constraints:[...t.constraints].map(n=>({dependency:n.dependency,ecosystem:n.ecosystem,range:n.range,source:n.source})).sort((n,i)=>ri(n).localeCompare(ri(i))),candidatePaths:[...t.candidatePaths].sort(),reason:t.reason})).sort((t,n)=>t.id.localeCompare(n.id)),evidence:e.evidence.map(kUe),gaps:[...e.gaps].map(t=>({stage:t.stage,dependency:t.dependency??null,ecosystem:t.ecosystem??null,surface:t.surface,severity:t.severity,automaticExecution:t.automaticExecution})).sort((t,n)=>ri(t).localeCompare(ri(n)))}}function lx(e){return(0,g1.createHash)("sha256").update(ri(_Ue(e))).digest("hex")}function SUe(e,t,n){return t.breakingChangeId!==e.id||t.confidence!=="high"?!1:e.kind!=="runtime-requirement"?!0:n?.changeId===e.id&&n.state==="incompatible"&&t.runtimeVerdict==="incompatible"}function xUe(e){let t=new Set,n=[];for(let i of e){let r=`${i.file}:${i.line}:${i.column??""}:${i.matchedSymbol??""}`;t.has(r)||(t.add(r),n.push(i))}return n}function Pf(e,t,n,i,r=!0){let o=new Map;for(let s of n){let a=o.get(s.changeId);a?a.push(s):o.set(s.changeId,[s])}return e.map(s=>{let a=xUe(t.filter(d=>d.breakingChangeId===s.id)),c=o.get(s.id)??[],l=c.length===1?c[0]:void 0,u=a.filter(d=>SUe(s,d,l));if(s.kind==="runtime-requirement"){if(!l)return{changeId:s.id,state:"unknown",reason:"not-localized",sites:a,actionableSites:u};let d={changeId:s.id,sites:a,actionableSites:u,runtimeAnalysis:{runtime:l.runtime,state:l.state,reason:l.reason}};return l.state==="incompatible"?{...d,state:"actionable",reason:"runtime-incompatible"}:l.state==="partial"?{...d,state:"review-only",reason:"runtime-partial"}:l.state==="unknown"?{...d,state:"review-only",reason:"runtime-unknown"}:{...d,state:"unaffected",reason:"runtime-compatible"}}return u.length>0?{changeId:s.id,state:"actionable",reason:"high-confidence-impact",sites:a,actionableSites:u}:a.length>0?{changeId:s.id,state:"review-only",reason:"low-confidence-impact",sites:a,actionableSites:u}:i?r?{changeId:s.id,state:"unknown",reason:"impact-unresolved",sites:[],actionableSites:[]}:{changeId:s.id,state:"unknown",reason:"localization-incomplete",sites:[],actionableSites:[]}:{changeId:s.id,state:"unknown",reason:"not-localized",sites:[],actionableSites:[]}})}function kte(e){return e.assessment?_7(e.assessment):e.confidence}function ux(e){let{repo:t,config:n,changes:i,evidence:r,impactSites:o}=e,s=EUe(e),a=Pf(s,o,e.runtimeAnalyses??e.rationale?.flatMap(m=>m.runtimeAnalyses??[])??[],e.localizationRan??!0,e.localizationComplete??!0),c=hte({breakingChanges:s,impactSites:o,dispositions:a,config:n,changes:i,codemods:e.codemods,recipes:e.recipes,fixPlans:e.fixPlans}),l=c.commits,u=y1(i,s,o,(e.rationale??[]).map(m=>m.assessment.runtimeCompatibility),a),d=TUe(e,s,l),{blockers:p,warnings:f}=RUe(e,s,l,u,d);return{schemaVersion:Cf,id:St("plan",t.owner,t.repo,t.afterSha),branchName:AUe(n,i,t.afterSha),baseBranch:t.baseBranch,headSha:t.afterSha,changes:[...i],evidence:[...r],breakingChanges:s,upstreamBreakingCount:s.length,impactSites:[...o],dispositions:a,localizationRan:e.localizationRan??!0,localizationComplete:e.localizationComplete??!0,runtimeConfigComplete:e.runtimeConfigComplete??!0,commits:l,planEdges:c.edges,upgradeCohorts:c.cohorts,...e.rationale?{rationale:[...e.rationale]}:{},risk:u,gaps:d,checkedSurfaces:[...e.checkedSurfaces??[]],confirmedRegressions:[...e.confirmedRegressions??[]],blockers:[...c.blockers,...p],warnings:f,createdAt:new Date().toISOString()}}function EUe(e){let{evidence:t,breakingChanges:n,impactSites:i}=e,r=e.localizationRan??!0,o=e.localizationComplete??!0;return n.map(s=>{let a=i.filter(p=>p.breakingChangeId===s.id),c=Or(s),l=(e.runtimeAnalyses??[]).find(p=>p.changeId===s.id)?.state,u=(e.verification??[]).filter(p=>p.breakingChangeIds!==void 0?p.breakingChangeIds.includes(s.id):p.dependency===void 0?!0:p.dependency===s.dependency&&p.workspace===s.workspace),d=$7({change:s,taxonomy:c,evidence:t,sites:a,localizationRan:r,localizationComplete:o,runtimeState:l,outcomes:u,checkedSurfaces:e.checkedSurfaces??[],gaps:[]});return{...s,taxonomy:c,assessment:d}})}function TUe(e,t,n){let{changes:i,evidence:r,impactSites:o,config:s}=e,a=[],c=e.localizationRan??!0;c&&e.localizationComplete===!1&&t.length>0&&a.push({stage:"localize",surface:"repository source",reason:e.runtimeConfigComplete===!1?"Source localization was incomplete, and at least one authoritative runtime configuration file could not be indexed. Zero local API sites is not an exhaustive absence claim.":"Source localization reached its file limit. Runtime configuration was indexed completely, but zero local API sites is not an exhaustive absence claim.",severity:"blocking",automaticExecution:"blocks",remediation:"Raise the source indexing limit or narrow the scan to the relevant workspace."}),!c&&t.length>0&&a.push({stage:"localize",surface:"repository source",reason:'No checkout was available, so Drift could not search this repository for affected code. Zero impact sites here means "not searched", not "not affected".',severity:"blocking",automaticExecution:"blocks",remediation:"Run Drift as a GitHub Action or from the CLI in a checkout. The webhook runner cannot localize \u2014 see docs/deployment.md."});for(let u of i)r.filter(f=>f.dependency===u.name&&f.workspace===u.workspace).filter(f=>f.source!=="semver-heuristic"&&f.source!=="registry-metadata").length===0&&a.push({stage:"evidence",ecosystem:u.ecosystem,dependency:u.name,surface:"upstream release evidence",reason:`No changelog, release notes, migration guide, or API diff could be retrieved for ${u.name}. Drift will not dispatch a fix based on a version number alone.`,severity:"significant",automaticExecution:s.guardrails.requireEvidence&&t.length>0?"blocks":"degrades",remediation:"Check the package publishes release notes Drift can reach, or review this upgrade by hand."});for(let u of t)o.filter(p=>p.breakingChangeId===u.id).length>0||u_(Or(u))&&a.push({stage:"localize",dependency:u.dependency,surface:`reachability of ${u.symbols.slice(0,3).join(", ")||u.dependency}`,reason:`${u.summary} is only observable at runtime, so searching the source cannot establish whether this repository is affected.`,severity:"significant",automaticExecution:"degrades",remediation:"Confirm by exercising the affected paths, or review the upstream notes directly."});(e.verification??[]).filter(u=>!u.name.startsWith("behavioural:")).length===0&&n.length>0&&a.push({stage:"verify",surface:"build, typecheck, and test",reason:"No checks were run against this plan, so nothing confirms the findings were understood correctly or that a fix would compile.",severity:"significant",automaticExecution:"degrades",remediation:"Configure the repository checks Drift should run, or review the resulting pull request against CI before merging."});for(let u of[...new Set(i.map(d=>d.ecosystem))].sort()){let d=wte(u);for(let p of vte)d.support[p].level==="none"&&a.push({stage:IUe(p),ecosystem:u,surface:m1[p],reason:d.support[p].note??`${m1[p]} does not run for ${u}.`,severity:"significant",automaticExecution:"degrades",remediation:`Drift cannot run this stage for ${u}; review this surface by hand.`})}return a}function IUe(e){switch(e){case"detect":return"detect";case"evidence":case"surface":return"evidence";case"static-analysis":return"localize";case"verify":return"verify";default:return"plan"}}function AUe(e,t,n){return lte({changes:t},{branch:e.pullRequest.branchTemplate,prefix:e.remediation.branchPrefix})}function y1(e,t,n,i=[],r){let o=i.some(p=>p==="unknown"||p==="partial"),s=r?.some(p=>p.state==="review-only"||p.state==="unknown")??!1,a=r?r.flatMap(p=>p.actionableSites):n;if(t.length===0||a.length===0)return o||s?"low":"none";let c="low",l=p=>{N2(p,c)>0&&(c=p)},u=new Set(a.map(p=>p.file)).size;(u>5||a.length>20)&&l("medium"),(u>20||a.length>75)&&l("high");let d=new Set((r??[]).filter(p=>p.state!=="unaffected").map(p=>p.changeId));for(let p of t.filter(f=>d.size===0||d.has(f.id)))(p.kind==="behaviour-change"||p.kind==="default-change")&&l("high"),p.kind==="unknown"&&l("medium"),p.confidence==="low"&&l("medium");for(let p of e)p.bump==="major"&&l("medium"),Tg(p.from,p.to,p.ecosystem)&&l("high");return a.some(p=>$te(p.file))&&l("medium"),c}function RUe(e,t,n,i,r){let{config:o,changes:s,impactSites:a,skipped:c=[]}=e,l=o.guardrails,u=[],d=[],p=[...new Set(n.flatMap(_=>_.files))];p.length>l.maxFilesChanged&&u.push(`This plan would touch ${p.length} files, above the \`maxFilesChanged\` limit of ${l.maxFilesChanged}. A change this wide should be read by a person before an agent starts editing.`),s.length>l.maxDependenciesPerRun&&u.push(`${s.length} dependencies moved in one commit, above the \`maxDependenciesPerRun\` limit of ${l.maxDependenciesPerRun}. Batched upgrades make it hard to attribute a regression to the dependency that caused it.`);let f=p.filter(_=>Yo(l.protectedPaths,_));f.length>0&&u.push(`Impact sites fall inside protected paths: ${f.slice(0,5).join(", ")}${f.length>5?`, +${f.length-5} more`:""}. Drift will not direct an agent to edit these.`);let m=s.filter(_=>Yo(o.alwaysApprove,_.name));m.length>0&&u.push(`${m.map(_=>_.name).join(", ")} matched \`alwaysApprove\` in drift.yml.`);let g=new Set(n.flatMap(_=>_.breakingChangeIds)),h=t.filter(_=>g.has(_.id)&&!MF(kte(_),l.minConfidence));if(h.length>0){let _=h.slice(0,3).map(S=>`\`${S.dependency}\`: ${S.summary}`).join("; ");l.experimentalDispatchBelowMinConfidence?d.push(`${h.length} finding(s) are below the \`minConfidence\` threshold of \`${l.minConfidence}\` but \`experimentalDispatchBelowMinConfidence\` is on, so Drift will dispatch anyway. ${_}.`):u.push(`${h.length} finding(s) Drift planned commits for are below the \`minConfidence\` threshold of \`${l.minConfidence}\`: ${_}. The plan is filed for review rather than dispatched.`)}let b=t.filter(_=>!g.has(_.id)&&!MF(kte(_),l.minConfidence));b.length>0&&d.push(`${b.length} finding(s) are below the \`minConfidence\` threshold and no commit was planned for them. They are listed for awareness.`);let y=r.filter(_=>_.automaticExecution==="blocks");for(let _ of y)u.push(`${_.reason} ${_.remediation}`);mC(i,o.maxAutoRisk)||u.push(`Assessed risk is \`${i}\`, above the \`maxAutoRisk\` ceiling of \`${o.maxAutoRisk}\`.`);let w=a.filter(_=>$te(_.file));w.length>0&&d.push(`${w.length} impact site(s) are in test files. Confirm the fix updates tests to match the new API rather than weakening what they assert.`);let k=t.filter(_=>!a.some(S=>S.breakingChangeId===_.id));k.length>0&&d.push(`${k.length} breaking change(s) were identified upstream but no usage was found in this repository. They are listed for awareness and no commit was planned for them.`);for(let _ of c)d.push(`Skipped \`${_.change.name}\`: ${_.reason}.`);return{blockers:u,warnings:d}}function $te(e){let t=e.toLowerCase();return/(^|\/)(tests?|__tests__|spec|specs|e2e|integration_tests)\//.test(t)||/\.(test|spec)\.[jt]sx?$/.test(t)||/(^|\/)test_[^/]+\.py$/.test(t)||/_test\.(py|go|rb)$/.test(t)||/_spec\.rb$/.test(t)||/Test\.java$/.test(e)||/Tests?\.kt$/.test(e)}function _te(e,t){return t.mode!=="auto"||e.blockers.length>0||e.commits.length===0?!1:mC(e.risk,t.maxAutoRisk)}var Py=require("node:fs/promises"),io=require("node:path");async function Ste(e,t,n){let i=n.replace(/\\/g,"/").trim();if(!i||/[\n\r\0]/.test(i))return null;let r;try{r=await(0,Py.realpath)(e)}catch{return null}let o=(0,io.isAbsolute)(i)||/^[A-Za-z]:\//.test(i)?[i]:[...new Set([t?(0,io.join)(r,t,i):null,(0,io.join)(r,i)].filter(s=>s!==null))];for(let s of o){let a;try{if(a=await(0,Py.realpath)(s),!(await(0,Py.stat)(a)).isFile())continue}catch{continue}let c=(0,io.relative)(r,a);if(!(!c||c.startsWith("..")||(0,io.isAbsolute)(c))&&!c.split(io.sep).includes(".git"))return c.split(io.sep).join("/")}return null}var xte="https://api.osv.dev/v1/query",NUe="https://api.osv.dev/v1/querybatch",CUe="https://api.osv.dev/v1/vulns",Rte={npm:"npm",pypi:"PyPI",go:"Go",cargo:"crates.io",maven:"Maven",rubygems:"RubyGems",nuget:"NuGet",packagist:"Packagist",hex:"Hex",pub:"Pub",swift:"SwiftURL",cocoapods:null,opam:null,conan:null,vcpkg:null,arduino:null};async function Dy(e,t,n,i,r={}){let o=Rte[t];if(!o)return Uo(`OSV has no advisory coverage for ${t} packages, so this upgrade's effect on known vulnerabilities could not be looked up.`);let s=r.fetch??jUe,[a,c]=await Promise.all([s(xte,dx(e,o,n)),s(xte,dx(e,o,i))]);return Nte(a,c,n,i,t)}async function Oy(e,t={}){let n=new Map,i=[];for(let a of e){let c=Rte[a.ecosystem];c?i.push({lookup:a,osvEcosystem:c}):n.set(a,Uo(`OSV has no advisory coverage for ${a.ecosystem} packages, so this upgrade's effect on known vulnerabilities could not be looked up.`))}if(i.length===0)return n;if(i.length===1&&!t.batchFetch){let{lookup:a}=i[0];return n.set(a,await Dy(a.name,a.ecosystem,a.from,a.to,t)),n}if(t.fetch&&!t.batchFetch){let a=await Promise.all(i.map(({lookup:c})=>Dy(c.name,c.ecosystem,c.from,c.to,t)));return i.forEach(({lookup:c},l)=>n.set(c,a[l])),n}let r=i.flatMap(({lookup:a,osvEcosystem:c})=>[dx(a.name,c,a.from),dx(a.name,c,a.to)]),s=await(t.batchFetch??zUe)(r);if(nu(s)){for(let{lookup:a}of i)n.set(a,Uo(`${s.osvFailure}, so this upgrade's effect on known vulnerabilities is unknown.`));return n}for(let a=0;a!b1(d,a)),l=a.filter(d=>!b1(d,s)),u=s.filter(d=>b1(d,a));return{checked:!0,current:s,target:a,resolved:c,introduced:l,carried:u,direction:PUe(c,l)}}function dx(e,t,n){return{version:n,package:{name:e,ecosystem:t}}}function b1(e,t){let n=new Set([e.id,...e.aliases]);return t.some(i=>n.has(i.id)||i.aliases.some(r=>n.has(r)))}function PUe(e,t){return e.length>0&&t.length>0?"mixed":e.length>0?"improves":t.length>0?"worsens":"preserves"}function Uo(e){return{checked:!1,...e?{reason:e}:{},current:[],target:[],resolved:[],introduced:[],carried:[],direction:"unknown"}}function Ete(e,t,n="npm"){let i=e?.vulns;if(!Array.isArray(i))return[];let r=[];for(let o of i)!o.id||o.withdrawn||r.push({id:o.id,aliases:(o.aliases??[]).filter(s=>typeof s=="string"),summary:FUe(o.summary||o.details||"No summary published."),severity:OUe(o),url:LUe(o),fixedIn:MUe(o,t,n)});return Cte(r,n).sort((o,s)=>Tte[o.severity]-Tte[s.severity])}function Cte(e,t="npm"){let n=new Map,i=[];for(let r of e){let o=[r.id,...r.aliases],a=o.map(c=>n.get(c)).find(c=>c!==void 0)??i.push([])-1;i[a].push(r);for(let c of o)n.set(c,a)}return i.filter(r=>r.length>0).map(r=>{let o=r.find(a=>a.severity!=="unknown")??r[0],s=new Set(r.flatMap(a=>[a.id,...a.aliases]));return s.delete(o.id),{...o,aliases:[...s].sort(),fixedIn:DUe(r.map(a=>a.fixedIn),t),summary:r.find(a=>a.summary!=="No summary published.")?.summary??o.summary}})}function DUe(e,t){return e.filter(i=>!!i).map(i=>({raw:i,parsed:Te(i,t)})).filter(i=>i.parsed!==null).sort((i,r)=>Qe(i.parsed,r.parsed)??0)[0]?.raw??e.find(i=>!!i)??null}var Tte={critical:0,high:1,medium:2,low:3,unknown:4};function OUe(e){let t=e.database_specific?.severity??e.affected?.find(r=>r.database_specific?.severity)?.database_specific?.severity??e.affected?.find(r=>r.ecosystem_specific?.severity)?.ecosystem_specific?.severity;if(t){let r=t.toLowerCase();if(r==="critical")return"critical";if(r==="high")return"high";if(r==="moderate"||r==="medium")return"medium";if(r==="low")return"low"}let n=e.severity?.find(r=>r.score)?.score,i=n?Pte(n):null;return i===null?"unknown":i>=9?"critical":i>=7?"high":i>=4?"medium":"low"}function Pte(e){if(!/^CVSS:3\.[01]\//.test(e))return null;let t=new Map;for(let w of e.split("/").slice(1)){let[k,_]=w.split(":");k&&_&&t.set(k,_)}let n={N:.85,A:.62,L:.55,P:.2},i={L:.77,H:.44},r={N:.85,R:.62},o={H:.56,L:.22,N:0},s=t.get("S")==="C",a=s?{N:.85,L:.68,H:.5}:{N:.85,L:.62,H:.27},c=n[t.get("AV")??""],l=i[t.get("AC")??""],u=a[t.get("PR")??""],d=r[t.get("UI")??""],p=o[t.get("C")??""],f=o[t.get("I")??""],m=o[t.get("A")??""];if([c,l,u,d,p,f,m].some(w=>w===void 0))return null;let g=1-(1-p)*(1-f)*(1-m),h=s?7.52*(g-.029)-3.25*(g-.02)**15:6.42*g;if(h<=0)return 0;let b=8.22*c*l*u*d,y=Math.min(s?1.08*(h+b):h+b,10);return Math.ceil(y*10)/10}function MUe(e,t,n="npm"){let i=Te(t,n),r=[];for(let a of e.affected??[])for(let c of a.ranges??[])for(let l of c.events??[])l.fixed&&r.push(l.fixed);if(r.length===0)return null;let o=r.map(a=>({raw:a,parsed:Te(a,n)})).filter(a=>a.parsed!==null);return!i||o.length===0?r[0]??null:(o.filter(a=>(Qe(a.parsed,i)??-1)>0).sort((a,c)=>Qe(a.parsed,c.parsed)??0)[0]??o.sort((a,c)=>Qe(a.parsed,c.parsed)??0)[0])?.raw??null}function LUe(e){return e.references?.find(n=>n.type==="ADVISORY"&&n.url)?.url??`https://osv.dev/vulnerability/${e.id}`}function FUe(e){let t=e.replace(/\s+/g," ").trim(),n=t.search(/\.\s|\.$/),i=n>0?t.slice(0,n+1):t;return i.length>300?`${i.slice(0,299)}\u2026`:i}var Ite=1e4,Ate=2,UUe=200;function nu(e){return typeof e=="object"&&e!==null&&"osvFailure"in e}var jUe=async(e,t)=>Dte(e,t),zUe=async e=>{let t=Array.from({length:e.length},()=>({vulns:[]})),n=e.map((r,o)=>({query:r,index:o}));for(;n.length>0;){let r=await Dte(NUe,{queries:n.map(a=>a.query)});if(nu(r))return r;let o=r?.results;if(!Array.isArray(o)||o.length!==n.length)return{osvFailure:"OSV returned a malformed batch response"};let s=[];for(let a=0;a!!u?.id)),l.next_page_token&&s.push({index:c.index,query:{...c.query,page_token:l.next_page_token}})}n=s}let i=await GUe(t.flatMap(r=>r.vulns));return nu(i)?i:t.map(r=>({vulns:r.vulns.map(o=>i.get(o.id)??o)}))};async function GUe(e){let t=[...new Set(e.map(r=>r.id).filter(r=>!!r))],n=await Promise.all(t.map(async r=>{let o=await VUe(`${CUe}/${encodeURIComponent(r)}`);return nu(o)?o:[r,o]})),i=n.find(nu);return i||new Map(n)}async function Dte(e,t){return Ote(e,{method:"POST",body:JSON.stringify(t)})}async function VUe(e){return Ote(e,{method:"GET"})}async function Ote(e,t){let n=null;for(let i=0;i<=Ate;i+=1){let r=await BUe(e,t);if(!nu(r)||!r.transient||i===Ate)return r;n=r,await HUe(UUe*2**i)}return n??{osvFailure:"OSV could not be reached (network error)"}}async function BUe(e,t){let n=new AbortController,i=setTimeout(()=>n.abort(),Ite);try{let r=await fetch(e,{method:t.method,signal:n.signal,headers:{"Content-Type":"application/json","User-Agent":"drift-bot/0.1 (+https://github.com/trydrift/drift)"},...t.method==="POST"?{body:t.body}:{}});return r.ok?await r.json():{osvFailure:r.status===429?"OSV rate-limited this scan (HTTP 429). Lowering `drift.analysis.concurrency` will fetch fewer advisories at once.":`OSV answered HTTP ${r.status} ${r.statusText}`.trim(),transient:r.status===408||r.status===429||r.status>=500}}catch(r){let o=r;return{osvFailure:o?.name==="AbortError"||o?.name==="TimeoutError"?`OSV did not answer within ${Ite/1e3}s${Mte(o)}`:`OSV could not be reached (${qUe(o)})`,transient:!0}}finally{clearTimeout(i)}}function qUe(e){return`${e?.message||"network error"}${Mte(e)}`}function Mte(e){let t=e?.cause;return t==null?"":`; cause: ${WUe(t)}`}function WUe(e){if(e instanceof Error)return e.message||e.name;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function HUe(e){return new Promise(t=>setTimeout(t,e))}var KUe=gt(Dc(),1);function w1(e){let{name:t,registry:n,repository:i,currentVersion:r,targetVersion:o}=e,s=e.now??new Date,a=[],c=o?.withdrawn??n?.deprecated??void 0;c&&a.push({statement:`The maintainer has withdrawn ${t} ${e.to}: ${c}`,url:n?.homepage??void 0,concerning:!0,polarity:"blocks"}),i?.archived?a.push({statement:"The upstream repository is archived. It will not receive further fixes.",url:i.url,concerning:!0,polarity:"blocks"}):i?.pushedAt&&a.push({statement:`The repository was last pushed to ${v1(i.pushedAt,s)}.`,url:i.url}),r?.withdrawn&&!c&&a.push({statement:`The version currently installed, ${e.from}, has been withdrawn: ${r.withdrawn}`,concerning:!0,polarity:"favors"});let l=YUe(n?.versions??[],e.ecosystem);if(l){let p=Te(e.to,e.ecosystem),f=Te(l,e.ecosystem),m=p&&f?Qe(f,p):null;m===0?a.push({statement:`${e.to} is the latest stable release.`}):m!==null&&m>0&&a.push({statement:`${e.to} is not the latest release; ${l} is also available.`})}o?.releasedAt&&a.push({statement:`The target version was released ${v1(o.releasedAt,s)}.`});let u=JUe(r,o);u&&a.push(u);let d=ZUe(e,l);return d&&a.push(d),{facts:a,...c?{deprecated:c}:{},...i?.archived?{archived:!0}:{},...l?{latestStable:l}:{},...o?.releasedAt?{targetReleasedAt:o.releasedAt}:{}}}function JUe(e,t){let n=e?.runtime,i=t?.runtime;return!i||n&&n.requirement===i.requirement?null:{statement:!n?`The target version requires ${i.name} ${i.requirement}.`:`The required ${i.name} version changed from ${n.requirement} to ${i.requirement}.`,concerning:!1,polarity:"context"}}function ZUe(e,t){let n=Te(e.from,e.ecosystem),i=t?Te(t,e.ecosystem):null;if(!n?.release||!i?.release||e.ecosystem==="maven"||e.ecosystem==="opam")return null;let r=(i.release[0]??0)-(n.release[0]??0);return r<1?null:{statement:`The installed version ${e.from} is ${r} major version${r===1?"":"s"} behind the latest release, ${t}. Maintainers rarely backport fixes that far.`}}function YUe(e,t){return e.map(i=>Te(i,t)).filter(i=>i!==null&&!i.prerelease).sort((i,r)=>-(Qe(i,r)??0))[0]?.raw??null}function v1(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return`on ${e}`;let i=Math.floor((t.getTime()-n.getTime())/864e5);if(i<0)return`on ${n.toISOString().slice(0,10)}`;if(i===0)return"today";if(i===1)return"yesterday";if(i<60)return`${i} days ago`;let r=Math.round(i/30.44);return r<24?`about ${r} months ago`:`about ${Math.round(i/365.25)} years ago`}var QUe=12;async function $1(e){let{name:t,currentVersion:n,targetVersion:i,repository:r,policy:o}=e,s=n?.license??null,a=i?.license??r?.license??null,c=o.enabled?await XUe(e):[],l=p=>_1(p,o),u=c.filter(p=>!p.allowed),d=()=>`This upgrade newly introduces ${u.map(p=>`${p.name} (${p.license??"no declared license"})`).join(", ")}, which the repository policy does not permit.`;if(!a&&!s){if(!l(a)||u.length>0){let p=[];return l(a)||p.push(`Neither ${t} ${e.from} nor ${e.to} declares a license Drift could read. The repository policy requires a declared license.`),u.length>0&&p.push(d()),p.push(`The policy permits ${px(o)}.`),{verdict:"policy-violation",statement:p.join(" "),introduced:c}}return{verdict:o.enabled?"unknown":"ok",statement:o.enabled?`Neither ${t} ${e.from} nor ${e.to} declares a license Drift could read, so this upgrade's licensing position could not be checked.`:"No license metadata was published for either version.",introduced:c}}if(s&&a&&!tje(s,a)){let p=!l(a);if(p||u.length>0){let f=[];return f.push(p?`The declared license changed from ${s} to ${a}, which the repository policy does not permit.`:`The declared license changed from ${s} to ${a}.`),u.length>0&&f.push(d()),f.push(`The policy permits ${px(o)}.`),{verdict:"policy-violation",from:s,to:a,statement:f.join(" "),introduced:c}}return{verdict:"changed",from:s,to:a,statement:`The declared license changed from ${s} to ${a}. It remains within this repository's configured policy.`,introduced:c}}return l(a)?u.length>0?{verdict:"policy-violation",...s?{from:s}:{},...a?{to:a}:{},statement:`${d()} The policy permits ${px(o)}.`,introduced:c}:a?{verdict:"ok",...s?{from:s}:{},to:a,statement:`The license is unchanged at ${a}.`,introduced:c}:{verdict:"unknown",...s?{from:s}:{},statement:`${t} ${e.to} declares no license Drift could read, though ${e.from} declared ${s}.`,introduced:c}:{verdict:"policy-violation",...s?{from:s}:{},...a?{to:a}:{},statement:a?`${t} is licensed ${a}, which the repository policy does not permit. The policy permits ${px(o)}.`:`${t} ${e.to} declares no license Drift could read, though ${e.from} declared ${s}. The repository policy requires a declared license.`,introduced:c}}async function XUe(e){let{currentVersion:t,targetVersion:n,ecosystem:i,policy:r}=e;if(!t||!n)return[];let o=new Set(t.dependencies),s=n.dependencies.filter(c=>!o.has(c)).slice(0,QUe);return s.length===0?[]:await Promise.all(s.map(async c=>{let u=(await ca(c,i,"latest").catch(()=>null))?.license??null;return{name:c,license:u,allowed:_1(u,r)}}))}function _1(e,t){if(!t.enabled)return!0;if(!e)return!t.requireDeclared;let n=eje(e);return t.deny.length>0&&n.some(i=>k1(i,t.deny))?!1:t.allow.length===0?!0:e.includes(" OR ")?n.some(i=>k1(i,t.allow)):n.every(i=>k1(i,t.allow))}function eje(e){return e.replace(/[()]/g," ").split(/\s+(?:OR|AND|WITH)\s+/i).map(t=>t.trim()).filter(Boolean)}function k1(e,t){let n=e.toLowerCase().replace(/\+$/,"");return t.some(i=>i.toLowerCase().replace(/\+$/,"")===n)}function tje(e,t){let n=i=>i.toLowerCase().replace(/[\s._]/g,"-").replace(/-+/g,"-");return n(e)===n(t)}function px(e){return e.allow.length>0?e.allow.join(", "):e.deny.length>0?`anything except ${e.deny.join(", ")}`:"no licenses in particular"}var nje=[{category:"security",pattern:/\b(CVE-\d{4}-\d+|GHSA-[\w-]+|GO-\d{4}-\d+|security fix|vulnerabilit|XSS|CSRF|SSRF|remote code execution|prototype pollution|path traversal|SQL injection|denial of service|ReDoS)\b/i},{category:"breaking",pattern:/\b(BREAKING|breaking change|no longer|has been removed|was removed|is removed|removed entirely|removed support|dropped support|drop support|renamed to|has been renamed|is now required|must now|now (?:requires?|returns?|expects?|accepts?|takes?)|migrate to|migration guide|incompatible)\b/i},{category:"performance",pattern:/\b(faster|speed ?up|sped up|reduces? (?:the )?(?:allocation|memory|latency)|allocation|throughput|optimi[sz]|performance (?:improvement|gain|boost|work|regression)|improv(?:e|es|ed|ing) performance)\b/i},{category:"fix",pattern:/^\s*(?:fix(?:e[sd])?|bugfix|resolve[sd]?|correct(?:s|ed)?)\b/i}];function S1(e){let{dependency:t,evidence:n,breakingChanges:i,impactSites:r}=e,o=new Map;for(let u of r)o.set(u.breakingChangeId,(o.get(u.breakingChangeId)??0)+1);let s=[],a=new Set;for(let u of i){if(u.dependency!==t)continue;let d=o.get(u.id)??0,p=Ute(u.summary);a.has(p)||(a.add(p),s.push({category:"breaking",text:u.summary,...d>0?{affectedSites:d}:{},...Fte(u,n)?{url:Fte(u,n)}:{},...u.citations[0]?{citation:u.citations[0]}:{}}))}let c=0,l=new Map;for(let u of n)if(u.dependency===t&&!(u.source==="semver-heuristic"||u.source==="type-surface-diff"))for(let d of jte(u.content)){let p=Ute(d);if(!p||a.has(p))continue;a.add(p);let f=T1(d);if(f==="breaking"&&s.some(g=>ije(g.text,d)))continue;let m=l.get(f)??0;if(m>=6){c++;continue}l.set(f,m+1),s.push({category:f,text:d,...u.url?{url:u.url}:{},citation:u.id})}return{changes:rje(s),unrelated:c}}function x1(e){return e.changes.filter(t=>t.category==="performance").map(t=>({statement:t.text,...t.url?{url:t.url}:{},...t.citation?{citation:t.citation}:{}}))}function E1(e,t){if(e.length===0)return null;let n=e.filter(o=>o.kind==="package-added").length,i=e.length-n,r=[];return n>0&&r.push(`${n} new package${n===1?"":"s"}`),i>0&&r.push(`${i} new exported symbol${i===1?"":"s"}`),r.length===0?null:{statement:`The target version adds ${r.join(" and ")}, none of which can break existing code. Computed from ${t}.`}}function T1(e){for(let{category:t,pattern:n}of nje)if(n.test(e))return t;return"improvement"}var Lte={breaking:0,security:1,fix:2,performance:3,improvement:4};function rje(e){return[...e].sort((t,n)=>{let i=Lte[t.category]-Lte[n.category];return i!==0?i:(n.affectedSites??0)-(t.affectedSites??0)})}function jte(e){let t=[],n=null;for(let i of e.split(` -`)){let r=i.trim();if(!r||/^[-=]{3,}$/.test(r))continue;if(r.startsWith("#")){n=null;continue}let o=/^[-*+]\s+/.test(r)||/^\d+\.\s+/.test(r),s=r.replace(/^[-*+]\s+/,"").replace(/^\d+\.\s+/,"").trim();if(!(s.length<12)&&!/^(?:by\s+@|thanks|co-authored-by|https?:\/\/\S+$)/i.test(s)){if(!o&&/:\s*$/.test(s)&&T1(s)==="breaking"){n=s;continue}t.push(oje(n&&o?`${n} ${s}`:s,240)),!o&&!/:\s*$/.test(s)&&(n=null)}}return t}function Fte(e,t){for(let n of e.citations){let i=t.find(r=>r.id===n)?.url;if(i)return i}}function ije(e,t){let n=r=>new Set(r.match(/`([^`]+)`/g)??[]),i=n(e);return i.size===0?!1:[...n(t)].some(r=>i.has(r))}function Ute(e){return e.toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}function oje(e,t){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}var zte={critical:0,high:1,medium:2,low:3,unknown:4};function I1(e,t){return zte[e]-zte[t]}function A1(e){return e.reduce((t,n)=>I1(n.severity,t)<0?n.severity:t,"unknown")}var sje=new Set(["behaviour-change","signature-change","default-change","moved-export","runtime-requirement"]);function My(e){let t=[],{security:n,maintenance:i,license:r,impactSites:o}=e,s=o.length,a=new Set(o.map(F=>F.file)).size,c=new Map(e.breakingChanges.map(F=>[F.id,F])),l=o.filter(F=>c.get(F.breakingChangeId)?.kind!=="runtime-requirement"),u=new Set(l.map(F=>F.file)).size,d=o.filter(F=>c.get(F.breakingChangeId)?.kind==="runtime-requirement"),p=e.breakingChanges.filter(F=>F.kind==="runtime-requirement"&&F.runtime?.runtime),f=tx(e.breakingChanges,e.runtimeAnalyses??[]),m=QF(f),g=p.length>0&&XF(m??"unknown"),h=p.length>0?m??"unknown":void 0,b=Pf(e.breakingChanges,o,f,e.localizationRan??!0,e.localizationComplete??!0),y=new Set(b.filter(F=>F.state==="actionable").map(F=>F.changeId)),w=e.breakingChanges.filter(F=>y.has(F.id)),k=new Set(b.flatMap(F=>F.actionableSites.map(K=>`${K.breakingChangeId}:${K.file}:${K.line}`))),_=l.filter(F=>!k.has(`${F.breakingChangeId}:${F.file}:${F.line}`)),S=w.filter(F=>sje.has(F.kind)),x=w.length-S.length,E=Df(e.breakingChanges);n.checked&&(n.resolved.length>0&&t.push(`Fixes ${n.resolved.length} known ${wr(n.resolved.length,"vulnerability","vulnerabilities")} (worst: ${A1(n.resolved)}).`),n.introduced.length>0&&t.push(`Introduces ${n.introduced.length} known ${wr(n.introduced.length,"vulnerability","vulnerabilities")} not present in the installed version (worst: ${A1(n.introduced)}).`),n.carried.length>0&&t.push(`${n.carried.length} known ${wr(n.carried.length,"vulnerability affects","vulnerabilities affect")} both versions; this upgrade does not address ${n.carried.length===1?"it":"them"}.`),n.resolved.length===0&&n.target.length===0&&t.push("No known vulnerabilities were found for the target version."));let T=l.filter(F=>k.has(`${F.breakingChangeId}:${F.file}:${F.line}`));T.length>0&&t.push(E?`${T.length} ${wr(T.length,"place","places")} in ${new Set(T.map(F=>F.file)).size} ${wr(new Set(T.map(F=>F.file)).size,"file","files")} match${T.length===1?"es":""} ${E} entries this upgrade changes.`:`${T.length} ${wr(T.length,"place","places")} in ${new Set(T.map(F=>F.file)).size} ${wr(new Set(T.map(F=>F.file)).size,"file","files")} use${T.length===1?"s":""} an API this upgrade changes.`),_.length>0&&t.push(`${_.length} local API match${_.length===1?"":"es"} require review; Drift did not establish a safe edit.`);for(let F of f)t.push(F.statement);if(d.length>0&&f.length===0&&t.push(...uje(d)),s>0)x>0&&t.push(`${x} of the locally affected changes can be applied mechanically.`),S.length>0&&t.push(`${S.length} locally affected ${wr(S.length,"change requires","changes require")} a developer decision rather than a substitution.`);else if(e.breakingChanges.some(F=>F.kind!=="runtime-requirement")&&!g){let F=e.breakingChanges.filter(K=>K.kind!=="runtime-requirement").length;t.push(E?`${F} published ${E} ${wr(F,"change","changes")} require review; these package-role contracts are assessed independently of source call signatures.`:`${F} upstream API breaking ${wr(F,"change","changes")}; no usage of the changed parts was located in this repository \u2014 review before upgrading.`)}for(let F of i.facts)F.concerning&&t.push(F.statement);r.verdict==="policy-violation"&&t.push(r.statement);let A=aje(e,{affected:s,decisions:S.length,actionable:w.length>0,runtimeUnresolved:g,localizationUnresolved:b.some(F=>F.reason==="localization-incomplete"||F.reason==="impact-unresolved"),roleContractChanged:E!==null}),L=cje(e);return e.gaps.length>0&&t.push(...e.gaps),{recommendation:A,reasons:t,confidence:L.level,confidenceBasis:L.basis,...h?{runtimeCompatibility:h}:{}}}function aje(e,t){let{security:n,maintenance:i,license:r}=e;if(n.checked&&n.introduced.length>0||i.deprecated||r.verdict==="policy-violation"||i.facts.some(a=>a.polarity==="blocks"))return"do-not-upgrade-yet";if(t.affected>0)return t.actionable&&t.decisions>0?"manual-migration-required":"upgrade-after-review";if(t.runtimeUnresolved||t.localizationUnresolved||t.roleContractChanged)return"upgrade-after-review";let o=n.checked&&n.resolved.length>0,s=i.facts.some(a=>a.polarity==="favors");return e.breakingChanges.length===0&&!R1(e)?o||s?"upgrade-recommended":"insufficient-evidence":o||s?"upgrade-recommended":"safe-to-upgrade"}function R1(e){return e.surfaceCompared||(e.proseRead??0)>0||Vte(e).length>0}function Vte(e){return e.evidence.filter(t=>t.dependency===e.dependency&&t.workspace===e.workspace&&(t.source==="github-release"||t.source==="changelog"||t.source==="migration-guide"))}function cje(e){let t=Math.max(Vte(e).length,e.proseRead??0),n=[];if(e.surfaceCompared){let r=Df(e.breakingChanges);n.push(r?`the computed ${r} diff`:"the computed API diff")}return t>0&&n.push(t===1?"release notes":"release notes and changelog"),e.security.checked&&n.push("the OSV advisory database"),n.length===0?{level:"low",basis:"Nothing but the version numbers could be read for this dependency."}:{level:e.surfaceCompared||n.length>=2?"high":"medium",basis:n.length===1?`${Gte(n[0])} is the available evidence.`:`${Gte(lje(n))} agree.`}}function Df(e){let t=e.filter(n=>n.kind!=="runtime-requirement");return t.length===0?null:t.every(n=>n.symbols.some(i=>i.startsWith("pom:")))?"Maven POM contract":t.every(n=>n.symbols.some(i=>i.startsWith("nuget:")))?"NuGet package contract":t.every(n=>n.symbols.some(i=>i.startsWith("pub:")))?"Pub package contract":null}function lje(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function Gte(e){return e.charAt(0).toUpperCase()+e.slice(1)}function uje(e){let t=[],n=e.filter(o=>o.runtimeVerdict!=="partial"&&o.runtimeVerdict!=="unknown"),i=e.filter(o=>o.runtimeVerdict==="partial"),r=e.filter(o=>o.runtimeVerdict==="unknown");if(n.length>0){let o=n.length;t.push(`${o} runtime ${wr(o,"declaration","declarations")} in this repository ${wr(o,"does not satisfy","do not satisfy")} this upgrade's runtime requirement.`)}if(i.length>0){let o=i.length;t.push(`${o} runtime ${wr(o,"declaration allows","declarations allow")} versions this upgrade's runtime requirement rejects.`)}if(r.length>0){let o=r.length;t.push(`${o} runtime ${wr(o,"declaration is","declarations are")} dynamically defined; Drift could not determine whether ${wr(o,"it satisfies","they satisfy")} this upgrade's runtime requirement.`)}return t}function wr(e,t,n){return e===1?t:n}var ru={"safe-to-upgrade":"Safe to upgrade","upgrade-recommended":"Upgrade recommended","upgrade-after-review":"Upgrade after review","manual-migration-required":"Migration required","insufficient-evidence":"Insufficient evidence","do-not-upgrade-yet":"Do not upgrade yet"};var dje={"rate-limited":"rate limited","server-error":"server error","network-error":"network error"};async function N1(e,t){return Br("rationale.prepare",{package:e.name,ecosystem:e.ecosystem,from:e.from,to:e.to},async()=>{let{config:n}=t,i=e.from,r=e.to,o=h=>t.onProgress?.(h);o("Checking package metadata");let s=Wn(e.name,e.ecosystem,r),a=ca(e.name,e.ecosystem,i).catch(()=>null),c=ca(e.name,e.ecosystem,r).catch(()=>null),l=n.rationale.security?(t.securityLookup??Promise.resolve(t.security).then(h=>h?.get(e)).then(h=>h??Dy(e.name,e.ecosystem,i,r,t.osv??{}))).catch(h=>Uo(`Advisory lookup failed unexpectedly (${h instanceof Error?h.message:String(h)}), so this upgrade's effect on known vulnerabilities is unknown.`)):Promise.resolve(Uo("Advisory lookup is switched off for this repository (`rationale.security`), so this upgrade\u2019s effect on known vulnerabilities was not checked.")),u=await s;o("Checking repository status");let d=u?.githubRepo?await YH(u.githubRepo,t.githubToken,(h,b)=>o(`Checking repository status (${dje[b]}, retrying \u2014 attempt ${h})`)).catch(()=>null):null;o("Checking security advisories");let[p,f,m]=await Promise.all([a,c,l]);o("Checking license");let g=await $1({name:e.name,ecosystem:e.ecosystem,from:i,to:r,currentVersion:p,targetVersion:f,repository:d,policy:n.licenses});return{registry:u,repository:d,currentVersion:p,targetVersion:f,security:m,license:g}})}async function fx(e,t){let n=e.changes.filter(s=>s.from&&s.to),i=n.filter(s=>!t.preparedFacts?.has(s)),r=i.map(s=>({name:s.name,ecosystem:s.ecosystem,from:s.from,to:s.to})),o=t.config.rationale.security?Oy(r,t.osv??{}).then(s=>new Map(i.map((a,c)=>[a,s.get(r[c])]))):void 0;return qn(n,4,async s=>{try{return await pje(s,e,{...t,security:o})}catch(a){return t.logger.debug(`Rationale failed for ${s.name}: ${a.message}`),bje(s,`Drift could not assemble an upgrade rationale for ${s.name}.`)}})}async function pje(e,t,n){let i=s=>n.onProgress?.(e,s),r=n.preparedFacts?.get(e),o=await(r??N1(e,{config:n.config,...n.githubToken?{githubToken:n.githubToken}:{},...n.osv?{osv:n.osv}:{},...n.security?{security:n.security}:{},onProgress:i}));return fje(e,t,o,n,{shared:r!==void 0})}async function fje(e,t,n,i,r){return Br("rationale.finalize",{package:e.name,ecosystem:e.ecosystem,from:e.from,to:e.to,shared:r?.shared??i.preparedFacts?.has(e)??!1},async()=>{let{config:o,logger:s}=i,a=e.from,c=e.to,l=D=>i.onProgress?.(e,D),{registry:u,repository:d,currentVersion:p,targetVersion:f,security:m,license:g}=n,h=t.breakingChanges.filter(D=>D.dependency===e.name&&D.workspace===e.workspace),b=new Set(h.map(D=>D.id)),y=t.impactSites.filter(D=>b.has(D.breakingChangeId)),w=(t.runtimeAnalyses??[]).filter(D=>b.has(D.changeId));l("Checking maintenance signals");let k=o.rationale.maintenance?w1({name:e.name,ecosystem:e.ecosystem,from:a,to:c,registry:u,repository:d,currentVersion:p,targetVersion:f,repoRuntime:(e.workspace!==void 0?i.repoRuntimeByWorkspace?.get(e.workspace):void 0)??i.repoRuntime,pythonRuntime:(e.workspace!==void 0?i.pythonRuntimeByWorkspace?.get(e.workspace):void 0)??i.pythonRuntime,analyzedRuntimeRequirements:w.map(D=>({runtime:D.runtime,requirement:D.requirement}))}):{facts:[]},_=cn(e),S=i.additions?.get(_),x=i.surfaceCompared?.has(_)??S!==void 0,E=o.rationale.summary?S1({dependency:e.name,evidence:t.evidence,breakingChanges:h,impactSites:y,additions:S?.additions}):{changes:[],unrelated:0},T=[...x1(E)],A=S?E1(S.additions,S.locator):null;A&&T.push(A);let L=i.prose?.get(_)??i.prose?.get(e.name)??[],F=mje(e,{surfaceCompared:x,surfaceGap:i.surfaceGaps?.get(_),security:m,registry:u,evidence:t.evidence,prose:L,licenseUnknown:g.verdict==="unknown"}),K={dependency:e.name,workspace:e.workspace,breakingChanges:h,impactSites:y,evidence:t.evidence,security:m,maintenance:k,license:g,gaps:F,surfaceCompared:x,proseRead:L.length,runtimeAnalyses:w,localizationRan:t.localizationRan,localizationComplete:t.localizationComplete},te=My(K);return s.debug(`${e.name} ${a} \u2192 ${c}: ${te.recommendation}`),{dependency:e.name,from:a,to:c,security:m,maintenance:k,improvements:T,license:g,summary:E,assessment:te,runtimeAnalyses:w.map(({changeId:D,runtime:X,requirement:re,state:ie,reason:ke,statement:We})=>({changeId:D,runtime:X,requirement:re,state:ie,reason:ke,statement:We})),gaps:F,hasCompatibilityEvidence:R1(K)}})}function mje(e,t){let n=[],i=t.evidence.filter(s=>s.dependency===e.name&&s.workspace===e.workspace&&(s.source==="github-release"||s.source==="changelog"||s.source==="migration-guide")),r=t.surfaceGap,o=i.length>0?null:t.prose.length>0?t.surfaceCompared?null:`Drift read ${hje(t.prose)} for ${e.name} ${e.to} and found nothing in ${t.prose.length===1?"it":"them"} that announces a breaking change. That is weaker than a clean API comparison: it means nothing was flagged, not that nothing broke.`:`No release notes, changelog, or migration guide was reachable for ${e.name} ${e.to}${t.registry?.githubRepo?"":", and no source repository could be resolved for it"}.`;return r&&o?n.push(`${qte(r.detail)}. ${o}${r.remedy?` ${r.remedy}`:""}`):r?n.push(`${qte(r.detail)}.${r.remedy?` ${r.remedy}`:""}`):o&&n.push(o),t.security.checked||n.push(t.security.reason??"The OSV advisory database could not be reached, so this upgrade's effect on known vulnerabilities is unknown."),yje(n)}var gje={"github-release":{one:"the release notes",many:"sets of release notes"},changelog:{one:"the changelog",many:"changelog files"},"migration-guide":{one:"the migration guide",many:"migration guides"}};function hje(e){let t=i=>e.filter(r=>r.kind===i),n=[];for(let i of["github-release","changelog","migration-guide"]){let r=t(i);if(r.length===0)continue;let o=gje[i];if(r.length===1){n.push(`${o.one} (${Bte(r[0])})`);continue}n.push(`${r.length} ${o.many} (${r.map(Bte).join(", ")})`)}return n.length===0?"the published release prose":n.length===1?n[0]:`${n.slice(0,-1).join(", ")} and ${n.at(-1)}`}function Bte(e){return`[${e.label}](${e.url})`}function yje(e){let t=new Set,n=[];for(let i of e){let r=i.toLowerCase().replace(/[^a-z0-9]+/g," ").trim();t.has(r)||(t.add(r),n.push(i))}return n}function qte(e){return e.replace(/\.\s*$/,"")}function bje(e,t){return{dependency:e.name,from:e.from??"",to:e.to??"",security:{checked:!1,current:[],target:[],resolved:[],introduced:[],carried:[],direction:"unknown"},maintenance:{facts:[]},improvements:[],license:{verdict:"unknown",statement:"Not checked.",introduced:[]},summary:{changes:[],unrelated:0},hasCompatibilityEvidence:!1,assessment:{recommendation:"insufficient-evidence",reasons:[t],confidence:"low",confidenceBasis:t},gaps:[t]}}var Kte=require("node:crypto"),Ni=require("node:fs/promises"),gx=require("node:os"),iu=require("node:path"),Jte=require("node:url"),Zte=require("node:child_process");var Aje={},Yte="behavioural-diff-npm-ts-v1",vje=new Set(["behaviour-change","default-change","type-change","signature-change","required-field-added"]);function wje(e,t){let n=t.verification.behavioural;if(!n.enabled)return[];let i=[];for(let r of e.breakingChanges){if(!vje.has(r.kind))continue;let o=e.impactSites.filter(a=>a.breakingChangeId===r.id);if(o.length===0)continue;let s=Or(r);if(!(!s.nature.includes("behaviour")&&s.nature!=="type-contract"&&r.kind!=="default-change"))for(let a of r.symbols.slice(0,n.maxSymbols-i.length)){let c=_je(r),l=[{id:"default",args:[],contracts:c}],u=new Set;for(let d of o){if(l.length>=n.maxCasesPerSymbol)break;if(d.matchedSymbol!==a)continue;let p=kje(d.excerpt,a);if(!p)continue;let f=JSON.stringify(p);u.has(f)||(u.add(f),l.push({id:`site-${l.length}`,args:p,contracts:c}))}if(i.push({dependency:r.dependency,workspace:r.workspace,symbol:a,modulePath:"",exportName:a,cases:l}),i.length>=n.maxSymbols)return i}}return i}function kje(e,t){let i=new RegExp(`\\b${$je(t)}\\s*\\(([^;]*)\\)`).exec(e);if(!i)return null;let r=i[1].trim();if(r==="")return[];let o=`[${r}]`.replace(/'/g,'"').replace(/([{,]\s*)([A-Za-z_$][\w$]*)\s*:/g,'$1"$2":');try{let s=JSON.parse(o);return Array.isArray(s)?s:null}catch{return null}}function $je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _je(e){switch(e.kind){case"default-change":return["configured-defaults","return-shape"];case"type-change":case"signature-change":case"required-field-added":return["return-shape","thrown-error","argument-mutation","promise-state"];case"behaviour-change":return["return-shape","thrown-error","argument-mutation","promise-state","serialization-output"];default:return["return-shape"]}}async function Sje(e){let{config:t,oldEnvironment:n,newEnvironment:i}=e,r=e.probes.slice(0,t.maxSymbols),o=[],s=[];if(!t.enabled)return{evidence:[],observations:[],gaps:["behavioural probing disabled"]};if(t.sandbox!=="required")return{evidence:[],observations:[],gaps:["behavioural probing requires a sandbox"]};for(let a of r){let c=a.cases.slice(0,t.maxCasesPerSymbol);for(let l of c){let u=await mx(t,n,a,l),d=await mx(t,n,a,l),p=await mx(t,i,a,l),f=await mx(t,i,a,l),m=!C1(u,d)||!C1(p,f);o.push({dependency:a.dependency,workspace:a.workspace,symbol:a.symbol,caseId:l.id,generatedInput:l.args,oldResult:u,newResult:p,observedDifference:m?"nondeterministic result; no compatibility conclusion drawn":Eje(u,p),nondeterministic:m,limitations:Tje(t,l.contracts)})}}return{observations:o,gaps:s,evidence:o.map(Qte)}}async function xje(){return typeof __dirname<"u"?(0,iu.join)(__dirname,"behavioural-worker.js"):(0,Jte.fileURLToPath)(new URL("./behavioural-worker.js",Aje.url))}async function mx(e,t,n,i){let r=await(0,Ni.mkdtemp)((0,iu.join)((0,gx.tmpdir)(),"drift-behavioural-")),o=await(0,Ni.realpath)(r),s=(0,iu.join)(r,"case.json"),a=await(0,Ni.realpath)(await xje()),c=(0,iu.resolve)(t.modulePath||n.modulePath),l=await(0,Ni.realpath)(c),u=(0,iu.resolve)(t.packageRoot);await(0,Ni.writeFile)(s,JSON.stringify({modulePath:l,exportName:n.exportName,args:i.args,network:e.network}));let d=[a,u,await(0,Ni.realpath)(u),c,l,s,await(0,Ni.realpath)(s)],p=[Number(process.versions.node.split(".")[0])>=24?"--permission":"--experimental-permission",...[...new Set(d)].map(f=>`--allow-fs-read=${f}`),`--max-old-space-size=${e.memoryMb}`,a,s];try{return await new Promise(f=>{let m=(0,Zte.spawn)(process.execPath,p,{stdio:["ignore","pipe","pipe"],env:{PATH:process.env.PATH??"",HOME:o,TMPDIR:o,DRIFT_BEHAVIOURAL_SANDBOX:"1"}});if(m.pid&&e.cpuLimit<1)try{(0,gx.setPriority)(m.pid,Math.round(10*(1-e.cpuLimit)))}catch{}let g="",h="",b=64*1024,y=setTimeout(()=>{m.kill("SIGKILL")},e.timeoutSeconds*1e3);m.stdout.on("data",w=>{g=(g+w.toString("utf8")).slice(-b)}),m.stderr.on("data",w=>{h=(h+w.toString("utf8")).slice(-b)}),m.on("close",(w,k)=>{if(clearTimeout(y),k){f({status:"timed-out",signal:k,stdoutDigest:Ly(g),stderrDigest:Ly(h)});return}let _=g.trim().split(` -`).at(-1)??"",S=Ije(_);f(S??{status:"worker-failed",stdoutDigest:Ly(g),stderrDigest:Ly(h)})}),m.on("error",w=>{clearTimeout(y),f({status:"worker-failed",error:{name:w.name,messageCategory:"spawn"}})})})}finally{e.retainArtifacts||await(0,Ni.rm)(r,{recursive:!0,force:!0}).catch(()=>{})}}function C1(e,t){return JSON.stringify(Wte(e))===JSON.stringify(Wte(t))}function Wte(e){return{status:e.status,value:e.value??null,error:e.error??null,mutations:e.mutations??[]}}var Hte=new Set(["worker-failed","timed-out"]);function Eje(e,t){return Hte.has(e.status)&&Hte.has(t.status)?`probe unavailable: neither version could be observed (${e.status})`:C1(e,t)?"no observed difference for this contract and generated input domain":e.status!==t.status?`status changed from ${e.status} to ${t.status}`:JSON.stringify(e.value??null)!==JSON.stringify(t.value??null)?"returned value changed":JSON.stringify(e.error??null)!==JSON.stringify(t.error??null)?"thrown error changed":JSON.stringify(e.mutations??[])!==JSON.stringify(t.mutations??[])?"argument mutation changed":"observable result changed"}function Tje(e,t){let n=[`Harness ${Yte}; bounded to ${t.join(", ")||"return-shape"} contracts.`,"No observed difference is not proof of behavioural compatibility outside these generated inputs.",`CPU limit requested: ${e.cpuLimit} (best-effort process priority; no OS-level quota). Node subprocess enforces wall-clock, memory, output, filesystem, and network policy, and cannot spawn its own children or threads \u2014 the wall-clock timeout is the actual hard bound on CPU consumption.`];return e.network||n.push("Network APIs were disabled for the probe."),n}function Qte(e){let t=JSON.stringify({generatedInput:e.generatedInput,normalizedOldResult:e.oldResult,normalizedNewResult:e.newResult,observedDifference:e.observedDifference,testHarnessVersion:Yte,nondeterminismHandling:e.nondeterministic?"Repeated runs disagreed, so Drift records the observation but draws no compatibility conclusion.":"Old and new observations were repeated once and matched within each version.",limitations:e.limitations},null,2);return{id:`ev_behaviour_${Ly(`${e.workspace??""}:${e.dependency}:${e.symbol}:${e.caseId}`).slice(0,12)}`,source:"behavioural-diff",dependency:e.dependency,...e.workspace!==void 0?{workspace:e.workspace}:{},locator:`${e.symbol}:${e.caseId}`,title:`Behavioural differential probe for ${e.symbol}`,content:t,weight:e.observedDifference.startsWith("probe unavailable")?0:e.observedDifference.startsWith("no observed difference")?.25:.8,findings:[{code:"behavioural-observation",symbol:e.symbol,detail:e.observedDifference}]}}async function Xte(e){let t=e.config.verification.behavioural,n=[],i=new Map,r=[];if(!t.enabled)return{evidence:n,citationsByChangeId:i,gaps:r};let o=wje({breakingChanges:e.breakingChanges,impactSites:e.impactSites},e.config);if(o.length===0)return{evidence:n,citationsByChangeId:i,gaps:r};let s=new Map;for(let a of o){let c=zc({name:a.dependency,workspace:a.workspace}),l=s.get(c);l?l.probes.push(a):s.set(c,{dependency:a.dependency,workspace:a.workspace,probes:[a]})}for(let{dependency:a,workspace:c,probes:l}of s.values()){let u=e.dependencyChanges.find(f=>f.name===a&&f.workspace===c&&f.ecosystem==="npm");if(!u?.from||!u.to){r.push(`${a}: behavioural probing needs both a resolved old and new version; skipped.`);continue}let d=await e.resolveEnvironments(u);if(!d){r.push(`${a}: could not resolve ${u.from} and ${u.to} to executable code for behavioural probing; skipped.`);continue}let p=await Sje({config:t,probes:l,oldEnvironment:d.oldEnvironment,newEnvironment:d.newEnvironment});r.push(...p.gaps);for(let f of p.observations){let m=Qte(f);n.push(m);for(let g of e.breakingChanges){if(g.dependency!==a||g.workspace!==c||!g.symbols.includes(f.symbol))continue;let h=i.get(g.id);h?h.push(m.id):i.set(g.id,[m.id])}}}return{evidence:n,citationsByChangeId:i,gaps:r}}function ene(e){return e.startsWith("probe unavailable")?"probe-unavailable":e.startsWith("no observed difference")?"no-difference":e.includes("returned value changed")?"return-value":e.startsWith("status changed")?"thrown-error":e.includes("argument mutation")?"argument-mutation":"behaviour"}function Ije(e){try{return JSON.parse(e)}catch{return null}}function Ly(e){return(0,Kte.createHash)("sha256").update(e).digest("hex")}var oo=require("node:fs/promises"),nne=require("node:os"),ou=require("node:path");function Rje(e){return Nje(e.exports)??e.module??e.main??"index.js"}function Nje(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e,n="."in t?t["."]:t,i=(r,o)=>{if(o>6||r==null)return null;if(typeof r=="string")return r;if(typeof r!="object")return null;let s=r;for(let a of["import","require","default","node"]){if(!(a in s))continue;let c=i(s[a],o+1);if(c)return c}return null};return i(n,0)}var tne="https://cdn.jsdelivr.net/npm";async function P1(e,t,n){let i=await $e(`${tne}/${t}@${n}/package.json`);if(!i)return null;let r=Rje(i).replace(/^\.\//,""),o=await rt(`${tne}/${t}@${n}/${r}`);if(o===null)return null;let s=await(0,oo.mkdtemp)((0,ou.join)((0,nne.tmpdir)(),"drift-behavioural-env-")),a=(0,ou.join)(s,r);return await(0,oo.mkdir)((0,ou.dirname)(a),{recursive:!0}),await(0,oo.writeFile)(a,o),await(0,oo.writeFile)((0,ou.join)(s,"package.json"),JSON.stringify(i)),{label:e,packageRoot:await(0,oo.realpath)(s),modulePath:await(0,oo.realpath)(a)}}var Tx=require("node:path");function D1(){return{probes:new Map}}function Cje(e,t,n,i){let r=Pje(t,n),o=i?.probes.get(r);if(o)return o;let s=e(t,["--version"],{timeoutMs:2e4,...n?{env:n}:{}}).then(a=>a.failure!=="not-found").catch(()=>!0);return i?.probes.set(r,s),s}async function rne(e,t,n,i){let r=[...new Set(t)],o=await Promise.all(r.map(s=>Cje(e,s,n,i)));return new Map(r.map((s,a)=>[s,o[a]]))}function Pje(e,t){let n=t??process.env,i=n.PATH??n.Path??n.path??"",r=n.PATHEXT??n.PathExt??"";return JSON.stringify([e,i,r,process.platform])}var hx=require("node:os");function yx(){try{return Math.max(1,(0,hx.availableParallelism)())}catch{return 4}}function Dje(){try{return Math.max(2,Math.floor((0,hx.totalmem)()/(512*1024*1024)))}catch{return 8}}function O1(e,t,n){return Math.max(t,Math.min(n,Math.floor(e)))}function M1(e,t){let n=t[e];if(!n)return;let i=Number(n);return Number.isFinite(i)&&i>=1?Math.floor(i):void 0}function bx(e=process.env){return M1("DRIFT_NETWORK_CONCURRENCY",e)??O1(yx()*4,8,32)}function L1(e=process.env){return M1("DRIFT_CONCURRENCY",e)??O1(Math.min(yx()*2,Dje()),4,16)}function vx(e=process.env){return M1("DRIFT_LOCAL_CONCURRENCY",e)??O1(yx()/4,2,6)}function ine(e=process.env){return`${yx()} cores \xB7 ${bx(e)} network, ${L1(e)} analysis, ${vx(e)} local`}var F1=require("node:crypto");var Oje=1,wvt=10080*60*1e3;function one(e){let t=(0,F1.createHash)("sha256");t.update(`v${Oje} +`);if(f.length!==m.length)return o.debug(`${t.name} changed the line count of ${d}; that is not expressible as a Drift operation.`),null;for(let g=0;g0?(o.info(`Drift could not re-derive what ${t.name}@${t.version} did to ${u.unexplained.length||c.length} line(s), so it will not apply it. This finding falls through to an agent.`),null):(l&&o.info(`${t.name}@${t.version} also changed files outside this finding's call sites; those edits were not learned from and will not be applied.`),SG({change:n,dependencyChange:e.dependencyChange,migration:t.migration,rationale:`Inferred from ${c.length} edit(s) made by ${t.name}@${t.version} in an isolated worktree, then re-derived as Drift operations. The recipe's own output was discarded.`,citations:[],ops:u.ops,provenance:{author:"recipe",recipe:{name:t.name,version:t.version,publisher:t.publisher,source:t.source},authoredAt:new Date().toISOString()}}))}async function a4e(e,t,n){let r=await n("git",["show",`HEAD:${t}`],{cwd:e});if(r.code!==0)return null;try{return{before:r.stdout,after:await(0,xae.readFile)((0,Eae.join)(e,t),"utf8")}}catch{return null}}async function Aae(e){let{change:t,candidate:n,sites:r,workspace:i,headSha:o,logger:s}=e;if(!n)return null;let a=new Set(r.filter(c=>c.breakingChangeId===t.id).map(c=>c.file));if(a.size===0)return null;try{return await mae(i,`fixplan-${n.provider}`,c=>Tae({candidate:n,change:t,dependencyChange:e.dependencyChange,sandbox:c.path,relevantFiles:a,logger:s}),{at:o,...e.env?{env:e.env}:{},copyIgnoredFiles:!1})}catch(c){return s.warn(`Could not observe ${n.name}@${n.version} in an isolated worktree (${c.message}); this finding gets no recipe-derived fix plan.`),null}}var c4e="https://api.codemod.com",PG="https://search.maven.org",CG=6e3;async function Rae(e,t){if(!t)return null;let n=Cae(t.name),r=t.name.toLowerCase(),i=`${c4e}/registry?search=${encodeURIComponent(n)}`,o=await Ie(i,{timeoutMs:CG,cacheTtlMs:3600*1e3});if(!o)return null;let s=Array.isArray(o)?o:o.entries??o.results??o.data??[];if(!Array.isArray(s))return null;let a=s.map(p=>({entry:p,confidence:l4e(p,r,n)})).filter(p=>p.confidence!=="none");if(a.length===0)return null;let c={exact:2,"base-name":1,text:0};a.sort((p,f)=>c[f.confidence]-c[p.confidence]||Number(RG(f.entry))-Number(RG(p.entry)));let l=a[0].entry,u=l.slug??l.name,d=l.version??l.latestVersion;return!u||!d?null:{provider:"codemod.com",name:u,version:d,publisher:l.owner?.name??l.author??l.publisher??"Codemod.com",source:`https://app.codemod.com/registry/${encodeURIComponent(l.slug??u)}`,migration:l.description??l.summary??`Migrates ${t.name} usages.`,official:RG(l)}}function l4e(e,t,n){let r=e.applicability?.flatMap(s=>s.packages??[])??[];if(r.some(s=>s.toLowerCase()===t))return"exact";if(r.some(s=>!s.includes("/")&&s.toLowerCase()===n))return"base-name";let i=`${e.slug??""} ${e.name??""} ${e.description??""} ${e.summary??""}`.toLowerCase(),o=new RegExp(`(?:^|[^a-z0-9])${u4e(n)}(?:$|[^a-z0-9])`);return n&&o.test(i)?"text":"none"}function u4e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function RG(e){if(e.verified||e.official)return!0;let t=(e.owner?.name??e.owner?.slug??e.author??e.publisher??"").toLowerCase();return t==="codemod"||t==="codemod.com"}var d4e=/\borg\.openrewrite\.[a-zA-Z0-9_.]*[A-Z][a-zA-Z0-9_]*\b/;async function Pae(e,t){if(!t||t.ecosystem!=="maven")return null;let n=Cae(t.name).replace(/[^a-z0-9]/g,"-"),r=await Iae(`rewrite-${n}`)??await Iae(n);if(!r?.latestVersion)return null;let i=await p4e(r.g,r.a,r.latestVersion),o=i?d4e.exec(i)?.[0]:void 0;return o?{provider:"openrewrite",name:o,version:r.latestVersion,publisher:"OpenRewrite",source:`${PG}/artifact/${r.g}/${r.a}/${r.latestVersion}`,migration:i??`Runs ${o} from ${r.g}:${r.a}.`,official:!0}:null}async function Iae(e){let t=encodeURIComponent(`g:org.openrewrite.recipe AND a:${e}`),n=`${PG}/solrsearch/select?q=${t}&core=gav&rows=1&wt=json`,i=(await Ie(n,{timeoutMs:CG,cacheTtlMs:3600*1e3}))?.response?.docs?.[0];return i?.g==="org.openrewrite.recipe"?i:null}async function p4e(e,t,n){let r=e.replace(/\./g,"/"),i=`${PG}/remotecontent?filepath=${r}/${t}/${n}/${t}-${n}.pom`,o=await ot(i,{timeoutMs:CG,cacheTtlMs:1440*60*1e3,immutable:!0});if(!o)return null;let s=/([\s\S]*?)<\/description>/.exec(o);return s?s[1].trim():null}function Cae(e){return e.replace(/^@[^/]+\//,"").toLowerCase()}var f4e=[Rae,Pae];async function Nae(e,t,n=f4e){let i=(await Promise.all(n.map(o=>o(e,t).catch(()=>null)))).filter(o=>o!==null);return i.length===0?null:(i.sort((o,s)=>Number(s.official)-Number(o.official)),i[0])}var Dae={branch:"{prefix}upgrade-{summary}-{date}",title:"chore(deps): upgrade {summary}",prefix:"drift/"};function Mae(e,t){let{changes:n}=e,r=e.now??new Date,i=n[0],o=i?n.length===1?`${i.name}-${i.from??"unknown"}-to-${i.to??"unknown"}`:`${n.length}-packages`:"dependencies",s=i?n.length===1?`${i.name} to ${i.to??"a new version"}`:`${n.length} packages`:"dependencies";return{prefix:t,summary:o,"summary-text":s,name:i?.name??"dependencies",from:i?.from??"",to:i?.to??"",count:String(n.length),date:r.toISOString().slice(0,10)}}function Lae(e,t){return e.replace(/\{([a-z-]+)\}/g,(n,r)=>t[r]??n)}function Oae(e){return(e.toLowerCase().replace(/[^a-z0-9/_.-]+/g,"-").replace(/(?<=[^/])\/(?=[^/])/g,"-").replace(/\.{2,}/g,".").replace(/-{2,}/g,"-").replace(/^[-./]+|[-./]+$/g,"").replace(/\.lock$/,"-lock")||"drift-upgrade").slice(0,200).replace(/[-./]+$/,"")}function Fae(e,t={}){let n={...Dae,...t},r=n.prefix?`${n.prefix.replace(/\/+$/,"")}/`:"",i=Lae(n.branch,Mae(e,r));return i.startsWith(r)&&r?`${r}${Oae(i.slice(r.length))}`:Oae(i)}function Uae(e,t={}){let n={...Dae,...t},r=Mae(e,n.prefix);return Lae(n.title,{...r,summary:r["summary-text"]}).trim()}var jae={"runtime-requirement":0,"config-change":1,"module-system-change":1,"moved-export":1,"removed-export":2,"renamed-export":2,"removed-endpoint":3,"changed-endpoint":3,"signature-change":4,"type-change":4,"required-field-added":5,"default-change":5,"behaviour-change":6,unknown:7};function m4e(e){switch(e){case"runtime-requirement":case"config-change":case"module-system-change":return"build";case"behaviour-change":case"default-change":return"fix";default:return"refactor"}}function qae({breakingChanges:e,impactSites:t,dispositions:n,config:r,changes:i=[],codemods:o,recipes:s,fixPlans:a}){let c=g4e(t),l=new Map((n??[]).map(w=>[w.changeId,w.actionableSites])),u=new Map(n?.map(w=>[w.changeId,w])),d=e.filter(w=>{let k=u.get(w.id);return k?k.state==="actionable"&&k.actionableSites.length>0:(c.get(w.id)??[]).some(x=>x.confidence==="high"&&x.runtimeVerdict===void 0)});if(d.length===0)return{commits:[],edges:[],cohorts:Bae(i),blockers:[]};let f=[...r.remediation.commitGranularity==="single"?[d]:r.remediation.commitGranularity==="per-dependency"?h4e(d):d.map(w=>[w])].sort(y4e),m=Bae(i),g=new Map;for(let w of m)for(let k of w.dependencies)g.set(k,w);let h=f.map((w,k)=>b4e(w,k+1,l,f.length,o,s,a)),v=k4e(h,e,t,g),b=E4e(h,v),_=b.cycle.length>0?T4e(b.cycle,v):void 0;return{commits:b.commits,edges:v,cohorts:m,blockers:_?[_]:[]}}function g4e(e){let t=new Map;for(let n of e){let r=t.get(n.breakingChangeId);r?r.push(n):t.set(n.breakingChangeId,[n])}return t}function h4e(e){let t=new Map;for(let n of e){let r=t.get(n.dependency);r?r.push(n):t.set(n.dependency,[n])}return[...t.values()]}function y4e(e,t){let n=Math.min(...e.map(s=>jae[s.kind])),r=Math.min(...t.map(s=>jae[s.kind]));if(n!==r)return n-r;let i=e[0]?.dependency??"",o=t[0]?.dependency??"";return i.localeCompare(o)}function b4e(e,t,n,r,i,o,s){let a=e.flatMap(f=>n.get(f.id)??[]),c=[...new Set(a.map(f=>f.file))].sort(),l=e[0],u=i?w4e(e,n,i):void 0,d=!u&&s?v4e(e,n,s):void 0,p=!u&&o?_4e(e,o):void 0;return{id:Pt("unit",e.map(f=>f.id).sort().join(","),c.join(","),l.dependency,l.kind),order:t,message:C4e(e,c.length),body:D4e(e,a,u,p),breakingChangeIds:e.map(f=>f.id),files:c,allowedFiles:c,allowedSymbols:[...new Set(e.flatMap(f=>f.symbols))].sort(),instructions:M4e(e,a,t,r),dependsOn:[],dependencyReasons:[],executionLayer:0,expectedChecks:A4e(e,c),invalidationTriggers:I4e(e,c),...u?{codemod:u}:{},...d?{fixPlan:d}:{},...p?{recipe:p}:{}}}function v4e(e,t,n){let r=e.map(a=>n.get(a.id)).filter(a=>!!a);if(r.length===0)return;let i=e.filter(a=>!n.has(a.id)).flatMap(a=>(t.get(a.id)??[]).map(c=>({file:c.file,line:c.line,reason:`No fix plan was accepted for "${a.summary}", so this site needs an agent.`}))),o=r[0],s=r.flatMap(a=>a.anchors);return{plan:o.plan,assurance:r.some(a=>a.assurance==="checked")?"checked":"proven",files:[...new Set(s.map(a=>a.file))].sort(),anchors:s,covered:r.reduce((a,c)=>a+c.covered,0),residual:r.reduce((a,c)=>a+c.residual,0)+i.length,residualSites:[...r.flatMap(a=>a.sites.filter(c=>c.status==="residual").map(c=>({file:c.file,line:c.line,reason:c.reason??"No rule matched."}))),...i]}}function _4e(e,t){let n=[];for(let r of e){let i=t.get(r.id);if(!i)return;n.push(i)}return n.length>0?n:void 0}function w4e(e,t,n){let r=new Set,i=[];for(let o of e){let s=t.get(o.id)??[],a=n.get(o.id);if(!a||a.sitesResolvedl.file))];if(c.some(l=>r.has(l)))return;for(let l of c)r.add(l);i.push({...a.transform,files:c})}return i.length>0?i:void 0}function k4e(e,t,n,r){let i=new Map,o=new Map(t.map(c=>[c.id,c])),s=new Map;for(let c of n){let l=s.get(c.file);l?l.push(c):s.set(c.file,[c])}let a=(c,l,u,d)=>{if(c.id===l.id)return;let p=`${c.id}\0${l.id}\0${u}`;i.has(p)||i.set(p,{from:c.id,to:l.id,reason:u,evidence:[...new Set(d)].sort()})};for(let c=0;cf.dependency)),p=new Set(l.allowedFiles);for(let f=c+1;fw.dependency)),v=m.allowedFiles.filter(w=>p.has(w));v.length>0&&a(l,m,"same-file-conflict",v),u.some(w=>w.kind==="runtime-requirement")&&a(l,m,"runtime-prerequisite",u.map(w=>w.summary)),u.some(w=>w.kind==="config-change"||w.kind==="module-system-change")&&g.some(w=>d.has(w.dependency))&&a(l,m,"configuration-prerequisite",u.map(w=>w.summary)),u.some(w=>w.kind==="moved-export")&&S4e(u,g)&&a(l,m,"import-prerequisite",u.flatMap(w=>w.symbols)),l.allowedFiles.some(NG)&&!m.allowedFiles.every(NG)&&$4e(d,h)&&a(l,m,"generated-output",l.allowedFiles.filter(NG));let b=[...d].map(w=>r.get(w)).filter(w=>!!w).filter(w=>g.some(k=>w.dependencies.includes(k.dependency)));for(let w of b)a(l,m,"package-cohort",[`${w.id}: ${w.reason}`]);let _=x4e(l,m,s);_.length>0&&a(l,m,"symbol-dependency",_)}}return[...i.values()].sort(Wae)}function zae(e,t){return e.breakingChangeIds.map(n=>t.get(n)).filter(n=>!!n)}function $4e(e,t){for(let n of e)if(t.has(n))return!0;return!1}function S4e(e,t){let n=e.filter(r=>r.kind==="moved-export");if(n.length===0)return!1;for(let r of n){let i=new Set([...r.symbols,...r.replacementSymbols??[]]);if(t.some(o=>o.dependency===r.dependency&&o.symbols.some(s=>i.has(s))))return!0}return!1}function NG(e){return/(^|\/)(__generated__|generated|gen)\//i.test(e)||/\.(generated|gen)\./i.test(e)}function x4e(e,t,n){let r=new Set(e.allowedSymbols??[]);if(r.size===0)return[];let i=[];for(let o of t.allowedFiles)for(let s of n.get(o)??[])s.enclosingSymbol&&r.has(s.enclosingSymbol)&&i.push(`${o}:${s.line} is inside ${s.enclosingSymbol}`);return i}function Wae(e,t){return e.from.localeCompare(t.from)||e.to.localeCompare(t.to)||e.reason.localeCompare(t.reason)||e.evidence.join("\0").localeCompare(t.evidence.join("\0"))}function E4e(e,t){let n=new Map(e.map(a=>[a.id,a])),r=new Map;for(let a of e)r.set(a.id,new Set);for(let a of t)!n.has(a.from)||!n.has(a.to)||r.get(a.to).add(a.from);let i=new Set(e.map(a=>a.id)),o=new Map,s=0;for(;i.size>0;){let a=[...i].filter(c=>[...r.get(c)??[]].every(l=>!i.has(l))).map(c=>n.get(c)).sort((c,l)=>c.order-l.order||c.id.localeCompare(l.id));if(a.length===0)return{commits:Gae(e,t,o),cycle:[...i].sort()};for(let c of a)o.set(c.id,s),i.delete(c.id);s+=1}return{commits:Gae(e,t,o),cycle:[]}}function Gae(e,t,n){let r=new Map;for(let i of t){let o=r.get(i.to);o?o.push(i):r.set(i.to,[i])}return e.map(i=>{let o=[...r.get(i.id)??[]].sort(Wae);return{...i,dependsOn:o.map(s=>s.from).sort(),dependencyReasons:o,executionLayer:n.get(i.id)??0}}).sort((i,o)=>i.executionLayer-o.executionLayer||i.order-o.order||i.id.localeCompare(o.id)).map((i,o)=>({...i,order:o+1}))}function T4e(e,t){let n=t.filter(r=>e.includes(r.from)&&e.includes(r.to)).slice(0,5).map(r=>`${r.from} -> ${r.to} (${r.reason})`).join("; ");return`The remediation graph contains a dependency cycle across ${e.length} commit unit(s): ${n}. Drift cannot automatically execute this plan until the inseparable work is combined or reviewed manually.`}function A4e(e,t){let n=[];return e.some(r=>r.kind==="signature-change"||r.kind==="type-change"||r.kind==="removed-export"||r.kind==="renamed-export"||r.kind==="moved-export")&&n.push({id:Pt("check","typecheck",e.map(r=>r.id).sort().join(",")),kind:"typecheck",reason:"API-shape and type-contract migrations should be checked by the repository type checker when available."}),e.some(r=>r.kind==="behaviour-change"||r.kind==="default-change")&&n.push({id:Pt("check","test",e.map(r=>r.id).sort().join(",")),kind:"test",reason:"Behavioural and default changes need tests because compilation can still succeed with wrong behaviour."}),t.some(r=>/(^|\/)(package\.json|tsconfig\.json|vite\.config|webpack\.config|rollup\.config)/.test(r))&&n.push({id:Pt("check","build",t.join(",")),kind:"build",reason:"Configuration and package-entry changes can alter the build graph."}),n}function I4e(e,t){let n=[...t.map(r=>`file:${r}`),...e.flatMap(r=>r.symbols.map(i=>`symbol:${i}`)),...e.map(r=>`dependency:${r.dependency}`)];return[...new Set(n)].sort()}function Bae(e){let t=[],n=new Map;for(let r of e){let i=n.get(r.ecosystem);i?i.push(r):n.set(r.ecosystem,[r])}for(let[r,i]of n)for(let o of R4e(i)){if(o.length<2)continue;let s=o.map(a=>a.name).sort();t.push({id:Pt("cohort",r,s.join(",")),ecosystem:o[0].ecosystem,dependencies:s,constraints:o.map(a=>({dependency:a.name,ecosystem:a.ecosystem,range:a.rawTo??a.to??"*",source:"workspace-family"})),candidatePaths:[...new Set(o.map(a=>a.manifestPath))].sort(),reason:`These ${r} packages appear to be part of the same ${P4e(o[0].name)} upgrade family and should be reviewed together.`})}return t.sort((r,i)=>r.id.localeCompare(i.id))}function R4e(e){let t=new Map;for(let n of e){let r=Hae(n.name);if(!r)continue;let i=t.get(r);i?i.push(n):t.set(r,[n])}return[...t.values()]}function Hae(e){let t=[/^(@angular)\//,/^(@babel)\//,/^(@nestjs)\//,/^(@types)\//,/^(@vue)\//,/^(react)(?:$|-)/,/^(next)(?:$|-)/,/^(eslint)(?:$|-)/,/^(jest)(?:$|-)/,/^(webpack)(?:$|-)/,/^(vite)(?:$|-)/];for(let n of t){let r=n.exec(e);if(r?.[1])return r[1]}if(e.startsWith("@")){let n=e.split("/")[0];return n&&n!==e?n:null}return null}function P4e(e){return O8(Hae(e)??e,32)}function C4e(e,t){let n=e[0],r=m4e(n.kind),i=O4e(e);return e.length===1?Vae(`${r}(${i}): ${N4e(n)}`):Vae(`${r}(${i}): update ${e.length} usages for the new ${n.dependency} API`)}function N4e(e){let t=e.symbols[0],n=e.replacementSymbols?.[0];switch(e.kind){case"removed-export":return t?`replace removed \`${t}\``:"replace removed API";case"renamed-export":return t&&n?`migrate \`${t}\` to \`${n}\``:`migrate renamed \`${t??"API"}\``;case"moved-export":return`import ${t?`\`${t}\``:"the API"} from its new entry point`;case"signature-change":return t?`update \`${t}\` call sites for the new signature`:"update call sites for new signatures";case"type-change":return t?`adapt to the new \`${t}\` type`:"adapt to changed types";case"removed-endpoint":return t?`migrate calls to removed endpoint \`${t}\``:"migrate removed endpoint calls";case"changed-endpoint":return t?`update requests to \`${t}\``:"update API requests";case"required-field-added":return t?`supply now-required \`${t}\``:"supply newly-required fields";case"default-change":return t?`pin previous default for \`${t}\``:"account for changed defaults";case"runtime-requirement":return e.summary.toLowerCase().startsWith("minimum")?e.summary.charAt(0).toLowerCase()+e.summary.slice(1):"raise the minimum runtime version";case"config-change":return"update configuration for the new version";case"module-system-change":return/commonjs/i.test(e.summary)?"replace dropped CommonJS usage":"migrate incompatible module loading";case"behaviour-change":return t?`handle changed \`${t}\` behaviour`:"handle changed behaviour";default:return`update usage of \`${e.dependency}\``}}function O4e(e){let t=[...new Set(e.map(n=>n.dependency))];if(t.length===1){let n=t[0];return n.startsWith("@")?n.split("/")[1]??n:n.split(":").pop()??n}return"deps"}function Vae(e){return e.length<=72?e:`${e.slice(0,69)}...`}function D4e(e,t,n,r){let i=[];for(let s of e)i.push(s.summary),i.push(""),i.push(s.remediation),i.push("");let o=[...new Set(t.map(s=>s.file))];if(i.push(`Affects ${t.length} location(s) across ${o.length} file(s).`),i.push(""),n){let s=new Set(n.flatMap(a=>a.files)).size;i.push(`Resolved deterministically by Drift's codemod engine across ${s} file(s) \u2014 no model call was made for this commit.`)}else if(r&&r.length>0){let s=[...new Map(r.map(c=>[`${c.provider}:${c.name}@${c.version}`,c])).values()],a=s.map(c=>`${c.name}@${c.version} (${c.provider}, published by ${c.publisher})`).join(", ");i.push(`Community recipe available: ${a}. Not applied without an explicit choice \u2014 see ${s[0].source}.`)}else i.push("Identified by Drift from upstream evidence; see the pull request"),i.push("description for the citations behind this change.");return i.join(` +`).trim()}function M4e(e,t,n,r){let i=[];i.push(`## Commit ${n} of ${r}`),i.push("");for(let o of e){i.push(`### ${o.summary}`),i.push(""),i.push(`- Dependency: \`${o.dependency}\``),i.push(`- Change type: ${o.kind}`),i.push(`- Confidence: ${o.confidence}`),i.push(""),i.push(o.remediation),i.push("");let s=t.filter(a=>a.breakingChangeId===o.id);if(s.length>0){i.push("Known locations (verify each; there may be others):"),i.push("");for(let a of s.slice(0,40)){let c=a.enclosingSymbol?` in \`${a.enclosingSymbol}\``:"";i.push(`- \`${a.file}:${a.line}\`${c} \u2014 \`${a.excerpt}\``)}s.length>40&&i.push(`- \u2026and ${s.length-40} more matches of the same symbols`),i.push("")}}return i.join(` +`).trim()}var Kae=["detect","evidence","surface","static-analysis","upgrade-discovery","upgrade-install","verify","fix","pull-request"],MG={detect:"Detect",evidence:"Evidence",surface:"API surface","static-analysis":"Static analysis","upgrade-discovery":"Find upgrades","upgrade-install":"Install a version",verify:"Verify",fix:"Fix","pull-request":"Automated PR"},_e=()=>({level:"full"}),we=(e,t)=>({level:"partial",note:e,...t?{requires:t}:{}}),xu=e=>({level:"none",note:e}),Ac="Resolves imports against the module names the published package declares, follows re-exports inside your repository, and matches references to symbols named in the evidence. Cannot see through reflection, dynamic dispatch, or generated code.",L4e="Matches imports and references to symbols named in the evidence, using the ecosystem's own module-naming convention where no published module list exists. Cannot see through reflection, dynamic dispatch, or generated code.",OG="Compares the declarations in both versions' public headers, which is what a consumer compiles against. Declarations behind preprocessor conditionals are read as written, not per build configuration.",DG="Matches `#include` directives and references to symbols named in the evidence, following includes through your own headers so a library reached indirectly still counts. A macro-generated call site is invisible.",F4e={npm:{ecosystem:"npm",localizationBasis:"declared",label:"JavaScript / TypeScript",files:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","npm-shrinkwrap.json"],managers:["npm","pnpm","Yarn (classic)","Yarn (berry)","Bun"],support:{detect:_e(),evidence:_e(),surface:we("Diffs published TypeScript declarations. A package that ships no declarations of its own falls back to prose evidence rather than reporting a clean comparison."),"static-analysis":we(Ac),"upgrade-discovery":_e(),verify:we("Runs the typecheck, test, and build scripts the project's package.json actually declares."),fix:_e(),"pull-request":_e()}},pypi:{ecosystem:"pypi",localizationBasis:"published",label:"Python",files:["pyproject.toml","requirements.in","requirements.txt","setup.py","poetry.lock","uv.lock","Pipfile"],managers:["pip","Poetry","uv"],support:{detect:_e(),evidence:_e(),surface:we("Compares the public surface reconstructed from published type stubs. Packages without stubs fall back to prose evidence.","a local Python interpreter"),"static-analysis":we(Ac),"upgrade-discovery":_e(),verify:we("Runs mypy/pyright and pytest when the project declares them."),fix:_e(),"pull-request":_e()}},go:{ecosystem:"go",localizationBasis:"declared",label:"Go",files:["go.mod","go.sum"],managers:["Go modules"],support:{detect:_e(),evidence:_e(),surface:we("Compares the exported API of both module versions.","the Go toolchain"),"static-analysis":we(Ac),"upgrade-discovery":_e(),verify:we("Runs `go vet`, `go test`, and `go build`.","the Go toolchain"),fix:_e(),"pull-request":_e()}},cargo:{ecosystem:"cargo",localizationBasis:"declared",label:"Rust",files:["Cargo.toml","Cargo.lock"],managers:["Cargo"],support:{detect:_e(),evidence:_e(),surface:we("Compares the public API of both crate versions.","cargo-public-api"),"static-analysis":we(Ac),"upgrade-discovery":_e(),verify:we("Runs `cargo check`, `cargo test`, and `cargo build`.","the Rust toolchain"),fix:_e(),"pull-request":_e()}},maven:{ecosystem:"maven",localizationBasis:"published",label:"Java / Kotlin / Scala",files:["pom.xml","build.gradle","build.gradle.kts","gradle/libs.versions.toml","build.sbt"],managers:["Maven","Gradle","sbt"],support:{detect:we("Reads pom.xml, Gradle build files and version catalogs, and sbt coordinates. Gradle versions computed at configuration time are not visible without running Gradle."),evidence:_e(),surface:we("Compares both published JARs.","japicmp"),"static-analysis":we(Ac),"upgrade-discovery":_e(),verify:we("Runs Maven or Gradle. sbt projects verify through sbt when it is installed."),fix:we("Maven and sbt are edited through the build file; Gradle versions declared outside a version catalog may need a manual edit."),"pull-request":_e()}},rubygems:{ecosystem:"rubygems",localizationBasis:"published",label:"Ruby",files:["Gemfile","Gemfile.lock","*.gemspec"],managers:["Bundler"],support:{detect:_e(),evidence:_e(),surface:xu("Ruby has no static public API surface to compare, so upgrades rest on release notes, changelogs, and advisories."),"static-analysis":we(Ac),"upgrade-discovery":_e(),verify:we("Runs RSpec or Rake when the Gemfile declares them.","Bundler"),fix:_e(),"pull-request":_e()}},nuget:{ecosystem:"nuget",localizationBasis:"published",label:".NET",files:["*.csproj","*.fsproj","*.vbproj","Directory.Packages.props","packages.lock.json"],managers:["NuGet"],support:{detect:_e(),evidence:we("Registry metadata, published versions, deprecation, and OSV advisories. Release notes depend on the package declaring a GitHub repository."),surface:we("Compares the public types and member signatures in both versions' published assemblies, preferring the reference assembly and a common target framework. A package that ships only native binaries, analyzers, or nothing at all has no surface to compare."),"static-analysis":we(Ac),"upgrade-discovery":_e(),verify:we("Runs `dotnet build` and `dotnet test`.","the .NET SDK"),fix:_e(),"pull-request":_e()}},packagist:{ecosystem:"packagist",localizationBasis:"published",label:"PHP",files:["composer.json","composer.lock"],managers:["Composer"],support:{detect:_e(),evidence:we("Registry metadata, published versions, abandonment notices, and OSV advisories. Release notes depend on the package declaring a source repository."),surface:xu("PHP publishes no machine-comparable API artefact; upgrades rest on release notes, changelogs, and advisories."),"static-analysis":we("Resolves `use` statements against the PSR-4 and PSR-0 roots the package declares in its own composer.json, read from Packagist. A package that autoloads only by classmap declares no namespace root and is not localized."),"upgrade-discovery":_e(),verify:we("Runs PHPUnit when composer.json declares it.","Composer"),fix:_e(),"pull-request":_e()}},hex:{ecosystem:"hex",localizationBasis:"published",label:"Elixir / Erlang",files:["mix.exs","mix.lock"],managers:["Mix"],support:{detect:_e(),evidence:we("Registry metadata, published versions, retirement notices, and OSV advisories."),surface:we("Compares the public modules and their functions, by name and arity, in both versions' published sources \u2014 `def` and `defmacro` in Elixir, `-export` in Erlang. A function a macro generates at compile time is not visible without compiling."),"static-analysis":we("Resolves module references against every module the released tarball defines, so a fully qualified call needs no `alias` to be found. Cannot see through `apply/3` or a module name computed at runtime."),"upgrade-discovery":_e(),verify:we("Runs `mix compile --warnings-as-errors` and `mix test`.","Elixir and Mix"),fix:_e(),"pull-request":_e()}},pub:{ecosystem:"pub",localizationBasis:"declared",label:"Dart / Flutter",files:["pubspec.yaml","pubspec.lock"],managers:["Dart pub","Flutter"],support:{detect:_e(),evidence:we("Registry metadata, published versions, retraction, and OSV advisories. Release notes depend on the package declaring a repository."),surface:we("Compares the public declarations of both versions' published libraries, following each `export` out of the private `lib/src` tree the way a consumer's import does. Read from source rather than from a compiled artefact."),"static-analysis":we(Ac),"upgrade-discovery":_e(),verify:we("Runs `dart analyze` and `dart test`, or their Flutter equivalents.","the Dart or Flutter SDK"),fix:_e(),"pull-request":_e()}},swift:{ecosystem:"swift",localizationBasis:"published",label:"Swift",files:["Package.swift","Package.resolved"],managers:["Swift Package Manager"],support:{detect:we("Reads literal `.package(...)` declarations and Package.resolved. Versions computed by Swift code at manifest-evaluation time are not visible without running SwiftPM."),evidence:we("Source repository, releases, and changelogs, because SwiftPM identifies packages by git URL. There is no central registry to query for deprecation."),surface:xu("Comparing two Swift module interfaces needs a local toolchain and a built artefact Drift does not produce; upgrades rest on prose evidence."),"static-analysis":we("Resolves `import` statements against the library and target names declared in the dependency's own Package.swift at the resolved version. A module name a manifest computes at evaluation time is not visible without running SwiftPM."),"upgrade-discovery":we("Versions are git tags, since SwiftPM has no package registry to ask. Drift lists them for packages hosted on GitHub; anything on another git host is reported as unchecked rather than up to date."),verify:we("Runs `swift build` and `swift test`.","the Swift toolchain"),fix:_e(),"pull-request":_e()}},cocoapods:{ecosystem:"cocoapods",localizationBasis:"published",label:"CocoaPods",files:["Podfile","Podfile.lock","*.podspec"],managers:["CocoaPods"],support:{detect:_e(),evidence:we("Release notes and changelogs when the pod declares a GitHub source. CocoaPods publishes no queryable metadata API, so there is no deprecation or advisory signal."),surface:xu("Drift does not compare compiled iOS frameworks; upgrades rest on prose evidence."),"static-analysis":we("Resolves `import` statements against the `module_name` the pod declares in its podspec, read from the CocoaPods CDN. A pod that builds its module name in Ruby at podspec-evaluation time is not visible without running CocoaPods."),"upgrade-discovery":_e(),verify:xu("Building an iOS target needs Xcode and a scheme Drift cannot infer; verification stays with the developer."),fix:_e(),"pull-request":_e()}},opam:{ecosystem:"opam",localizationBasis:"convention",label:"OCaml",files:["*.opam","dune-project","*.opam.locked"],managers:["opam"],support:{detect:_e(),evidence:we("Release notes and changelogs when the package declares a GitHub source. opam has no JSON metadata API, so there is no registry deprecation signal."),surface:xu("Comparing two OCaml module interfaces needs a built switch Drift does not create; upgrades rest on prose evidence."),"static-analysis":we(L4e),"upgrade-discovery":we("opam publishes no version API, so releases are read from the package directories in the opam-repository index. A package published only in a custom repository is reported as unchecked rather than up to date."),verify:we("Runs `dune build` and `dune runtest`.","opam and dune"),fix:_e(),"pull-request":_e()}},conan:{ecosystem:"conan",localizationBasis:"convention",label:"C / C++ (Conan)",files:["conanfile.txt","conanfile.py","conan.lock"],managers:["Conan"],support:{detect:we("Reads conanfile.txt, conan.lock, and the literal `requires` declarations in conanfile.py. A reference a recipe builds at evaluation time is not visible without running Python."),evidence:we("Versions from the ConanCenter recipe index, and releases and changelogs from the upstream project the recipe builds \u2014 not from the recipe itself. ConanCenter publishes no deprecation signal, and OSV has no Conan ecosystem."),surface:we(OG),"static-analysis":we(DG),"upgrade-discovery":we("Conan version schemes are package-defined, so Drift can analyze exact version changes but does not invent an ordering to select a newer release automatically."),verify:we("Runs `conan build`, which is the compiler \u2014 in C and C++ an incompatible header change is a build failure rather than a runtime surprise.","Conan"),fix:_e(),"pull-request":_e()}},vcpkg:{ecosystem:"vcpkg",localizationBasis:"convention",label:"C / C++ (vcpkg)",files:["vcpkg.json","vcpkg-configuration.json"],managers:["vcpkg"],support:{detect:we("Reads declared dependencies, `version>=` floors, and `overrides`. A registry baseline moving changes every unpinned version at once; Drift reports the baseline move rather than resolving it to versions."),evidence:we("Versions from the vcpkg versions database, and releases and changelogs from the port's upstream project. vcpkg publishes no deprecation signal, and OSV has no vcpkg ecosystem."),surface:we(OG),"static-analysis":we(DG),"upgrade-discovery":we("vcpkg versions are port-defined and baseline resolution can change every dependency, so Drift analyzes exact overrides but does not invent an ordering or resolve baseline moves automatically."),verify:we("Runs the project's CMake build, which is where an incompatible header change surfaces.","CMake"),fix:_e(),"pull-request":_e()}},arduino:{ecosystem:"arduino",localizationBasis:"convention",label:"Arduino / PlatformIO",files:["library.properties","platformio.ini"],managers:["Arduino CLI","PlatformIO"],support:{detect:_e(),evidence:we("Versions and repositories from the Arduino Library Manager index, plus releases and changelogs from the library's own repository. A library published only to PlatformIO has metadata but no version history, because that registry serves only the current release."),surface:we(OG),"static-analysis":we(DG),"upgrade-discovery":_e(),verify:we("Runs `arduino-cli compile` or `pio run`, and `pio test` where the project has tests.","Arduino CLI or PlatformIO"),fix:_e(),"pull-request":_e()}}};function U4e(e){let t=La.filter(s=>s.ecosystem===e),n={name:"example",version:"1.0.0",kind:"runtime"},r=t.filter(s=>s.upgrade(n)!==null),i=t.filter(s=>s.upgrade(n)===null);if(i.length===0)return _e();let o=s=>s.map(a=>a.label).join(", ");return r.length===0?xu(`${o(i)} ${i.length===1?"has":"have"} no command that pins a version \u2014 the coordinate lives in a build file the tool will not rewrite. Drift reports the version to set and where, and leaves the edit to you.`):we(`${o(r)} can install a chosen version directly. ${o(i)} cannot: the version lives in a build file the tool will not rewrite, so Drift tells you what to change instead of running something that silently changes nothing.`)}var j4e=Object.values(F4e).map(e=>({...e,support:{...e.support,"upgrade-install":U4e(e.ecosystem)}})),z4e=Object.fromEntries(j4e.map(e=>[e.ecosystem,e]));function Jae(e){return z4e[e]}var LG=require("node:crypto");var jm=3,FG=[jm];function wi(e){return e===null||typeof e!="object"?JSON.stringify(e??null)??"null":Array.isArray(e)?`[${e.map(n=>wi(n)).join(",")}]`:`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[r])=>nr?1:0).map(([n,r])=>`${JSON.stringify(n)}:${wi(r)}`).join(",")}}`}function G4e(e){return{id:e.id,source:e.source,dependency:e.dependency,url:e.url??null,locator:e.locator??null,title:e.title,contentHash:(0,LG.createHash)("sha256").update(e.content).digest("hex"),weight:e.weight,findings:(e.findings??[]).map(t=>({code:t.code,symbol:t.symbol,detail:t.detail,before:t.before??null,after:t.after??null}))}}function B4e(e){return{nature:e.nature,detectability:[...e.detectability].sort(),scope:e.scope,visibility:[...e.visibility].sort(),origin:e.origin}}function V4e(e){return{schemaVersion:jm,id:e.id,baseBranch:e.baseBranch,headSha:e.headSha,risk:e.risk,blockers:[...e.blockers],warnings:[...e.warnings],changes:e.changes.map(t=>({name:t.name,ecosystem:t.ecosystem,from:t.from,to:t.to,kind:t.kind,bump:t.bump,manifestPath:t.manifestPath,workspace:t.workspace??null})),breakingChanges:e.breakingChanges.map(t=>({id:t.id,dependency:t.dependency,kind:t.kind,summary:t.summary,remediation:t.remediation,symbols:[...t.symbols].sort(),replacementSymbols:[...t.replacementSymbols??[]].sort(),confidence:t.confidence,taxonomy:B4e(Vr(t)),assessment:t.assessment?{upstream:t.assessment.upstream.score,localImpact:t.assessment.localImpact.score,verification:t.assessment.verification.score,automaticExecutionEligible:t.assessment.automaticExecutionEligible,calibration:t.assessment.upstream.calibration}:null,citations:[...t.citations].sort()})),impactSites:e.impactSites.map(t=>({breakingChangeId:t.breakingChangeId,file:t.file,line:t.line,matchedSymbol:t.matchedSymbol,enclosingSymbol:t.enclosingSymbol??null,confidence:t.confidence})),commits:e.commits.map(t=>({id:t.id,order:t.order,message:t.message,body:t.body,breakingChangeIds:[...t.breakingChangeIds].sort(),files:[...t.files].sort(),allowedFiles:[...t.allowedFiles].sort(),allowedSymbols:[...t.allowedSymbols??[]].sort(),instructions:t.instructions,dependsOn:[...t.dependsOn].sort(),dependencyReasons:[...t.dependencyReasons].map(n=>({from:n.from,to:n.to,reason:n.reason,evidence:[...n.evidence].sort()})).sort((n,r)=>wi(n).localeCompare(wi(r))),executionLayer:t.executionLayer,expectedChecks:[...t.expectedChecks].map(n=>({id:n.id,kind:n.kind,command:n.command??null,reason:n.reason})).sort((n,r)=>wi(n).localeCompare(wi(r))),invalidationTriggers:[...t.invalidationTriggers].sort()})),planEdges:[...e.planEdges].map(t=>({from:t.from,to:t.to,reason:t.reason,evidence:[...t.evidence].sort()})).sort((t,n)=>wi(t).localeCompare(wi(n))),upgradeCohorts:[...e.upgradeCohorts].map(t=>({id:t.id,ecosystem:t.ecosystem,dependencies:[...t.dependencies].sort(),constraints:[...t.constraints].map(n=>({dependency:n.dependency,ecosystem:n.ecosystem,range:n.range,source:n.source})).sort((n,r)=>wi(n).localeCompare(wi(r))),candidatePaths:[...t.candidatePaths].sort(),reason:t.reason})).sort((t,n)=>t.id.localeCompare(n.id)),evidence:e.evidence.map(G4e),gaps:[...e.gaps].map(t=>({stage:t.stage,dependency:t.dependency??null,ecosystem:t.ecosystem??null,surface:t.surface,severity:t.severity,automaticExecution:t.automaticExecution})).sort((t,n)=>wi(t).localeCompare(wi(n)))}}function eA(e){return(0,LG.createHash)("sha256").update(wi(V4e(e))).digest("hex")}function q4e(e,t,n){return t.breakingChangeId!==e.id||t.confidence!=="high"?!1:e.kind!=="runtime-requirement"?!0:n?.changeId===e.id&&n.state==="incompatible"&&t.runtimeVerdict==="incompatible"}function W4e(e){let t=new Set,n=[];for(let r of e){let i=`${r.file}:${r.line}:${r.column??""}:${r.matchedSymbol??""}`;t.has(i)||(t.add(i),n.push(r))}return n}function zm(e,t,n,r,i=!0){let o=new Map;for(let s of n){let a=o.get(s.changeId);a?a.push(s):o.set(s.changeId,[s])}return e.map(s=>{let a=W4e(t.filter(d=>d.breakingChangeId===s.id)),c=o.get(s.id)??[],l=c.length===1?c[0]:void 0,u=a.filter(d=>q4e(s,d,l));if(s.kind==="runtime-requirement"){if(!l)return{changeId:s.id,state:"unknown",reason:"not-localized",sites:a,actionableSites:u};let d={changeId:s.id,sites:a,actionableSites:u,runtimeAnalysis:{runtime:l.runtime,state:l.state,reason:l.reason}};return l.state==="incompatible"?{...d,state:"actionable",reason:"runtime-incompatible"}:l.state==="partial"?{...d,state:"review-only",reason:"runtime-partial"}:l.state==="unknown"?{...d,state:"review-only",reason:"runtime-unknown"}:{...d,state:"unaffected",reason:"runtime-compatible"}}return u.length>0?{changeId:s.id,state:"actionable",reason:"high-confidence-impact",sites:a,actionableSites:u}:a.length>0?{changeId:s.id,state:"review-only",reason:"low-confidence-impact",sites:a,actionableSites:u}:r?i?{changeId:s.id,state:"unknown",reason:"impact-unresolved",sites:[],actionableSites:[]}:{changeId:s.id,state:"unknown",reason:"localization-incomplete",sites:[],actionableSites:[]}:{changeId:s.id,state:"unknown",reason:"not-localized",sites:[],actionableSites:[]}})}function Zae(e){return e.assessment?Qoe(e.assessment):e.confidence}function tA(e){let{repo:t,config:n,changes:r,evidence:i,impactSites:o}=e,s=H4e(e),a=zm(s,o,e.runtimeAnalyses??e.rationale?.flatMap(m=>m.runtimeAnalyses??[])??[],e.localizationRan??!0,e.localizationComplete??!0),c=qae({breakingChanges:s,impactSites:o,dispositions:a,config:n,changes:r,codemods:e.codemods,recipes:e.recipes,fixPlans:e.fixPlans}),l=c.commits,u=UG(r,s,o,(e.rationale??[]).map(m=>m.assessment.runtimeCompatibility),a),d=K4e(e,s,l),{blockers:p,warnings:f}=Y4e(e,s,l,u,d);return{schemaVersion:jm,id:Pt("plan",t.owner,t.repo,t.afterSha),branchName:Z4e(n,r,t.afterSha),baseBranch:t.baseBranch,headSha:t.afterSha,changes:[...r],evidence:[...i],breakingChanges:s,upstreamBreakingCount:s.length,impactSites:[...o],dispositions:a,localizationRan:e.localizationRan??!0,localizationComplete:e.localizationComplete??!0,runtimeConfigComplete:e.runtimeConfigComplete??!0,commits:l,planEdges:c.edges,upgradeCohorts:c.cohorts,...e.rationale?{rationale:[...e.rationale]}:{},risk:u,gaps:d,checkedSurfaces:[...e.checkedSurfaces??[]],confirmedRegressions:[...e.confirmedRegressions??[]],blockers:[...c.blockers,...p],warnings:f,createdAt:new Date().toISOString()}}function H4e(e){let{evidence:t,breakingChanges:n,impactSites:r}=e,i=e.localizationRan??!0,o=e.localizationComplete??!0;return n.map(s=>{let a=r.filter(p=>p.breakingChangeId===s.id),c=Vr(s),l=(e.runtimeAnalyses??[]).find(p=>p.changeId===s.id)?.state,u=(e.verification??[]).filter(p=>p.breakingChangeIds!==void 0?p.breakingChangeIds.includes(s.id):p.dependency===void 0?!0:p.dependency===s.dependency&&p.workspace===s.workspace),d=Yoe({change:s,taxonomy:c,evidence:t,sites:a,localizationRan:i,localizationComplete:o,runtimeState:l,outcomes:u,checkedSurfaces:e.checkedSurfaces??[],gaps:[]});return{...s,taxonomy:c,assessment:d}})}function K4e(e,t,n){let{changes:r,evidence:i,impactSites:o,config:s}=e,a=[],c=e.localizationRan??!0;c&&e.localizationComplete===!1&&t.length>0&&a.push({stage:"localize",surface:"repository source",reason:e.runtimeConfigComplete===!1?"Source localization was incomplete, and at least one authoritative runtime configuration file could not be indexed. Zero local API sites is not an exhaustive absence claim.":"Source localization reached its file limit. Runtime configuration was indexed completely, but zero local API sites is not an exhaustive absence claim.",severity:"blocking",automaticExecution:"blocks",remediation:"Raise the source indexing limit or narrow the scan to the relevant workspace."}),!c&&t.length>0&&a.push({stage:"localize",surface:"repository source",reason:'No checkout was available, so Drift could not search this repository for affected code. Zero impact sites here means "not searched", not "not affected".',severity:"blocking",automaticExecution:"blocks",remediation:"Run Drift as a GitHub Action or from the CLI in a checkout. The webhook runner cannot localize \u2014 see docs/deployment.md."});for(let u of r)i.filter(f=>f.dependency===u.name&&f.workspace===u.workspace).filter(f=>f.source!=="semver-heuristic"&&f.source!=="registry-metadata").length===0&&a.push({stage:"evidence",ecosystem:u.ecosystem,dependency:u.name,surface:"upstream release evidence",reason:`No changelog, release notes, migration guide, or API diff could be retrieved for ${u.name}. Drift will not dispatch a fix based on a version number alone.`,severity:"significant",automaticExecution:s.guardrails.requireEvidence&&t.length>0?"blocks":"degrades",remediation:"Check the package publishes release notes Drift can reach, or review this upgrade by hand."});for(let u of t)o.filter(p=>p.breakingChangeId===u.id).length>0||VS(Vr(u))&&a.push({stage:"localize",dependency:u.dependency,surface:`reachability of ${u.symbols.slice(0,3).join(", ")||u.dependency}`,reason:`${u.summary} is only observable at runtime, so searching the source cannot establish whether this repository is affected.`,severity:"significant",automaticExecution:"degrades",remediation:"Confirm by exercising the affected paths, or review the upstream notes directly."});(e.verification??[]).filter(u=>!u.name.startsWith("behavioural:")).length===0&&n.length>0&&a.push({stage:"verify",surface:"build, typecheck, and test",reason:"No checks were run against this plan, so nothing confirms the findings were understood correctly or that a fix would compile.",severity:"significant",automaticExecution:"degrades",remediation:"Configure the repository checks Drift should run, or review the resulting pull request against CI before merging."});for(let u of[...new Set(r.map(d=>d.ecosystem))].sort()){let d=Jae(u);for(let p of Kae)d.support[p].level==="none"&&a.push({stage:J4e(p),ecosystem:u,surface:MG[p],reason:d.support[p].note??`${MG[p]} does not run for ${u}.`,severity:"significant",automaticExecution:"degrades",remediation:`Drift cannot run this stage for ${u}; review this surface by hand.`})}return a}function J4e(e){switch(e){case"detect":return"detect";case"evidence":case"surface":return"evidence";case"static-analysis":return"localize";case"verify":return"verify";default:return"plan"}}function Z4e(e,t,n){return Fae({changes:t},{branch:e.pullRequest.branchTemplate,prefix:e.remediation.branchPrefix})}function UG(e,t,n,r=[],i){let o=r.some(p=>p==="unknown"||p==="partial"),s=i?.some(p=>p.state==="review-only"||p.state==="unknown")??!1,a=i?i.flatMap(p=>p.actionableSites):n;if(t.length===0||a.length===0)return o||s?"low":"none";let c="low",l=p=>{XH(p,c)>0&&(c=p)},u=new Set(a.map(p=>p.file)).size;(u>5||a.length>20)&&l("medium"),(u>20||a.length>75)&&l("high");let d=new Set((i??[]).filter(p=>p.state!=="unaffected").map(p=>p.changeId));for(let p of t.filter(f=>d.size===0||d.has(f.id)))(p.kind==="behaviour-change"||p.kind==="default-change")&&l("high"),p.kind==="unknown"&&l("medium"),p.confidence==="low"&&l("medium");for(let p of e)p.bump==="major"&&l("medium"),Dh(p.from,p.to,p.ecosystem)&&l("high");return a.some(p=>Yae(p.file))&&l("medium"),c}function Y4e(e,t,n,r,i){let{config:o,changes:s,impactSites:a,skipped:c=[]}=e,l=o.guardrails,u=[],d=[],p=[...new Set(n.flatMap(k=>k.files))];p.length>l.maxFilesChanged&&u.push(`This plan would touch ${p.length} files, above the \`maxFilesChanged\` limit of ${l.maxFilesChanged}. A change this wide should be read by a person before an agent starts editing.`),s.length>l.maxDependenciesPerRun&&u.push(`${s.length} dependencies moved in one commit, above the \`maxDependenciesPerRun\` limit of ${l.maxDependenciesPerRun}. Batched upgrades make it hard to attribute a regression to the dependency that caused it.`);let f=p.filter(k=>vs(l.protectedPaths,k));f.length>0&&u.push(`Impact sites fall inside protected paths: ${f.slice(0,5).join(", ")}${f.length>5?`, +${f.length-5} more`:""}. Drift will not direct an agent to edit these.`);let m=s.filter(k=>vs(o.alwaysApprove,k.name));m.length>0&&u.push(`${m.map(k=>k.name).join(", ")} matched \`alwaysApprove\` in drift.yml.`);let g=new Set(n.flatMap(k=>k.breakingChangeIds)),h=t.filter(k=>g.has(k.id)&&!iG(Zae(k),l.minConfidence));if(h.length>0){let k=h.slice(0,3).map(x=>`\`${x.dependency}\`: ${x.summary}`).join("; ");l.experimentalDispatchBelowMinConfidence?d.push(`${h.length} finding(s) are below the \`minConfidence\` threshold of \`${l.minConfidence}\` but \`experimentalDispatchBelowMinConfidence\` is on, so Drift will dispatch anyway. ${k}.`):u.push(`${h.length} finding(s) Drift planned commits for are below the \`minConfidence\` threshold of \`${l.minConfidence}\`: ${k}. The plan is filed for review rather than dispatched.`)}let v=t.filter(k=>!g.has(k.id)&&!iG(Zae(k),l.minConfidence));v.length>0&&d.push(`${v.length} finding(s) are below the \`minConfidence\` threshold and no commit was planned for them. They are listed for awareness.`);let b=i.filter(k=>k.automaticExecution==="blocks");for(let k of b)u.push(`${k.reason} ${k.remediation}`);oD(r,o.maxAutoRisk)||u.push(`Assessed risk is \`${r}\`, above the \`maxAutoRisk\` ceiling of \`${o.maxAutoRisk}\`.`);let _=a.filter(k=>Yae(k.file));_.length>0&&d.push(`${_.length} impact site(s) are in test files. Confirm the fix updates tests to match the new API rather than weakening what they assert.`);let w=t.filter(k=>!a.some(x=>x.breakingChangeId===k.id));w.length>0&&d.push(`${w.length} breaking change(s) were identified upstream but no usage was found in this repository. They are listed for awareness and no commit was planned for them.`);for(let k of c)d.push(`Skipped \`${k.change.name}\`: ${k.reason}.`);return{blockers:u,warnings:d}}function Yae(e){let t=e.toLowerCase();return/(^|\/)(tests?|__tests__|spec|specs|e2e|integration_tests)\//.test(t)||/\.(test|spec)\.[jt]sx?$/.test(t)||/(^|\/)test_[^/]+\.py$/.test(t)||/_test\.(py|go|rb)$/.test(t)||/_spec\.rb$/.test(t)||/Test\.java$/.test(e)||/Tests?\.kt$/.test(e)}function Qae(e,t){return t.mode!=="auto"||e.blockers.length>0||e.commits.length===0?!1:oD(e.risk,t.maxAutoRisk)}var fv=require("node:fs/promises"),vo=require("node:path");async function Xae(e,t,n){let r=n.replace(/\\/g,"/").trim();if(!r||/[\n\r\0]/.test(r))return null;let i;try{i=await(0,fv.realpath)(e)}catch{return null}let o=(0,vo.isAbsolute)(r)||/^[A-Za-z]:\//.test(r)?[r]:[...new Set([t?(0,vo.join)(i,t,r):null,(0,vo.join)(i,r)].filter(s=>s!==null))];for(let s of o){let a;try{if(a=await(0,fv.realpath)(s),!(await(0,fv.stat)(a)).isFile())continue}catch{continue}let c=(0,vo.relative)(i,a);if(!(!c||c.startsWith("..")||(0,vo.isAbsolute)(c))&&!c.split(vo.sep).includes(".git"))return c.split(vo.sep).join("/")}return null}var ece="https://api.osv.dev/v1/query",Q4e="https://api.osv.dev/v1/querybatch",X4e="https://api.osv.dev/v1/vulns",oce={npm:"npm",pypi:"PyPI",go:"Go",cargo:"crates.io",maven:"Maven",rubygems:"RubyGems",nuget:"NuGet",packagist:"Packagist",hex:"Hex",pub:"Pub",swift:"SwiftURL",cocoapods:null,opam:null,conan:null,vcpkg:null,arduino:null};async function mv(e,t,n,r,i={}){let o=oce[t];if(!o)return as(`OSV has no advisory coverage for ${t} packages, so this upgrade's effect on known vulnerabilities could not be looked up.`);let s=i.fetch??a6e,[a,c]=await Promise.all([s(ece,nA(e,o,n)),s(ece,nA(e,o,r))]);return sce(a,c,n,r,t)}async function gv(e,t={}){let n=new Map,r=[];for(let a of e){let c=oce[a.ecosystem];c?r.push({lookup:a,osvEcosystem:c}):n.set(a,as(`OSV has no advisory coverage for ${a.ecosystem} packages, so this upgrade's effect on known vulnerabilities could not be looked up.`))}if(r.length===0)return n;if(r.length===1&&!t.batchFetch){let{lookup:a}=r[0];return n.set(a,await mv(a.name,a.ecosystem,a.from,a.to,t)),n}if(t.fetch&&!t.batchFetch){let a=await Promise.all(r.map(({lookup:c})=>mv(c.name,c.ecosystem,c.from,c.to,t)));return r.forEach(({lookup:c},l)=>n.set(c,a[l])),n}let i=r.flatMap(({lookup:a,osvEcosystem:c})=>[nA(a.name,c,a.from),nA(a.name,c,a.to)]),s=await(t.batchFetch??c6e)(i);if(Eu(s)){for(let{lookup:a}of r)n.set(a,as(`${s.osvFailure}, so this upgrade's effect on known vulnerabilities is unknown.`));return n}for(let a=0;a!jG(d,a)),l=a.filter(d=>!jG(d,s)),u=s.filter(d=>jG(d,a));return{checked:!0,current:s,target:a,resolved:c,introduced:l,carried:u,direction:e6e(c,l)}}function nA(e,t,n){return{version:n,package:{name:e,ecosystem:t}}}function jG(e,t){let n=new Set([e.id,...e.aliases]);return t.some(r=>n.has(r.id)||r.aliases.some(i=>n.has(i)))}function e6e(e,t){return e.length>0&&t.length>0?"mixed":e.length>0?"improves":t.length>0?"worsens":"preserves"}function as(e){return{checked:!1,...e?{reason:e}:{},current:[],target:[],resolved:[],introduced:[],carried:[],direction:"unknown"}}function tce(e,t,n="npm"){let r=e?.vulns;if(!Array.isArray(r))return[];let i=[];for(let o of r)!o.id||o.withdrawn||i.push({id:o.id,aliases:(o.aliases??[]).filter(s=>typeof s=="string"),summary:o6e(o.summary||o.details||"No summary published."),severity:n6e(o),url:i6e(o),fixedIn:r6e(o,t,n)});return ace(i,n).sort((o,s)=>nce[o.severity]-nce[s.severity])}function ace(e,t="npm"){let n=new Map,r=[];for(let i of e){let o=[i.id,...i.aliases],a=o.map(c=>n.get(c)).find(c=>c!==void 0)??r.push([])-1;r[a].push(i);for(let c of o)n.set(c,a)}return r.filter(i=>i.length>0).map(i=>{let o=i.find(a=>a.severity!=="unknown")??i[0],s=new Set(i.flatMap(a=>[a.id,...a.aliases]));return s.delete(o.id),{...o,aliases:[...s].sort(),fixedIn:t6e(i.map(a=>a.fixedIn),t),summary:i.find(a=>a.summary!=="No summary published.")?.summary??o.summary}})}function t6e(e,t){return e.filter(r=>!!r).map(r=>({raw:r,parsed:Ne(r,t)})).filter(r=>r.parsed!==null).sort((r,i)=>Xe(r.parsed,i.parsed)??0)[0]?.raw??e.find(r=>!!r)??null}var nce={critical:0,high:1,medium:2,low:3,unknown:4};function n6e(e){let t=e.database_specific?.severity??e.affected?.find(i=>i.database_specific?.severity)?.database_specific?.severity??e.affected?.find(i=>i.ecosystem_specific?.severity)?.ecosystem_specific?.severity;if(t){let i=t.toLowerCase();if(i==="critical")return"critical";if(i==="high")return"high";if(i==="moderate"||i==="medium")return"medium";if(i==="low")return"low"}let n=e.severity?.find(i=>i.score)?.score,r=n?cce(n):null;return r===null?"unknown":r>=9?"critical":r>=7?"high":r>=4?"medium":"low"}function cce(e){if(!/^CVSS:3\.[01]\//.test(e))return null;let t=new Map;for(let _ of e.split("/").slice(1)){let[w,k]=_.split(":");w&&k&&t.set(w,k)}let n={N:.85,A:.62,L:.55,P:.2},r={L:.77,H:.44},i={N:.85,R:.62},o={H:.56,L:.22,N:0},s=t.get("S")==="C",a=s?{N:.85,L:.68,H:.5}:{N:.85,L:.62,H:.27},c=n[t.get("AV")??""],l=r[t.get("AC")??""],u=a[t.get("PR")??""],d=i[t.get("UI")??""],p=o[t.get("C")??""],f=o[t.get("I")??""],m=o[t.get("A")??""];if([c,l,u,d,p,f,m].some(_=>_===void 0))return null;let g=1-(1-p)*(1-f)*(1-m),h=s?7.52*(g-.029)-3.25*(g-.02)**15:6.42*g;if(h<=0)return 0;let v=8.22*c*l*u*d,b=Math.min(s?1.08*(h+v):h+v,10);return Math.ceil(b*10)/10}function r6e(e,t,n="npm"){let r=Ne(t,n),i=[];for(let a of e.affected??[])for(let c of a.ranges??[])for(let l of c.events??[])l.fixed&&i.push(l.fixed);if(i.length===0)return null;let o=i.map(a=>({raw:a,parsed:Ne(a,n)})).filter(a=>a.parsed!==null);return!r||o.length===0?i[0]??null:(o.filter(a=>(Xe(a.parsed,r)??-1)>0).sort((a,c)=>Xe(a.parsed,c.parsed)??0)[0]??o.sort((a,c)=>Xe(a.parsed,c.parsed)??0)[0])?.raw??null}function i6e(e){return e.references?.find(n=>n.type==="ADVISORY"&&n.url)?.url??`https://osv.dev/vulnerability/${e.id}`}function o6e(e){let t=e.replace(/\s+/g," ").trim(),n=t.search(/\.\s|\.$/),r=n>0?t.slice(0,n+1):t;return r.length>300?`${r.slice(0,299)}\u2026`:r}var rce=1e4,ice=2,s6e=200;function Eu(e){return typeof e=="object"&&e!==null&&"osvFailure"in e}var a6e=async(e,t)=>lce(e,t),c6e=async e=>{let t=Array.from({length:e.length},()=>({vulns:[]})),n=e.map((i,o)=>({query:i,index:o}));for(;n.length>0;){let i=await lce(Q4e,{queries:n.map(a=>a.query)});if(Eu(i))return i;let o=i?.results;if(!Array.isArray(o)||o.length!==n.length)return{osvFailure:"OSV returned a malformed batch response"};let s=[];for(let a=0;a!!u?.id)),l.next_page_token&&s.push({index:c.index,query:{...c.query,page_token:l.next_page_token}})}n=s}let r=await l6e(t.flatMap(i=>i.vulns));return Eu(r)?r:t.map(i=>({vulns:i.vulns.map(o=>r.get(o.id)??o)}))};async function l6e(e){let t=[...new Set(e.map(i=>i.id).filter(i=>!!i))],n=await Promise.all(t.map(async i=>{let o=await u6e(`${X4e}/${encodeURIComponent(i)}`);return Eu(o)?o:[i,o]})),r=n.find(Eu);return r||new Map(n)}async function lce(e,t){return uce(e,{method:"POST",body:JSON.stringify(t)})}async function u6e(e){return uce(e,{method:"GET"})}async function uce(e,t){let n=null;for(let r=0;r<=ice;r+=1){let i=await d6e(e,t);if(!Eu(i)||!i.transient||r===ice)return i;n=i,await m6e(s6e*2**r)}return n??{osvFailure:"OSV could not be reached (network error)"}}async function d6e(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),rce);try{let i=await fetch(e,{method:t.method,signal:n.signal,headers:{"Content-Type":"application/json","User-Agent":"drift-bot/0.1 (+https://github.com/trydrift/drift)"},...t.method==="POST"?{body:t.body}:{}});return i.ok?await i.json():{osvFailure:i.status===429?"OSV rate-limited this scan (HTTP 429). Lowering `drift.analysis.concurrency` will fetch fewer advisories at once.":`OSV answered HTTP ${i.status} ${i.statusText}`.trim(),transient:i.status===408||i.status===429||i.status>=500}}catch(i){let o=i;return{osvFailure:o?.name==="AbortError"||o?.name==="TimeoutError"?`OSV did not answer within ${rce/1e3}s${dce(o)}`:`OSV could not be reached (${p6e(o)})`,transient:!0}}finally{clearTimeout(r)}}function p6e(e){return`${e?.message||"network error"}${dce(e)}`}function dce(e){let t=e?.cause;return t==null?"":`; cause: ${f6e(t)}`}function f6e(e){if(e instanceof Error)return e.message||e.name;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function m6e(e){return new Promise(t=>setTimeout(t,e))}var g6e=$t(nl(),1);function GG(e){let{name:t,registry:n,repository:r,currentVersion:i,targetVersion:o}=e,s=e.now??new Date,a=[],c=o?.withdrawn??n?.deprecated??void 0;c&&a.push({statement:`The maintainer has withdrawn ${t} ${e.to}: ${c}`,url:n?.homepage??void 0,concerning:!0,polarity:"blocks"}),r?.archived?a.push({statement:"The upstream repository is archived. It will not receive further fixes.",url:r.url,concerning:!0,polarity:"blocks"}):r?.pushedAt&&a.push({statement:`The repository was last pushed to ${zG(r.pushedAt,s)}.`,url:r.url}),i?.withdrawn&&!c&&a.push({statement:`The version currently installed, ${e.from}, has been withdrawn: ${i.withdrawn}`,concerning:!0,polarity:"favors"});let l=b6e(n?.versions??[],e.ecosystem);if(l){let p=Ne(e.to,e.ecosystem),f=Ne(l,e.ecosystem),m=p&&f?Xe(f,p):null;m===0?a.push({statement:`${e.to} is the latest stable release.`}):m!==null&&m>0&&a.push({statement:`${e.to} is not the latest release; ${l} is also available.`})}o?.releasedAt&&a.push({statement:`The target version was released ${zG(o.releasedAt,s)}.`});let u=h6e(i,o);u&&a.push(u);let d=y6e(e,l);return d&&a.push(d),{facts:a,...c?{deprecated:c}:{},...r?.archived?{archived:!0}:{},...l?{latestStable:l}:{},...o?.releasedAt?{targetReleasedAt:o.releasedAt}:{}}}function h6e(e,t){let n=e?.runtime,r=t?.runtime;return!r||n&&n.requirement===r.requirement?null:{statement:!n?`The target version requires ${r.name} ${r.requirement}.`:`The required ${r.name} version changed from ${n.requirement} to ${r.requirement}.`,concerning:!1,polarity:"context"}}function y6e(e,t){let n=Ne(e.from,e.ecosystem),r=t?Ne(t,e.ecosystem):null;if(!n?.release||!r?.release||e.ecosystem==="maven"||e.ecosystem==="opam")return null;let i=(r.release[0]??0)-(n.release[0]??0);return i<1?null:{statement:`The installed version ${e.from} is ${i} major version${i===1?"":"s"} behind the latest release, ${t}. Maintainers rarely backport fixes that far.`}}function b6e(e,t){return e.map(r=>Ne(r,t)).filter(r=>r!==null&&!r.prerelease).sort((r,i)=>-(Xe(r,i)??0))[0]?.raw??null}function zG(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return`on ${e}`;let r=Math.floor((t.getTime()-n.getTime())/864e5);if(r<0)return`on ${n.toISOString().slice(0,10)}`;if(r===0)return"today";if(r===1)return"yesterday";if(r<60)return`${r} days ago`;let i=Math.round(r/30.44);return i<24?`about ${i} months ago`:`about ${Math.round(r/365.25)} years ago`}var v6e=12;async function VG(e){let{name:t,currentVersion:n,targetVersion:r,repository:i,policy:o}=e,s=n?.license??null,a=r?.license??i?.license??null,c=o.enabled?await _6e(e):[],l=p=>qG(p,o),u=c.filter(p=>!p.allowed),d=()=>`This upgrade newly introduces ${u.map(p=>`${p.name} (${p.license??"no declared license"})`).join(", ")}, which the repository policy does not permit.`;if(!a&&!s){if(!l(a)||u.length>0){let p=[];return l(a)||p.push(`Neither ${t} ${e.from} nor ${e.to} declares a license Drift could read. The repository policy requires a declared license.`),u.length>0&&p.push(d()),p.push(`The policy permits ${rA(o)}.`),{verdict:"policy-violation",statement:p.join(" "),introduced:c}}return{verdict:o.enabled?"unknown":"ok",statement:o.enabled?`Neither ${t} ${e.from} nor ${e.to} declares a license Drift could read, so this upgrade's licensing position could not be checked.`:"No license metadata was published for either version.",introduced:c}}if(s&&a&&!k6e(s,a)){let p=!l(a);if(p||u.length>0){let f=[];return f.push(p?`The declared license changed from ${s} to ${a}, which the repository policy does not permit.`:`The declared license changed from ${s} to ${a}.`),u.length>0&&f.push(d()),f.push(`The policy permits ${rA(o)}.`),{verdict:"policy-violation",from:s,to:a,statement:f.join(" "),introduced:c}}return{verdict:"changed",from:s,to:a,statement:`The declared license changed from ${s} to ${a}. It remains within this repository's configured policy.`,introduced:c}}return l(a)?u.length>0?{verdict:"policy-violation",...s?{from:s}:{},...a?{to:a}:{},statement:`${d()} The policy permits ${rA(o)}.`,introduced:c}:a?{verdict:"ok",...s?{from:s}:{},to:a,statement:`The license is unchanged at ${a}.`,introduced:c}:{verdict:"unknown",...s?{from:s}:{},statement:`${t} ${e.to} declares no license Drift could read, though ${e.from} declared ${s}.`,introduced:c}:{verdict:"policy-violation",...s?{from:s}:{},...a?{to:a}:{},statement:a?`${t} is licensed ${a}, which the repository policy does not permit. The policy permits ${rA(o)}.`:`${t} ${e.to} declares no license Drift could read, though ${e.from} declared ${s}. The repository policy requires a declared license.`,introduced:c}}async function _6e(e){let{currentVersion:t,targetVersion:n,ecosystem:r,policy:i}=e;if(!t||!n)return[];let o=new Set(t.dependencies),s=n.dependencies.filter(c=>!o.has(c)).slice(0,v6e);return s.length===0?[]:await Promise.all(s.map(async c=>{let u=(await Da(c,r,"latest").catch(()=>null))?.license??null;return{name:c,license:u,allowed:qG(u,i)}}))}function qG(e,t){if(!t.enabled)return!0;if(!e)return!t.requireDeclared;let n=w6e(e);return t.deny.length>0&&n.some(r=>BG(r,t.deny))?!1:t.allow.length===0?!0:e.includes(" OR ")?n.some(r=>BG(r,t.allow)):n.every(r=>BG(r,t.allow))}function w6e(e){return e.replace(/[()]/g," ").split(/\s+(?:OR|AND|WITH)\s+/i).map(t=>t.trim()).filter(Boolean)}function BG(e,t){let n=e.toLowerCase().replace(/\+$/,"");return t.some(r=>r.toLowerCase().replace(/\+$/,"")===n)}function k6e(e,t){let n=r=>r.toLowerCase().replace(/[\s._]/g,"-").replace(/-+/g,"-");return n(e)===n(t)}function rA(e){return e.allow.length>0?e.allow.join(", "):e.deny.length>0?`anything except ${e.deny.join(", ")}`:"no licenses in particular"}var $6e=[{category:"security",pattern:/\b(CVE-\d{4}-\d+|GHSA-[\w-]+|GO-\d{4}-\d+|security fix|vulnerabilit|XSS|CSRF|SSRF|remote code execution|prototype pollution|path traversal|SQL injection|denial of service|ReDoS)\b/i},{category:"breaking",pattern:/\b(BREAKING|breaking change|no longer|has been removed|was removed|is removed|removed entirely|removed support|dropped support|drop support|renamed to|has been renamed|is now required|must now|now (?:requires?|returns?|expects?|accepts?|takes?)|migrate to|migration guide|incompatible)\b/i},{category:"performance",pattern:/\b(faster|speed ?up|sped up|reduces? (?:the )?(?:allocation|memory|latency)|allocation|throughput|optimi[sz]|performance (?:improvement|gain|boost|work|regression)|improv(?:e|es|ed|ing) performance)\b/i},{category:"fix",pattern:/^\s*(?:fix(?:e[sd])?|bugfix|resolve[sd]?|correct(?:s|ed)?)\b/i}];function WG(e){let{dependency:t,evidence:n,breakingChanges:r,impactSites:i}=e,o=new Map;for(let u of i)o.set(u.breakingChangeId,(o.get(u.breakingChangeId)??0)+1);let s=[],a=new Set;for(let u of r){if(u.dependency!==t)continue;let d=o.get(u.id)??0,p=mce(u.summary);a.has(p)||(a.add(p),s.push({category:"breaking",text:u.summary,...d>0?{affectedSites:d}:{},...fce(u,n)?{url:fce(u,n)}:{},...u.citations[0]?{citation:u.citations[0]}:{}}))}let c=0,l=new Map;for(let u of n)if(u.dependency===t&&!(u.source==="semver-heuristic"||u.source==="type-surface-diff"))for(let d of gce(u.content)){let p=mce(d);if(!p||a.has(p))continue;a.add(p);let f=JG(d);if(f==="breaking"&&s.some(g=>x6e(g.text,d)))continue;let m=l.get(f)??0;if(m>=6){c++;continue}l.set(f,m+1),s.push({category:f,text:d,...u.url?{url:u.url}:{},citation:u.id})}return{changes:S6e(s),unrelated:c}}function HG(e){return e.changes.filter(t=>t.category==="performance").map(t=>({statement:t.text,...t.url?{url:t.url}:{},...t.citation?{citation:t.citation}:{}}))}function KG(e,t){if(e.length===0)return null;let n=e.filter(o=>o.kind==="package-added").length,r=e.length-n,i=[];return n>0&&i.push(`${n} new package${n===1?"":"s"}`),r>0&&i.push(`${r} new exported symbol${r===1?"":"s"}`),i.length===0?null:{statement:`The target version adds ${i.join(" and ")}, none of which can break existing code. Computed from ${t}.`}}function JG(e){for(let{category:t,pattern:n}of $6e)if(n.test(e))return t;return"improvement"}var pce={breaking:0,security:1,fix:2,performance:3,improvement:4};function S6e(e){return[...e].sort((t,n)=>{let r=pce[t.category]-pce[n.category];return r!==0?r:(n.affectedSites??0)-(t.affectedSites??0)})}function gce(e){let t=[],n=null;for(let r of e.split(` +`)){let i=r.trim();if(!i||/^[-=]{3,}$/.test(i))continue;if(i.startsWith("#")){n=null;continue}let o=/^[-*+]\s+/.test(i)||/^\d+\.\s+/.test(i),s=i.replace(/^[-*+]\s+/,"").replace(/^\d+\.\s+/,"").trim();if(!(s.length<12)&&!/^(?:by\s+@|thanks|co-authored-by|https?:\/\/\S+$)/i.test(s)){if(!o&&/:\s*$/.test(s)&&JG(s)==="breaking"){n=s;continue}t.push(E6e(n&&o?`${n} ${s}`:s,240)),!o&&!/:\s*$/.test(s)&&(n=null)}}return t}function fce(e,t){for(let n of e.citations){let r=t.find(i=>i.id===n)?.url;if(r)return r}}function x6e(e,t){let n=i=>new Set(i.match(/`([^`]+)`/g)??[]),r=n(e);return r.size===0?!1:[...n(t)].some(i=>r.has(i))}function mce(e){return e.toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}function E6e(e,t){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}var hce={critical:0,high:1,medium:2,low:3,unknown:4};function ZG(e,t){return hce[e]-hce[t]}function YG(e){return e.reduce((t,n)=>ZG(n.severity,t)<0?n.severity:t,"unknown")}var T6e=new Set(["behaviour-change","signature-change","default-change","moved-export","runtime-requirement"]);function hv(e){let t=[],{security:n,maintenance:r,license:i,impactSites:o}=e,s=o.length,a=new Set(o.map(z=>z.file)).size,c=new Map(e.breakingChanges.map(z=>[z.id,z])),l=o.filter(z=>c.get(z.breakingChangeId)?.kind!=="runtime-requirement"),u=new Set(l.map(z=>z.file)).size,d=o.filter(z=>c.get(z.breakingChangeId)?.kind==="runtime-requirement"),p=e.breakingChanges.filter(z=>z.kind==="runtime-requirement"&&z.runtime?.runtime),f=WT(e.breakingChanges,e.runtimeAnalyses??[]),m=_G(f),g=p.length>0&&wG(m??"unknown"),h=p.length>0?m??"unknown":void 0,v=zm(e.breakingChanges,o,f,e.localizationRan??!0,e.localizationComplete??!0),b=new Set(v.filter(z=>z.state==="actionable").map(z=>z.changeId)),_=e.breakingChanges.filter(z=>b.has(z.id)),w=new Set(v.flatMap(z=>z.actionableSites.map(Y=>`${Y.breakingChangeId}:${Y.file}:${Y.line}`))),k=l.filter(z=>!w.has(`${z.breakingChangeId}:${z.file}:${z.line}`)),x=_.filter(z=>T6e.has(z.kind)),A=_.length-x.length,I=Gm(e.breakingChanges);n.checked&&(n.resolved.length>0&&t.push(`Fixes ${n.resolved.length} known ${Ir(n.resolved.length,"vulnerability","vulnerabilities")} (worst: ${YG(n.resolved)}).`),n.introduced.length>0&&t.push(`Introduces ${n.introduced.length} known ${Ir(n.introduced.length,"vulnerability","vulnerabilities")} not present in the installed version (worst: ${YG(n.introduced)}).`),n.carried.length>0&&t.push(`${n.carried.length} known ${Ir(n.carried.length,"vulnerability affects","vulnerabilities affect")} both versions; this upgrade does not address ${n.carried.length===1?"it":"them"}.`),n.resolved.length===0&&n.target.length===0&&t.push("No known vulnerabilities were found for the target version."));let R=l.filter(z=>w.has(`${z.breakingChangeId}:${z.file}:${z.line}`));R.length>0&&t.push(I?`${R.length} ${Ir(R.length,"place","places")} in ${new Set(R.map(z=>z.file)).size} ${Ir(new Set(R.map(z=>z.file)).size,"file","files")} match${R.length===1?"es":""} ${I} entries this upgrade changes.`:`${R.length} ${Ir(R.length,"place","places")} in ${new Set(R.map(z=>z.file)).size} ${Ir(new Set(R.map(z=>z.file)).size,"file","files")} use${R.length===1?"s":""} an API this upgrade changes.`),k.length>0&&t.push(`${k.length} local API match${k.length===1?"":"es"} require review; Drift did not establish a safe edit.`);for(let z of f)t.push(z.statement);if(d.length>0&&f.length===0&&t.push(...P6e(d)),s>0)A>0&&t.push(`${A} of the locally affected changes can be applied mechanically.`),x.length>0&&t.push(`${x.length} locally affected ${Ir(x.length,"change requires","changes require")} a developer decision rather than a substitution.`);else if(e.breakingChanges.some(z=>z.kind!=="runtime-requirement")&&!g){let z=e.breakingChanges.filter(Y=>Y.kind!=="runtime-requirement").length;t.push(I?`${z} published ${I} ${Ir(z,"change","changes")} require review; these package-role contracts are assessed independently of source call signatures.`:`${z} upstream API breaking ${Ir(z,"change","changes")}; no usage of the changed parts was located in this repository \u2014 review before upgrading.`)}for(let z of r.facts)z.concerning&&t.push(z.statement);i.verdict==="policy-violation"&&t.push(i.statement);let C=A6e(e,{affected:s,decisions:x.length,actionable:_.length>0,runtimeUnresolved:g,localizationUnresolved:v.some(z=>z.reason==="localization-incomplete"||z.reason==="impact-unresolved"),roleContractChanged:I!==null}),j=I6e(e);return e.gaps.length>0&&t.push(...e.gaps),{recommendation:C,reasons:t,confidence:j.level,confidenceBasis:j.basis,...h?{runtimeCompatibility:h}:{}}}function A6e(e,t){let{security:n,maintenance:r,license:i}=e;if(n.checked&&n.introduced.length>0||r.deprecated||i.verdict==="policy-violation"||r.facts.some(a=>a.polarity==="blocks"))return"do-not-upgrade-yet";if(t.affected>0)return t.actionable&&t.decisions>0?"manual-migration-required":"upgrade-after-review";if(t.runtimeUnresolved||t.localizationUnresolved||t.roleContractChanged)return"upgrade-after-review";let o=n.checked&&n.resolved.length>0,s=r.facts.some(a=>a.polarity==="favors");return e.breakingChanges.length===0&&!QG(e)?o||s?"upgrade-recommended":"insufficient-evidence":o||s?"upgrade-recommended":"safe-to-upgrade"}function QG(e){return e.surfaceCompared||(e.proseRead??0)>0||bce(e).length>0}function bce(e){return e.evidence.filter(t=>t.dependency===e.dependency&&t.workspace===e.workspace&&(t.source==="github-release"||t.source==="changelog"||t.source==="migration-guide"))}function I6e(e){let t=Math.max(bce(e).length,e.proseRead??0),n=[];if(e.surfaceCompared){let i=Gm(e.breakingChanges);n.push(i?`the computed ${i} diff`:"the computed API diff")}return t>0&&n.push(t===1?"release notes":"release notes and changelog"),e.security.checked&&n.push("the OSV advisory database"),n.length===0?{level:"low",basis:"Nothing but the version numbers could be read for this dependency."}:{level:e.surfaceCompared||n.length>=2?"high":"medium",basis:n.length===1?`${yce(n[0])} is the available evidence.`:`${yce(R6e(n))} agree.`}}function Gm(e){let t=e.filter(n=>n.kind!=="runtime-requirement");return t.length===0?null:t.every(n=>n.symbols.some(r=>r.startsWith("pom:")))?"Maven POM contract":t.every(n=>n.symbols.some(r=>r.startsWith("nuget:")))?"NuGet package contract":t.every(n=>n.symbols.some(r=>r.startsWith("pub:")))?"Pub package contract":null}function R6e(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function yce(e){return e.charAt(0).toUpperCase()+e.slice(1)}function P6e(e){let t=[],n=e.filter(o=>o.runtimeVerdict!=="partial"&&o.runtimeVerdict!=="unknown"),r=e.filter(o=>o.runtimeVerdict==="partial"),i=e.filter(o=>o.runtimeVerdict==="unknown");if(n.length>0){let o=n.length;t.push(`${o} runtime ${Ir(o,"declaration","declarations")} in this repository ${Ir(o,"does not satisfy","do not satisfy")} this upgrade's runtime requirement.`)}if(r.length>0){let o=r.length;t.push(`${o} runtime ${Ir(o,"declaration allows","declarations allow")} versions this upgrade's runtime requirement rejects.`)}if(i.length>0){let o=i.length;t.push(`${o} runtime ${Ir(o,"declaration is","declarations are")} dynamically defined; Drift could not determine whether ${Ir(o,"it satisfies","they satisfy")} this upgrade's runtime requirement.`)}return t}function Ir(e,t,n){return e===1?t:n}var Tu={"safe-to-upgrade":"Safe to upgrade","upgrade-recommended":"Upgrade recommended","upgrade-after-review":"Upgrade after review","manual-migration-required":"Migration required","insufficient-evidence":"Insufficient evidence","do-not-upgrade-yet":"Do not upgrade yet"};var C6e={"rate-limited":"rate limited","server-error":"server error","network-error":"network error"};async function XG(e,t){return ni("rationale.prepare",{package:e.name,ecosystem:e.ecosystem,from:e.from,to:e.to},async()=>{let{config:n}=t,r=e.from,i=e.to,o=h=>t.onProgress?.(h);o("Checking package metadata");let s=Qn(e.name,e.ecosystem,i),a=Da(e.name,e.ecosystem,r).catch(()=>null),c=Da(e.name,e.ecosystem,i).catch(()=>null),l=n.rationale.security?(t.securityLookup??Promise.resolve(t.security).then(h=>h?.get(e)).then(h=>h??mv(e.name,e.ecosystem,r,i,t.osv??{}))).catch(h=>as(`Advisory lookup failed unexpectedly (${h instanceof Error?h.message:String(h)}), so this upgrade's effect on known vulnerabilities is unknown.`)):Promise.resolve(as("Advisory lookup is switched off for this repository (`rationale.security`), so this upgrade\u2019s effect on known vulnerabilities was not checked.")),u=await s;o("Checking repository status");let d=u?.githubRepo?await v8(u.githubRepo,t.githubToken,(h,v)=>o(`Checking repository status (${C6e[v]}, retrying \u2014 attempt ${h})`)).catch(()=>null):null;o("Checking security advisories");let[p,f,m]=await Promise.all([a,c,l]);o("Checking license");let g=await VG({name:e.name,ecosystem:e.ecosystem,from:r,to:i,currentVersion:p,targetVersion:f,repository:d,policy:n.licenses});return{registry:u,repository:d,currentVersion:p,targetVersion:f,security:m,license:g}})}async function iA(e,t){let n=e.changes.filter(s=>s.from&&s.to),r=n.filter(s=>!t.preparedFacts?.has(s)),i=r.map(s=>({name:s.name,ecosystem:s.ecosystem,from:s.from,to:s.to})),o=t.config.rationale.security?gv(i,t.osv??{}).then(s=>new Map(r.map((a,c)=>[a,s.get(i[c])]))):void 0;return Yn(n,4,async s=>{try{return await N6e(s,e,{...t,security:o})}catch(a){return t.logger.debug(`Rationale failed for ${s.name}: ${a.message}`),U6e(s,`Drift could not assemble an upgrade rationale for ${s.name}.`)}})}async function N6e(e,t,n){let r=s=>n.onProgress?.(e,s),i=n.preparedFacts?.get(e),o=await(i??XG(e,{config:n.config,...n.githubToken?{githubToken:n.githubToken}:{},...n.osv?{osv:n.osv}:{},...n.security?{security:n.security}:{},onProgress:r}));return O6e(e,t,o,n,{shared:i!==void 0})}async function O6e(e,t,n,r,i){return ni("rationale.finalize",{package:e.name,ecosystem:e.ecosystem,from:e.from,to:e.to,shared:i?.shared??r.preparedFacts?.has(e)??!1},async()=>{let{config:o,logger:s}=r,a=e.from,c=e.to,l=L=>r.onProgress?.(e,L),{registry:u,repository:d,currentVersion:p,targetVersion:f,security:m,license:g}=n,h=t.breakingChanges.filter(L=>L.dependency===e.name&&L.workspace===e.workspace),v=new Set(h.map(L=>L.id)),b=t.impactSites.filter(L=>v.has(L.breakingChangeId)),_=(t.runtimeAnalyses??[]).filter(L=>v.has(L.changeId));l("Checking maintenance signals");let w=o.rationale.maintenance?GG({name:e.name,ecosystem:e.ecosystem,from:a,to:c,registry:u,repository:d,currentVersion:p,targetVersion:f,repoRuntime:(e.workspace!==void 0?r.repoRuntimeByWorkspace?.get(e.workspace):void 0)??r.repoRuntime,pythonRuntime:(e.workspace!==void 0?r.pythonRuntimeByWorkspace?.get(e.workspace):void 0)??r.pythonRuntime,analyzedRuntimeRequirements:_.map(L=>({runtime:L.runtime,requirement:L.requirement}))}):{facts:[]},k=fn(e),x=r.additions?.get(k),A=r.surfaceCompared?.has(k)??x!==void 0,I=o.rationale.summary?WG({dependency:e.name,evidence:t.evidence,breakingChanges:h,impactSites:b,additions:x?.additions}):{changes:[],unrelated:0},R=[...HG(I)],C=x?KG(x.additions,x.locator):null;C&&R.push(C);let j=r.prose?.get(k)??r.prose?.get(e.name)??[],z=D6e(e,{surfaceCompared:A,surfaceGap:r.surfaceGaps?.get(k),security:m,registry:u,evidence:t.evidence,prose:j,licenseUnknown:g.verdict==="unknown"}),Y={dependency:e.name,workspace:e.workspace,breakingChanges:h,impactSites:b,evidence:t.evidence,security:m,maintenance:w,license:g,gaps:z,surfaceCompared:A,proseRead:j.length,runtimeAnalyses:_,localizationRan:t.localizationRan,localizationComplete:t.localizationComplete},se=hv(Y);return s.debug(`${e.name} ${a} \u2192 ${c}: ${se.recommendation}`),{dependency:e.name,from:a,to:c,security:m,maintenance:w,improvements:R,license:g,summary:I,assessment:se,runtimeAnalyses:_.map(({changeId:L,runtime:ee,requirement:ce,state:le,reason:Ae,statement:Ke})=>({changeId:L,runtime:ee,requirement:ce,state:le,reason:Ae,statement:Ke})),gaps:z,hasCompatibilityEvidence:QG(Y)}})}function D6e(e,t){let n=[],r=t.evidence.filter(s=>s.dependency===e.name&&s.workspace===e.workspace&&(s.source==="github-release"||s.source==="changelog"||s.source==="migration-guide")),i=t.surfaceGap,o=r.length>0?null:t.prose.length>0?t.surfaceCompared?null:`Drift read ${L6e(t.prose)} for ${e.name} ${e.to} and found nothing in ${t.prose.length===1?"it":"them"} that announces a breaking change. That is weaker than a clean API comparison: it means nothing was flagged, not that nothing broke.`:`No release notes, changelog, or migration guide was reachable for ${e.name} ${e.to}${t.registry?.githubRepo?"":", and no source repository could be resolved for it"}.`;return i&&o?n.push(`${_ce(i.detail)}. ${o}${i.remedy?` ${i.remedy}`:""}`):i?n.push(`${_ce(i.detail)}.${i.remedy?` ${i.remedy}`:""}`):o&&n.push(o),t.security.checked||n.push(t.security.reason??"The OSV advisory database could not be reached, so this upgrade's effect on known vulnerabilities is unknown."),F6e(n)}var M6e={"github-release":{one:"the release notes",many:"sets of release notes"},changelog:{one:"the changelog",many:"changelog files"},"migration-guide":{one:"the migration guide",many:"migration guides"}};function L6e(e){let t=r=>e.filter(i=>i.kind===r),n=[];for(let r of["github-release","changelog","migration-guide"]){let i=t(r);if(i.length===0)continue;let o=M6e[r];if(i.length===1){n.push(`${o.one} (${vce(i[0])})`);continue}n.push(`${i.length} ${o.many} (${i.map(vce).join(", ")})`)}return n.length===0?"the published release prose":n.length===1?n[0]:`${n.slice(0,-1).join(", ")} and ${n.at(-1)}`}function vce(e){return`[${e.label}](${e.url})`}function F6e(e){let t=new Set,n=[];for(let r of e){let i=r.toLowerCase().replace(/[^a-z0-9]+/g," ").trim();t.has(i)||(t.add(i),n.push(r))}return n}function _ce(e){return e.replace(/\.\s*$/,"")}function U6e(e,t){return{dependency:e.name,from:e.from??"",to:e.to??"",security:{checked:!1,current:[],target:[],resolved:[],introduced:[],carried:[],direction:"unknown"},maintenance:{facts:[]},improvements:[],license:{verdict:"unknown",statement:"Not checked.",introduced:[]},summary:{changes:[],unrelated:0},hasCompatibilityEvidence:!1,assessment:{recommendation:"insufficient-evidence",reasons:[t],confidence:"low",confidenceBasis:t},gaps:[t]}}var $ce=require("node:crypto"),Hi=require("node:fs/promises"),sA=require("node:os"),Au=require("node:path"),Sce=require("node:url"),xce=require("node:child_process");var Z6e={},Ece="behavioural-diff-npm-ts-v1",j6e=new Set(["behaviour-change","default-change","type-change","signature-change","required-field-added"]);function z6e(e,t){let n=t.verification.behavioural;if(!n.enabled)return[];let r=[];for(let i of e.breakingChanges){if(!j6e.has(i.kind))continue;let o=e.impactSites.filter(a=>a.breakingChangeId===i.id);if(o.length===0)continue;let s=Vr(i);if(!(!s.nature.includes("behaviour")&&s.nature!=="type-contract"&&i.kind!=="default-change"))for(let a of i.symbols.slice(0,n.maxSymbols-r.length)){let c=V6e(i),l=[{id:"default",args:[],contracts:c}],u=new Set;for(let d of o){if(l.length>=n.maxCasesPerSymbol)break;if(d.matchedSymbol!==a)continue;let p=G6e(d.excerpt,a);if(!p)continue;let f=JSON.stringify(p);u.has(f)||(u.add(f),l.push({id:`site-${l.length}`,args:p,contracts:c}))}if(r.push({dependency:i.dependency,workspace:i.workspace,symbol:a,modulePath:"",exportName:a,cases:l}),r.length>=n.maxSymbols)return r}}return r}function G6e(e,t){let r=new RegExp(`\\b${B6e(t)}\\s*\\(([^;]*)\\)`).exec(e);if(!r)return null;let i=r[1].trim();if(i==="")return[];let o=`[${i}]`.replace(/'/g,'"').replace(/([{,]\s*)([A-Za-z_$][\w$]*)\s*:/g,'$1"$2":');try{let s=JSON.parse(o);return Array.isArray(s)?s:null}catch{return null}}function B6e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function V6e(e){switch(e.kind){case"default-change":return["configured-defaults","return-shape"];case"type-change":case"signature-change":case"required-field-added":return["return-shape","thrown-error","argument-mutation","promise-state"];case"behaviour-change":return["return-shape","thrown-error","argument-mutation","promise-state","serialization-output"];default:return["return-shape"]}}async function q6e(e){let{config:t,oldEnvironment:n,newEnvironment:r}=e,i=e.probes.slice(0,t.maxSymbols),o=[],s=[];if(!t.enabled)return{evidence:[],observations:[],gaps:["behavioural probing disabled"]};if(t.sandbox!=="required")return{evidence:[],observations:[],gaps:["behavioural probing requires a sandbox"]};for(let a of i){let c=a.cases.slice(0,t.maxCasesPerSymbol);for(let l of c){let u=await oA(t,n,a,l),d=await oA(t,n,a,l),p=await oA(t,r,a,l),f=await oA(t,r,a,l),m=!eB(u,d)||!eB(p,f);o.push({dependency:a.dependency,workspace:a.workspace,symbol:a.symbol,caseId:l.id,generatedInput:l.args,oldResult:u,newResult:p,observedDifference:m?"nondeterministic result; no compatibility conclusion drawn":H6e(u,p),nondeterministic:m,limitations:K6e(t,l.contracts)})}}return{observations:o,gaps:s,evidence:o.map(Tce)}}async function W6e(){return typeof __dirname<"u"?(0,Au.join)(__dirname,"behavioural-worker.js"):(0,Sce.fileURLToPath)(new URL("./behavioural-worker.js",Z6e.url))}async function oA(e,t,n,r){let i=await(0,Hi.mkdtemp)((0,Au.join)((0,sA.tmpdir)(),"drift-behavioural-")),o=await(0,Hi.realpath)(i),s=(0,Au.join)(i,"case.json"),a=await(0,Hi.realpath)(await W6e()),c=(0,Au.resolve)(t.modulePath||n.modulePath),l=await(0,Hi.realpath)(c),u=(0,Au.resolve)(t.packageRoot);await(0,Hi.writeFile)(s,JSON.stringify({modulePath:l,exportName:n.exportName,args:r.args,network:e.network}));let d=[a,u,await(0,Hi.realpath)(u),c,l,s,await(0,Hi.realpath)(s)],p=[Number(process.versions.node.split(".")[0])>=24?"--permission":"--experimental-permission",...[...new Set(d)].map(f=>`--allow-fs-read=${f}`),`--max-old-space-size=${e.memoryMb}`,a,s];try{return await new Promise(f=>{let m=(0,xce.spawn)(process.execPath,p,{stdio:["ignore","pipe","pipe"],env:{PATH:process.env.PATH??"",HOME:o,TMPDIR:o,DRIFT_BEHAVIOURAL_SANDBOX:"1"}});if(m.pid&&e.cpuLimit<1)try{(0,sA.setPriority)(m.pid,Math.round(10*(1-e.cpuLimit)))}catch{}let g="",h="",v=64*1024,b=setTimeout(()=>{m.kill("SIGKILL")},e.timeoutSeconds*1e3);m.stdout.on("data",_=>{g=(g+_.toString("utf8")).slice(-v)}),m.stderr.on("data",_=>{h=(h+_.toString("utf8")).slice(-v)}),m.on("close",(_,w)=>{if(clearTimeout(b),w){f({status:"timed-out",signal:w,stdoutDigest:yv(g),stderrDigest:yv(h)});return}let k=g.trim().split(` +`).at(-1)??"",x=J6e(k);f(x??{status:"worker-failed",stdoutDigest:yv(g),stderrDigest:yv(h)})}),m.on("error",_=>{clearTimeout(b),f({status:"worker-failed",error:{name:_.name,messageCategory:"spawn"}})})})}finally{e.retainArtifacts||await(0,Hi.rm)(i,{recursive:!0,force:!0}).catch(()=>{})}}function eB(e,t){return JSON.stringify(wce(e))===JSON.stringify(wce(t))}function wce(e){return{status:e.status,value:e.value??null,error:e.error??null,mutations:e.mutations??[]}}var kce=new Set(["worker-failed","timed-out"]);function H6e(e,t){return kce.has(e.status)&&kce.has(t.status)?`probe unavailable: neither version could be observed (${e.status})`:eB(e,t)?"no observed difference for this contract and generated input domain":e.status!==t.status?`status changed from ${e.status} to ${t.status}`:JSON.stringify(e.value??null)!==JSON.stringify(t.value??null)?"returned value changed":JSON.stringify(e.error??null)!==JSON.stringify(t.error??null)?"thrown error changed":JSON.stringify(e.mutations??[])!==JSON.stringify(t.mutations??[])?"argument mutation changed":"observable result changed"}function K6e(e,t){let n=[`Harness ${Ece}; bounded to ${t.join(", ")||"return-shape"} contracts.`,"No observed difference is not proof of behavioural compatibility outside these generated inputs.",`CPU limit requested: ${e.cpuLimit} (best-effort process priority; no OS-level quota). Node subprocess enforces wall-clock, memory, output, filesystem, and network policy, and cannot spawn its own children or threads \u2014 the wall-clock timeout is the actual hard bound on CPU consumption.`];return e.network||n.push("Network APIs were disabled for the probe."),n}function Tce(e){let t=JSON.stringify({generatedInput:e.generatedInput,normalizedOldResult:e.oldResult,normalizedNewResult:e.newResult,observedDifference:e.observedDifference,testHarnessVersion:Ece,nondeterminismHandling:e.nondeterministic?"Repeated runs disagreed, so Drift records the observation but draws no compatibility conclusion.":"Old and new observations were repeated once and matched within each version.",limitations:e.limitations},null,2);return{id:`ev_behaviour_${yv(`${e.workspace??""}:${e.dependency}:${e.symbol}:${e.caseId}`).slice(0,12)}`,source:"behavioural-diff",dependency:e.dependency,...e.workspace!==void 0?{workspace:e.workspace}:{},locator:`${e.symbol}:${e.caseId}`,title:`Behavioural differential probe for ${e.symbol}`,content:t,weight:e.observedDifference.startsWith("probe unavailable")?0:e.observedDifference.startsWith("no observed difference")?.25:.8,findings:[{code:"behavioural-observation",symbol:e.symbol,detail:e.observedDifference}]}}async function Ace(e){let t=e.config.verification.behavioural,n=[],r=new Map,i=[];if(!t.enabled)return{evidence:n,citationsByChangeId:r,gaps:i};let o=z6e({breakingChanges:e.breakingChanges,impactSites:e.impactSites},e.config);if(o.length===0)return{evidence:n,citationsByChangeId:r,gaps:i};let s=new Map;for(let a of o){let c=ll({name:a.dependency,workspace:a.workspace}),l=s.get(c);l?l.probes.push(a):s.set(c,{dependency:a.dependency,workspace:a.workspace,probes:[a]})}for(let{dependency:a,workspace:c,probes:l}of s.values()){let u=e.dependencyChanges.find(f=>f.name===a&&f.workspace===c&&f.ecosystem==="npm");if(!u?.from||!u.to){i.push(`${a}: behavioural probing needs both a resolved old and new version; skipped.`);continue}let d=await e.resolveEnvironments(u);if(!d){i.push(`${a}: could not resolve ${u.from} and ${u.to} to executable code for behavioural probing; skipped.`);continue}let p=await q6e({config:t,probes:l,oldEnvironment:d.oldEnvironment,newEnvironment:d.newEnvironment});i.push(...p.gaps);for(let f of p.observations){let m=Tce(f);n.push(m);for(let g of e.breakingChanges){if(g.dependency!==a||g.workspace!==c||!g.symbols.includes(f.symbol))continue;let h=r.get(g.id);h?h.push(m.id):r.set(g.id,[m.id])}}}return{evidence:n,citationsByChangeId:r,gaps:i}}function Ice(e){return e.startsWith("probe unavailable")?"probe-unavailable":e.startsWith("no observed difference")?"no-difference":e.includes("returned value changed")?"return-value":e.startsWith("status changed")?"thrown-error":e.includes("argument mutation")?"argument-mutation":"behaviour"}function J6e(e){try{return JSON.parse(e)}catch{return null}}function yv(e){return(0,$ce.createHash)("sha256").update(e).digest("hex")}var _o=require("node:fs/promises"),Pce=require("node:os"),Iu=require("node:path");function Y6e(e){return Q6e(e.exports)??e.module??e.main??"index.js"}function Q6e(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e,n="."in t?t["."]:t,r=(i,o)=>{if(o>6||i==null)return null;if(typeof i=="string")return i;if(typeof i!="object")return null;let s=i;for(let a of["import","require","default","node"]){if(!(a in s))continue;let c=r(s[a],o+1);if(c)return c}return null};return r(n,0)}var Rce="https://cdn.jsdelivr.net/npm";async function tB(e,t,n){let r=await Ie(`${Rce}/${t}@${n}/package.json`);if(!r)return null;let i=Y6e(r).replace(/^\.\//,""),o=await ot(`${Rce}/${t}@${n}/${i}`);if(o===null)return null;let s=await(0,_o.mkdtemp)((0,Iu.join)((0,Pce.tmpdir)(),"drift-behavioural-env-")),a=(0,Iu.join)(s,i);return await(0,_o.mkdir)((0,Iu.dirname)(a),{recursive:!0}),await(0,_o.writeFile)(a,o),await(0,_o.writeFile)((0,Iu.join)(s,"package.json"),JSON.stringify(r)),{label:e,packageRoot:await(0,_o.realpath)(s),modulePath:await(0,_o.realpath)(a)}}var bA=require("node:path");function nB(){return{probes:new Map}}function X6e(e,t,n,r){let i=eWe(t,n),o=r?.probes.get(i);if(o)return o;let s=e(t,["--version"],{timeoutMs:2e4,...n?{env:n}:{}}).then(a=>a.failure!=="not-found").catch(()=>!0);return r?.probes.set(i,s),s}async function Cce(e,t,n,r){let i=[...new Set(t)],o=await Promise.all(i.map(s=>X6e(e,s,n,r)));return new Map(i.map((s,a)=>[s,o[a]]))}function eWe(e,t){let n=t??process.env,r=n.PATH??n.Path??n.path??"",i=n.PATHEXT??n.PathExt??"";return JSON.stringify([e,r,i,process.platform])}var aA=require("node:os");function cA(){try{return Math.max(1,(0,aA.availableParallelism)())}catch{return 4}}function tWe(){try{return Math.max(2,Math.floor((0,aA.totalmem)()/(512*1024*1024)))}catch{return 8}}function rB(e,t,n){return Math.max(t,Math.min(n,Math.floor(e)))}function iB(e,t){let n=t[e];if(!n)return;let r=Number(n);return Number.isFinite(r)&&r>=1?Math.floor(r):void 0}function lA(e=process.env){return iB("DRIFT_NETWORK_CONCURRENCY",e)??rB(cA()*4,8,32)}function oB(e=process.env){return iB("DRIFT_CONCURRENCY",e)??rB(Math.min(cA()*2,tWe()),4,16)}function uA(e=process.env){return iB("DRIFT_LOCAL_CONCURRENCY",e)??rB(cA()/4,2,6)}function Nce(e=process.env){return`${cA()} cores \xB7 ${lA(e)} network, ${oB(e)} analysis, ${uA(e)} local`}var sB=require("node:crypto");var nWe=1,nDt=10080*60*1e3;function Oce(e){let t=(0,sB.createHash)("sha256");t.update(`v${nWe} `),t.update(`${e.head} `),t.update(`${e.dir} `),t.update(`${e.packageManager} `),t.update(`${[...e.kinds].sort().join(",")} `),t.update(`${e.runtime} -`);for(let n of[...e.files].sort((i,r)=>i.path.localeCompare(r.path)))t.update(`${n.path} -`),t.update((0,F1.createHash)("sha256").update(n.content).digest("hex")),t.update(` -`);return t.digest("hex")}var Mje={async read(){return null},async write(){}};function U1(){return Mje}var _x=require("node:path");var sne=["typecheck","test","build"],Lje={typecheck:["typecheck","type-check","types","check-types","tsc","check"],test:["test","tests","test:unit"],build:["build","compile"]};function kx(e,t){let n=Fje(e,t);return sne.flatMap(i=>n.filter(r=>r.kind===i))}function Fje(e,t){switch(e){case"npm":case"pnpm":case"yarn":case"yarn-berry":case"bun":return jje(e,t);case"cargo":return[Oe("typecheck",{command:"cargo",args:["check"]},"the Cargo toolchain"),Oe("test",{command:"cargo",args:["test"]},"the Cargo toolchain"),Oe("build",{command:"cargo",args:["build"]},"the Cargo toolchain",!0)];case"go":return[Oe("typecheck",{command:"go",args:["vet","./..."]},"the Go toolchain"),Oe("test",{command:"go",args:["test","./..."]},"the Go toolchain"),Oe("build",{command:"go",args:["build","./..."]},"the Go toolchain",!0)];case"poetry":case"uv":case"pip":return Vje(e,t);case"bundler":return Bje(t);case"maven":return[Oe("typecheck",{command:"mvn",args:["-q","test-compile"]},"Maven"),Oe("test",{command:"mvn",args:["-q","test"]},"Maven"),Oe("build",{command:"mvn",args:["-q","package","-DskipTests"]},"Maven",!0)];case"gradle":return[Oe("typecheck",{command:"gradle",args:["compileTestJava"]},"Gradle"),Oe("test",{command:"gradle",args:["test"]},"Gradle"),Oe("build",{command:"gradle",args:["build","-x","test"]},"Gradle",!0)];case"sbt":return[Oe("typecheck",{command:"sbt",args:["Test/compile"]},"sbt"),Oe("test",{command:"sbt",args:["test"]},"sbt"),Oe("build",{command:"sbt",args:["package"]},"sbt",!0)];case"dotnet":return[Oe("typecheck",{command:"dotnet",args:["build","--nologo"]},"the .NET SDK"),Oe("test",{command:"dotnet",args:["test","--nologo"]},"the .NET SDK"),Oe("build",{command:"dotnet",args:["publish","--nologo"]},"the .NET SDK",!0)];case"composer":return Uje(t);case"mix":return[Oe("typecheck",{command:"mix",args:["compile","--warnings-as-errors"]},"Mix"),Oe("test",{command:"mix",args:["test"]},"Mix"),Oe("build",{command:"mix",args:["compile"]},"Mix",!0)];case"rebar":return[Oe("typecheck",{command:"rebar3",args:["compile"]},"Rebar3"),Oe("test",{command:"rebar3",args:["eunit"]},"Rebar3")];case"dart":return[Oe("typecheck",{command:"dart",args:["analyze"]},"the Dart SDK"),Oe("test",{command:"dart",args:["test"]},"the Dart SDK")];case"flutter":return[Oe("typecheck",{command:"flutter",args:["analyze"]},"the Flutter SDK"),Oe("test",{command:"flutter",args:["test"]},"the Flutter SDK")];case"swiftpm":return[Oe("typecheck",{command:"swift",args:["build"]},"the Swift toolchain"),Oe("test",{command:"swift",args:["test"]},"the Swift toolchain")];case"cocoapods":return[];case"opam":return[Oe("typecheck",{command:"dune",args:["build","@check"]},"dune"),Oe("test",{command:"dune",args:["runtest"]},"dune"),Oe("build",{command:"dune",args:["build"]},"dune",!0)];case"conan":case"vcpkg":return[Oe("build",e==="conan"?{command:"conan",args:["build","."]}:{command:"cmake",args:["--build","build"]},e==="conan"?"Conan":"CMake",!0)];case"arduino-cli":return[Oe("build",{command:"arduino-cli",args:["compile","--warnings","all"]},"Arduino CLI",!0)];case"platformio":return[Oe("build",{command:"pio",args:["run"]},"PlatformIO",!0),Oe("test",{command:"pio",args:["test"]},"PlatformIO")]}}function Uje(e){let t=Gt(e??""),n=[];if(t?.scripts&&"test"in t.scripts)return n.push(Oe("test",{command:"composer",args:["run","test"]},"`scripts.test` in composer.json")),n;let i=t?.["require-dev"]??{};return"phpunit/phpunit"in i?n.push(Oe("test",{command:"vendor/bin/phpunit",args:[]},"phpunit, declared in composer.json",!1,wx("composer"))):"pestphp/pest"in i&&n.push(Oe("test",{command:"vendor/bin/pest",args:[]},"pest, declared in composer.json",!1,wx("composer"))),"phpstan/phpstan"in i?n.push(Oe("typecheck",{command:"vendor/bin/phpstan",args:["analyse"]},"phpstan, declared in composer.json",!0,wx("composer"))):"vimeo/psalm"in i&&n.push(Oe("typecheck",{command:"vendor/bin/psalm",args:[]},"psalm, declared in composer.json",!0,wx("composer"))),n}function jje(e,t){let n=Gt(t??"")?.scripts;if(!n)return[];let i=e==="yarn"||e==="yarn-berry"?"yarn":e,r=[];for(let o of sne){let s=Lje[o].find(c=>typeof n[c]=="string");if(!s)continue;let a=s==="test"&&e!=="yarn"&&e!=="yarn-berry"?["test"]:i==="yarn"?[s]:["run",s];r.push(Oe(o,{command:i,args:a},`\`scripts.${s}\` in package.json`,o!=="test"&&Gje(n[s])))}return r}var zje=new Set(["tsc","vue-tsc","svelte-check"]);function Gje(e){return e.split(/&&|\|\||;/).some(t=>{let n=t.trim().split(/\s+/).filter(Boolean),i=0;for(;n[i]&&/^[\w.]+=/.test(n[i]);)i+=1;return n[i]==="npx"&&(i+=1),n[i]!==void 0&&zje.has(n[i])})}function Vje(e,t){let n=t??"",i=pi(n),r=l=>i.some(u=>u.header===l||u.header.startsWith(`${l}.`)),o=l=>new RegExp(`["']${l}\\b`,"i").test(n),s=e==="poetry"?["poetry","run"]:e==="uv"?["uv","run"]:null,a=(l,u)=>s?{command:s[0],args:[...s.slice(1),l,...u]}:{command:l,args:u},c=[];return r("tool.mypy")||o("mypy")?c.push(Oe("typecheck",a("mypy",["."]),"mypy, declared in pyproject.toml")):(r("tool.pyright")||o("pyright"))&&c.push(Oe("typecheck",a("pyright",[]),"pyright, declared in pyproject.toml")),(r("tool.pytest")||r("tool.pytest.ini_options")||o("pytest"))&&c.push(Oe("test",a("pytest",[]),"pytest, declared in pyproject.toml")),c}function Bje(e){let t=e??"",n=[];return/gem\s+["']rspec/.test(t)?n.push(Oe("test",{command:"bundle",args:["exec","rspec"]},"rspec, declared in the Gemfile")):/gem\s+["'](minitest|rake)/.test(t)&&n.push(Oe("test",{command:"bundle",args:["exec","rake","test"]},"rake, declared in the Gemfile")),n}function Oe(e,t,n,i=e==="typecheck",r={kind:"host",command:t.command}){return{kind:e,label:[t.command,...t.args].join(" "),command:t,source:n,commandOrigin:r,compileCapable:i}}function wx(...e){return{kind:"post-install",requiredHostCommands:e}}var qje=40,Wje=10*6e4;async function Sx(e,t="",n=Hn(),i){let r=t?(0,_x.join)(e,t):e,o=await n.readDirectory(r);if(o.length===0)return[];let s=da({entries:o}),a=i?s.find(u=>u.manager.id===i):void 0,c=a?[a,...s.filter(u=>u.manager.ecosystem!==a.manager.ecosystem)]:s,l=[];for(let{manager:u}of c){let d=u.manifests.find(f=>o.includes(f)),p=d?await n.readFile((0,_x.join)(r,d)):null;for(let f of kx(u.id,p))l.some(m=>m.label===f.label)||l.push(f)}return l}async function xx(e){let t=e.dir?(0,_x.join)(e.root,e.dir):e.root,n=e.exec??Xe,i=e.env??process.env,r=[],o=e.checks.length,s=!1;for(let[a,c]of e.checks.entries()){if(s){r.push($x(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"not-run",durationMs:0,output:"",reason:"An earlier check already failed, so this one was not run."}));continue}if(e.token?.isCancellationRequested){r.push($x(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"cancelled",durationMs:0,output:"",reason:"Cancelled before this check ran."}));continue}e.onProgress?.(c,a,o);let l=Date.now(),u=await n(c.command.command,c.command.args,{cwd:t,env:i,timeoutMs:e.timeoutMs??Wje,...e.signal?{signal:e.signal}:{},...e.onOutput?{onOutput:p=>e.onOutput(c,p)}:{}}),d=Date.now()-l;if(u.failure==="not-found"){r.push($x(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"not-run",durationMs:d,output:"",reason:e.notFoundReason?.(c.command.command)??`\`${c.command.command}\` was not found on PATH, so this check could not run.`}));continue}u.code!==0&&e.stopOnFirstFailure&&(s=!0),r.push($x(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:u.code===0?"passed":"failed",durationMs:d,output:Hje(`${u.stdout} +`);for(let n of[...e.files].sort((r,i)=>r.path.localeCompare(i.path)))t.update(`${n.path} +`),t.update((0,sB.createHash)("sha256").update(n.content).digest("hex")),t.update(` +`);return t.digest("hex")}var rWe={async read(){return null},async write(){}};function aB(){return rWe}var mA=require("node:path");var Dce=["typecheck","test","build"],iWe={typecheck:["typecheck","type-check","types","check-types","tsc","check"],test:["test","tests","test:unit"],build:["build","compile"]};function pA(e,t){let n=oWe(e,t);return Dce.flatMap(r=>n.filter(i=>i.kind===r))}function oWe(e,t){switch(e){case"npm":case"pnpm":case"yarn":case"yarn-berry":case"bun":return aWe(e,t);case"cargo":return[Fe("typecheck",{command:"cargo",args:["check"]},"the Cargo toolchain"),Fe("test",{command:"cargo",args:["test"]},"the Cargo toolchain"),Fe("build",{command:"cargo",args:["build"]},"the Cargo toolchain",!0)];case"go":return[Fe("typecheck",{command:"go",args:["vet","./..."]},"the Go toolchain"),Fe("test",{command:"go",args:["test","./..."]},"the Go toolchain"),Fe("build",{command:"go",args:["build","./..."]},"the Go toolchain",!0)];case"poetry":case"uv":case"pip":return uWe(e,t);case"bundler":return dWe(t);case"maven":return[Fe("typecheck",{command:"mvn",args:["-q","test-compile"]},"Maven"),Fe("test",{command:"mvn",args:["-q","test"]},"Maven"),Fe("build",{command:"mvn",args:["-q","package","-DskipTests"]},"Maven",!0)];case"gradle":return[Fe("typecheck",{command:"gradle",args:["compileTestJava"]},"Gradle"),Fe("test",{command:"gradle",args:["test"]},"Gradle"),Fe("build",{command:"gradle",args:["build","-x","test"]},"Gradle",!0)];case"sbt":return[Fe("typecheck",{command:"sbt",args:["Test/compile"]},"sbt"),Fe("test",{command:"sbt",args:["test"]},"sbt"),Fe("build",{command:"sbt",args:["package"]},"sbt",!0)];case"dotnet":return[Fe("typecheck",{command:"dotnet",args:["build","--nologo"]},"the .NET SDK"),Fe("test",{command:"dotnet",args:["test","--nologo"]},"the .NET SDK"),Fe("build",{command:"dotnet",args:["publish","--nologo"]},"the .NET SDK",!0)];case"composer":return sWe(t);case"mix":return[Fe("typecheck",{command:"mix",args:["compile","--warnings-as-errors"]},"Mix"),Fe("test",{command:"mix",args:["test"]},"Mix"),Fe("build",{command:"mix",args:["compile"]},"Mix",!0)];case"rebar":return[Fe("typecheck",{command:"rebar3",args:["compile"]},"Rebar3"),Fe("test",{command:"rebar3",args:["eunit"]},"Rebar3")];case"dart":return[Fe("typecheck",{command:"dart",args:["analyze"]},"the Dart SDK"),Fe("test",{command:"dart",args:["test"]},"the Dart SDK")];case"flutter":return[Fe("typecheck",{command:"flutter",args:["analyze"]},"the Flutter SDK"),Fe("test",{command:"flutter",args:["test"]},"the Flutter SDK")];case"swiftpm":return[Fe("typecheck",{command:"swift",args:["build"]},"the Swift toolchain"),Fe("test",{command:"swift",args:["test"]},"the Swift toolchain")];case"cocoapods":return[];case"opam":return[Fe("typecheck",{command:"dune",args:["build","@check"]},"dune"),Fe("test",{command:"dune",args:["runtest"]},"dune"),Fe("build",{command:"dune",args:["build"]},"dune",!0)];case"conan":case"vcpkg":return[Fe("build",e==="conan"?{command:"conan",args:["build","."]}:{command:"cmake",args:["--build","build"]},e==="conan"?"Conan":"CMake",!0)];case"arduino-cli":return[Fe("build",{command:"arduino-cli",args:["compile","--warnings","all"]},"Arduino CLI",!0)];case"platformio":return[Fe("build",{command:"pio",args:["run"]},"PlatformIO",!0),Fe("test",{command:"pio",args:["test"]},"PlatformIO")]}}function sWe(e){let t=Ht(e??""),n=[];if(t?.scripts&&"test"in t.scripts)return n.push(Fe("test",{command:"composer",args:["run","test"]},"`scripts.test` in composer.json")),n;let r=t?.["require-dev"]??{};return"phpunit/phpunit"in r?n.push(Fe("test",{command:"vendor/bin/phpunit",args:[]},"phpunit, declared in composer.json",!1,dA("composer"))):"pestphp/pest"in r&&n.push(Fe("test",{command:"vendor/bin/pest",args:[]},"pest, declared in composer.json",!1,dA("composer"))),"phpstan/phpstan"in r?n.push(Fe("typecheck",{command:"vendor/bin/phpstan",args:["analyse"]},"phpstan, declared in composer.json",!0,dA("composer"))):"vimeo/psalm"in r&&n.push(Fe("typecheck",{command:"vendor/bin/psalm",args:[]},"psalm, declared in composer.json",!0,dA("composer"))),n}function aWe(e,t){let n=Ht(t??"")?.scripts;if(!n)return[];let r=e==="yarn"||e==="yarn-berry"?"yarn":e,i=[];for(let o of Dce){let s=iWe[o].find(c=>typeof n[c]=="string");if(!s)continue;let a=s==="test"&&e!=="yarn"&&e!=="yarn-berry"?["test"]:r==="yarn"?[s]:["run",s];i.push(Fe(o,{command:r,args:a},`\`scripts.${s}\` in package.json`,o!=="test"&&lWe(n[s])))}return i}var cWe=new Set(["tsc","vue-tsc","svelte-check"]);function lWe(e){return e.split(/&&|\|\||;/).some(t=>{let n=t.trim().split(/\s+/).filter(Boolean),r=0;for(;n[r]&&/^[\w.]+=/.test(n[r]);)r+=1;return n[r]==="npx"&&(r+=1),n[r]!==void 0&&cWe.has(n[r])})}function uWe(e,t){let n=t??"",r=Ri(n),i=l=>r.some(u=>u.header===l||u.header.startsWith(`${l}.`)),o=l=>new RegExp(`["']${l}\\b`,"i").test(n),s=e==="poetry"?["poetry","run"]:e==="uv"?["uv","run"]:null,a=(l,u)=>s?{command:s[0],args:[...s.slice(1),l,...u]}:{command:l,args:u},c=[];return i("tool.mypy")||o("mypy")?c.push(Fe("typecheck",a("mypy",["."]),"mypy, declared in pyproject.toml")):(i("tool.pyright")||o("pyright"))&&c.push(Fe("typecheck",a("pyright",[]),"pyright, declared in pyproject.toml")),(i("tool.pytest")||i("tool.pytest.ini_options")||o("pytest"))&&c.push(Fe("test",a("pytest",[]),"pytest, declared in pyproject.toml")),c}function dWe(e){let t=e??"",n=[];return/gem\s+["']rspec/.test(t)?n.push(Fe("test",{command:"bundle",args:["exec","rspec"]},"rspec, declared in the Gemfile")):/gem\s+["'](minitest|rake)/.test(t)&&n.push(Fe("test",{command:"bundle",args:["exec","rake","test"]},"rake, declared in the Gemfile")),n}function Fe(e,t,n,r=e==="typecheck",i={kind:"host",command:t.command}){return{kind:e,label:[t.command,...t.args].join(" "),command:t,source:n,commandOrigin:i,compileCapable:r}}function dA(...e){return{kind:"post-install",requiredHostCommands:e}}var pWe=40,fWe=10*6e4;async function gA(e,t="",n=Xn(),r){let i=t?(0,mA.join)(e,t):e,o=await n.readDirectory(i);if(o.length===0)return[];let s=Fa({entries:o}),a=r?s.find(u=>u.manager.id===r):void 0,c=a?[a,...s.filter(u=>u.manager.ecosystem!==a.manager.ecosystem)]:s,l=[];for(let{manager:u}of c){let d=u.manifests.find(f=>o.includes(f)),p=d?await n.readFile((0,mA.join)(i,d)):null;for(let f of pA(u.id,p))l.some(m=>m.label===f.label)||l.push(f)}return l}async function hA(e){let t=e.dir?(0,mA.join)(e.root,e.dir):e.root,n=e.exec??et,r=e.env??process.env,i=[],o=e.checks.length,s=!1;for(let[a,c]of e.checks.entries()){if(s){i.push(fA(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"not-run",durationMs:0,output:"",reason:"An earlier check already failed, so this one was not run."}));continue}if(e.token?.isCancellationRequested){i.push(fA(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"cancelled",durationMs:0,output:"",reason:"Cancelled before this check ran."}));continue}e.onProgress?.(c,a,o);let l=Date.now(),u=await n(c.command.command,c.command.args,{cwd:t,env:r,timeoutMs:e.timeoutMs??fWe,...e.signal?{signal:e.signal}:{},...e.onOutput?{onOutput:p=>e.onOutput(c,p)}:{}}),d=Date.now()-l;if(u.failure==="not-found"){i.push(fA(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"not-run",durationMs:d,output:"",reason:e.notFoundReason?.(c.command.command)??`\`${c.command.command}\` was not found on PATH, so this check could not run.`}));continue}u.code!==0&&e.stopOnFirstFailure&&(s=!0),i.push(fA(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:u.code===0?"passed":"failed",durationMs:d,output:mWe(`${u.stdout} ${u.stderr}`),fullOutput:`${u.stdout} -${u.stderr}`,...u.failure==="timeout"?{reason:"Timed out."}:{}}))}return r}function $x(e,t,n){return e.onResult?.(n,t,e.checks.length),n}function Hje(e){let t=e.split(` -`).filter(i=>i.trim().length>0),n=t.slice(-qje);return n.lengthr.trim().length>0),n=t.slice(-pWe);return n.length]+\((\w[\w$]*\.(?:java|kt|scala)):(\d+)\)/;function Of(e){return e.replace(/\x1b\[[0-9;]*m/g,"").trim().slice(0,300)}function Ex(e,t){let n=e.replace(/\\/g,"/").replace(/^\.\//,"");if(t){let i=t.replace(/\\/g,"/").replace(/\/+$/,"");if(n===i)return n;n.startsWith(`${i}/`)&&(n=n.slice(i.length+1))}return n}function cne(e,t){let n=[],i=new Set,r=s=>{let a=`${s.file}|${s.line}|${s.column??""}|${s.code??""}|${s.message}`;i.has(a)||(i.add(a),n.push(s))},o=null;for(let s of e.split(` -`)){let a=s.replace(/\x1b\[[0-9;]*m/g,""),c=Xje.exec(a);if(c){o={testClass:c[2]??c[3],testName:c[1]??c[4],message:null,frames:0};continue}if(o){let f=eze.exec(a);if(f){let g=f[1].split("$")[0];if(g===o.testClass.split("$")[0]&&o.frames<3){o.frames++;let h=g.includes(".")?`${g.slice(0,g.lastIndexOf(".")).replace(/\./g,"/")}/`:"";r({file:`${h}${f[2]}`,line:Number(f[3]),message:Of(o.message??`${o.testName} failed`),severity:"error",origin:"stack-frame"})}continue}o.message===null&&a.trim().length>0&&(o.message=Of(a))}let l=Kje.exec(a);if(l){let f=Number(l[2]??l[4]),m=Number(l[3]??l[5]);r({file:Ex(l[1],t),line:f,...Number.isFinite(m)&&m>0?{column:m-1}:{},code:l[7].toUpperCase(),message:Of(l[8]??""),severity:(l[6]??"error").toLowerCase()==="warning"?"warning":"error"});continue}let u=Jje.exec(a);if(u){let f=Number(u[3]);r({file:Ex(u[1],t),line:Number(u[2]),...Number.isFinite(f)&&f>0?{column:f-1}:{},message:Of(u[4]??""),severity:/^\s*\[WARNING\]/.test(a)?"warning":"error"});continue}let d=Zje.exec(a);if(d){r({file:Ex(d[1],t),line:Number(d[2]),message:Of(d[4]??""),severity:(d[3]??"error").toLowerCase()==="warning"?"warning":"error"});continue}if(Yje.test(a))continue;let p=Qje.exec(a);if(p){let f=Number(p[3]),m=Of(p[4]??"");if(m.length===0)continue;r({file:Ex(p[1],t),line:Number(p[2]),...Number.isFinite(f)&&f>0?{column:f-1}:{},message:m,severity:/warning/i.test(m)?"warning":"error"})}}return n}function ane(e){let t=e.message.toLowerCase().replace(/['"`].*?['"`]/g,"\u2039\u203A").replace(/\s+/g," ").slice(0,80);return`${e.file}|${e.code??""}|${t}`}function lne(e,t){let n=new Set(t.map(ane));return e.filter(i=>i.severity==="error"&&!n.has(ane(i)))}var hne=["typecheck","build","test"];async function yne(e){let t={...e,toolAvailability:D1()},n=new Map,i=(a,c)=>{n.set(a.id,c),t.onVerified?.(a,c)};if(t.targets.length===0)return n;let r=[...fze(t.targets)],o=0,s=t.targets.length;return await qn(r,Math.max(1,t.concurrency??vx()),async([a,c])=>{if(t.token?.isCancellationRequested){for(let u of c)i(u,B1());return}let l=mze(a);await tze(t,l,c,{report:(u,d,p)=>t.onProgress?.({phase:u,detail:d,done:o,total:s,...p?{targets:p.map(f=>f.id)}:{}}),output:u=>t.onProgress?.({phase:"",detail:"",done:o,total:s,output:u}),settle:(u,d)=>{o+=1,i(u,d)}})}),await a1(),n}async function tze(e,t,n,i){let r=e.exec??Xe,o=au(e.env??process.env),s=wne(e.root,t),a=await(e.warm?.take(t,n[0].packageManager)??bne(e,t,n[0].packageManager,i));if(!a.ok){for(let d of n)i.settle(d,jo(a.reason));return}let{worktree:c,usable:l,manager:u}=a;for(let d of a.notes)i.report(`Preparing a test checkout of ${s}`,d);try{let d={exec:r,env:o,dir:t,root:c.path,usable:l,install:u?.install,...e.installTogether?{installTogether:e.installTogether}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{},...e.token?{token:e.token}:{}};await G1(d,n,i)}finally{await c.dispose()}}var nze=4;async function G1(e,t,n){if(e.token?.isCancellationRequested){for(let c of t)n.settle(c,B1());return!0}let i=t.length===1?t[0]:void 0;if(i)return une(e,i,n);let r=await aze(e,t,n);if(r!=="inconclusive")return r==="settled";if(t.length<=nze){for(let[c,l]of t.entries()){if(e.token?.isCancellationRequested){n.settle(l,B1());continue}if(!await une(e,l,n))return gne(t,c+1,n),!1}return!0}let o=Math.ceil(t.length/2),s=t.slice(0,o),a=t.slice(o);return await G1(e,s,n)?G1(e,a,n):(gne(a,0,n),!1)}async function une(e,t,n){let i=`Testing ${t.name}@${t.selected}`;n.report(i,"installing into the test checkout",[t]);try{await t.install(e.root)}catch(r){return n.settle(t,jo(`${t.name}@${t.selected} could not be installed, so it could not be tested. ${Ix(r)}`)),V1(e)}return n.report(i,e.usable.map(r=>r.label).join(", "),[t]),n.settle(t,W1(await kne(e,n,i,[t]),e.root)),V1(e)}async function dne(e,t,n,i){let r=[...new Set(t.flatMap(pne))];if(r.length===0)return{usable:t,missing:[]};let o=await rne(e,r,n,i),s=c=>pne(c).every(l=>o.get(l)===!0);return{usable:t.filter(s),missing:r.filter(c=>o.get(c)===!1)}}function pne(e){return e.commandOrigin.kind==="host"?[e.commandOrigin.command]:[...e.commandOrigin.requiredHostCommands]}function rze(e,t,n){let i=e.install?[{kind:"build",label:`${e.install.command} ${e.install.args.join(" ")}`.trim(),command:e.install,source:`${e.label} install`,commandOrigin:{kind:"host",command:e.install.command},compileCapable:!1}]:[],r=kx(e.id,null).filter(s=>n.includes(s.kind)),o=i.length>0?t.filter(s=>n.includes(s.kind)):[];return ize([...i,...r,...o])}function ize(e){let t=[];for(let n of e)t.some(i=>i.label===n.label)||t.push(n);return t}function fne(e){return e.length===1?`\`${e[0]}\` is`:`${e.slice(0,-1).map(t=>`\`${t}\``).join(", ")} and \`${e.at(-1)}\` are`}async function bne(e,t,n,i){let r=e.exec??Xe,o=au(e.env??process.env),s=e.kinds??hne,a=wne(e.root,t),c=Uc(n),l=c?await Sx(e.root,t,e.fs??Hn(),n).catch(()=>[]):[],u=c?rze(c,l,s):[];if(u.length>0){let E=await dne(r,u,o,e.toolAvailability);if(E.usable.length===0)return nt("verify.skipped.noTool"),{ok:!1,reason:`${fne(E.missing)} not installed, so ${a} could not be built or tested against the upgrade.`}}i.report(`Preparing a test checkout of ${a}`,"checking out a clean copy");let d,p=It("verify","worktree",{project:a});try{d=await ax(e.root,`probe-${t||"root"}`,{exec:r,env:o,...e.allowedGlobs?{allowedGlobs:e.allowedGlobs}:{}}),p.end()}catch(E){return p.end({failed:!0}),{ok:!1,reason:Ix(E)}}let f=[];d.copiedFiles.length>0&&f.push(`carried over ${j1(d.copiedFiles,d.copiedRules)} not tracked by git`),d.oversizedFiles.length>0&&f.push(`skipped ${j1(d.oversizedFiles,d.oversizedRules)} \u2014 too large to carry over automatically, which may make a check fail for a reason unrelated to this upgrade`),d.skippedSecrets.length>0&&f.push(`never copied ${j1(d.skippedSecrets,d.skippedSecretRules)} \u2014 ${d.skippedSecrets.length===1?"it looked":"they looked"} like credentials, which may make a check fail for a reason unrelated to this upgrade; see \`verify.generatedSourceGlobs\` if the project genuinely needs ${d.skippedSecrets.length===1?"it":"one of them"}`);let m=async E=>(await d.dispose(),{ok:!1,reason:E}),g=(await Sx(d.path,t,e.fs??Hn(),n)).filter(E=>s.includes(E.kind));if(g.length===0)return m("This project declares no typecheck or build that Drift could run against the upgrade.");let h=await dne(r,g,o,e.toolAvailability),b=h.usable;if(b.length===0)return m(h.missing.length>0?`${fne(h.missing)} not installed, so ${a} could not be built or tested against the upgrade.`:"This project declares checks, but none of them could run in the current environment.");let y=c?.install;if(y){i.report(`Installing ${a}'s dependencies`,`\`${y.command} ${y.args.join(" ")}\``),nt("verify.install");let E=await En("verify","install",()=>r(y.command,y.args,{cwd:t?`${d.path}/${t}`:d.path,env:o,timeoutMs:e.timeoutMs??q1,...e.signal?{signal:e.signal}:{},onOutput:i.output}),{project:a,manager:y.command});if(E.code!==0){let T=(E.stderr||E.stdout).trim().split(` -`).slice(-3).join(" ");return m(`\`${y.command} ${y.args.join(" ")}\` failed in a clean checkout, so there was nothing to test the upgrade against. ${T}`.trim())}}if(e.token?.isCancellationRequested)return m("Cancelled before this upgrade could be tested.");let w=e.baselineCache??U1(),k=await oze(e,d.path,t,n,b),_=k?await w.read(k):null,S;if(_)nt("verify.baseline.cached"),i.report(`Checking ${a} as it is`,`reusing the baseline measured earlier for this commit (${_.filter(E=>E.status==="passed").length} of ${_.length} checks green)`),S=_;else{nt("verify.baseline.measured");let E=It("verify","baseline",{project:a,checks:b.length});i.report(`Checking ${a} as it is`,`${b.map(A=>A.label).join(", ")}`);let T=await xx({root:d.path,dir:t,checks:b,env:o,exec:r,onProgress:A=>i.report(`Checking ${a} as it is`,`\`${A.label}\``),onOutput:(A,L)=>i.output(L),...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}});E.end(),S=T,k&&!e.token?.isCancellationRequested&&await w.write(k,T)}let x=b.filter(E=>S.some(T=>T.label===E.label&&T.status==="passed"));return x.length===0?m(pze(S)):{ok:!0,worktree:d,usable:x,manager:c,notes:f}}async function oze(e,t,n,i,r){if(!e.baselineCache)return null;let o=e.exec??Xe,s=au(e.env??process.env),a=await o("git",["rev-parse","HEAD"],{cwd:t,env:s}).catch(()=>null);if(!a||a.code!==0)return null;let c=e.fs??Hn(),l=n?`${t}/${n}`:t,d=(await c.readDirectory(l).catch(()=>[])).filter(f=>sze.test(f)||Oc(f)).sort();if(d.length===0)return null;let p=[];for(let f of d){let m=await c.readFile(`${l}/${f}`).catch(()=>null);if(m===null)return null;p.push({path:f,content:m})}return one({head:a.stdout.trim(),dir:n,packageManager:i,kinds:r.map(f=>f.kind),files:p,runtime:`${process.version}/${process.platform}/${process.arch}`})}var sze=/^(package\.json|package-lock\.json|npm-shrinkwrap\.json|yarn\.lock|pnpm-lock\.yaml|bun\.lockb?|pyproject\.toml|setup\.py|setup\.cfg|poetry\.lock|uv\.lock|Pipfile(\.lock)?|go\.mod|go\.sum|Cargo\.(toml|lock)|Gemfile(\.lock)?|[^/]*\.gemspec|pom\.xml|build\.gradle(\.kts)?|gradle\.lockfile|build\.sbt|composer\.(json|lock)|mix\.(exs|lock)|pubspec\.(yaml|lock)|Package\.(swift|resolved)|Podfile(\.lock)?|[^/]*\.opam|conanfile\.(txt|py)|conan\.lock|vcpkg\.json|platformio\.ini|library\.properties|.*\.csproj|.*\.fsproj|packages\.lock\.json)$/i;function vne(e,t,n){let i={...e,toolAvailability:D1()},r=new Map,o={report:(u,d)=>n?.({phase:u,detail:d,done:0,total:0}),output:u=>n?.({phase:"",detail:"",done:0,total:0,output:u})},s=Math.max(1,i.concurrency??vx()),a=0,c=[],l=async u=>{a>=s&&await new Promise(d=>c.push(d)),a+=1;try{return await u()}finally{a-=1,c.shift()?.()}};for(let{dir:u,packageManager:d}of t)r.has(u)||r.set(u,{packageManager:d,prepared:l(()=>bne(i,u,d,o)).catch(p=>({ok:!1,reason:Ix(p)}))});return{take(u,d){let p=r.get(u);if(p&&p.packageManager===d)return r.delete(u),p.prepared},async dispose(){let u=[...r.values()];r.clear(),await Promise.all(u.map(({prepared:d})=>d.then(p=>p.ok?p.worktree.dispose():void 0,()=>{}))),await a1()}}}function wne(e,t){return t||(0,Tx.basename)(e)||"the repository"}async function aze(e,t,n){n.report(`Testing ${t.length} upgrades together`,t.map(a=>`${a.name}@${a.selected}`).join(", "),t);let r=await cze(e,t)&&!e.token?.isCancellationRequested?await kne(e,n,`Testing ${t.length} upgrades together`,t,{stopOnFirstFailure:!0}):[],o=r.length>0&&r.every(a=>a.status==="passed"),s=await V1(e);if(o){for(let a of t)n.settle(a,{...W1(r,e.root),measuredWith:t.length});return"settled"}if(!s){for(let a of t)n.settle(a,jo("The test checkout could not be reset to a clean state after testing these upgrades together, so they could not be attributed individually."));return"contaminated"}return"inconclusive"}async function cze(e,t){if(e.token?.isCancellationRequested)return!1;nt("verify.install");let n=It("verify","install",{packages:t.length});try{return await lze(e,t)}finally{n.end()}}async function lze(e,t){if(e.installTogether)try{if(await e.installTogether(e.root,t))return!0}catch{return!1}for(let n of t){if(e.token?.isCancellationRequested)return!1;try{await n.install(e.root)}catch{return!1}}return!0}function kne(e,t,n,i,r){return nt("verify.checkPass"),En("verify","checks",()=>xx({root:e.root,dir:e.dir,checks:e.usable,env:e.env,exec:e.exec,...r?.stopOnFirstFailure?{stopOnFirstFailure:!0}:{},...t&&n?{onProgress:o=>t.report(n,`\`${o.label}\``,i)}:{},...t?{onOutput:(o,s)=>t.output(s)}:{},...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}}))}var q1=15*6e4;async function $ne(e){let t=e.exec??Xe,n=au(e.env??process.env),i=await mne(e,e.afterSha,t,n,"with the change");if(i.status!=="failed"||!e.beforeSha)return i;let r=await mne(e,e.beforeSha,t,n,"without it");return uze(i,r,e.beforeSha)}function uze(e,t,n){if(t.checks.length===0)return jo(`The project could not be checked at ${su(n)}, so there is nothing to compare the failure against.`);let i=new Map(t.checks.map(a=>[a.label,a])),r=e.checks.filter(a=>a.status==="failed"&&i.get(a.label)?.status==="passed");if(r.length===0){let a=[...new Set(e.checks.filter(c=>c.status==="failed").map(c=>i.get(c.label)?`\`${c.label}\` already failed at ${su(n)}`:`\`${c.label}\` has no baseline at ${su(n)} to compare against`))];return jo(`${a.join("; ")}, so the failure afterwards proves nothing about this dependency.`)}let o=r.map(a=>`$ ${a.label} +`)}var gWe=/^\s*(?:\x1b\[[0-9;]*m)*([^\s()][^()]*?)(?:\((\d+),(\d+)\)|:(\d+):(\d+))\s*[-:]?\s*(error|warning)\s+(TS\d+)\s*:\s*(.*)$/i,hWe=/^\s*(?:\[(?:ERROR|WARNING)\]\s*)?(\/?[^\s:]+\.(?:java|kt|scala)):\[(\d+),(\d+)\]\s*(.*)$/,yWe=/^\s*(?:\[(?:ERROR|WARNING)\]\s*)?(\/?[^\s:]+\.(?:java|kt|scala)):(\d+):\s*(error|warning)\s*:\s*(.*)$/i,bWe=/^\s*at\s+(?:.*?\((?:[A-Za-z]:)?[^()]+:\d+:\d+\)|(?:[A-Za-z]:)?\S+:\d+:\d+)\s*$/,vWe=/^\s*([^\s:][^:]*\.\w+):(\d+)(?::(\d+))?:\s*(.*)$/,_We=/^\s*(?:\[ERROR\]\s*)?(?:(\w+)\((\S+?)\)|([\w.$]+)\.(\w+))\s+Time elapsed:.*<<<\s*(FAILURE|ERROR)!/,wWe=/^\s*at\s+([\w.$]+)\.[\w$<>]+\((\w[\w$]*\.(?:java|kt|scala)):(\d+)\)/;function Bm(e){return e.replace(/\x1b\[[0-9;]*m/g,"").trim().slice(0,300)}function yA(e,t){let n=e.replace(/\\/g,"/").replace(/^\.\//,"");if(t){let r=t.replace(/\\/g,"/").replace(/\/+$/,"");if(n===r)return n;n.startsWith(`${r}/`)&&(n=n.slice(r.length+1))}return n}function Lce(e,t){let n=[],r=new Set,i=s=>{let a=`${s.file}|${s.line}|${s.column??""}|${s.code??""}|${s.message}`;r.has(a)||(r.add(a),n.push(s))},o=null;for(let s of e.split(` +`)){let a=s.replace(/\x1b\[[0-9;]*m/g,""),c=_We.exec(a);if(c){o={testClass:c[2]??c[3],testName:c[1]??c[4],message:null,frames:0};continue}if(o){let f=wWe.exec(a);if(f){let g=f[1].split("$")[0];if(g===o.testClass.split("$")[0]&&o.frames<3){o.frames++;let h=g.includes(".")?`${g.slice(0,g.lastIndexOf(".")).replace(/\./g,"/")}/`:"";i({file:`${h}${f[2]}`,line:Number(f[3]),message:Bm(o.message??`${o.testName} failed`),severity:"error",origin:"stack-frame"})}continue}o.message===null&&a.trim().length>0&&(o.message=Bm(a))}let l=gWe.exec(a);if(l){let f=Number(l[2]??l[4]),m=Number(l[3]??l[5]);i({file:yA(l[1],t),line:f,...Number.isFinite(m)&&m>0?{column:m-1}:{},code:l[7].toUpperCase(),message:Bm(l[8]??""),severity:(l[6]??"error").toLowerCase()==="warning"?"warning":"error"});continue}let u=hWe.exec(a);if(u){let f=Number(u[3]);i({file:yA(u[1],t),line:Number(u[2]),...Number.isFinite(f)&&f>0?{column:f-1}:{},message:Bm(u[4]??""),severity:/^\s*\[WARNING\]/.test(a)?"warning":"error"});continue}let d=yWe.exec(a);if(d){i({file:yA(d[1],t),line:Number(d[2]),message:Bm(d[4]??""),severity:(d[3]??"error").toLowerCase()==="warning"?"warning":"error"});continue}if(bWe.test(a))continue;let p=vWe.exec(a);if(p){let f=Number(p[3]),m=Bm(p[4]??"");if(m.length===0)continue;i({file:yA(p[1],t),line:Number(p[2]),...Number.isFinite(f)&&f>0?{column:f-1}:{},message:m,severity:/warning/i.test(m)?"warning":"error"})}}return n}function Mce(e){let t=e.message.toLowerCase().replace(/['"`].*?['"`]/g,"\u2039\u203A").replace(/\s+/g," ").slice(0,80);return`${e.file}|${e.code??""}|${t}`}function Fce(e,t){let n=new Set(t.map(Mce));return e.filter(r=>r.severity==="error"&&!n.has(Mce(r)))}var qce=["typecheck","build","test"];async function Wce(e){let t={...e,toolAvailability:nB()},n=new Map,r=(a,c)=>{n.set(a.id,c),t.onVerified?.(a,c)};if(t.targets.length===0)return n;let i=[...OWe(t.targets)],o=0,s=t.targets.length;return await Yn(i,Math.max(1,t.concurrency??uA()),async([a,c])=>{if(t.token?.isCancellationRequested){for(let u of c)r(u,pB());return}let l=DWe(a);await kWe(t,l,c,{report:(u,d,p)=>t.onProgress?.({phase:u,detail:d,done:o,total:s,...p?{targets:p.map(f=>f.id)}:{}}),output:u=>t.onProgress?.({phase:"",detail:"",done:o,total:s,output:u}),settle:(u,d)=>{o+=1,r(u,d)}})}),await IG(),n}async function kWe(e,t,n,r){let i=e.exec??et,o=Pu(e.env??process.env),s=Jce(e.root,t),a=await(e.warm?.take(t,n[0].packageManager)??Hce(e,t,n[0].packageManager,r));if(!a.ok){for(let d of n)r.settle(d,cs(a.reason));return}let{worktree:c,usable:l,manager:u}=a;for(let d of a.notes)r.report(`Preparing a test checkout of ${s}`,d);try{let d={exec:i,env:o,dir:t,root:c.path,usable:l,install:u?.install,...e.installTogether?{installTogether:e.installTogether}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{},...e.token?{token:e.token}:{}};await uB(d,n,r)}finally{await c.dispose()}}var $We=4;async function uB(e,t,n){if(e.token?.isCancellationRequested){for(let c of t)n.settle(c,pB());return!0}let r=t.length===1?t[0]:void 0;if(r)return Uce(e,r,n);let i=await AWe(e,t,n);if(i!=="inconclusive")return i==="settled";if(t.length<=$We){for(let[c,l]of t.entries()){if(e.token?.isCancellationRequested){n.settle(l,pB());continue}if(!await Uce(e,l,n))return Vce(t,c+1,n),!1}return!0}let o=Math.ceil(t.length/2),s=t.slice(0,o),a=t.slice(o);return await uB(e,s,n)?uB(e,a,n):(Vce(a,0,n),!1)}async function Uce(e,t,n){let r=`Testing ${t.name}@${t.selected}`;n.report(r,"installing into the test checkout",[t]);try{await t.install(e.root)}catch(i){return n.settle(t,cs(`${t.name}@${t.selected} could not be installed, so it could not be tested. ${vA(i)}`)),dB(e)}return n.report(r,e.usable.map(i=>i.label).join(", "),[t]),n.settle(t,mB(await Zce(e,n,r,[t]),e.root)),dB(e)}async function jce(e,t,n,r){let i=[...new Set(t.flatMap(zce))];if(i.length===0)return{usable:t,missing:[]};let o=await Cce(e,i,n,r),s=c=>zce(c).every(l=>o.get(l)===!0);return{usable:t.filter(s),missing:i.filter(c=>o.get(c)===!1)}}function zce(e){return e.commandOrigin.kind==="host"?[e.commandOrigin.command]:[...e.commandOrigin.requiredHostCommands]}function SWe(e,t,n){let r=e.install?[{kind:"build",label:`${e.install.command} ${e.install.args.join(" ")}`.trim(),command:e.install,source:`${e.label} install`,commandOrigin:{kind:"host",command:e.install.command},compileCapable:!1}]:[],i=pA(e.id,null).filter(s=>n.includes(s.kind)),o=r.length>0?t.filter(s=>n.includes(s.kind)):[];return xWe([...r,...i,...o])}function xWe(e){let t=[];for(let n of e)t.some(r=>r.label===n.label)||t.push(n);return t}function Gce(e){return e.length===1?`\`${e[0]}\` is`:`${e.slice(0,-1).map(t=>`\`${t}\``).join(", ")} and \`${e.at(-1)}\` are`}async function Hce(e,t,n,r){let i=e.exec??et,o=Pu(e.env??process.env),s=e.kinds??qce,a=Jce(e.root,t),c=al(n),l=c?await gA(e.root,t,e.fs??Xn(),n).catch(()=>[]):[],u=c?SWe(c,l,s):[];if(u.length>0){let I=await jce(i,u,o,e.toolAvailability);if(I.usable.length===0)return it("verify.skipped.noTool"),{ok:!1,reason:`${Gce(I.missing)} not installed, so ${a} could not be built or tested against the upgrade.`}}r.report(`Preparing a test checkout of ${a}`,"checking out a clean copy");let d,p=Dt("verify","worktree",{project:a});try{d=await QT(e.root,`probe-${t||"root"}`,{exec:i,env:o,...e.allowedGlobs?{allowedGlobs:e.allowedGlobs}:{}}),p.end()}catch(I){return p.end({failed:!0}),{ok:!1,reason:vA(I)}}let f=[];d.copiedFiles.length>0&&f.push(`carried over ${cB(d.copiedFiles,d.copiedRules)} not tracked by git`),d.oversizedFiles.length>0&&f.push(`skipped ${cB(d.oversizedFiles,d.oversizedRules)} \u2014 too large to carry over automatically, which may make a check fail for a reason unrelated to this upgrade`),d.skippedSecrets.length>0&&f.push(`never copied ${cB(d.skippedSecrets,d.skippedSecretRules)} \u2014 ${d.skippedSecrets.length===1?"it looked":"they looked"} like credentials, which may make a check fail for a reason unrelated to this upgrade; see \`verify.generatedSourceGlobs\` if the project genuinely needs ${d.skippedSecrets.length===1?"it":"one of them"}`);let m=async I=>(await d.dispose(),{ok:!1,reason:I}),g=(await gA(d.path,t,e.fs??Xn(),n)).filter(I=>s.includes(I.kind));if(g.length===0)return m("This project declares no typecheck or build that Drift could run against the upgrade.");let h=await jce(i,g,o,e.toolAvailability),v=h.usable;if(v.length===0)return m(h.missing.length>0?`${Gce(h.missing)} not installed, so ${a} could not be built or tested against the upgrade.`:"This project declares checks, but none of them could run in the current environment.");let b=c?.install;if(b){r.report(`Installing ${a}'s dependencies`,`\`${b.command} ${b.args.join(" ")}\``),it("verify.install");let I=await Rn("verify","install",()=>i(b.command,b.args,{cwd:t?`${d.path}/${t}`:d.path,env:o,timeoutMs:e.timeoutMs??fB,...e.signal?{signal:e.signal}:{},onOutput:r.output}),{project:a,manager:b.command});if(I.code!==0){let R=(I.stderr||I.stdout).trim().split(` +`).slice(-3).join(" ");return m(`\`${b.command} ${b.args.join(" ")}\` failed in a clean checkout, so there was nothing to test the upgrade against. ${R}`.trim())}}if(e.token?.isCancellationRequested)return m("Cancelled before this upgrade could be tested.");let _=e.baselineCache??aB(),w=await EWe(e,d.path,t,n,v),k=w?await _.read(w):null,x;if(k)it("verify.baseline.cached"),r.report(`Checking ${a} as it is`,`reusing the baseline measured earlier for this commit (${k.filter(I=>I.status==="passed").length} of ${k.length} checks green)`),x=k;else{it("verify.baseline.measured");let I=Dt("verify","baseline",{project:a,checks:v.length});r.report(`Checking ${a} as it is`,`${v.map(C=>C.label).join(", ")}`);let R=await hA({root:d.path,dir:t,checks:v,env:o,exec:i,onProgress:C=>r.report(`Checking ${a} as it is`,`\`${C.label}\``),onOutput:(C,j)=>r.output(j),...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}});I.end(),x=R,w&&!e.token?.isCancellationRequested&&await _.write(w,R)}let A=v.filter(I=>x.some(R=>R.label===I.label&&R.status==="passed"));return A.length===0?m(NWe(x)):{ok:!0,worktree:d,usable:A,manager:c,notes:f}}async function EWe(e,t,n,r,i){if(!e.baselineCache)return null;let o=e.exec??et,s=Pu(e.env??process.env),a=await o("git",["rev-parse","HEAD"],{cwd:t,env:s}).catch(()=>null);if(!a||a.code!==0)return null;let c=e.fs??Xn(),l=n?`${t}/${n}`:t,d=(await c.readDirectory(l).catch(()=>[])).filter(f=>TWe.test(f)||rl(f)).sort();if(d.length===0)return null;let p=[];for(let f of d){let m=await c.readFile(`${l}/${f}`).catch(()=>null);if(m===null)return null;p.push({path:f,content:m})}return Oce({head:a.stdout.trim(),dir:n,packageManager:r,kinds:i.map(f=>f.kind),files:p,runtime:`${process.version}/${process.platform}/${process.arch}`})}var TWe=/^(package\.json|package-lock\.json|npm-shrinkwrap\.json|yarn\.lock|pnpm-lock\.yaml|bun\.lockb?|pyproject\.toml|setup\.py|setup\.cfg|poetry\.lock|uv\.lock|Pipfile(\.lock)?|go\.mod|go\.sum|Cargo\.(toml|lock)|Gemfile(\.lock)?|[^/]*\.gemspec|pom\.xml|build\.gradle(\.kts)?|gradle\.lockfile|build\.sbt|composer\.(json|lock)|mix\.(exs|lock)|pubspec\.(yaml|lock)|Package\.(swift|resolved)|Podfile(\.lock)?|[^/]*\.opam|conanfile\.(txt|py)|conan\.lock|vcpkg\.json|platformio\.ini|library\.properties|.*\.csproj|.*\.fsproj|packages\.lock\.json)$/i;function Kce(e,t,n){let r={...e,toolAvailability:nB()},i=new Map,o={report:(u,d)=>n?.({phase:u,detail:d,done:0,total:0}),output:u=>n?.({phase:"",detail:"",done:0,total:0,output:u})},s=Math.max(1,r.concurrency??uA()),a=0,c=[],l=async u=>{a>=s&&await new Promise(d=>c.push(d)),a+=1;try{return await u()}finally{a-=1,c.shift()?.()}};for(let{dir:u,packageManager:d}of t)i.has(u)||i.set(u,{packageManager:d,prepared:l(()=>Hce(r,u,d,o)).catch(p=>({ok:!1,reason:vA(p)}))});return{take(u,d){let p=i.get(u);if(p&&p.packageManager===d)return i.delete(u),p.prepared},async dispose(){let u=[...i.values()];i.clear(),await Promise.all(u.map(({prepared:d})=>d.then(p=>p.ok?p.worktree.dispose():void 0,()=>{}))),await IG()}}}function Jce(e,t){return t||(0,bA.basename)(e)||"the repository"}async function AWe(e,t,n){n.report(`Testing ${t.length} upgrades together`,t.map(a=>`${a.name}@${a.selected}`).join(", "),t);let i=await IWe(e,t)&&!e.token?.isCancellationRequested?await Zce(e,n,`Testing ${t.length} upgrades together`,t,{stopOnFirstFailure:!0}):[],o=i.length>0&&i.every(a=>a.status==="passed"),s=await dB(e);if(o){for(let a of t)n.settle(a,{...mB(i,e.root),measuredWith:t.length});return"settled"}if(!s){for(let a of t)n.settle(a,cs("The test checkout could not be reset to a clean state after testing these upgrades together, so they could not be attributed individually."));return"contaminated"}return"inconclusive"}async function IWe(e,t){if(e.token?.isCancellationRequested)return!1;it("verify.install");let n=Dt("verify","install",{packages:t.length});try{return await RWe(e,t)}finally{n.end()}}async function RWe(e,t){if(e.installTogether)try{if(await e.installTogether(e.root,t))return!0}catch{return!1}for(let n of t){if(e.token?.isCancellationRequested)return!1;try{await n.install(e.root)}catch{return!1}}return!0}function Zce(e,t,n,r,i){return it("verify.checkPass"),Rn("verify","checks",()=>hA({root:e.root,dir:e.dir,checks:e.usable,env:e.env,exec:e.exec,...i?.stopOnFirstFailure?{stopOnFirstFailure:!0}:{},...t&&n?{onProgress:o=>t.report(n,`\`${o.label}\``,r)}:{},...t?{onOutput:(o,s)=>t.output(s)}:{},...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}}))}var fB=15*6e4;async function Yce(e){let t=e.exec??et,n=Pu(e.env??process.env),r=await Bce(e,e.afterSha,t,n,"with the change");if(r.status!=="failed"||!e.beforeSha)return r;let i=await Bce(e,e.beforeSha,t,n,"without it");return PWe(r,i,e.beforeSha)}function PWe(e,t,n){if(t.checks.length===0)return cs(`The project could not be checked at ${Ru(n)}, so there is nothing to compare the failure against.`);let r=new Map(t.checks.map(a=>[a.label,a])),i=e.checks.filter(a=>a.status==="failed"&&r.get(a.label)?.status==="passed");if(i.length===0){let a=[...new Set(e.checks.filter(c=>c.status==="failed").map(c=>r.get(c.label)?`\`${c.label}\` already failed at ${Ru(n)}`:`\`${c.label}\` has no baseline at ${Ru(n)} to compare against`))];return cs(`${a.join("; ")}, so the failure afterwards proves nothing about this dependency.`)}let o=i.map(a=>`$ ${a.label} ${a.fullOutput??a.output}`).join(` -`),s=lne(e.parsedDiagnostics??[],t.parsedDiagnostics??[]);return{status:"failed",checks:e.checks,diagnostics:o,failedFiles:_ne(o),...s.length>0?{introducedDiagnostics:s}:{}}}async function mne(e,t,n,i,r){let o=e.dir??"",s=e.kinds??hne;e.onProgress?.({phase:`Checking the project ${r}`,detail:su(t),done:0,total:1});let a;try{a=await ax(e.workspace,`change-${su(t)}`,{at:t,exec:n,env:i,...e.allowedGlobs?{allowedGlobs:e.allowedGlobs}:{}})}catch(c){return jo(Ix(c))}try{let c=(await Sx(a.path,o,e.fs??Hn(),e.packageManager)).filter(u=>s.includes(u.kind));if(c.length===0)return jo(`This project declares no typecheck or build at ${su(t)} that Drift could run.`);let l=Uc(e.packageManager);if(l?.install){let u=await n(l.install.command,l.install.args,{cwd:o?`${a.path}/${o}`:a.path,env:i,timeoutMs:e.timeoutMs??q1,...e.signal?{signal:e.signal}:{}});if(u.code!==0){let d=(u.stderr||u.stdout).trim().split(` -`).slice(-3).join(" ");return jo(`\`${l.install.command} ${l.install.args.join(" ")}\` failed at ${su(t)}, so the project could not be checked ${r}. ${d}`.trim())}}return W1(await xx({root:a.path,dir:o,checks:c,env:i,exec:n,...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}}),a.path)}finally{await a.dispose()}}function su(e){return/^[0-9a-f]{7,40}$/i.test(e)?e.slice(0,7):e}async function V1(e){nt("verify.reset");let t=It("verify","reset");try{return await dze(e)}finally{t.end()}}async function dze(e){return(await e.exec("git",["checkout","--","."],{cwd:e.root,env:e.env}).catch(()=>({code:1}))).code!==0?!1:e.install?(await e.exec(e.install.command,e.install.args,{cwd:e.dir?`${e.root}/${e.dir}`:e.root,env:e.env,timeoutMs:e.timeoutMs??q1,...e.signal?{signal:e.signal}:{}}).catch(()=>({code:1}))).code===0:!0}function gne(e,t,n){for(let i of e.slice(t))n.settle(i,jo("The test checkout could not be reset to a clean state after testing an earlier upgrade in this group, so testing stopped rather than risk attributing one candidate\u2019s breakage to another."))}function W1(e,t){let n=e.filter(o=>o.status==="failed");if(n.length>0){let o=n.map(a=>`$ ${a.label} +`),s=Fce(e.parsedDiagnostics??[],t.parsedDiagnostics??[]);return{status:"failed",checks:e.checks,diagnostics:o,failedFiles:Qce(o),...s.length>0?{introducedDiagnostics:s}:{}}}async function Bce(e,t,n,r,i){let o=e.dir??"",s=e.kinds??qce;e.onProgress?.({phase:`Checking the project ${i}`,detail:Ru(t),done:0,total:1});let a;try{a=await QT(e.workspace,`change-${Ru(t)}`,{at:t,exec:n,env:r,...e.allowedGlobs?{allowedGlobs:e.allowedGlobs}:{}})}catch(c){return cs(vA(c))}try{let c=(await gA(a.path,o,e.fs??Xn(),e.packageManager)).filter(u=>s.includes(u.kind));if(c.length===0)return cs(`This project declares no typecheck or build at ${Ru(t)} that Drift could run.`);let l=al(e.packageManager);if(l?.install){let u=await n(l.install.command,l.install.args,{cwd:o?`${a.path}/${o}`:a.path,env:r,timeoutMs:e.timeoutMs??fB,...e.signal?{signal:e.signal}:{}});if(u.code!==0){let d=(u.stderr||u.stdout).trim().split(` +`).slice(-3).join(" ");return cs(`\`${l.install.command} ${l.install.args.join(" ")}\` failed at ${Ru(t)}, so the project could not be checked ${i}. ${d}`.trim())}}return mB(await hA({root:a.path,dir:o,checks:c,env:r,exec:n,...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}}),a.path)}finally{await a.dispose()}}function Ru(e){return/^[0-9a-f]{7,40}$/i.test(e)?e.slice(0,7):e}async function dB(e){it("verify.reset");let t=Dt("verify","reset");try{return await CWe(e)}finally{t.end()}}async function CWe(e){return(await e.exec("git",["checkout","--","."],{cwd:e.root,env:e.env}).catch(()=>({code:1}))).code!==0?!1:e.install?(await e.exec(e.install.command,e.install.args,{cwd:e.dir?`${e.root}/${e.dir}`:e.root,env:e.env,timeoutMs:e.timeoutMs??fB,...e.signal?{signal:e.signal}:{}}).catch(()=>({code:1}))).code===0:!0}function Vce(e,t,n){for(let r of e.slice(t))n.settle(r,cs("The test checkout could not be reset to a clean state after testing an earlier upgrade in this group, so testing stopped rather than risk attributing one candidate\u2019s breakage to another."))}function mB(e,t){let n=e.filter(o=>o.status==="failed");if(n.length>0){let o=n.map(a=>`$ ${a.label} ${a.fullOutput??a.output}`).join(` -`),s=cne(o,t).filter(a=>a.severity==="error");return{status:"failed",checks:[...e],diagnostics:o,failedFiles:_ne(o),...s.length>0?{parsedDiagnostics:s}:{}}}let i=e.filter(o=>o.status==="not-run"||o.status==="cancelled");return i.length>0?{status:"skipped",reason:i.some(o=>o.status==="cancelled")?"Cancelled before this upgrade could be tested.":i.find(o=>o.reason)?.reason??"One or more project checks could not run against this upgrade.",checks:[...e],failedFiles:[]}:e.filter(o=>o.status==="passed").length===0?{status:"skipped",reason:e.some(o=>o.status==="cancelled")?"Cancelled before this upgrade could be tested.":"None of the project\u2019s checks could run against this upgrade.",checks:[...e],failedFiles:[]}:{status:"passed",checks:[...e],failedFiles:[]}}function pze(e){let t=e.filter(i=>i.status==="failed");if(t.length>0){let i=t.map(o=>o.label),r=t.map(o=>`$ ${o.label} +`),s=Lce(o,t).filter(a=>a.severity==="error");return{status:"failed",checks:[...e],diagnostics:o,failedFiles:Qce(o),...s.length>0?{parsedDiagnostics:s}:{}}}let r=e.filter(o=>o.status==="not-run"||o.status==="cancelled");return r.length>0?{status:"skipped",reason:r.some(o=>o.status==="cancelled")?"Cancelled before this upgrade could be tested.":r.find(o=>o.reason)?.reason??"One or more project checks could not run against this upgrade.",checks:[...e],failedFiles:[]}:e.filter(o=>o.status==="passed").length===0?{status:"skipped",reason:e.some(o=>o.status==="cancelled")?"Cancelled before this upgrade could be tested.":"None of the project\u2019s checks could run against this upgrade.",checks:[...e],failedFiles:[]}:{status:"passed",checks:[...e],failedFiles:[]}}function NWe(e){let t=e.filter(r=>r.status==="failed");if(t.length>0){let r=t.map(o=>o.label),i=t.map(o=>`$ ${o.label} ${(o.output??o.reason??"").trim()||"(no output captured)"}`).join(` -`);return`\`${i.join("`, `")}\` already fails on this commit before any upgrade is applied, so a failure afterwards would prove nothing. +`);return`\`${r.join("`, `")}\` already fails on this commit before any upgrade is applied, so a failure afterwards would prove nothing. -${r}`}return e.find(i=>i.reason)?.reason??"None of the project\u2019s checks could be run in a clean checkout."}function _ne(e){let t=new Set;for(let n of e.split(` -`)){let r=/^\s*(?:[A-Za-z]:)?([\w./\\@+-]+\.\w+)(?:\((\d+),\d+\)|:(\d+):\d+)/.exec(n)?.[1];r&&t.add(r.replace(/\\/g,"/").replace(/^\.\//,""))}return[...t]}function fze(e){let t=new Map;for(let n of e){let i=t.get(n.manifestPath);i?i.push(n):t.set(n.manifestPath,[n])}return t}function j1(e,t){let n=`${e.length} gitignored file${e.length===1?"":"s"}`;if(e.length===0)return n;if(e.length<=z1)return`${n} (${e.join(", ")})`;let i=e.slice(0,z1).join(", "),r=t.length>0?`, matching: ${t.join(", ")}`:"";return`${n} (${i}, and ${e.length-z1} more${r})`}var z1=4;function mze(e){let t=(0,Tx.dirname)(e);return t==="."||t==="/"?"":t}function jo(e){return{status:"skipped",reason:e,checks:[],failedFiles:[]}}function B1(){return jo("Cancelled before this upgrade could be tested.")}function Ix(e){return e instanceof Error?e.message:String(e)}function au(e){let t=/token|secret|password|passwd|credential|api[_-]?key|private[_-]?key|_key$/i,n={};for(let[i,r]of Object.entries(e))i.startsWith("INPUT_")||i==="GITHUB_TOKEN"||t.test(i)||(n[i]=r);return n}function H1(e){return Or(e).detectability.some(t=>t==="compile-time"||t==="link-or-import")}function Fy(e){if(e.status!=="skipped")return e.measuredWith&&e.measuredWith>1?"batch":"isolated"}function Ax(e,t,n){return K1(hze(e,t,n))}var gze="build, typecheck, and test";function K1(e){let t=e.gaps.findIndex(c=>c.stage==="verify"&&c.surface===gze),n=e.verification;if(t===-1||!n)return e;let i=n.checks.filter(c=>c.status==="passed"||c.status==="failed"),r=i.map(c=>c.label).join(", "),o,s;if(n.status==="failed")o=`This project's checks (${r||"the configured checks"}) ran with the upgrade installed and failed where they passed before: a measured regression. No fix has been checked against them yet.`,s="Fix the measured failures, then run the same checks again before merging.";else if(n.status==="passed"&&i.length>0)o=`This project's checks (${r}) passed with the upgrade installed, before any fix. They confirm only what they exercise; findings on code they do not reach remain unconfirmed.`,s="Review the findings the checks do not exercise, and run the checks again after any fix.";else{let c=n.reason?.replace(/\s+/g," ").trim();o=`Verification did not run the project's checks${c?`: ${c.length>200?`${c.slice(0,199)}\u2026`:c}`:""}. Nothing measured confirms or refutes the findings.`,s="Resolve what stopped verification, or review the resulting pull request against CI before merging."}let a=[...e.gaps];return a[t]={...a[t],reason:o,remediation:s},{...e,gaps:a}}function hze(e,t,n){if(t.status!=="passed")return{...e,verification:t};if(!t.checks.some(o=>o.status==="passed"&&o.compileCapable))return{...e,verification:t};if(Fy(t)==="batch")return{...e,verification:t};let i=o=>n===void 0||(o.workspace??"")===n,r=new Set(e.breakingChanges.filter(o=>i(o)&&H1(o)).map(o=>o.id));return r.size===0?{...e,verification:t}:yze(e,r,t)}function yze(e,t,n){let i=e.breakingChanges.filter(l=>!t.has(l.id)),r=e.impactSites.filter(l=>!t.has(l.breakingChangeId)),o=e.dispositions?.filter(l=>!t.has(l.changeId)),s=e.commits.map(l=>({...l,breakingChangeIds:l.breakingChangeIds.filter(u=>!t.has(u))})).filter(l=>l.breakingChangeIds.length>0),a=new Set(s.map(l=>l.id)),c={...e,breakingChanges:i,impactSites:r,...o?{dispositions:o}:{},verification:n,planEdges:e.planEdges.filter(l=>a.has(l.from)&&a.has(l.to)),commits:s.map(l=>({...l,dependsOn:l.dependsOn.filter(u=>a.has(u)),dependencyReasons:l.dependencyReasons.filter(u=>a.has(u.from)&&a.has(u.to))}))};return bze(c)}function bze(e){let t=new Map;for(let s of e.rationale??[])for(let a of s.runtimeAnalyses??[])t.set(a.changeId,{changeId:a.changeId,runtime:a.runtime,requirement:a.requirement??"",state:a.state,reason:a.reason,declarations:[],unresolved:[],sites:e.impactSites.filter(c=>c.breakingChangeId===a.changeId),statement:a.statement??""});let n=[...t.values()].filter(s=>e.breakingChanges.some(a=>a.id===s.changeId)),i=Pf(e.breakingChanges,e.impactSites,n,e.localizationRan??!0),r=(e.rationale??[]).map(s=>{let a=e.changes.find(d=>d.name===s.dependency)?.workspace,c=e.breakingChanges.filter(d=>d.dependency===s.dependency&&(a===void 0||d.workspace===a)),l=new Set(c.map(d=>d.id)),u=My({dependency:s.dependency,...a!==void 0?{workspace:a}:{},breakingChanges:c,impactSites:e.impactSites.filter(d=>l.has(d.breakingChangeId)),evidence:e.evidence,security:s.security,maintenance:s.maintenance,license:s.license,gaps:s.gaps,surfaceCompared:s.hasCompatibilityEvidence,runtimeAnalyses:n.filter(d=>l.has(d.changeId)),localizationRan:e.localizationRan??!0});return{...s,assessment:{...u,confidence:s.assessment.confidence,confidenceBasis:s.assessment.confidenceBasis}}}),o=y1(e.changes,e.breakingChanges,e.impactSites,r.map(s=>s.assessment.runtimeCompatibility),i);return{...e,dispositions:i,risk:o,...e.rationale?{rationale:r}:{}}}function Sne(e){if(e.length===0||e.every(o=>!o))return;let t=e.filter(o=>!!o),n=t.flatMap(o=>o.checks),i=t.filter(o=>o.status==="failed");if(i.length>0){let o=i.flatMap(c=>c.introducedDiagnostics??[]),s=[],a=new Set;for(let c of o){let l=`${c.file}|${c.line}|${c.column??""}|${c.code??""}`;a.has(l)||(a.add(l),s.push(c))}return{status:"failed",checks:n,diagnostics:i.map(c=>c.diagnostics).filter(c=>!!c).join(` +${i}`}return e.find(r=>r.reason)?.reason??"None of the project\u2019s checks could be run in a clean checkout."}function Qce(e){let t=new Set;for(let n of e.split(` +`)){let i=/^\s*(?:[A-Za-z]:)?([\w./\\@+-]+\.\w+)(?:\((\d+),\d+\)|:(\d+):\d+)/.exec(n)?.[1];i&&t.add(i.replace(/\\/g,"/").replace(/^\.\//,""))}return[...t]}function OWe(e){let t=new Map;for(let n of e){let r=t.get(n.manifestPath);r?r.push(n):t.set(n.manifestPath,[n])}return t}function cB(e,t){let n=`${e.length} gitignored file${e.length===1?"":"s"}`;if(e.length===0)return n;if(e.length<=lB)return`${n} (${e.join(", ")})`;let r=e.slice(0,lB).join(", "),i=t.length>0?`, matching: ${t.join(", ")}`:"";return`${n} (${r}, and ${e.length-lB} more${i})`}var lB=4;function DWe(e){let t=(0,bA.dirname)(e);return t==="."||t==="/"?"":t}function cs(e){return{status:"skipped",reason:e,checks:[],failedFiles:[]}}function pB(){return cs("Cancelled before this upgrade could be tested.")}function vA(e){return e instanceof Error?e.message:String(e)}function Pu(e){let t=/token|secret|password|passwd|credential|api[_-]?key|private[_-]?key|_key$/i,n={};for(let[r,i]of Object.entries(e))r.startsWith("INPUT_")||r==="GITHUB_TOKEN"||t.test(r)||(n[r]=i);return n}function gB(e){return Vr(e).detectability.some(t=>t==="compile-time"||t==="link-or-import")}function bv(e){if(e.status!=="skipped")return e.measuredWith&&e.measuredWith>1?"batch":"isolated"}function _A(e,t,n){return hB(LWe(e,t,n))}var MWe="build, typecheck, and test";function hB(e){let t=e.gaps.findIndex(c=>c.stage==="verify"&&c.surface===MWe),n=e.verification;if(t===-1||!n)return e;let r=n.checks.filter(c=>c.status==="passed"||c.status==="failed"),i=r.map(c=>c.label).join(", "),o,s;if(n.status==="failed")o=`This project's checks (${i||"the configured checks"}) ran with the upgrade installed and failed where they passed before: a measured regression. No fix has been checked against them yet.`,s="Fix the measured failures, then run the same checks again before merging.";else if(n.status==="passed"&&r.length>0)o=`This project's checks (${i}) passed with the upgrade installed, before any fix. They confirm only what they exercise; findings on code they do not reach remain unconfirmed.`,s="Review the findings the checks do not exercise, and run the checks again after any fix.";else{let c=n.reason?.replace(/\s+/g," ").trim();o=`Verification did not run the project's checks${c?`: ${c.length>200?`${c.slice(0,199)}\u2026`:c}`:""}. Nothing measured confirms or refutes the findings.`,s="Resolve what stopped verification, or review the resulting pull request against CI before merging."}let a=[...e.gaps];return a[t]={...a[t],reason:o,remediation:s},{...e,gaps:a}}function LWe(e,t,n){if(t.status!=="passed")return{...e,verification:t};if(!t.checks.some(o=>o.status==="passed"&&o.compileCapable))return{...e,verification:t};if(bv(t)==="batch")return{...e,verification:t};let r=o=>n===void 0||(o.workspace??"")===n,i=new Set(e.breakingChanges.filter(o=>r(o)&&gB(o)).map(o=>o.id));return i.size===0?{...e,verification:t}:FWe(e,i,t)}function FWe(e,t,n){let r=e.breakingChanges.filter(l=>!t.has(l.id)),i=e.impactSites.filter(l=>!t.has(l.breakingChangeId)),o=e.dispositions?.filter(l=>!t.has(l.changeId)),s=e.commits.map(l=>({...l,breakingChangeIds:l.breakingChangeIds.filter(u=>!t.has(u))})).filter(l=>l.breakingChangeIds.length>0),a=new Set(s.map(l=>l.id)),c={...e,breakingChanges:r,impactSites:i,...o?{dispositions:o}:{},verification:n,planEdges:e.planEdges.filter(l=>a.has(l.from)&&a.has(l.to)),commits:s.map(l=>({...l,dependsOn:l.dependsOn.filter(u=>a.has(u)),dependencyReasons:l.dependencyReasons.filter(u=>a.has(u.from)&&a.has(u.to))}))};return UWe(c)}function UWe(e){let t=new Map;for(let s of e.rationale??[])for(let a of s.runtimeAnalyses??[])t.set(a.changeId,{changeId:a.changeId,runtime:a.runtime,requirement:a.requirement??"",state:a.state,reason:a.reason,declarations:[],unresolved:[],sites:e.impactSites.filter(c=>c.breakingChangeId===a.changeId),statement:a.statement??""});let n=[...t.values()].filter(s=>e.breakingChanges.some(a=>a.id===s.changeId)),r=zm(e.breakingChanges,e.impactSites,n,e.localizationRan??!0),i=(e.rationale??[]).map(s=>{let a=e.changes.find(d=>d.name===s.dependency)?.workspace,c=e.breakingChanges.filter(d=>d.dependency===s.dependency&&(a===void 0||d.workspace===a)),l=new Set(c.map(d=>d.id)),u=hv({dependency:s.dependency,...a!==void 0?{workspace:a}:{},breakingChanges:c,impactSites:e.impactSites.filter(d=>l.has(d.breakingChangeId)),evidence:e.evidence,security:s.security,maintenance:s.maintenance,license:s.license,gaps:s.gaps,surfaceCompared:s.hasCompatibilityEvidence,runtimeAnalyses:n.filter(d=>l.has(d.changeId)),localizationRan:e.localizationRan??!0});return{...s,assessment:{...u,confidence:s.assessment.confidence,confidenceBasis:s.assessment.confidenceBasis}}}),o=UG(e.changes,e.breakingChanges,e.impactSites,i.map(s=>s.assessment.runtimeCompatibility),r);return{...e,dispositions:r,risk:o,...e.rationale?{rationale:i}:{}}}function Xce(e){if(e.length===0||e.every(o=>!o))return;let t=e.filter(o=>!!o),n=t.flatMap(o=>o.checks),r=t.filter(o=>o.status==="failed");if(r.length>0){let o=r.flatMap(c=>c.introducedDiagnostics??[]),s=[],a=new Set;for(let c of o){let l=`${c.file}|${c.line}|${c.column??""}|${c.code??""}`;a.has(l)||(a.add(l),s.push(c))}return{status:"failed",checks:n,diagnostics:r.map(c=>c.diagnostics).filter(c=>!!c).join(` -`),failedFiles:[...new Set(i.flatMap(c=>c.failedFiles))],...s.length>0?{introducedDiagnostics:s}:{}}}let r=e.filter(o=>!o||o.status==="skipped");return r.length>0?{status:"skipped",reason:[...new Set(r.map(s=>s?.reason??"One of these upgrades was not tested, and no reason was recorded."))].join(" "),checks:n,failedFiles:[]}:{status:"passed",checks:n,failedFiles:[]}}function Uy(e){let t=e.checks.filter(n=>n.status==="passed"||n.status==="failed").map(n=>`\`${n.label}\``);if(e.status==="passed"){let n=Fy(e)==="batch"?` (measured with ${e.measuredWith-1} other upgrade${e.measuredWith===2?"":"s"} from the same manifest installed alongside it)`:"";return t.length>0?`${t.join(", ")} ${t.length===1?"passes":"pass"} with this upgrade installed${n}.`:`This upgrade was installed and the project still checks out clean${n}.`}if(e.status==="failed"){let n=e.checks.filter(a=>a.status==="failed"),i=n.map(a=>`\`${a.label}\``),r=e.failedFiles.length>0?` in ${e.failedFiles.length} file${e.failedFiles.length===1?"":"s"}`:"",o=`${i.join(", ")} fails with this upgrade installed${r} \u2014 measured, not predicted.`,s=n.map(a=>`$ ${a.label} +`),failedFiles:[...new Set(r.flatMap(c=>c.failedFiles))],...s.length>0?{introducedDiagnostics:s}:{}}}let i=e.filter(o=>!o||o.status==="skipped");return i.length>0?{status:"skipped",reason:[...new Set(i.map(s=>s?.reason??"One of these upgrades was not tested, and no reason was recorded."))].join(" "),checks:n,failedFiles:[]}:{status:"passed",checks:n,failedFiles:[]}}function vv(e){let t=e.checks.filter(n=>n.status==="passed"||n.status==="failed").map(n=>`\`${n.label}\``);if(e.status==="passed"){let n=bv(e)==="batch"?` (measured with ${e.measuredWith-1} other upgrade${e.measuredWith===2?"":"s"} from the same manifest installed alongside it)`:"";return t.length>0?`${t.join(", ")} ${t.length===1?"passes":"pass"} with this upgrade installed${n}.`:`This upgrade was installed and the project still checks out clean${n}.`}if(e.status==="failed"){let n=e.checks.filter(a=>a.status==="failed"),r=n.map(a=>`\`${a.label}\``),i=e.failedFiles.length>0?` in ${e.failedFiles.length} file${e.failedFiles.length===1?"":"s"}`:"",o=`${r.join(", ")} fails with this upgrade installed${i} \u2014 measured, not predicted.`,s=n.map(a=>`$ ${a.label} ${a.output.trim()||"(no output captured)"}`).join(` `);return s?`${o} -${s}`:o}return e.reason??"This upgrade was not tested."}var Tne={"no-incompatible-change-in-checked-surfaces":"No incompatible change detected in the surfaces that were checked","detected-not-locally-reachable":"Breaking change detected upstream \u2014 Drift could not establish whether this repository is affected; review before upgrading","locally-affected":"This repository is affected","insufficient-evidence":"Insufficient evidence to say","verification-incomplete":"Verification incomplete"};function Ine(e,t){return e==="locally-affected"&&t&&t.localImpact.band!=="high"?"This repository may be affected":Tne[e]}function Y1(e){let t=e.assessment;return!t||t.upstream.band==="none"||t.upstream.band==="low"?"insufficient-evidence":t.localImpact.band==="none"?Df([e])||t.localImpact.penalties.some(i=>i.code==="localization-unavailable"||i.code==="not-locally-checkable")?"verification-incomplete":"detected-not-locally-reachable":"locally-affected"}var xne=new Set(["no-incompatible-change-in-checked-surfaces"]);var vze=new Set(["no-incompatible-change-in-checked-surfaces","detected-not-locally-reachable"]);function wze(e,t,n){if(t){if(e.length>0)return e[0];let r=n.some(s=>s.surface==="api-surface"&&s.status==="checked"),o=n.some(s=>s.surface==="localization"&&s.status==="checked");return r&&o?"no-incompatible-change-in-checked-surfaces":"insufficient-evidence"}return["locally-affected","insufficient-evidence","verification-incomplete","detected-not-locally-reachable","no-incompatible-change-in-checked-surfaces"].find(r=>e.includes(r))??e[0]??"insufficient-evidence"}function kze(e){let t=e.breakingChanges.map(i=>Y1(i)),n=wze(t,e.breakingChanges.length===0,e.checkedSurfaces);return e.confirmedRegressions.length>0&&vze.has(n)?"locally-affected":(xne.has(n)||n==="detected-not-locally-reachable")&&!Sze(e)||xne.has(n)&&$ze(e)&&!_ze(e)?"insufficient-evidence":n}function $ze(e){return e.checkedSurfaces.some(t=>t.surface==="api-surface"&&t.status==="checked"&&(t.unruledChanges??0)>0)}function _ze(e){return e.verification?.status==="passed"&&(e.verification.checks??[]).some(t=>t.compileCapable&&t.status==="passed")}function Sze(e){let t=new Set(e.checkedSurfaces.filter(n=>n.surface==="api-surface"&&n.status==="checked").map(n=>Ene(n.dependency,n.ecosystem,n.workspace)));return e.changes.every(n=>t.has(Ene(n.name,n.ecosystem,n.workspace)))}function Ene(e,t,n){return cn({name:e??"",ecosystem:t,workspace:n})}var Q1="The project's own checks failed after this change was applied in ";function Lf(e){let t=kze(e);if(e.confirmedRegressions.length>0){let n=e.blockers.find(r=>r.startsWith(Q1)),i=e.impactSites.filter(r=>r.breakingChangeId.startsWith("measured:"));if(i.length>0){let r=i.slice(0,3).map(s=>`${s.file}:${s.line}`).join(", "),o=i.length>3?`, +${i.length-3} more`:"";return`Drift confirmed this repository is affected: the project's own checks passed before this change and failed after it, at ${r}${o}.`}return n?`Drift confirmed this repository is affected, even though static analysis found nothing to point at: ${n}`:"Drift confirmed this repository is affected: the project's own checks passed before this change and failed after it, even though static analysis found nothing to point at."}return t!=="locally-affected"&&e.blockers.length>0?`Could not establish whether this repository is affected: ${e.blockers[0]}`:Tne[t]}var xze={high:"\u{1F7E2}",medium:"\u{1F7E1}",low:"\u{1F7E0}",none:"\u26AA"};function Eze(e){return xze[e]??"\u26AA"}function J1(e){return`${Eze(e.band)} ${e.band} (${e.score.toFixed(2)})`}function Ane(e){return e>=.9?"very strong source":e>=.7?"strong source":e>=.5?"moderate source":e>=.3?"weak source":"very weak source"}function Tze(e){let t=DF(e);return`${t.score}/100 \u2014 ${t.label}`}function Rx(e){if(e.assessment){let t=DF(e.assessment);return{text:Tze(e.assessment),band:t.band,score:t.score,label:t.label}}return{text:"Confidence unavailable",band:"none",score:null,label:"Confidence unavailable"}}function Rne(e){return["| Dimension | Confidence | Why |","|---|---|---|",`| Upstream \u2014 did this change happen? | ${J1(e.upstream)} | ${Z1(e.upstream)} |`,`| Local impact \u2014 does it reach this repo? | ${J1(e.localImpact)} | ${Z1(e.localImpact)} |`,`| Verification \u2014 did anything run? | ${J1(e.verification)} | ${Z1(e.verification)} |`].join(` -`)}function Z1(e){let t=e.penalties[0];if(t)return Mf(t.detail);let n=[...e.evidence].sort((i,r)=>r.delta-i.delta)[0];return n?Mf(n.detail):"\u2014"}function Mf(e){return e.replace(/\\/g,"\\\\").replace(/\|/g,"\\|").replace(/\n+/g," ")}function Nne(e){let t=Or(e),n=[`**Nature:** ${t.nature}`,`**Scope:** ${t.scope}`,`**Detectable at:** ${t.detectability.join(", ")}`,`**Reached via:** ${t.visibility.join(", ")}`],r=!t.detectability.some(o=>["manifest","link-or-import","compile-time","static-semantic"].includes(o))?` +${s}`:o}return e.reason??"This upgrade was not tested."}var nle={"no-incompatible-change-in-checked-surfaces":"No incompatible change detected in the surfaces that were checked","detected-not-locally-reachable":"Breaking change detected upstream \u2014 Drift could not establish whether this repository is affected; review before upgrading","locally-affected":"This repository is affected","insufficient-evidence":"Insufficient evidence to say","verification-incomplete":"Verification incomplete"};function rle(e,t){return e==="locally-affected"&&t&&t.localImpact.band!=="high"?"This repository may be affected":nle[e]}function vB(e){let t=e.assessment;return!t||t.upstream.band==="none"||t.upstream.band==="low"?"insufficient-evidence":t.localImpact.band==="none"?Gm([e])||t.localImpact.penalties.some(r=>r.code==="localization-unavailable"||r.code==="not-locally-checkable")?"verification-incomplete":"detected-not-locally-reachable":"locally-affected"}var ele=new Set(["no-incompatible-change-in-checked-surfaces"]);var jWe=new Set(["no-incompatible-change-in-checked-surfaces","detected-not-locally-reachable"]);function zWe(e,t,n){if(t){if(e.length>0)return e[0];let i=n.some(s=>s.surface==="api-surface"&&s.status==="checked"),o=n.some(s=>s.surface==="localization"&&s.status==="checked");return i&&o?"no-incompatible-change-in-checked-surfaces":"insufficient-evidence"}return["locally-affected","insufficient-evidence","verification-incomplete","detected-not-locally-reachable","no-incompatible-change-in-checked-surfaces"].find(i=>e.includes(i))??e[0]??"insufficient-evidence"}function GWe(e){let t=e.breakingChanges.map(r=>vB(r)),n=zWe(t,e.breakingChanges.length===0,e.checkedSurfaces);return e.confirmedRegressions.length>0&&jWe.has(n)?"locally-affected":(ele.has(n)||n==="detected-not-locally-reachable")&&!qWe(e)||ele.has(n)&&BWe(e)&&!VWe(e)?"insufficient-evidence":n}function BWe(e){return e.checkedSurfaces.some(t=>t.surface==="api-surface"&&t.status==="checked"&&(t.unruledChanges??0)>0)}function VWe(e){return e.verification?.status==="passed"&&(e.verification.checks??[]).some(t=>t.compileCapable&&t.status==="passed")}function qWe(e){let t=new Set(e.checkedSurfaces.filter(n=>n.surface==="api-surface"&&n.status==="checked").map(n=>tle(n.dependency,n.ecosystem,n.workspace)));return e.changes.every(n=>t.has(tle(n.name,n.ecosystem,n.workspace)))}function tle(e,t,n){return fn({name:e??"",ecosystem:t,workspace:n})}var _B="The project's own checks failed after this change was applied in ";function qm(e){let t=GWe(e);if(e.confirmedRegressions.length>0){let n=e.blockers.find(i=>i.startsWith(_B)),r=e.impactSites.filter(i=>i.breakingChangeId.startsWith("measured:"));if(r.length>0){let i=r.slice(0,3).map(s=>`${s.file}:${s.line}`).join(", "),o=r.length>3?`, +${r.length-3} more`:"";return`Drift confirmed this repository is affected: the project's own checks passed before this change and failed after it, at ${i}${o}.`}return n?`Drift confirmed this repository is affected, even though static analysis found nothing to point at: ${n}`:"Drift confirmed this repository is affected: the project's own checks passed before this change and failed after it, even though static analysis found nothing to point at."}return t!=="locally-affected"&&e.blockers.length>0?`Could not establish whether this repository is affected: ${e.blockers[0]}`:nle[t]}var WWe={high:"\u{1F7E2}",medium:"\u{1F7E1}",low:"\u{1F7E0}",none:"\u26AA"};function HWe(e){return WWe[e]??"\u26AA"}function yB(e){return`${HWe(e.band)} ${e.band} (${e.score.toFixed(2)})`}function ile(e){return e>=.9?"very strong source":e>=.7?"strong source":e>=.5?"moderate source":e>=.3?"weak source":"very weak source"}function KWe(e){let t=nG(e);return`${t.score}/100 \u2014 ${t.label}`}function wA(e){if(e.assessment){let t=nG(e.assessment);return{text:KWe(e.assessment),band:t.band,score:t.score,label:t.label}}return{text:"Confidence unavailable",band:"none",score:null,label:"Confidence unavailable"}}function ole(e){return["| Dimension | Confidence | Why |","|---|---|---|",`| Upstream \u2014 did this change happen? | ${yB(e.upstream)} | ${bB(e.upstream)} |`,`| Local impact \u2014 does it reach this repo? | ${yB(e.localImpact)} | ${bB(e.localImpact)} |`,`| Verification \u2014 did anything run? | ${yB(e.verification)} | ${bB(e.verification)} |`].join(` +`)}function bB(e){let t=e.penalties[0];if(t)return Vm(t.detail);let n=[...e.evidence].sort((r,i)=>i.delta-r.delta)[0];return n?Vm(n.detail):"\u2014"}function Vm(e){return e.replace(/\\/g,"\\\\").replace(/\|/g,"\\|").replace(/\n+/g," ")}function sle(e){let t=Vr(e),n=[`**Nature:** ${t.nature}`,`**Scope:** ${t.scope}`,`**Detectable at:** ${t.detectability.join(", ")}`,`**Reached via:** ${t.visibility.join(", ")}`],i=!t.detectability.some(o=>["manifest","link-or-import","compile-time","static-semantic"].includes(o))?` -> This change is only observable when the code runs. Neither a compiler nor a source search can confirm whether this repository is affected.`:"";return`${n.join(" \xB7 ")}${r}`}function X1(e){if(e.length===0)return"";let t=["## What Drift could not check","","These are surfaces Drift did not establish. A limit of the tool is not a finding","about the upgrade \u2014 an absence here is not evidence that nothing is wrong.","","| Stage | Surface | Why it matters | What to do |","|---|---|---|---|"];for(let n of e){let i=n.automaticExecution==="blocks"?"**blocks automatic execution**":n.automaticExecution==="degrades"?"lowers confidence":"noted",r=n.dependency?`${n.surface} (\`${n.dependency}\`)`:n.surface;t.push(`| ${n.stage} | ${Mf(r)} | ${Mf(n.reason)} \u2014 ${i} | ${Mf(n.remediation)} |`)}return t.join(` -`)}function eU(e){if(e.checkedSurfaces.length===0)return"";let t=["## What Drift checked","","| Surface | Dependency | Result |","|---|---|---|"];for(let n of e.checkedSurfaces){let i=n.status==="checked"?"\u2705 checked":n.status==="skipped"?"\u23ED\uFE0F skipped":"\u26A0\uFE0F unavailable";t.push(`| ${n.surface} | ${n.dependency?`\`${n.dependency}\``:"\u2014"} | ${i} \u2014 ${Mf(n.detail)} |`)}return t.join(` -`)}function Cne(e){if(e.automaticExecutionEligible)return"**Automatic execution:** eligible \u2014 upstream evidence and local impact are both established.";let t=[];e.upstream.band!=="high"&&t.push("upstream evidence is not conclusive"),e.localImpact.band==="none"?t.push("no local impact was established"):e.localImpact.band==="low"&&t.push("local impact is weakly established");for(let n of e.gaps)n.automaticExecution==="blocks"&&t.push(n.surface);return`**Automatic execution:** not eligible \u2014 ${t.join("; ")||"insufficient evidence"}.`}async function jy(e){let{repo:t,config:n,logger:i,provider:r,githubToken:o,onProgress:s}=e,a=e.workspace??t.workspace,c=Date.now(),l=(fe,ae)=>{let be=Date.now();i.debug(`${fe} (+${be-c}ms): ${ae}`),c=be,s?.(fe,ae)};l("detect","Reading manifest changes");let u=await Lze(r,t,i);if(u.length===0)return tU("No dependency manifest changed in this range.");let d=a?await Ed(a,Hn()):[],p=a?(await Kk(a,Hn(),Td(d))).map(fe=>({kind:"undeclared-nested",ecosystem:fe.ecosystem,declaredIn:fe.manifestPath,members:[{dir:fe.dir,name:null,ecosystem:fe.ecosystem}]})):[],f=[...d,...p];if(f.length>0){let fe=new Map;for(let ae of f){let be=fe.get(ae.kind)??{layouts:0,members:0};fe.set(ae.kind,{layouts:be.layouts+1,members:be.members+ae.members.length})}i.info(`Workspace: ${[...fe].map(([ae,{layouts:be,members:Mt}])=>be===1?`${ae} (${Mt} member(s))`:`${ae} \xD7${be} (${Mt} member(s))`).join(", ")}`)}let m=nK(yH(u),f);if(m.length===0)return tU("Manifests changed, but no dependency versions moved.");let g=await XH(m,{logger:i});i.info(`Detected ${g.length} dependency change(s)`);let{actionable:h,skipped:b}=bH(g,n);for(let fe of b)i.info(` - ${fe.change.name}: skipped \u2014 ${fe.reason}`);if(h.length===0)return tU(g.length===1?"The 1 dependency change found doesn't match the analysis criteria in drift.yml (see reason above).":`None of the ${g.length} dependency changes found match the analysis criteria in drift.yml (see reasons above).`);l("triage",`${h.length} change(s) to analyse`),l("evidence",`Gathering evidence for ${h.map(fe=>fe.name).join(", ")}`);let y=new Map,w=new Map,k=new Map,_=new Set,S=new Map,x=[],E=await t5(h,{config:n,logger:i,githubToken:o,...e.env?{env:e.env}:{},readRepoFile:(fe,ae)=>r.readFile(fe,ae),...r.listFiles?{listRepoFiles:fe=>r.listFiles(fe)}:{},beforeSha:t.beforeSha,afterSha:t.afterSha,...a?{workspaceRoot:a}:{},onSurfaceComputed:(fe,ae)=>{let be=cn(fe);ae.weight>=.8&&_.add(be),ae.sourceIncompatibleCount&&S.set(be,ae.sourceIncompatibleCount),y.set(be,{additions:ae.additions??[],locator:ae.locator})},onUnavailableSurface:(fe,ae)=>w.set(cn(fe),ae),onProseConsulted:(fe,ae)=>{let be=cn(fe);k.set(be,[...k.get(be)??[],ae])},onSpecComputed:(fe,ae)=>x.push({surface:"contract-document",dependency:fe,status:"checked",detail:`${fe} was compared between the two commits by ${ae.tool}.`}),onUnavailableSpec:(fe,ae)=>x.push({surface:"contract-document",dependency:fe,status:"unavailable",detail:ae.remedy?`${ae.detail} ${ae.remedy}`:ae.detail})});i.info(`Gathered ${E.length} evidence record(s)`),l("analyze","Identifying breaking changes");let T=await BS(h,E,{config:n,logger:i});i.info(`Identified ${T.length} breaking change(s)`);let A=[],L=[],F=[],K=[],te=[],D,X,re=!!a,ie=new Map,ke=new Map,We=new Map,ye=new Map;if(a){let fe=Td(f),ae=await Ad(a,{members:fe});if(K=Tf(ae),te=If(ae),f.length>0&&(D=new Map(fe.map(be=>[be,Tf(ae,be,fe)])),X=new Map(fe.map(be=>[be,If(ae,be,fe)]))),T.some(be=>be.kind==="runtime-requirement"&&be.runtime?.runtime==="rust")&&await qF([...Ef(ae,"rust",void 0,fe).resolved.map(be=>be.requirement),...T.flatMap(be=>be.kind==="runtime-requirement"&&be.runtime?.runtime==="rust"&&be.runtime.requirement?[be.runtime.requirement]:[])]),T.length>0){l("localize","Searching for affected code");let be=_f(ae),Mt=await WS(h,{logger:i});for(let[_t,tt]of Mze(h)){let Gn=new Set(tt.map(Vn=>Vn.name)),tb=T.filter(Vn=>Gn.has(Vn.dependency)&&Vn.workspace===_t);if(tb.length===0)continue;let Ts=nx(tb,tt,be,ae,{logger:i,member:_t,members:fe,moduleMaps:Mt});A.push(...Ts.sites),L.push(...Ts.runtimeAnalyses);for(let Vn of Ts.diagnostics){let Go=F.find(fu=>fu.dependency===Vn.dependency&&fu.ecosystem===Vn.ecosystem);Go?(Go.importerCandidateFiles+=Vn.importerCandidateFiles,Go.changesSearched+=Vn.changesSearched,Go.sitesFound+=Vn.sitesFound):F.push({...Vn})}}i.info(`Found ${A.length} impact site(s)`);let vt=new Map;for(let _t of A){let tt=vt.get(_t.breakingChangeId);tt?tt.push(_t):vt.set(_t.breakingChangeId,[_t])}let sn=new Map(ae.map(_t=>[_t.path,_t.content])),oi=new Map(h.map(_t=>[`${_t.workspace??""}::${_t.name}`,_t])),so=[];for(let _t of T){let tt=vt.get(_t.id);if(!tt||tt.length===0)continue;let Gn=hee(_t,tt,sn);Gn?ie.set(_t.id,Gn):so.push(_t)}if(n.remediation.communityRecipes&&so.length>0){let _t=await qn(so,4,async tt=>{let Gn=oi.get(`${tt.workspace??""}::${tt.dependency}`);return[tt.id,await ite(tt,Gn)]});for(let[tt,Gn]of _t)Gn&&ke.set(tt,Gn)}if(so.length>0){l("plan","Resolving deterministic fix plans");let _t=await Oee({changes:so,sites:A,evidence:E,dependencyChanges:h,fileContents:sn,config:n,logger:i,cache:n.remediation.fixPlans.cache?r1()?See(r1()):Cy():Cy(),client:n.remediation.fixPlans.enabled&&n.llm.enabled?await RF(n,i)??void 0:void 0,proposeFromRecipe:n.remediation.communityRecipes&&a?tt=>Xee({change:tt,candidate:ke.get(tt.id),dependencyChange:oi.get(`${tt.workspace??""}::${tt.dependency}`),sites:A,workspace:a,headSha:t.afterSha,env:e.env,logger:i}):void 0});for(let[tt,Gn]of _t.accepted)We.set(tt,Gn);for(let[tt,Gn]of _t.rejected)ye.set(tt,Gn)}}}else T.length>0&&i.warn("No local checkout available; affected code cannot be located.");let xt=[],bt=[],pt=!1;if(n.verification.behavioural.enabled&&T.length>0&&A.length>0){l("verify","Probing dependency behaviour for reachable findings"),pt=!0;let fe=await Xte({config:n,breakingChanges:T,dependencyChanges:h,impactSites:A,resolveEnvironments:async ae=>{if(!ae.from||!ae.to)return null;let[be,Mt]=await Promise.all([P1("old",ae.name,ae.from),P1("new",ae.name,ae.to)]);return be&&Mt?{oldEnvironment:be,newEnvironment:Mt}:null}});for(let ae of fe.gaps)xt.push({stage:"verify",surface:"behavioural-diff",reason:ae,severity:"minor",automaticExecution:"none",remediation:"Behavioural probing is experimental; see `verification.behavioural` in drift.yml."});if(fe.evidence.length>0){E=[...E,...fe.evidence],T=T.map(be=>{let Mt=fe.citationsByChangeId.get(be.id);return Mt?.length?{...be,citations:[...be.citations,...Mt]}:be}),i.info(`Behavioural probing added ${fe.evidence.length} observation(s) of evidence`);let ae=new Map;for(let[be,Mt]of fe.citationsByChangeId)for(let vt of Mt){let sn=ae.get(vt);sn?sn.push(be):ae.set(vt,[be])}for(let be of fe.evidence){let Mt=be.findings?.[0]?.detail??"",vt=ene(Mt);bt.push({name:`behavioural:${be.dependency}`,command:"drift verify --behavioural (bounded differential probe)",status:vt==="probe-unavailable"?"unavailable":"passed",detail:Mt,dependency:be.dependency,workspace:be.workspace,breakingChangeIds:ae.get(be.id)??[]})}}}let ft=[...x];n.verification.behavioural.enabled&&ft.push({surface:"behavioural-diff",status:pt?"checked":"skipped",detail:pt?"Old and new dependency code were run against generated and observed inputs and compared.":"No breaking change had a local impact site to probe, so behavioural probing did not run."});for(let fe of h){let ae=cn(fe),be=E.filter(oi=>oi.dependency===fe.name&&oi.workspace===fe.workspace),Mt=w.get(ae),vt=_.has(ae)||be.some(oi=>oi.findings?.length);ft.push({surface:"api-surface",dependency:fe.name,ecosystem:fe.ecosystem,workspace:fe.workspace,status:Mt?"unavailable":vt?"checked":"unavailable",...S.get(ae)?{unruledChanges:S.get(ae)}:{},detail:Mt?Mt.reason:vt?"A computed diff of the published API surface was produced.":"No computed API diff was available for this ecosystem or version pair."});let sn=k.get(ae)?.filter(oi=>oi.kind==="changelog"||oi.kind==="github-release");ft.push({surface:"release-notes",dependency:fe.name,ecosystem:fe.ecosystem,workspace:fe.workspace,status:sn&&sn.length>0?"checked":"unavailable",detail:sn&&sn.length>0?`${sn.length} release note or changelog section(s) retrieved.`:"No changelog or release notes could be retrieved."})}ft.push({surface:"localization",status:re?"checked":"skipped",detail:re?`Searched the files importing each changed dependency; ${A.length} affected location(s).`:"No checkout was available, so this repository was not searched."});let Cn=tx(T,L);l("rationale","Weighing what each upgrade is worth");let Ci=await fx({changes:h,evidence:E,breakingChanges:T,impactSites:A,runtimeAnalyses:Cn,localizationRan:re},{config:n,logger:i,githubToken:o,additions:y,surfaceCompared:_,surfaceGaps:w,prose:k,repoRuntime:K,pythonRuntime:te,repoRuntimeByWorkspace:D,pythonRuntimeByWorkspace:X});l("plan","Building the remediation plan");let zn=ux({repo:t,config:n,changes:h,evidence:E,breakingChanges:T,impactSites:A,runtimeAnalyses:Cn,rationale:Ci,skipped:b,localizationRan:re,verification:bt,checkedSurfaces:ft,codemods:ie,recipes:ke,fixPlans:We});l("done","Analysis complete");let Pi=xt.length>0?{...zn,gaps:[...zn.gaps,...xt]}:zn;return{plan:Pi,summary:Pne(Pi),...re?{localizationDiagnostics:F}:{}}}function Pne(e){return e.commits.length>0?`${e.breakingChanges.length} breaking change(s), ${new Set(e.impactSites.map(t=>t.file)).size} file(s) affected`:Lf(e)}async function nU(e,t){if(!e.plan)return e;let n=t.workspace??t.repo.workspace,i=Date.now(),r=(s,a)=>{let c=Date.now();t.logger.debug(`${s} (+${c-i}ms): ${a}`),i=c,t.onProgress?.(s,a)},o=await Ize(e.plan,{...t,...n?{workspace:n}:{},progress:r});return o===e.plan?e:{plan:o,summary:Pne(o),...e.localizationDiagnostics?{localizationDiagnostics:e.localizationDiagnostics}:{}}}async function Ize(e,t){let{repo:n,config:i,workspace:r}=t;if(!i.verify.enabled||!r||e.changes.length===0)return e;let o=new Map;for(let p of e.changes){let f=p.workspace??"",m=o.get(f);m?m.push(p):o.set(f,[p])}let s=e,a=[],c=[],l=[],u=[];for(let[p,f]of o){let m=await Oze(r,p,f[0].ecosystem);if(!m)continue;t.progress("verify",`Installing the change in ${p||"the repository root"} and running ${i.verify.checks.join(", ")}`);let g=await $ne({workspace:r,dir:p,packageManager:m,afterSha:n.afterSha,...n.beforeSha?{beforeSha:n.beforeSha}:{},kinds:i.verify.checks,timeoutMs:i.verify.timeoutMs,...t.signal?{signal:t.signal,token:{get isCancellationRequested(){return t.signal.aborted}}}:{},...i.verify.generatedSourceGlobs.length>0?{allowedGlobs:i.verify.generatedSourceGlobs}:{},logger:t.logger,...t.env?{env:t.env}:{},onProgress:({phase:h,detail:b})=>t.progress("verify",`${h}: ${b}`)});if(t.logger.info(`Verification (${p||"root"}): ${Uy(g)}`),a.push(g),g.status==="failed"&&(c.push(p||"the repository root"),f.length===1)){let h=cn(f[0]);l.push(h);let b=await Pze(g.introducedDiagnostics??[],h,f[0].name,p,r);if(u.push(...b),b.length===0){let y=await Cze(r,f[0],h);y&&u.push(y)}}s=Ax(s,g,p)}let d=Sne(a);if(d&&(s=K1({...s,verification:d})),c.length>0&&(s={...s,blockers:[...s.blockers,`${Q1}${c.join(", ")}, which static analysis did not predict. See the verification output for what broke.`]}),l.length>0&&(s={...s,confirmedRegressions:[...s.confirmedRegressions,...l]}),u.length>0){let p=new Set(s.impactSites.map(m=>`${m.file}:${m.line}`)),f=u.filter(m=>!p.has(`${m.file}:${m.line}`));f.length>0&&(s={...s,impactSites:[...s.impactSites,...f]})}return s}var Aze=["","src/test/java/","src/main/java/","src/test/kotlin/","src/main/kotlin/","src/test/scala/","src/main/scala/"];async function Rze(e,t,n,i){for(let r of[t,...i])for(let o of Aze){let s=[r,o+n].filter(Boolean).join("/").replace(/\/{2,}/g,"/");try{if((await(0,Ff.stat)((0,Cx.join)(e,s))).isFile())return s}catch{}}}async function Nze(e,t,n){let i;try{i=await(0,Ff.readFile)((0,Cx.join)(e,t),"utf8")}catch{return}let o=(n.includes(":")?n.slice(n.indexOf(":")+1):n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=[new RegExp(`\\s*${o}\\s*`),new RegExp(`["'\`]${o}["'\`]\\s*[:=]`),new RegExp(`(^|\\s)${o}\\s*(==|>=|<=|~=|=|:|$)`)],a=i.split(` -`);for(let c of s){let l=a.findIndex(u=>c.test(u));if(l!==-1)return{line:l+1,excerpt:a[l].trim().slice(0,200)}}}async function Cze(e,t,n){let i=await Nze(e,t.manifestPath,t.name);if(i)return{breakingChangeId:`measured:${n}`,file:t.manifestPath,line:i.line,excerpt:i.excerpt,matchedSymbol:t.name,confidence:"high",siteKind:"manifest"}}async function Pze(e,t,n,i,r){let o=[],s=new Set,a,c=async()=>{if(a)return a;try{a=(await(0,Ff.readdir)(r,{withFileTypes:!0})).filter(u=>u.isDirectory()&&!u.name.startsWith(".")&&u.name!=="target").map(u=>u.name)}catch{a=[]}return a};for(let l of e){if(/(^|\/)(node_modules|\.venv|venv|site-packages|target\/|dist\/|build\/)/.test(l.file))continue;let u;if(l.origin==="stack-frame"){let p=await Rze(r,i,l.file,await c());if(!p)continue;u=p}else{let p=await Ste(r,i,l.file);if(!p)continue;u=p}let d=`${u}:${l.line}:${l.column??""}`;s.has(d)||(s.add(d),o.push({breakingChangeId:`measured:${t}`,file:u,line:l.line,...l.column!==void 0?{column:l.column}:{},excerpt:(l.code?`${l.code}: ${l.message}`:l.message).slice(0,200),matchedSymbol:l.code??Dze(l.message)??n,confidence:"high"}))}return o}function Dze(e){return/[`'"]([A-Za-z_$][\w$.]*)[`'"]/.exec(e)?.[1]}async function Oze(e,t,n){let i=Hn(),r=await i.readDirectory(t?(0,Cx.join)(e,t):e);if(r.length===0)return null;let o=da({entries:r}).filter(a=>a.manager.ecosystem===n),s=o.find(a=>a.fromLockfile);if(s)return s.manager.id;if(t){let a=await i.readDirectory(e),c=da({entries:a}).find(l=>l.manager.ecosystem===n&&l.fromLockfile);if(c)return c.manager.id}return o[0]?.manager.id??null}function Mze(e){let t=new Map;for(let n of e){let i=n.workspace,r=t.get(i)??[];r.push(n),t.set(i,r)}return[...t.entries()]}async function Lze(e,t,n){let r=(await e.changedFiles()).filter(hH);return r.length===0?[]:(n.debug(`Changed manifests: ${r.join(", ")}`),(await Promise.all(r.map(async s=>{let[a,c]=await Promise.all([e.readFile(s,t.beforeSha),e.readFile(s,t.afterSha)]);return{path:s,before:a,after:c}}))).filter(s=>s.before!==null||s.after!==null))}function tU(e){return{plan:null,summary:e}}var Fze={critical:"\u{1F534} critical",high:"\u{1F7E0} high",medium:"\u{1F7E1} medium",low:"\u{1F535} low",unknown:"\u26AA severity not stated"},Uze={high:"\u{1F7E2} High",medium:"\u{1F7E1} Medium",low:"\u{1F7E0} Low"},jze=8;function iU(e){let t=e.rationale??[];if(t.length===0)return"";let n=t.map(zze).filter(Boolean);return n.length===0?"":["## Upgrade assessment","",n.join(` +> This change is only observable when the code runs. Neither a compiler nor a source search can confirm whether this repository is affected.`:"";return`${n.join(" \xB7 ")}${i}`}function wB(e){if(e.length===0)return"";let t=["## What Drift could not check","","These are surfaces Drift did not establish. A limit of the tool is not a finding","about the upgrade \u2014 an absence here is not evidence that nothing is wrong.","","| Stage | Surface | Why it matters | What to do |","|---|---|---|---|"];for(let n of e){let r=n.automaticExecution==="blocks"?"**blocks automatic execution**":n.automaticExecution==="degrades"?"lowers confidence":"noted",i=n.dependency?`${n.surface} (\`${n.dependency}\`)`:n.surface;t.push(`| ${n.stage} | ${Vm(i)} | ${Vm(n.reason)} \u2014 ${r} | ${Vm(n.remediation)} |`)}return t.join(` +`)}function kB(e){if(e.checkedSurfaces.length===0)return"";let t=["## What Drift checked","","| Surface | Dependency | Result |","|---|---|---|"];for(let n of e.checkedSurfaces){let r=n.status==="checked"?"\u2705 checked":n.status==="skipped"?"\u23ED\uFE0F skipped":"\u26A0\uFE0F unavailable";t.push(`| ${n.surface} | ${n.dependency?`\`${n.dependency}\``:"\u2014"} | ${r} \u2014 ${Vm(n.detail)} |`)}return t.join(` +`)}function ale(e){if(e.automaticExecutionEligible)return"**Automatic execution:** eligible \u2014 upstream evidence and local impact are both established.";let t=[];e.upstream.band!=="high"&&t.push("upstream evidence is not conclusive"),e.localImpact.band==="none"?t.push("no local impact was established"):e.localImpact.band==="low"&&t.push("local impact is weakly established");for(let n of e.gaps)n.automaticExecution==="blocks"&&t.push(n.surface);return`**Automatic execution:** not eligible \u2014 ${t.join("; ")||"insufficient evidence"}.`}async function _v(e){let{repo:t,config:n,logger:r,provider:i,githubToken:o,onProgress:s}=e,a=e.workspace??t.workspace,c=Date.now(),l=(be,pe)=>{let Se=Date.now();r.debug(`${be} (+${Se-c}ms): ${pe}`),c=Se,s?.(be,pe)};l("detect","Reading manifest changes");let u=await iHe(i,t,r);if(u.length===0)return $B("No dependency manifest changed in this range.");let d=a?await Zd(a,Xn()):[],p=a?(await A$(a,Xn(),Yd(d))).map(be=>({kind:"undeclared-nested",ecosystem:be.ecosystem,declaredIn:be.manifestPath,members:[{dir:be.dir,name:null,ecosystem:be.ecosystem}]})):[],f=[...d,...p];if(f.length>0){let be=new Map;for(let pe of f){let Se=be.get(pe.kind)??{layouts:0,members:0};be.set(pe.kind,{layouts:Se.layouts+1,members:Se.members+pe.members.length})}r.info(`Workspace: ${[...be].map(([pe,{layouts:Se,members:Gt}])=>Se===1?`${pe} (${Gt} member(s))`:`${pe} \xD7${Se} (${Gt} member(s))`).join(", ")}`)}let m=S8(U3(u),f);if(m.length===0)return $B("Manifests changed, but no dependency versions moved.");let g=await w8(m,{logger:r});r.info(`Detected ${g.length} dependency change(s)`);let{actionable:h,skipped:v}=j3(g,n);for(let be of v)r.info(` - ${be.change.name}: skipped \u2014 ${be.reason}`);if(h.length===0)return $B(g.length===1?"The 1 dependency change found doesn't match the analysis criteria in drift.yml (see reason above).":`None of the ${g.length} dependency changes found match the analysis criteria in drift.yml (see reasons above).`);l("triage",`${h.length} change(s) to analyse`),l("evidence",`Gathering evidence for ${h.map(be=>be.name).join(", ")}`);let b=new Map,_=new Map,w=new Map,k=new Set,x=new Map,A=[],I=await $ee(h,{config:n,logger:r,githubToken:o,...e.env?{env:e.env}:{},readRepoFile:(be,pe)=>i.readFile(be,pe),...i.listFiles?{listRepoFiles:be=>i.listFiles(be)}:{},beforeSha:t.beforeSha,afterSha:t.afterSha,...a?{workspaceRoot:a}:{},onSurfaceComputed:(be,pe)=>{let Se=fn(be);pe.weight>=.8&&k.add(Se),pe.sourceIncompatibleCount&&x.set(Se,pe.sourceIncompatibleCount),b.set(Se,{additions:pe.additions??[],locator:pe.locator})},onUnavailableSurface:(be,pe)=>_.set(fn(be),pe),onProseConsulted:(be,pe)=>{let Se=fn(be);w.set(Se,[...w.get(Se)??[],pe])},onSpecComputed:(be,pe)=>A.push({surface:"contract-document",dependency:be,status:"checked",detail:`${be} was compared between the two commits by ${pe.tool}.`}),onUnavailableSpec:(be,pe)=>A.push({surface:"contract-document",dependency:be,status:"unavailable",detail:pe.remedy?`${pe.detail} ${pe.remedy}`:pe.detail})});r.info(`Gathered ${I.length} evidence record(s)`),l("analyze","Identifying breaking changes");let R=await DT(h,I,{config:n,logger:r});r.info(`Identified ${R.length} breaking change(s)`);let C=[],j=[],z=[],Y=[],se=[],L,ee,ce=!!a,le=new Map,Ae=new Map,Ke=new Map,ke=new Map;if(a){let be=Yd(f),pe=await Xd(a,{members:be});if(Y=Dm(pe),se=Mm(pe),f.length>0&&(L=new Map(be.map(Se=>[Se,Dm(pe,Se,be)])),ee=new Map(be.map(Se=>[Se,Mm(pe,Se,be)]))),R.some(Se=>Se.kind==="runtime-requirement"&&Se.runtime?.runtime==="rust")&&await fG([...Om(pe,"rust",void 0,be).resolved.map(Se=>Se.requirement),...R.flatMap(Se=>Se.kind==="runtime-requirement"&&Se.runtime?.runtime==="rust"&&Se.runtime.requirement?[Se.runtime.requirement]:[])]),R.length>0){l("localize","Searching for affected code");let Se=Pm(pe),Gt=await LT(h,{logger:r});for(let[Rt,rt]of rHe(h)){let Kn=new Set(rt.map(Jn=>Jn.name)),Dv=R.filter(Jn=>Kn.has(Jn.dependency)&&Jn.workspace===Rt);if(Dv.length===0)continue;let ea=HT(Dv,rt,Se,pe,{logger:r,member:Rt,members:be,moduleMaps:Gt});C.push(...ea.sites),j.push(...ea.runtimeAnalyses);for(let Jn of ea.diagnostics){let us=z.find(Lu=>Lu.dependency===Jn.dependency&&Lu.ecosystem===Jn.ecosystem);us?(us.importerCandidateFiles+=Jn.importerCandidateFiles,us.changesSearched+=Jn.changesSearched,us.sitesFound+=Jn.sitesFound):z.push({...Jn})}}r.info(`Found ${C.length} impact site(s)`);let At=new Map;for(let Rt of C){let rt=At.get(Rt.breakingChangeId);rt?rt.push(Rt):At.set(Rt.breakingChangeId,[Rt])}let dn=new Map(pe.map(Rt=>[Rt.path,Rt.content])),$i=new Map(h.map(Rt=>[`${Rt.workspace??""}::${Rt.name}`,Rt])),wo=[];for(let Rt of R){let rt=At.get(Rt.id);if(!rt||rt.length===0)continue;let Kn=qse(Rt,rt,dn);Kn?le.set(Rt.id,Kn):wo.push(Rt)}if(n.remediation.communityRecipes&&wo.length>0){let Rt=await Yn(wo,4,async rt=>{let Kn=$i.get(`${rt.workspace??""}::${rt.dependency}`);return[rt.id,await Nae(rt,Kn)]});for(let[rt,Kn]of Rt)Kn&&Ae.set(rt,Kn)}if(wo.length>0){l("plan","Resolving deterministic fix plans");let Rt=await uae({changes:wo,sites:C,evidence:I,dependencyChanges:h,fileContents:dn,config:n,logger:r,cache:n.remediation.fixPlans.cache?xG()?Xse(xG()):pv():pv(),client:n.remediation.fixPlans.enabled&&n.llm.enabled?await Qz(n,r)??void 0:void 0,proposeFromRecipe:n.remediation.communityRecipes&&a?rt=>Aae({change:rt,candidate:Ae.get(rt.id),dependencyChange:$i.get(`${rt.workspace??""}::${rt.dependency}`),sites:C,workspace:a,headSha:t.afterSha,env:e.env,logger:r}):void 0});for(let[rt,Kn]of Rt.accepted)Ke.set(rt,Kn);for(let[rt,Kn]of Rt.rejected)ke.set(rt,Kn)}}}else R.length>0&&r.warn("No local checkout available; affected code cannot be located.");let Ct=[],Tt=[],yt=!1;if(n.verification.behavioural.enabled&&R.length>0&&C.length>0){l("verify","Probing dependency behaviour for reachable findings"),yt=!0;let be=await Ace({config:n,breakingChanges:R,dependencyChanges:h,impactSites:C,resolveEnvironments:async pe=>{if(!pe.from||!pe.to)return null;let[Se,Gt]=await Promise.all([tB("old",pe.name,pe.from),tB("new",pe.name,pe.to)]);return Se&&Gt?{oldEnvironment:Se,newEnvironment:Gt}:null}});for(let pe of be.gaps)Ct.push({stage:"verify",surface:"behavioural-diff",reason:pe,severity:"minor",automaticExecution:"none",remediation:"Behavioural probing is experimental; see `verification.behavioural` in drift.yml."});if(be.evidence.length>0){I=[...I,...be.evidence],R=R.map(Se=>{let Gt=be.citationsByChangeId.get(Se.id);return Gt?.length?{...Se,citations:[...Se.citations,...Gt]}:Se}),r.info(`Behavioural probing added ${be.evidence.length} observation(s) of evidence`);let pe=new Map;for(let[Se,Gt]of be.citationsByChangeId)for(let At of Gt){let dn=pe.get(At);dn?dn.push(Se):pe.set(At,[Se])}for(let Se of be.evidence){let Gt=Se.findings?.[0]?.detail??"",At=Ice(Gt);Tt.push({name:`behavioural:${Se.dependency}`,command:"drift verify --behavioural (bounded differential probe)",status:At==="probe-unavailable"?"unavailable":"passed",detail:Gt,dependency:Se.dependency,workspace:Se.workspace,breakingChangeIds:pe.get(Se.id)??[]})}}}let bt=[...A];n.verification.behavioural.enabled&&bt.push({surface:"behavioural-diff",status:yt?"checked":"skipped",detail:yt?"Old and new dependency code were run against generated and observed inputs and compared.":"No breaking change had a local impact site to probe, so behavioural probing did not run."});for(let be of h){let pe=fn(be),Se=I.filter($i=>$i.dependency===be.name&&$i.workspace===be.workspace),Gt=_.get(pe),At=k.has(pe)||Se.some($i=>$i.findings?.length);bt.push({surface:"api-surface",dependency:be.name,ecosystem:be.ecosystem,workspace:be.workspace,status:Gt?"unavailable":At?"checked":"unavailable",...x.get(pe)?{unruledChanges:x.get(pe)}:{},detail:Gt?Gt.reason:At?"A computed diff of the published API surface was produced.":"No computed API diff was available for this ecosystem or version pair."});let dn=w.get(pe)?.filter($i=>$i.kind==="changelog"||$i.kind==="github-release");bt.push({surface:"release-notes",dependency:be.name,ecosystem:be.ecosystem,workspace:be.workspace,status:dn&&dn.length>0?"checked":"unavailable",detail:dn&&dn.length>0?`${dn.length} release note or changelog section(s) retrieved.`:"No changelog or release notes could be retrieved."})}bt.push({surface:"localization",status:ce?"checked":"skipped",detail:ce?`Searched the files importing each changed dependency; ${C.length} affected location(s).`:"No checkout was available, so this repository was not searched."});let Ln=WT(R,j);l("rationale","Weighing what each upgrade is worth");let Ki=await iA({changes:h,evidence:I,breakingChanges:R,impactSites:C,runtimeAnalyses:Ln,localizationRan:ce},{config:n,logger:r,githubToken:o,additions:b,surfaceCompared:k,surfaceGaps:_,prose:w,repoRuntime:Y,pythonRuntime:se,repoRuntimeByWorkspace:L,pythonRuntimeByWorkspace:ee});l("plan","Building the remediation plan");let Hn=tA({repo:t,config:n,changes:h,evidence:I,breakingChanges:R,impactSites:C,runtimeAnalyses:Ln,rationale:Ki,skipped:v,localizationRan:ce,verification:Tt,checkedSurfaces:bt,codemods:le,recipes:Ae,fixPlans:Ke});l("done","Analysis complete");let Ji=Ct.length>0?{...Hn,gaps:[...Hn.gaps,...Ct]}:Hn;return{plan:Ji,summary:cle(Ji),...ce?{localizationDiagnostics:z}:{}}}function cle(e){return e.commits.length>0?`${e.breakingChanges.length} breaking change(s), ${new Set(e.impactSites.map(t=>t.file)).size} file(s) affected`:qm(e)}async function SB(e,t){if(!e.plan)return e;let n=t.workspace??t.repo.workspace,r=Date.now(),i=(s,a)=>{let c=Date.now();t.logger.debug(`${s} (+${c-r}ms): ${a}`),r=c,t.onProgress?.(s,a)},o=await JWe(e.plan,{...t,...n?{workspace:n}:{},progress:i});return o===e.plan?e:{plan:o,summary:cle(o),...e.localizationDiagnostics?{localizationDiagnostics:e.localizationDiagnostics}:{}}}async function JWe(e,t){let{repo:n,config:r,workspace:i}=t;if(!r.verify.enabled||!i||e.changes.length===0)return e;let o=new Map;for(let p of e.changes){let f=p.workspace??"",m=o.get(f);m?m.push(p):o.set(f,[p])}let s=e,a=[],c=[],l=[],u=[];for(let[p,f]of o){let m=await nHe(i,p,f[0].ecosystem);if(!m)continue;t.progress("verify",`Installing the change in ${p||"the repository root"} and running ${r.verify.checks.join(", ")}`);let g=await Yce({workspace:i,dir:p,packageManager:m,afterSha:n.afterSha,...n.beforeSha?{beforeSha:n.beforeSha}:{},kinds:r.verify.checks,timeoutMs:r.verify.timeoutMs,...t.signal?{signal:t.signal,token:{get isCancellationRequested(){return t.signal.aborted}}}:{},...r.verify.generatedSourceGlobs.length>0?{allowedGlobs:r.verify.generatedSourceGlobs}:{},logger:t.logger,...t.env?{env:t.env}:{},onProgress:({phase:h,detail:v})=>t.progress("verify",`${h}: ${v}`)});if(t.logger.info(`Verification (${p||"root"}): ${vv(g)}`),a.push(g),g.status==="failed"&&(c.push(p||"the repository root"),f.length===1)){let h=fn(f[0]);l.push(h);let v=await eHe(g.introducedDiagnostics??[],h,f[0].name,p,i);if(u.push(...v),v.length===0){let b=await XWe(i,f[0],h);b&&u.push(b)}}s=_A(s,g,p)}let d=Xce(a);if(d&&(s=hB({...s,verification:d})),c.length>0&&(s={...s,blockers:[...s.blockers,`${_B}${c.join(", ")}, which static analysis did not predict. See the verification output for what broke.`]}),l.length>0&&(s={...s,confirmedRegressions:[...s.confirmedRegressions,...l]}),u.length>0){let p=new Set(s.impactSites.map(m=>`${m.file}:${m.line}`)),f=u.filter(m=>!p.has(`${m.file}:${m.line}`));f.length>0&&(s={...s,impactSites:[...s.impactSites,...f]})}return s}var ZWe=["","src/test/java/","src/main/java/","src/test/kotlin/","src/main/kotlin/","src/test/scala/","src/main/scala/"];async function YWe(e,t,n,r){for(let i of[t,...r])for(let o of ZWe){let s=[i,o+n].filter(Boolean).join("/").replace(/\/{2,}/g,"/");try{if((await(0,Wm.stat)((0,$A.join)(e,s))).isFile())return s}catch{}}}async function QWe(e,t,n){let r;try{r=await(0,Wm.readFile)((0,$A.join)(e,t),"utf8")}catch{return}let o=(n.includes(":")?n.slice(n.indexOf(":")+1):n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=[new RegExp(`\\s*${o}\\s*`),new RegExp(`["'\`]${o}["'\`]\\s*[:=]`),new RegExp(`(^|\\s)${o}\\s*(==|>=|<=|~=|=|:|$)`)],a=r.split(` +`);for(let c of s){let l=a.findIndex(u=>c.test(u));if(l!==-1)return{line:l+1,excerpt:a[l].trim().slice(0,200)}}}async function XWe(e,t,n){let r=await QWe(e,t.manifestPath,t.name);if(r)return{breakingChangeId:`measured:${n}`,file:t.manifestPath,line:r.line,excerpt:r.excerpt,matchedSymbol:t.name,confidence:"high",siteKind:"manifest"}}async function eHe(e,t,n,r,i){let o=[],s=new Set,a,c=async()=>{if(a)return a;try{a=(await(0,Wm.readdir)(i,{withFileTypes:!0})).filter(u=>u.isDirectory()&&!u.name.startsWith(".")&&u.name!=="target").map(u=>u.name)}catch{a=[]}return a};for(let l of e){if(/(^|\/)(node_modules|\.venv|venv|site-packages|target\/|dist\/|build\/)/.test(l.file))continue;let u;if(l.origin==="stack-frame"){let p=await YWe(i,r,l.file,await c());if(!p)continue;u=p}else{let p=await Xae(i,r,l.file);if(!p)continue;u=p}let d=`${u}:${l.line}:${l.column??""}`;s.has(d)||(s.add(d),o.push({breakingChangeId:`measured:${t}`,file:u,line:l.line,...l.column!==void 0?{column:l.column}:{},excerpt:(l.code?`${l.code}: ${l.message}`:l.message).slice(0,200),matchedSymbol:l.code??tHe(l.message)??n,confidence:"high"}))}return o}function tHe(e){return/[`'"]([A-Za-z_$][\w$.]*)[`'"]/.exec(e)?.[1]}async function nHe(e,t,n){let r=Xn(),i=await r.readDirectory(t?(0,$A.join)(e,t):e);if(i.length===0)return null;let o=Fa({entries:i}).filter(a=>a.manager.ecosystem===n),s=o.find(a=>a.fromLockfile);if(s)return s.manager.id;if(t){let a=await r.readDirectory(e),c=Fa({entries:a}).find(l=>l.manager.ecosystem===n&&l.fromLockfile);if(c)return c.manager.id}return o[0]?.manager.id??null}function rHe(e){let t=new Map;for(let n of e){let r=n.workspace,i=t.get(r)??[];i.push(n),t.set(r,i)}return[...t.entries()]}async function iHe(e,t,n){let i=(await e.changedFiles()).filter(F3);return i.length===0?[]:(n.debug(`Changed manifests: ${i.join(", ")}`),(await Promise.all(i.map(async s=>{let[a,c]=await Promise.all([e.readFile(s,t.beforeSha),e.readFile(s,t.afterSha)]);return{path:s,before:a,after:c}}))).filter(s=>s.before!==null||s.after!==null))}function $B(e){return{plan:null,summary:e}}var oHe={critical:"\u{1F534} critical",high:"\u{1F7E0} high",medium:"\u{1F7E1} medium",low:"\u{1F535} low",unknown:"\u26AA severity not stated"},sHe={high:"\u{1F7E2} High",medium:"\u{1F7E1} Medium",low:"\u{1F7E0} Low"},aHe=8;function EB(e){let t=e.rationale??[];if(t.length===0)return"";let n=t.map(cHe).filter(Boolean);return n.length===0?"":["## Upgrade assessment","",n.join(` --- `)].join(` -`)}function zze(e){let t=[`### \`${e.dependency}\` ${e.from} \u2192 ${e.to}`,"",`**Recommendation: ${ru[e.assessment.recommendation]}**`,""],n=Gze(e.security);n&&t.push(n,"");let i=Vze(e.maintenance);if(i&&t.push(i,""),e.improvements.length>0){t.push("**Other improvements**","");for(let s of e.improvements)t.push(`- ${s.statement}${s.url?` ([source](${s.url}))`:""}`);t.push("")}let r=Bze(e.license);r&&t.push(r,"");let o=qze(e.summary);if(o&&t.push(o,""),t.push(`**Evidence confidence:** ${Uze[e.assessment.confidence]} \u2014 ${e.assessment.confidenceBasis}`,""),e.assessment.reasons.length>0){t.push("
Why Drift concluded this","");for(let s of e.assessment.reasons)t.push(`- ${s}`);t.push("","
")}return t.join(` -`).trim()}function Gze(e){if(!e.checked)return`**Security** - -${e.reason??"The OSV advisory database could not be reached, so this upgrade's effect on known vulnerabilities is unknown."}`;let t=["**Security**",""];return e.resolved.length>0&&(t.push(`Upgrading resolves ${zy(e.resolved.length,"known vulnerability","known vulnerabilities")}:`),t.push(...rU(e.resolved)),t.push("")),e.introduced.length>0&&(t.push(`The target version is affected by ${zy(e.introduced.length,"advisory","advisories")} that ${e.introduced.length===1?"does":"do"} not affect the installed version:`),t.push(...rU(e.introduced)),t.push("")),e.carried.length>0&&(t.push(`${zy(e.carried.length,"advisory affects","advisories affect")} both versions and ${e.carried.length===1?"is":"are"} not addressed by this upgrade:`),t.push(...rU(e.carried)),t.push("")),e.target.length===0&&t.push("No known vulnerabilities were found for the target version."),t.join(` -`).trim()}function rU(e){let t=e.slice(0,jze),n=t.map(i=>{let r=i.aliases.find(a=>a.startsWith("CVE-")),o=r&&r!==i.id?`${i.id} (${r})`:i.id,s=i.fixedIn?` \u2014 first fixed in ${i.fixedIn}`:" \u2014 no fixed version published";return`- [${o}](${i.url}) \u2014 ${Fze[i.severity]}${s}. ${i.summary}`});return e.length>t.length&&n.push(`- \u2026and ${e.length-t.length} more.`),n}function Vze(e){return e.facts.length===0?"":["**Maintenance**","",...[...e.facts].sort((n,i)=>Number(i.concerning??!1)-Number(n.concerning??!1)).map(n=>`- ${n.statement}${n.url?` ([source](${n.url}))`:""}`)].join(` -`)}function Bze(e){if(e.verdict==="ok"||e.verdict==="changed")return"";let n=[e.verdict==="policy-violation"?"**License review required**":"**License**","",e.statement],i=e.introduced.filter(r=>!r.allowed);if(i.length>0){n.push("","Newly introduced dependencies of this package:");for(let r of i)n.push(`- \`${r.name}\` \u2014 ${r.license??"no declared license"}`);n.push("","This covers the dependencies this package itself declares. Drift does not resolve the full transitive graph during analysis.")}return n.push("","_Drift reports what the metadata says and how it compares to your configured policy. It does not give legal advice._"),n.join(` -`)}function qze(e){if(e.changes.length===0)return"";let t=[["Breaking changes",e.changes.filter(i=>i.category==="breaking")],["Security",e.changes.filter(i=>i.category==="security")],["Improvements",e.changes.filter(i=>i.category==="performance"||i.category==="improvement")],["Fixes",e.changes.filter(i=>i.category==="fix")]],n=["
What changed upstream",""];for(let[i,r]of t)if(r.length!==0){n.push(`**${i}**`,"");for(let o of r){let s=o.affectedSites!==void 0?` Drift found ${zy(o.affectedSites,"affected call","affected calls")} in this repository.`:"";n.push(`- ${o.text}${s}${o.url?` ([source](${o.url}))`:""}`)}n.push("")}return e.unrelated>0&&n.push("**Unrelated changes**","",`- ${zy(e.unrelated,"further change","further changes")} were read and judged not to concern this repository.`,""),n.push("
"),n.join(` -`)}function zy(e,t,n){return`${e} ${e===1?t:n}`}var Wze=["drift-schema","drift-plan","drift-plan-digest","drift-commit","drift-base-branch"],Hze=/^[ \t]*[ \t]*$/gm,Kze=/^[0-9a-f]{40}$/,Jze=/^plan_[0-9a-f]{10}$/,Zze=/^[0-9a-f]{64}$/;function Yze(e){return!(!e||e.length>255||/[\x00-\x20~^:?*[\\]/.test(e)||e.includes("..")||e.includes("@{")||e.startsWith("/")||e.endsWith("/")||e.includes("//")||e.startsWith("-")||e.startsWith(".")||e.endsWith(".")||e.endsWith(".lock"))}function Dne(e){return[``,``,``,``,``].join(` -`)}function One(e){if(!e)return{ok:!1,reason:"the issue has no body"};let t=new Map;for(let l of e.matchAll(Hze)){let u=l[1],d=(l[2]??"").trim(),p=t.get(u);p?p.push(d):t.set(u,[d])}if(t.size===0)return{ok:!1,reason:"the issue has no Drift plan footer, so it is not a Drift approval issue"};for(let l of Wze){let u=t.get(l);if(!u)return{ok:!1,reason:`the plan footer is missing \`${l}\``};if(u.length>1)return{ok:!1,reason:`the plan footer declares \`${l}\` ${u.length} times; a Drift issue declares each key exactly once`};if(u[0]==="")return{ok:!1,reason:`the plan footer has an empty \`${l}\``}}let n=l=>t.get(l)[0],i=n("drift-schema");if(!/^\d+$/.test(i))return{ok:!1,reason:`\`drift-schema\` must be an integer, not \`${oU(i)}\``};let r=Number(i);if(!h1.includes(r))return{ok:!1,reason:`this issue records plan schema v${r}, which this version of Drift cannot verify (it supports v${h1.join(", v")}). Re-run Drift to generate a current plan.`};let o=n("drift-plan");if(!Jze.test(o))return{ok:!1,reason:`\`drift-plan\` is not a Drift plan id: \`${oU(o)}\``};let s=n("drift-plan-digest");if(!Zze.test(s))return{ok:!1,reason:"`drift-plan-digest` is not a 64-character SHA-256 digest"};let a=n("drift-commit");if(!Kze.test(a))return{ok:!1,reason:"`drift-commit` must be a full 40-character commit SHA; an abbreviated SHA does not name one commit unambiguously"};let c=n("drift-base-branch");return Yze(c)?{ok:!0,metadata:{schemaVersion:r,planId:o,planDigest:s,headSha:a,baseBranch:c}}:{ok:!1,reason:`\`drift-base-branch\` is not a valid branch name: \`${oU(c)}\``}}function Mne(e){let t=[``,``];return e.taskId&&t.push(``),e.pullRequestNumber!==void 0&&t.push(``),t.join(` -`)}function Lne(e,t){for(let n of e){if(!n.authorIsDrift||!n.body)continue;let i=//.exec(n.body)?.[1];if(i!==t)continue;let r=//.exec(n.body)?.[1]?.trim(),o=//.exec(n.body)?.[1]?.trim(),s=//.exec(n.body)?.[1];return{planDigest:i,...r?{branchName:r}:{},...o?{taskId:o}:{},...s?{pullRequestNumber:Number(s)}:{}}}return null}function oU(e){let t=e.replace(/[`\r\n]/g," ").trim();return t.length<=40?t:`${t.slice(0,40)}\u2026`}var hU=require("node:crypto");var kr=require("node:path");var Vne=require("node:fs"),zo=require("node:fs/promises"),Bne=require("node:child_process"),qne=require("node:util");function Qze(e){return e.verification?e.verification.status==="passed"?"passed":e.verification.status==="failed"?"failed":"skipped":"not-run"}function Gy(e){if(e.status==="pending")return"pending";if(e.status==="error")return"error";let t=e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial";if((e.actionableImpactCount??(t?e.runtimeDeclarationSiteCount!==void 0?Math.max(0,e.impactCount-e.runtimeDeclarationSiteCount):e.impactConfidence==="high"?e.impactCount:0:e.impactConfidence==="low"||e.impactConfidence==="medium"?0:e.impactCount))>0)return"affected";if(e.verification?.status==="failed")return"verification-failed";let i=t?e.runtimeDeclarationSiteCount:0;if((i===void 0?t?0:e.impactCount:Math.max(0,e.impactCount-i))>0)return"review-required";if(e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial")return"runtime-unresolved";let o=e.runtimeAnalyses?.length??0,s=Math.max(0,e.breakingCount-o);return s>0&&(e.sourceCoverage?.localizationComplete===!1||e.sourceCoverage?.sourceTruncated)?"localization-incomplete":s>0?e.verifiedUnaffected===!0?"upstream-only":"review-required":e.breakingCount>0?"upstream-only":e.recommendation==="insufficient-evidence"?"evidence-missing":e.recommendation?"clean":e.gaps&&e.gaps.length>0?"evidence-missing":"clean"}function Une(e){let t=Qze(e),n=t==="not-run"?" \u2014 not deeply verified":t==="skipped"?" \u2014 deep verification did not complete":"",i=eGe(e);switch(Gy(e)){case"pending":return"Not checked yet";case"error":return"Could not check";case"affected":{let r=e.actionableImpactCount!==void 0,o=e.actionableImpactFiles??e.impactFiles,s=e.actionableImpactCount??e.impactCount,a=r?"actionable site":"site",c=e.impactConfidence&&e.impactConfidence!=="high"||e.runtimeCompatibility==="partial"?"May affect":"Affects",l=e.impactPendingIsolatedClearance?" \u2014 not yet confirmed alone: a batch check passed without testing this package in isolation":"",u=t==="failed"?" \u2014 and its own checks fail with this installed, measured not predicted":n,d=i?` \xB7 ${i}`:"";return`${c} your code \xB7 ${s} ${a}${s===1?"":"s"} in ${o} file${o===1?"":"s"}${d}${l}${u}`}case"verification-failed":{let r=(e.verification?.checks??[]).filter(o=>o.status==="failed").map(o=>o.label);return r.length>0?`Verified breaking \xB7 ${r.join(", ")} failed with this upgrade installed \u2014 measured, not predicted`:"Verified breaking \xB7 this upgrade broke the project's own checks \u2014 measured, not predicted"}case"upstream-only":{let r=`${e.breakingCount} upstream change${e.breakingCount===1?"":"s"}, none used here`;return e.verifiedUnaffected===!0?`Verified safe \xB7 ${r}, and your own checks pass`:`Safe for your code \xB7 ${r}`}case"review-required":{let r=e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial"?e.runtimeDeclarationSiteCount??0:0;if(e.impactCount-r<=0){let a=e.breakingCount;return`Review Required \xB7 ${a} breaking change${a===1?"":"s"} upstream; Drift found no usage in this repository but could not prove none \u2014 verify before upgrading`+(i?` \xB7 ${i}`:"")}let o=Math.max(1,e.impactCount-r),s=i?` \xB7 ${i}`:"";return e.impactConfidence==="low"||e.impactConfidence==="medium"?`May affect your code \xB7 ${o} local site${o===1?"":"s"} Drift flagged but could not confirm \u2014 Review required; check before upgrading${s}`:`Review Required \xB7 ${o} local site${o===1?"":"s"} Drift flagged but could not confirm${s}`}case"runtime-unresolved":return i?`Runtime Unknown \xB7 ${i}`:"Runtime Unknown \xB7 Drift could not resolve this repository\u2019s runtime compatibility";case"localization-incomplete":return"Localization Incomplete \xB7 Drift searched the indexed source subset, but the file limit prevented proving the breaking API is unused";case"evidence-missing":return"Evidence Missing \xB7 Drift could not obtain enough upstream evidence to decide";case"clean":{let r=e.recommendation==="upgrade-recommended";return t==="passed"?r?"Verified worth taking \xB7 no breaking changes, it improves on what you have, and your own checks pass":"Verified safe \xB7 no breaking changes found, and your own checks pass":r?`Worth taking \xB7 no breaking changes, and it improves on what you have${n}`:`Safe for your code \xB7 no breaking changes found${n}`}}}function Fne(e){return{affected:0,"verification-failed":1,error:2,"review-required":3,"runtime-unresolved":4,"localization-incomplete":5,"evidence-missing":6,"upstream-only":7,pending:8,clean:9}[e]}function Xze(e,t){return Fne(e)-Fne(t)}function jne(e,t){return Xze(Gy(e),Gy(t))}function eGe(e){if(e.runtimeCompatibility!=="unknown"&&e.runtimeCompatibility!=="partial")return;let t=e.runtimeAnalyses?.find(i=>i.state==="unknown"||i.state==="partial");if(t?.statement)return t.statement;if(t?.reason==="config-incomplete")return"Drift could not index every authoritative runtime configuration file";let n=e.runtimeDeclarationSiteCount??0;return n>0?`${n} runtime declaration${n===1?"":"s"} to review`:"Drift could not resolve this repository\u2019s runtime compatibility"}function sU(e,t){return Te(e,t)}function ac(e,t){return Qe(e,t)??0}function Px(e){switch(e){case"npm":return"the npm registry";case"pypi":return"PyPI";case"cargo":return"crates.io";case"go":return"the Go module proxy";case"maven":return"Maven Central";case"rubygems":return"RubyGems";case"nuget":return"NuGet";case"packagist":return"Packagist";case"hex":return"Hex";case"pub":return"pub.dev";case"cocoapods":return"CocoaPods Trunk";case"conan":return"ConanCenter";case"vcpkg":return"the vcpkg registry";case"arduino":return"the Arduino Library Manager";case"swift":return"the package\u2019s git tags";case"opam":return"the opam repository"}}async function zne(e){try{return await tGe(e)}catch(t){return{outcome:"unchecked",reason:`Checking ${Px(e.ecosystem)} for ${e.name} failed: ${t.message}`}}}async function tGe(e){let{name:t,ecosystem:n,current:i,range:r}=e,o=Px(n),s=sU(i,n);if(!s)return{outcome:"unchecked",reason:`${t} is installed at \u201C${i}\u201D, which Drift cannot compare against published versions.`};let a=await cU(e);if(!a)return{outcome:"unchecked",reason:`Drift could not reach ${o} for ${t}.`};if(a.complete===!1)return{outcome:"unchecked",reason:`Drift could not enumerate all of ${o} for ${t}, so it cannot establish whether a newer compatible version exists.`};if(a.versions.length===0)return{outcome:"unchecked",reason:`${o} returned no versions for ${t}, so Drift has nothing to compare against.`};let l=(n==="swift"?a.versions.filter(y=>aU(y)===aU(i)):a.versions).map(y=>sU(y,n)).filter(y=>y!==null);if(l.length===0)return n==="swift"?{outcome:"unchecked",reason:`${o} returned no tags in the installed version's ${aU(i)} family for ${t}.`}:{outcome:"unchecked",reason:`Drift could not read any of the ${a.versions.length} version numbers ${o} published for ${t}.`};let d=(s.prerelease?l:l.filter(y=>!y.prerelease)).filter(y=>ac(y,s)>0).sort((y,w)=>ac(w,y)),p=a.latest?sU(a.latest,n):null,f=n==="swift"?d[0]:p&&(s.prerelease||!p.prerelease)?p:d[0];if(!f||ac(f,s)<=0)return{outcome:"up-to-date"};let m=lGe(d,s,r,n),g=d,h=cGe(g,s,n),b=[...new Map([f,...m?[m]:[],...h?[h]:[],...g.slice(0,18)].map(y=>[y.raw,y])).values()].filter(y=>ac(y,s)>0).sort((y,w)=>ac(w,y)).map(y=>y.raw);return{outcome:"upgrade",latest:f.raw,...m?{safeLatest:m.raw}:{},...h?{latestMinor:h.raw}:{},versions:b}}function aU(e){let t=e.trim().replace(/^[^\d]*/,"");return/^\d{4}[.-]\d{1,2}[.-]\d{1,2}(?:[.-]\d+)?(?:$|[-+])/.test(t)?"calendar":Te(e,"swift")?"semver":"unknown"}var nGe="https://repo1.maven.org/maven2";async function cU(e){switch(e.ecosystem){case"npm":return oGe(e.name);case"swift":return sGe(e.name,e.githubToken);case"opam":return aGe(e.name,e.githubToken);case"maven":return rGe(e.name);default:{let t=await Wn(e.name,e.ecosystem,null);return t?{latest:null,versions:t.versions}:null}}}async function rGe(e){let[t,n]=e.split(":");if(!t||!n)return null;let i=await rt(`${nGe}/${t.replace(/\./g,"/")}/${n}/maven-metadata.xml`);if(i===null){let s=await Wn(e,"maven",null);return s?{latest:null,versions:s.versions}:null}let r=/([^<]+)<\/release>/.exec(i)?.[1]?.trim()??null,o=[...i.matchAll(/([^<]+)<\/version>/g)].map(s=>s[1].trim());if(o.length===0){let s=await Wn(e,"maven",null);return s?{latest:null,versions:s.versions}:null}return{latest:r,versions:o}}var iGe="application/vnd.npm.install-v1+json, application/json";async function oGe(e){let t=await $e(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`,{timeoutMs:12e3,headers:{Accept:iGe}});return t?{latest:t["dist-tags"]?.latest?.trim()??null,versions:Object.keys(t.versions??{})}:null}function Gne(e){return{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28",...e?{Authorization:`Bearer ${e}`}:{}}}async function sGe(e,t){if(!/^[\w.-]+\/[\w.-]+$/.test(e))return null;let n=100,i=20,r=[];for(let o=1;o<=i;o++){let s=await $e(`https://api.github.com/repos/${e}/tags?per_page=${n}&page=${o}`,{headers:Gne(t)});if(!s)return o===1?null:{latest:null,versions:[...new Set(r)],complete:!1};if(r.push(...s.map(a=>a.name).filter(a=>!!a)),s.lengthi.sameCompatibilityLine(t,r)===!0).sort((r,o)=>ac(o,r))[0]}function lGe(e,t,n,i){let r=Gi(i),s=e.filter(a=>ac(a,t)>0).map(a=>({version:a,satisfies:r.satisfies(a,n)}));if(!s.some(a=>a.satisfies===null))return s.filter(a=>a.satisfies).map(a=>a.version).sort((a,c)=>ac(c,a))[0]}function Dx(e,t,n,i,r){if(!r)return e>0?`${e} breaking change${e===1?"":"s"} found in ${i}.`:`No breaking changes found for this version of ${i}.`;let{assessment:o,security:s}=r,a=ru[o.recommendation],c=[],l=new Map(t.map(g=>[g.id,g])),u=n.filter(g=>l.get(g.breakingChangeId)?.kind!=="runtime-requirement"),d=n.filter(g=>l.get(g.breakingChangeId)?.kind==="runtime-requirement");u.length>0&&c.push(`${u.length} place${u.length===1?"":"s"} in this repository use${u.length===1?"s":""} an API that ${i} changed`),c.push(...uGe(d));let p=o.runtimeCompatibility,f=p==="unknown"||p==="partial";d.length===0&&p==="unknown"&&c.push("this upgrade's runtime requirement could not be checked against this repository");let m=t.filter(g=>g.kind!=="runtime-requirement").length;if(u.length===0&&d.length===0&&m>0&&!f){let g=Df(t);c.push(g?`${m} published ${g} change${m===1?"":"s"} ${m===1?"requires":"require"} review; ${m===1?"this package-role contract is":"these package-role contracts are"} assessed independently of source call signatures`:`${m} upstream API breaking change${m===1?"":"s"}, no usage of the changed parts located in this repository \u2014 review before upgrading`)}return s.checked&&s.resolved.length>0&&c.push(`fixes ${s.resolved.length} known ${s.resolved.length===1?"vulnerability":"vulnerabilities"}`),s.checked&&s.introduced.length>0&&c.push(`introduces ${s.introduced.length} known ${s.introduced.length===1?"vulnerability":"vulnerabilities"}`),c.length===0&&r.gaps.length>0?`${a}. ${r.gaps.join(" ")}`:c.length===0?`${a}. No breaking changes found for this version of ${i}.`:`${a}. ${dGe(c.join("; "))}.`}function uGe(e){let t=[],n=e.filter(o=>o.runtimeVerdict!=="partial"&&o.runtimeVerdict!=="unknown"),i=e.filter(o=>o.runtimeVerdict==="partial"),r=e.filter(o=>o.runtimeVerdict==="unknown");if(n.length>0){let o=n.length;t.push(`${o} runtime declaration${o===1?"":"s"} in this repository do${o===1?"es":""} not satisfy this upgrade's runtime requirement`)}if(i.length>0){let o=i.length;t.push(`${o} runtime declaration${o===1?"":"s"} only partially satisf${o===1?"ies":"y"} this upgrade's runtime requirement`)}if(r.length>0){let o=r.length;t.push(`${o} runtime declaration${o===1?"":"s"} could not be resolved, so compatibility is unknown`)}return t}function dGe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ox(e,t){let n={...e,verification:t};if(!n.plan||(n.plan=Ax(n.plan,t),t.status==="skipped"))return n;n.breakingCount=n.plan.upstreamBreakingCount??n.plan.breakingChanges.length,n.impactCount=n.plan.impactSites.length,n.impactFiles=new Set(n.plan.impactSites.map(r=>r.file)).size;let i=n.plan.dispositions;return i&&(n.actionableImpactCount=i.reduce((r,o)=>r+o.actionableSites.length,0),n.actionableImpactFiles=new Set(i.flatMap(r=>r.actionableSites.map(o=>o.file))).size,n.runtimeDeclarationSiteCount=i.filter(r=>r.runtimeAnalysis!==void 0).reduce((r,o)=>r+o.sites.length,0)),n.rationale&&(n.rationale=n.plan.rationale?.find(r=>r.dependency===n.rationale.dependency)??n.plan.rationale?.[0]??n.rationale),n.risk=n.plan.risk,n.verifiedUnaffected=t.status==="passed"&&Fy(t)==="isolated"&&t.checks.some(r=>r.status==="passed"&&r.compileCapable)&&Array.isArray(n.plan.dispositions)&&n.plan.dispositions.every(r=>r.state==="unaffected")&&(n.plan.breakingChanges.length>0||(n.plan.upstreamBreakingCount??0)>0),n.impactPendingIsolatedClearance=Fy(t)==="batch"&&t.checks.some(r=>r.status==="passed"&&r.compileCapable)&&n.plan.impactSites.some(r=>{let o=n.plan.breakingChanges.find(s=>s.id===r.breakingChangeId);return o!==void 0&&H1(o)}),n.summary=Dx(n.breakingCount,n.plan.breakingChanges,n.plan.impactSites,n.name,n.rationale),n}var Wne=(0,qne.promisify)(Bne.execFile);function pGe(e,t){return t?[...e]:e.map(n=>n.state==="incompatible"||n.state==="partial"?n:{...n,state:"unknown",reason:"config-incomplete",statement:`${n.statement} Drift could not index every authoritative runtime configuration file, so this result is incomplete.`})}function Hne(e,t){return`${e}\0${t}`}var fGe={includeDev:!0,maxSites:40,maxPackages:0};function Kne(e){return{available:!1,reason:e.reason,inspection:e.reason==="no-public-surface"?"succeeded":e.reason==="artifact-type-unsupported"?"not-applicable":"failed",tool:e.tool,detail:e.detail,...e.packageRole?{packageRole:e.packageRole}:{},...e.diagnostic?{diagnostic:e.diagnostic}:{}}}async function dU(e,t=[""],n=new Map,i=Hn()){let r=[],o=[],s=await hGe(e,i);for(let a of t){let c=a?(0,kr.join)(e,a):e,l=await i.readDirectory(c);if(l.length===0)continue;let u=[...l,...await mGe(c,l,i)],d=da({entries:u,read:p=>tre((0,kr.join)(c,p))});if(d.length!==0){for(let p of oK(d))(n.get(Hne(a,p.ecosystem))??(a?s.get(p.ecosystem):void 0))||o.push({...p,dir:a});for(let p of gGe(d,a,n,s)){let f=p.manager.manifestPattern?u.filter(h=>p.manager.manifestPattern.test(h)):[],m=p.manager.manifests.find(h=>u.includes(h))??f.find(lP)??f[0];if(!m)continue;let g=p.manager.lockfiles.find(h=>u.includes(h))??null;if(p.manager.id==="pip"&&lP(m)){let h=m.replace(/\.in$/i,".txt");if(u.includes(h)){let b=await i.readFile((0,kr.join)(c,h));b&&Ok(b)&&(g=h)}}r.push({manager:p.manager,dir:a,manifestPath:a?`${a}/${m}`:m,lockfilePath:g?a?`${a}/${g}`:g:null})}}}return{targets:r,ambiguities:o}}async function mGe(e,t,n){let i=new Set;for(let o of ua)for(let s of[...o.manifests,...o.lockfiles])s.includes("/")&&i.add(s);let r=[];for(let o of i){if(t.includes(o))continue;let s=o.slice(0,o.indexOf("/"));t.includes(s)&&await n.readFile((0,kr.join)(e,o))!==null&&r.push(o)}return r}function gGe(e,t,n,i=new Map){let r=new Set,o=[];for(let s of new Set(e.map(a=>a.manager.ecosystem))){let a=e.filter(u=>u.manager.ecosystem===s),c=n.get(Hne(t,s)),l=a.find(u=>u.manager.id===c)??a.find(u=>u.manager.id===i.get(s))??a[0];r.has(s)||(r.add(s),o.push(l))}return o}async function hGe(e,t){let n=await t.readDirectory(e),i=da({entries:n,read:o=>tre((0,kr.join)(e,o))}),r=new Map;for(let o of i)o.fromLockfile&&r.set(o.manager.ecosystem,o.manager.id);return r}async function Jne(e){let{root:t,repo:n,config:i,logger:r,githubToken:o,onProgress:s,onCandidate:a,onDropped:c,onOutdated:l,token:u,repoLabel:d}=e,p=e.breadth??fGe,f=e.fs??Hn(),m=e.env??process.env,g=Math.max(1,Math.min(32,Math.floor(e.concurrency??L1(m))||1));r.debug(`Scan parallelism: ${ine(m)}`);let h={enabled:(e.verify?.enabled??!1)&&i.verify.enabled,checks:e.verify?.checks??i.verify.checks,timeoutMs:e.verify?.timeoutMs??i.verify.timeoutMs,generatedSourceGlobs:e.verify?.generatedSourceGlobs??i.verify.generatedSourceGlobs,baselineCache:e.verify?.baselineCache},b=Date.now(),y=(z,Y,Re=0,Ee=0)=>{let Ge=Date.now();r.debug(`${z} (+${Ge-b}ms): ${Y}`),b=Ge,s?.({phase:z,detail:Y,done:Re,total:Ee})},w=It("scan","total"),k=It("discover","manifests");y("Looking for manifests",t);let _=await Ed(t,f),S=Td(_),x=await Kk(t,f,S).catch(()=>[]),E=x.filter(z=>z.hasOwnGit),T=x.filter(z=>!z.hasOwnGit).map(z=>z.dir),A=[...S,...T],L=e.dirs??A;if(_.length>0||T.length>0){let z=[..._.map(Y=>Y.kind),...T.length>0?["undeclared"]:[]];y("Reading the workspace",`${L.length} package${L.length===1?"":"s"} \xB7 ${z.join(", ")}`)}let F=Mc("manifest.discovery"),{targets:K,ambiguities:te}=await dU(t,L,e.managers??new Map,f);if(K.length===0)return k.end({targets:0}),F.end({targets:0}),w.end({checked:0,candidates:0}),{candidates:[],checked:0,upToDate:0,unchecked:[],targets:K,workspaces:_,ambiguities:te,nestedGitRepos:E};let D=new Map;for(let z of _)for(let Y of z.members)Y.name&&D.set(Y.dir,Y.name);for(let z of K){if(D.has(z.dir))continue;let Y=z.manifestPath.includes("/")?z.manifestPath.slice(z.manifestPath.lastIndexOf("/")+1):z.manifestPath,Re=await Lg(t,f,z.dir,Y,z.manager.ecosystem).catch(()=>null);Re&&D.set(z.dir,Re)}k.end({targets:K.length}),F.end({targets:K.length,manifests:K.length});let X=new Set(i.ecosystems),re=A.length>1||new Set(K.map(z=>z.dir)).size>1,ie=new Set,ke=(z,Y)=>{ie.add(Lx(z,d?t:void 0)),a?.(ere({dep:z,member:re?z.target.dir:void 0,memberName:re?D.get(z.target.dir):void 0,repoRoot:d?t:void 0,repoLabel:d,phase:Y}))},We=(z,Y)=>_Ge(z,Y,"Waiting to be checked",{...re?{member:z.target.dir}:{},...re&&D.get(z.target.dir)?{memberName:D.get(z.target.dir)}:{},...d?{repoRoot:t,repoLabel:d}:{}}),ye=()=>{for(let z of ae)ie.delete(z.id);for(let z of ie)c?.(z);ie.clear()},xt=z=>{let Y=Lx(z,d?t:void 0);ie.delete(Y),c?.(Y)},bt=[],pt=[];for(let z of K){if(!X.has(z.manager.ecosystem))continue;y("Reading manifest",z.manifestPath);let Y=await pU(t,z,p.includeDev,f),Re=p.maxPackages>0?Math.max(0,p.maxPackages-bt.length):Y.dependencies.length;for(let Ee of Y.dependencies.slice(0,Re))ke(Ee,"Waiting to be checked");bt.push(...Y.dependencies),pt.push(...Y.unresolved)}if(pt.length>0){let z=[];await lU(pt,bx(m),async Y=>{let Re=Y.ecosystem,Ee=Y.current==="unspecified"?"*":Y.current,Ge=K.find(ao=>ao.manifestPath===Y.manifestPath);if(!Ge){z.push(Y);return}let Di=((await cU({name:Y.name,ecosystem:Re,current:Ee,range:Ee,...o?{githubToken:o}:{}}).catch(()=>null))?.versions??[]).filter(ao=>xW(ao,Ee,Re)===!0).sort((ao,iE)=>Eg(iE,ao,Re)??0)[0];if(!Di){z.push(Y);return}let nb={name:Y.name,kind:Y.kind,current:Di,range:Ee,assumed:!0,target:Ge};ke(nb,"Waiting to be checked"),bt.push(nb)}),pt.length=0,pt.push(...z)}let ft=p.maxPackages>0?bt.slice(0,p.maxPackages):bt;y("Indexing your code","Walking source files",0,ft.length);let Cn=It("index","walk+build"),Ci=Ad(t,{members:L}).then(z=>{y("Indexing your code",`${z.length} file${z.length===1?"":"s"} indexed \xB7 ${ft.length} direct dependenc${ft.length===1?"y":"ies"} to check`,0,ft.length);let Y={files:z,index:_f(z)};return Cn.end({files:z.length}),Y});Ci.catch(()=>{});let zn=0,Pi=0,fe=0,ae=[],be=[...pt],Mt=z=>h.enabled&&z.size>0&&!u?.isCancellationRequested?vne({root:t,targets:[],kinds:h.checks,env:m,logger:r,timeoutMs:h.timeoutMs,...h.generatedSourceGlobs?{allowedGlobs:h.generatedSourceGlobs}:{},...h.baselineCache?{baselineCache:h.baselineCache}:{},...u?{token:u}:{}},[...new Map(K.filter(Y=>z.has(Y.dir)).map(Y=>[Y.dir,Y])).values()].map(Y=>({dir:Y.dir,packageManager:Y.manager.id})),Y=>Y.output!==void 0?s?.({phase:"",detail:"",done:0,total:0,output:Y.output}):y(Y.phase,Y.detail)):void 0;y("Checking registries",`${ft.length} direct dependenc${ft.length===1?"y":"ies"}`,0,ft.length);let vt=[],sn=new Map,oi=It("phase","version-discovery");await Br("version.discovery",{dependencies:ft.length},()=>lU(ft,bx(m),async z=>{if(u?.isCancellationRequested)return;let Y=Px(z.target.manager.ecosystem);ke(z,`Asking ${Y} what has been published`);let Re=Mc("registry.lookup",{package:z.name}),Ee=JSON.stringify([z.target.manager.ecosystem,z.name,z.current,z.range??null]),Ge=sn.get(Ee);Ge||(Ge=En("versions",z.target.manager.ecosystem,()=>zne({name:z.name,ecosystem:z.target.manager.ecosystem,current:z.current,range:z.range,...o?{githubToken:o}:{}})),sn.set(Ee,Ge),Ge.then(si=>{si.outcome==="unchecked"&&sn.get(Ee)===Ge&&sn.delete(Ee)},()=>{sn.get(Ee)===Ge&&sn.delete(Ee)}));let Et=await Ge;if(Re.end({outcome:Et.outcome}),Et.outcome==="up-to-date"){zn+=1,Pi+=1,xt(z),y("Up to date",`${z.name}@${z.current}`,Pi,ft.length);return}if(Et.outcome==="unchecked"){be.push({name:z.name,kind:z.kind,ecosystem:z.target.manager.ecosystem,packageManager:z.target.manager.id,manifestPath:z.target.manifestPath,current:z.current,reason:Et.reason}),Pi+=1,xt(z),y("Could not check",`${z.name}@${z.current} \xB7 ${Et.reason}`,Pi,ft.length);return}vt.push({dep:z,available:Et}),Pi+=1,a?.(We(z,Et)),y("Outdated",`${z.name} ${z.current} \u2192 ${Et.safeLatest??Et.latest}`,Pi,ft.length)})),oi.end({checked:ft.length,outdated:vt.length}),vt.sort((z,Y)=>z.dep.name.localeCompare(Y.dep.name));let so=Mt(new Set(vt.map(({dep:z})=>z.target.dir)));if(l?.({outdated:vt.map(({dep:z,available:Y})=>We(z,Y)),checked:ft.length,upToDate:zn,unchecked:[...be]}),u?.isCancellationRequested)return ye(),await so?.dispose(),w.end({cancelled:!0}),{candidates:[],checked:ft.length,upToDate:zn,unchecked:be,targets:K,workspaces:_,ambiguities:te,nestedGitRepos:E};let _t=It("phase","analysis"),tt=new Map;for(let{dep:z,available:Y}of vt){let Re=Y.safeLatest??Y.latest,Ee=NP({ecosystem:z.target.manager.ecosystem,name:z.name,from:z.current,to:Re});tt.has(Ee)||tt.set(Ee,{name:z.name,ecosystem:z.target.manager.ecosystem,from:z.current,to:Re})}let Gn=i.rationale.security&&tt.size>0?Br("security.batch",{upgrades:tt.size},async()=>{let z=[...tt.keys()],Y=[...tt.values()];try{let Re=await Oy(Y,{});return new Map(z.map((Ee,Ge)=>[Ee,Re.get(Y[Ge])??Uo("The OSV advisory batch lookup did not return a result for this upgrade, so its effect on known vulnerabilities is unknown.")]))}catch(Re){let Ee=`The OSV advisory batch lookup failed unexpectedly (${Re.message}), so this upgrade's effect on known vulnerabilities is unknown.`;return new Map(z.map(Ge=>[Ge,Uo(Ee)]))}}):void 0;Gn?.catch(()=>{});let tb=z=>Gn?.then(Y=>Y.get(z)),Ts=new Map,Vn=new Map,Go=new Map,fu=new Map,rE=(z,Y,Re)=>{fu.set(z,[Y,Re]);for(let Ee of Go.get(z)??[])Ee(Y,Re)},Pie=(z,Y)=>{let Re=Go.get(z);Re||(Re=new Set,Go.set(z,Re)),Re.add(Y);let Ee=fu.get(z);return Ee&&Y(Ee[0],Ee[1]),()=>{Re.delete(Y),Re.size===0&&(Go.delete(z),fu.delete(z))}},Die=(z,Y,Re)=>{let Ee={name:z.name,ecosystem:z.target.manager.ecosystem,from:z.current,to:Y,kind:z.kind,bump:ta(z.current,Y,z.target.manager.ecosystem),manifestPath:z.target.manifestPath,rawFrom:z.current,rawTo:Y},Ge=NP(Ee),Et=`${z.name} ${Ee.from} \u2192 ${Ee.to}`,si=Re?Pie(Ge,Re):void 0,Di=Ts.get(Ge),nb=Di!==void 0;if(!Di){let co=new Map,mu=new Map,jU=new Set,oE=new Map,sE=new Map;rE(Ge,"Reading release notes and changelog",Et);let rb=Br("upstream.analysis",{package:z.name,ecosystem:Ee.ecosystem,from:Ee.from,to:Ee.to,shared:!1},()=>UO(Ee,{config:i,logger:r,...o?{githubToken:o}:{},env:m,workspaceRoot:t,onSurfaceComputed:(cc,Oi)=>{let Vo=cn(cc);Oi.weight>=.8&&jU.add(Vo),oE.set(Vo,{available:!0,inspection:"succeeded",tool:Oi.tool,...Oi.packageRole?{packageRole:Oi.packageRole}:{}}),co.set(Vo,{additions:Oi.additions??[],locator:Oi.locator}),rE(Ge,"Comparing the public API surface",Et)},onUnavailableSurface:(cc,Oi)=>{let Vo=cn(cc);mu.set(Vo,Oi),oE.set(Vo,Kne(Oi))},onProseConsulted:(cc,Oi)=>{let Vo=cn(cc);sE.set(Vo,[...sE.get(Vo)??[],Oi])}}).then(cc=>({evidence:cc,additions:co,surfaceGaps:mu,surfaceCompared:jU,surfaceAssessments:oE,prose:sE})));Ts.set(Ge,rb),Di=rb,rb.catch(()=>{Ts.get(Ge)===rb&&Ts.delete(Ge)})}let ao=Vn.get(Ge),iE=ao!==void 0;if(!ao){let co=N1(Ee,{config:i,...o?{githubToken:o}:{},securityLookup:tb(Ge),onProgress:mu=>rE(Ge,mu,Et)});Vn.set(Ge,co),ao=co,co.catch(()=>{Vn.get(Ge)===co&&Vn.delete(Ge)})}let Oie=Di,UU=ao;return Br("upstream.wait",{package:z.name,ecosystem:Ee.ecosystem,from:Ee.from,to:Ee.to,evidenceShared:nb,rationaleShared:iE},async()=>{let[co,mu]=await Promise.allSettled([Oie,UU]);return si?.(),{evidence:co.status==="fulfilled"?co.value:void 0,rationaleFacts:mu.status==="fulfilled"?UU:void 0}})};try{await Br("analysis",{packages:vt.length},()=>lU(vt,g,async({dep:Y,available:Re})=>{if(u?.isCancellationRequested)return;let Ee=Re.safeLatest??Re.latest,Ge;try{Ge=await Die(Y,Ee,(si,Di)=>{y(si,Di,fe,vt.length),ke(Y,si)})}catch(si){r.debug(`Shared upstream analysis failed for ${Y.name} ${Y.current} \u2192 ${Ee}: ${si.message}. Falling back to independent analysis for this row.`)}let Et=await Br("package",{package:Y.name,ecosystem:Y.target.manager.ecosystem,from:Y.current,to:Ee},()=>wGe({dep:Y,selected:Ee,versions:Re.versions,latest:Re.latest,safeLatest:Re.safeLatest,latestMinor:Re.latestMinor,repo:n,config:i,githubToken:o,root:t,indexing:Ci,logger:r,env:m,maxSites:p.maxSites,member:re?Y.target.dir:void 0,allMembers:re?A:void 0,memberName:re?D.get(Y.target.dir):void 0,repoRoot:d?t:void 0,repoLabel:d,prepared:Ge,onProgress:(si,Di)=>{y(si,Di,fe,vt.length),ke(Y,si)}}));ae.push(Et),a?.(h.enabled?{...Et,status:"checking",phase:"Waiting to be installed and tested"}:Et),fe+=1,y(Gy(Et)==="affected"?"Needs your attention":"Checked",`${Et.name} ${Et.current} \u2192 ${Et.selected} \xB7 ${Une(Et).toLowerCase()}`,fe,vt.length)})),_t.end({packages:vt.length});let z=It("phase","verification");try{h.enabled&&ae.length>0&&!u?.isCancellationRequested&&await Br("verification",{candidates:ae.length},()=>yGe({root:t,candidates:ae,checks:h.checks,timeoutMs:h.timeoutMs,generatedSourceGlobs:h.generatedSourceGlobs,...h.baselineCache?{baselineCache:h.baselineCache}:{},env:m,logger:r,...so?{warm:so}:{},...u?{token:u}:{},onProgress:Y=>{if(Y.output!==void 0){s?.({phase:"",detail:"",done:Y.done,total:Y.total,output:Y.output});return}y(Y.phase,Y.detail,Y.done,Y.total);for(let Re of Y.targets??[]){let Ee=ae.findIndex(Et=>Et.id===Re),Ge=Ee>=0?ae[Ee]:void 0;!Ge||Ge.verification||a?.({...Ge,status:"checking",phase:Y.detail?`${Y.phase} \xB7 ${Y.detail}`:Y.phase})}},onCandidate:a}))}finally{if(h.enabled)for(let[Y,Re]of ae.entries()){if(Re.verification)continue;let Ee=Ox(Re,{status:"skipped",reason:u?.isCancellationRequested?`The scan was stopped before ${Re.name} ${Re.selected} could be installed and checked, so the findings below are predictions.`:`${Re.name} ${Re.selected} was not installed and checked, so the findings below are predictions.`,checks:[],failedFiles:[]});ae[Y]=Ee,a?.(Ee)}await so?.dispose(),z.end({candidates:ae.length})}}finally{ye()}return w.end({checked:ft.length,candidates:ae.length}),{candidates:ae.sort(xGe),checked:ft.length,upToDate:zn,unchecked:be,targets:K,workspaces:_,ambiguities:te,nestedGitRepos:E}}async function yGe(e){let t=new Map(e.candidates.map(o=>[o.id,o])),n=e.candidates.filter(o=>o.rationale?.maintenance.deprecated);for(let o of n){let s=o.rationale?.maintenance.deprecated,a=Ox(o,{status:"skipped",reason:`${o.name} ${o.selected} has been withdrawn (${s}), so it cannot be installed to test.`,checks:[],failedFiles:[]}),c=e.candidates.indexOf(o);c>=0&&(e.candidates[c]=a),e.onCandidate?.(a)}let r=e.candidates.filter(o=>!n.includes(o)).map(o=>({id:o.id,name:o.name,current:o.current,selected:o.selected,manifestPath:o.manifestPath,packageManager:o.packageManager,install:s=>bGe(s,o,"safe",au(e.env))}));await yne({root:e.root,targets:r,installTogether:(o,s)=>vGe(o,s.map(a=>t.get(a.id)).filter(a=>a!==void 0),"safe",au(e.env)),kinds:e.checks,env:e.env,logger:e.logger,timeoutMs:e.timeoutMs,...e.generatedSourceGlobs?{allowedGlobs:e.generatedSourceGlobs}:{},...e.baselineCache?{baselineCache:e.baselineCache}:{},...e.warm?{warm:e.warm}:{},...e.token?{token:e.token}:{},onProgress:o=>e.onProgress?.({phase:o.phase,detail:o.detail,done:o.done,total:o.total,...o.targets?{targets:o.targets}:{},...o.output!==void 0?{output:o.output}:{}}),onVerified:(o,s)=>{let a=t.get(o.id);if(!a)return;let c=Ox(a,s),l=e.candidates.indexOf(a);l>=0&&(e.candidates[l]=c);let u=(a.plan?.breakingChanges.length??0)-(c.plan?.breakingChanges.length??0);e.logger.info(`${o.name}@${o.selected}: ${Uy(s)}`+(u>0?` ${u} predicted finding(s) dropped as disproved.`:"")),e.onCandidate?.(c)}})}async function lU(e,t,n){let i=0,r=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let o=i;i+=1;let s=e[o];if(s===void 0)return;await n(s)}});await Promise.all(r)}var uU=class extends Error{constructor(n){super(`${n.packageManager} cannot pin a version from the command line. Edit ${n.manifestPath} to require ${n.name} ${n.selected}, then re-run the scan.`);this.candidate=n}candidate};function Zne(e,t="safe"){let n=Yne(e,t);return n?sK(n):null}function Yne(e,t){let i=Uc(e.packageManager)?.upgrade(Mx(e));return i?t==="force"&&e.packageManager==="npm"?{...i,args:[...i.args,"--force"]}:i:null}function Mx(e){return{name:e.name,version:e.selected,kind:e.kind,...e.cargo?{cargo:e.cargo}:{}}}async function bGe(e,t,n="safe",i=process.env){let r=Yne(t,n);if(!r)throw new uU(t);let o=Uc(t.packageManager),s=(0,kr.join)(e,t.manifestPath),a=(0,kr.dirname)(s),c=await Qne([s,...(o?.lockfiles??[]).map(l=>(0,kr.join)(a,l))]);try{if(o?.rewriteManifest){let l=await(0,zo.readFile)(s,"utf8"),u=o.rewriteManifest(l,Mx(t),t.manifestPath);u!==l&&await(0,zo.writeFile)(s,u,"utf8")}await Wne(r.command,r.args,{cwd:a,env:i,shell:process.platform==="win32",windowsHide:!0,maxBuffer:8*1024*1024})}catch(l){throw await Xne(c),l.code==="ENOENT"?new Error(`${r.command} was not found on PATH. Run \`command -v ${r.command}\` to check, and install it if it is genuinely missing.`):l}}async function vGe(e,t,n="safe",i=process.env){if(t.length===0)return!1;let r=t[0];if(!t.every(d=>d.manifestPath===r.manifestPath&&d.packageManager===r.packageManager))return!1;let s=Uc(r.packageManager);if(!s)return!1;let a=iK(s,t.map(Mx));if(!a)return!1;let c=(0,kr.join)(e,r.manifestPath),l=(0,kr.dirname)(c),u=await Qne([c,...(s.lockfiles??[]).map(d=>(0,kr.join)(l,d))]);try{if(s.rewriteManifest){let d=await(0,zo.readFile)(c,"utf8"),p=d;for(let f of t)p=s.rewriteManifest(p,Mx(f),f.manifestPath);p!==d&&await(0,zo.writeFile)(c,p,"utf8")}for(let d of a){let p=n==="force"&&r.packageManager==="npm"?[...d.args,"--force"]:d.args;await Wne(d.command,p,{cwd:l,env:i,shell:process.platform==="win32",windowsHide:!0,maxBuffer:8*1024*1024})}}catch(d){throw await Xne(u),d.code==="ENOENT"?new Error(`${a[0].command} was not found on PATH. Run \`command -v ${a[0].command}\` to check, and install it if it is genuinely missing.`):d}return!0}async function Qne(e){return Promise.all(e.map(async t=>({path:t,content:await(0,zo.readFile)(t,"utf8").catch(()=>null)})))}async function Xne(e){await Promise.all(e.map(async({path:t,content:n})=>{try{n===null?await(0,zo.rm)(t,{force:!0}):await(0,zo.writeFile)(t,n,"utf8")}catch{}}))}async function wGe(e){let t=`${e.dep.name} ${e.dep.current} \u2192 ${e.selected}`,n=e.onProgress??(()=>{}),{target:i}=e.dep,r={name:e.dep.name,ecosystem:i.manager.ecosystem,from:e.dep.current,to:e.selected,kind:e.dep.kind,bump:ta(e.dep.current,e.selected,i.manager.ecosystem),manifestPath:i.manifestPath,rawFrom:e.dep.current,rawTo:e.selected,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{}},o={id:Lx(e.dep,e.repoRoot),name:e.dep.name,kind:e.dep.kind,ecosystem:i.manager.ecosystem,packageManager:i.manager.id,manifestPath:i.manifestPath,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{},...e.repoRoot?{repoRoot:e.repoRoot,repoLabel:e.repoLabel}:{},...e.allMembers?{allMembers:e.allMembers}:{},current:e.dep.current,...e.dep.assumed?{assumed:!0}:{},range:e.dep.range,safeLatest:e.safeLatest,latestMinor:e.latestMinor,selected:e.selected,latest:e.latest,versions:e.versions};try{n("Reading release notes and changelog",t);let s=new Map,a=new Map,c=new Set,l=new Map,u=new Map,d=e.prepared?.evidence?.evidence.map(T=>e.member===void 0?T:{...T,workspace:e.member})??await Br("evidence",{package:e.dep.name,ecosystem:i.manager.ecosystem},()=>En("evidence",i.manager.ecosystem,()=>UO(r,{config:e.config,logger:e.logger,githubToken:e.githubToken,env:e.env,workspaceRoot:e.root,onSurfaceComputed:(T,A)=>{let L=cn(T);A.weight>=.8&&c.add(L),l.set(L,{available:!0,inspection:"succeeded",tool:A.tool,...A.packageRole?{packageRole:A.packageRole}:{}}),s.set(L,{additions:A.additions??[],locator:A.locator})},onUnavailableSurface:(T,A)=>{let L=cn(T);a.set(L,A),l.set(L,Kne(A))},onProseConsulted:(T,A)=>{let L=cn(T);u.set(L,[...u.get(L)??[],A])}}),{package:e.dep.name}));if(e.prepared?.evidence){let T=cn(r),A=cn({...r,workspace:void 0}),L=e.prepared.evidence;s.clear();let F=L.additions.get(A);F&&s.set(T,F),a.clear();let K=L.surfaceGaps.get(A);K&&a.set(T,K),L.surfaceCompared.has(A)&&c.add(T),l.clear();let te=L.surfaceAssessments.get(A);te&&l.set(T,te),u.clear();let D=L.prose.get(A);D&&u.set(T,D)}n("Comparing the public API surface",`${t} \xB7 ${d.length} evidence source${d.length===1?"":"s"}`);let p=await Br("api.diff",{package:e.dep.name,evidenceSources:d.length},()=>En("analyze",i.manager.ecosystem,()=>BS([r],d,{config:e.config,logger:e.logger})));n(p.length>0?`Searching your code for ${p.length} breaking change${p.length===1?"":"s"}`:"No breaking changes to look for",t);let f=p.length>0?await En("module-maps",i.manager.ecosystem,()=>WS([r],{logger:e.logger})):void 0,m=It("index-wait",i.manager.ecosystem),{files:g,index:h}=await e.indexing;m.end();let b=It("localize",i.manager.ecosystem,{changes:p.length}),y=Mc("localization",{package:e.dep.name,changes:p.length,filesConsidered:g.length}),{sites:w,runtimeAnalyses:k}=nx(p,[r],h,g,{logger:e.logger,maxSitesPerChange:e.maxSites??40,member:e.member,members:e.allMembers,...f?{moduleMaps:f}:{}}),_=pGe(k,g.coverage.runtimeConfigComplete);b.end({sites:w.length}),y.end({sites:w.length}),n("Weighing what this upgrade is worth",t);let[S]=await En("rationale",i.manager.ecosystem,()=>fx({changes:[r],evidence:d,breakingChanges:p,impactSites:w,runtimeAnalyses:_,localizationRan:!0,localizationComplete:!g.coverage.sourceTruncated},{config:e.config,logger:e.logger,githubToken:e.githubToken,additions:s,surfaceCompared:c,surfaceGaps:a,prose:u,...e.prepared?.rationaleFacts?{preparedFacts:new Map([[r,e.prepared.rationaleFacts]])}:{},repoRuntime:Tf(g,e.member,e.allMembers),pythonRuntime:If(g,e.member,e.allMembers),onProgress:(T,A)=>n(A,t)})),x=ux({repo:e.repo,config:e.config,changes:[r],evidence:d,breakingChanges:p,impactSites:w,runtimeAnalyses:_,localizationRan:!0,localizationComplete:!g.coverage.sourceTruncated,runtimeConfigComplete:g.coverage.runtimeConfigComplete,...S?{rationale:[S]}:{}}),E=l.get(cn(r));return{...o,status:p.length>0?"ready":"clean",evidenceCount:d.length,breakingCount:p.length,impactCount:w.length,actionableImpactCount:(x.dispositions??[]).reduce((T,A)=>T+A.actionableSites.length,0),actionableImpactFiles:new Set((x.dispositions??[]).flatMap(T=>T.actionableSites.map(A=>A.file))).size,runtimeDeclarationSiteCount:(x.dispositions??[]).filter(T=>T.runtimeAnalysis!==void 0).reduce((T,A)=>T+A.sites.length,0),impactFiles:new Set(w.map(T=>T.file)).size,impactConfidence:kGe(w),sourceCoverage:g.coverage,...E?{surfaceAssessment:E}:{},risk:x.risk,summary:Dx(p.length,p,w,e.dep.name,S),gaps:S?.gaps??[],toolRequests:$Ge(a),...S?{rationale:S,recommendation:S.assessment.recommendation,...S.assessment.runtimeCompatibility?{runtimeCompatibility:S.assessment.runtimeCompatibility}:{},..._.length>0?{runtimeAnalyses:_.map(T=>({changeId:T.changeId,runtime:T.runtime,state:T.state,reason:T.reason,siteCount:T.sites.length,declarationCount:T.declarations.length,unresolvedCount:T.unresolved.length,statement:T.statement}))}:{}}:{},plan:x}}catch(s){return{...o,status:"error",evidenceCount:0,breakingCount:0,impactCount:0,actionableImpactCount:0,actionableImpactFiles:0,runtimeDeclarationSiteCount:0,impactFiles:0,impactConfidence:"none",risk:"unknown",summary:"Could not inspect this upgrade",gaps:[],toolRequests:[],error:s.message}}}function kGe(e){return e.some(t=>t.confidence==="high")?"high":e.some(t=>t.confidence==="medium")?"medium":e.some(t=>t.confidence==="low")?"low":"none"}function $Ge(e){let t=new Set,n=[];for(let i of e.values())!i.install||t.has(i.install.id)||(t.add(i.install.id),n.push(i.install));return n}function Lx(e,t){return`${t?`${t}::`:""}${e.target.manifestPath}#${e.name}@${e.current}`}function ere(e){let{dep:t}=e;return{id:Lx(t,e.repoRoot),name:t.name,kind:t.kind,...t.cargo?{cargo:t.cargo}:{},ecosystem:t.target.manager.ecosystem,packageManager:t.target.manager.id,manifestPath:t.target.manifestPath,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{},...e.repoRoot?{repoRoot:e.repoRoot,repoLabel:e.repoLabel}:{},current:t.current,...t.assumed?{assumed:!0}:{},range:t.range,selected:t.current,latest:t.current,versions:[],status:"pending",phase:e.phase,evidenceCount:0,breakingCount:0,impactCount:0,actionableImpactCount:0,actionableImpactFiles:0,runtimeDeclarationSiteCount:0,impactFiles:0,impactConfidence:"none",risk:"unknown",summary:"",gaps:[],toolRequests:[]}}function _Ge(e,t,n,i){return{...ere({dep:e,phase:n,...i?.member===void 0?{}:{member:i.member},...i?.memberName?{memberName:i.memberName}:{},...i?.repoRoot?{repoRoot:i.repoRoot}:{},...i?.repoLabel?{repoLabel:i.repoLabel}:{}}),selected:t.safeLatest??t.latest,latest:t.latest,...t.safeLatest?{safeLatest:t.safeLatest}:{},...t.latestMinor?{latestMinor:t.latestMinor}:{},versions:t.versions}}async function SGe(e){let t=new Map,n=new Map,i=c=>{let l=c;for(let u=0;u<4&&l.includes("${");u+=1)l=l.replace(/\$\{([^}]+)\}/g,(d,p)=>n.get(p)??d);return l},r=c=>{for(let[u,d]of c.properties)n.has(u)||n.set(u,d);let l=[];for(let[u,d]of c.dependencyManagement){let p=d.split("|"),f=p[0]??"";f&&(p.includes("import")?l.push(`${u}:${f}`):t.has(u)||t.set(u,f))}return l},o;try{o=IO(e)}catch{return t}let s=r(o);o.parent&&s.push(o.parent);let a=new Set;for(let c=0;c<8&&s.length>0;c+=1){let l=s.shift(),[u,d,p]=l.split(":");if(!u||!d||!p)continue;let f=i(p),m=`${u}:${d}:${f}`;if(a.has(m)||f.includes("${"))continue;a.add(m);let g=await i_({groupId:u,artifactId:d},f);if(g.ok){for(let h of r(g.contract))s.push(h);g.contract.parent&&s.push(g.contract.parent)}}for(let[c,l]of t)t.set(c,i(l));return t}async function pU(e,t,n,i){let r=Mk(t.manifestPath),o=await i.readFile((0,kr.join)(e,t.manifestPath));if(!r||o===null)return{dependencies:[],unresolved:[]};let s=r.parse(o,t.manifestPath),a=t.lockfilePath?await i.readFile((0,kr.join)(e,t.lockfilePath)):null,c=a!==null&&t.lockfilePath?Mk(t.lockfilePath)?.parse(a,t.lockfilePath):void 0,l=n?["runtime","dev","optional","peer"]:["runtime"],u=[],d=[];for(let[p,f]of s){if(!l.includes(f.kind))continue;let m=t.manager.ecosystem,g=c?.get(p)?.version??null,h=Gi(m),b=g?h.exactVersion(g)??h.parse(g)?.raw??null:h.exactVersion(f.version??"");if(!b){let y=f.version?.trim()??"";d.push({name:p,kind:f.kind,ecosystem:m,packageManager:t.manager.id,manifestPath:t.manifestPath,current:y||"unspecified",reason:y?`no lockfile entry, and "${y}" is a range rather than one version`:m==="maven"?"no version here and none in a lockfile \u2014 it is set by a parent POM or an imported BOM, which Drift does not fetch yet":"no version declared here, and no lockfile entry to resolve one from"});continue}u.push({name:p,kind:f.kind,...f.cargo?{cargo:f.cargo}:{},current:b,range:f.version??b,target:t})}if(d.length>0&&t.manager.ecosystem==="maven"&&t.manifestPath.endsWith("pom.xml")){let p=await SGe(o);if(p.size>0){let f=Gi("maven"),m=[];for(let g of d){let h=p.get(g.name),b=h?f.exactVersion(h):null;if(!b){m.push(g);continue}u.push({name:g.name,kind:g.kind,current:b,range:h??b,target:t})}d.length=0,d.push(...m)}}return{dependencies:u,unresolved:d}}function tre(e){try{return(0,Vne.readFileSync)(e,"utf8")}catch{return null}}function xGe(e,t){let n=jne(e,t);if(n!==0)return n;if(e.impactCount!==t.impactCount)return t.impactCount-e.impactCount;let i=e.name.localeCompare(t.name);return i!==0?i:e.manifestPath.localeCompare(t.manifestPath)}var EGe=12;async function nre(e,t){if(!t)return e;let n=e.breakingChanges.filter(s=>s.symbols.length>0&&e.impactSites.some(a=>a.breakingChangeId===s.id));if(n.length===0)return e;let i=new Map,r=new Map,o=0;for(let s of n){if(o>=EGe)break;let a=e.changes.find(u=>u.name===s.dependency&&(u.workspace??"")===(s.workspace??""));if(!a?.to||a.ecosystem!=="npm")continue;let c=i.get(a.name);if(c===void 0&&(c=(await Wn(a.name,a.ecosystem,a.to))?.githubRepo??null,i.set(a.name,c)),!c)continue;o++;let l=await TGe(c,a.to,s.symbols[0],t);l&&r.set(s.id,l.url)}return r.size===0?e:{...e,breakingChanges:e.breakingChanges.map(s=>r.has(s.id)?{...s,sourceUrl:r.get(s.id)}:s)}}async function TGe(e,t,n,i){let r={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};i&&(r.Authorization=`Bearer ${i}`);let o=await IGe(e,t,r);if(!o)return null;let s=await AGe(e,n,r);if(!s)return null;let a=await RGe(e,o,s,n);return a?{url:`https://github.com/${e}/blob/${o}/${s.split("/").map(encodeURIComponent).join("/")}#L${a}`,line:a}:null}async function IGe(e,t,n){return(await $e(`https://api.github.com/repos/${e}/tags?per_page=100`,{headers:n})??[]).find(o=>!!o.name&&Xd(o.name,t))?.name??null}async function AGe(e,t,n){let i=encodeURIComponent(`${t} repo:${e} language:TypeScript`);return((await $e(`https://api.github.com/search/code?q=${i}&per_page=5`,{headers:n}))?.items??[]).map(s=>s.path).find(s=>!!s&&!s.endsWith(".d.ts")&&!s.includes("node_modules/"))??null}async function RGe(e,t,n,i){let r=await rt(`https://raw.githubusercontent.com/${e}/${t}/${n}`);if(!r)return null;let o=new RegExp(`\\b(export\\s+)?(declare\\s+)?(default\\s+)?(function|const|class|interface|type|enum)\\s+${NGe(i)}\\b`),a=r.split(` -`).findIndex(c=>o.test(c));return a===-1?null:a+1}function NGe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var CGe="Drift",rre="https://github.com/trydrift/drift",mU=9;function lre(e,t){let n=new Map;for(let i of e)n.has(i.ruleId)||n.set(i.ruleId,{id:i.ruleId,name:i.ruleName,...i.helpUri?{helpUri:i.helpUri}:{}});return{$schema:"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",version:"2.1.0",runs:[{tool:{driver:{name:CGe,informationUri:rre,rules:[...n.values()].map(i=>({id:i.id,name:i.name,shortDescription:{text:i.name},fullDescription:{text:"A Drift finding: what changed, where it's used, and the fix \u2014 see the alert body."},helpUri:i.helpUri??rre,defaultConfiguration:{level:"warning"},properties:{tags:["dependencies","drift"]}}))}},...t?{automationDetails:{id:t}}:{},results:e.map(i=>({ruleId:i.ruleId,level:i.level,message:{text:PGe(i.message),markdown:i.message},locations:[ore(i.primaryLocation,i.snippetOk)],...i.relatedLocations.length>0?{relatedLocations:i.relatedLocations.map((r,o)=>({id:o+1,...ore(r)}))}:{},partialFingerprints:{primaryLocationLineHash:OGe(i)}}))}]}}function PGe(e){return e.replace(/\[([^\]]*)\]\(([^)]+)\)/g,"$1 ($2)").replace(/\*\*(.*?)\*\*/g,"$1").replace(/`([^`]*)`/g,"$1").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function ire(e){return e.replace(/&/g,"&").replace(//g,">")}function DGe(e,t,n){let i=n?`${n}/${e}#L${t}`:`${e}#L${t}`;return`[\`${e}:${t}\`](${i})`}function ore(e,t=!1){return{physicalLocation:{artifactLocation:{uri:e.file},region:{startLine:Math.max(1,e.line),...t&&e.excerpt?{snippet:{text:e.excerpt}}:{}}}}}function OGe(e){let t=`${e.ruleId}|${e.primaryLocation.file}|${(e.primaryLocation.excerpt??"").trim()}`;return(0,hU.createHash)("sha256").update(t).digest("hex").slice(0,40)}async function yU(e,t={}){let n=t.includeInformational??!1,i=t.granularity??"package",r=t.repoBlobUrl,o=[];e=await nre(e,t.githubToken);for(let s of e.changes){let a=e.breakingChanges.filter(g=>g.dependency===s.name&&(g.workspace??"")===(s.workspace??"")),c=e.rationale?.find(g=>g.dependency===s.name),l=[],u=0,d=[...a].sort((g,h)=>Ux(h.confidence)-Ux(g.confidence));for(let g of d){let h=e.impactSites.filter(b=>b.breakingChangeId===g.id);if(h.length===0){u++;continue}l.push({breaking:g,block:zGe(g,h,e.evidence)})}let p=[];if(LGe(c)&&p.push(BGe(c)),e.verification?.status==="failed"&&p.push(qGe(e.verification)),l.length===0&&p.length===0)if(u>0){if(!n)continue;p.push(HGe(s,u))}else{if(!n||!c)continue;p.push(WGe(s,c))}let f=e.commits.find(g=>a.some(h=>g.breakingChangeIds.includes(h.id))),m=t.fixOf?.(s)??YGe(f,e);if(i==="package"){let g=[...l.map(h=>h.block),...p];o.push(Fx({change:s,blocks:g,upstreamOnlyCount:u,fix:m,repoBlobUrl:r,ruleName:g.length===1&&g[0].ruleNameSuffix?`${s.name}: ${g[0].ruleNameSuffix}`:void 0}));continue}for(let{breaking:g,block:h}of l)if(i==="affectedSite"){let b=[h.primaryCandidate,...h.relatedCandidates].filter(y=>y!==void 0);for(let y of b)o.push(Fx({change:s,blocks:[{...h,primaryCandidate:y,relatedCandidates:[]}],upstreamOnlyCount:0,fix:m,ruleIdSuffix:`${g.id}/${MGe(y)}`,ruleName:sre(s,g),snippetOk:!0,repoBlobUrl:r}))}else o.push(Fx({change:s,blocks:[h],upstreamOnlyCount:0,fix:m,ruleIdSuffix:g.id,ruleName:sre(s,g),snippetOk:!0,repoBlobUrl:r}));for(let g of p)o.push(Fx({change:s,blocks:[g],upstreamOnlyCount:0,fix:m,ruleIdSuffix:"other",ruleName:g.ruleNameSuffix?`${s.name}: ${g.ruleNameSuffix}`:void 0,repoBlobUrl:r}))}return o}function MGe(e){return(0,hU.createHash)("sha256").update(`${e.file}|${(e.excerpt??"").trim()}`).digest("hex").slice(0,10)}function LGe(e){if(!e)return!1;let t=e.security;return t.checked&&(t.resolved.length>0||t.introduced.length>0||t.current.length>0)}async function ure(e,t={}){let n=[];for(let i of e){if(!i.plan)continue;let r=()=>{if(i.plan.commits.length>0)return;let o=Zne(i);if(o)return{description:i.verification?.status==="failed"?"The project's own checks failed with this upgrade installed \u2014 measured, not predicted. Do not treat this as safe to upgrade without investigating.":i.breakingCount>0?"The upstream API changed, but no code in this repository was found to use the affected parts. Review before upgrading.":"Safe to upgrade \u2014 no breaking changes found.",command:o}};n.push(...await yU(i.plan,{...t,fixOf:r}))}return n}var FGe={"removed-export":"Removed export used in this repository","renamed-export":"Renamed export used in this repository","moved-export":"Export moved to a different module","signature-change":"Call signature changed","type-change":"Type changed in a breaking way","behaviour-change":"Runtime behaviour changed","removed-endpoint":"API endpoint removed","changed-endpoint":"API endpoint changed","required-field-added":"New required field","default-change":"Default value changed","config-change":"Configuration shape changed","module-system-change":"Module loading compatibility changed","runtime-requirement":"Runtime requirement changed",unknown:"Unclassified breaking change"};function dre(e){return FGe[e]??"Breaking change"}function sre(e,t){let n=`${e.name}: ${dre(t.kind)}`;if(t.symbols.length===0)return n;let i=t.symbols.slice(0,2).join(", "),r=t.symbols.length>2?", \u2026":"";return`${n} (${i}${r})`}var Vy={runtime:"dependency",dev:"devDependency",peer:"peerDependency",optional:"optionalDependency",transitive:"transitive dependency"};function UGe(e){return Vy[e]??e}var are={error:2,warning:1,note:0};function jGe(e){return e.reduce((t,n)=>are[n]>are[t]?n:t,"note")}function zGe(e,t,n){let i=[...t].sort((d,p)=>Ux(p.confidence)-Ux(d.confidence)||d.file.localeCompare(p.file)||d.line-p.line),r=i[0],o=i.slice(1,1+mU),s=r.confidence,a=new Set(t.map(d=>d.file)),c=KGe(e,n),l=e.sourceUrl??(c?JGe(c,e):void 0),u=[`**${dre(e.kind)}:** ${GGe(e.summary,l)}`,"",`Upstream confidence: ${e.confidence}. Local confidence: ${s}`+(t.length>1?` (best of ${t.length} matches across ${a.size} file(s)).`:".")];return e.before&&e.after&&e.before!==e.after&&u.push("",`- \`${ire(gU(e.before,300))}\``,`+ \`${ire(gU(e.after,300))}\``),l&&u.push("",`${e.sourceUrl?"GitHub source":"Declaration source"}: ${l}`),{level:VGe(e.confidence,s),lines:u,primaryCandidate:{file:r.file,line:r.line,excerpt:r.excerpt},relatedCandidates:o.map(d=>({file:d.file,line:d.line,excerpt:d.excerpt})),helpUri:l}}function gU(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e}function GGe(e,t){return t?e.replace(/`([^`]+)`/g,(n,i)=>`[\`${i}\`](${t})`):e}function VGe(e,t){return e==="high"&&t==="high"?"error":e==="high"||t==="high"||e==="medium"&&t==="medium"?"warning":"note"}function Ux(e){return e==="high"?2:e==="medium"?1:0}function BGe(e){let t=e.security,n,i,r=[];if(t.current.length>0){n=`Currently affected by ${t.current.length} known ${Uf(t.current.length,"advisory","advisories")}`;let s=cre(t.current);i=s==="critical"||s==="high"?"error":"warning",r.push(["**Currently affected:**",...t.current.map(a=>`- ${fU(a)}`)].join(` -`))}else if(t.introduced.length>0){n=`Upgrading would introduce ${t.introduced.length} new known ${Uf(t.introduced.length,"advisory","advisories")}`;let s=cre(t.introduced);i=s==="critical"||s==="high"?"error":"warning"}else n=`Resolves ${t.resolved.length} known ${Uf(t.resolved.length,"advisory","advisories")}`,i="note";t.introduced.length>0&&r.push(["**Would introduce:**",...t.introduced.map(s=>`- ${fU(s)}`)].join(` -`)),t.resolved.length>0&&r.push(["**Resolves:**",...t.resolved.map(s=>`- ${fU(s)}`)].join(` -`));let o=[`**${n}**`];for(let s of r)o.push("",s);o.push("",`Drift's assessment: **${ru[e.assessment.recommendation]}**.`);for(let s of e.assessment.reasons)o.push(`- ${s}`);return{level:i,lines:o,relatedCandidates:[],helpUri:t.current[0]?.url??t.introduced[0]?.url??t.resolved[0]?.url,ruleNameSuffix:n}}function qGe(e){let n=e.checks.filter(o=>o.status==="failed").map(o=>`\`${o.label}\``).join(", "),r=[`**The project's own checks fail with this upgrade installed${e.failedFiles.length>0?` in ${e.failedFiles.length} file${e.failedFiles.length===1?"":"s"}`:""}** \u2014 measured, not predicted. Drift's static analysis found no specific call site to point at, but the upgrade should not be treated as safe.`];return n&&r.push("",`Failing: ${n}`),e.diagnostics&&r.push("",gU(e.diagnostics,4e3)),{level:"error",lines:r,relatedCandidates:[],ruleNameSuffix:"Project's own checks fail with this upgrade"}}function WGe(e,t){return{level:"note",lines:[`**Update available** (${e.to?`${e.from??"none"} \u2192 ${e.to}`:"removed"}), with no breaking changes or advisories found.`],relatedCandidates:[],ruleNameSuffix:"Outdated \u2014 safe to upgrade"}}function HGe(e,t){return{level:"warning",lines:[`**Breaking change detected upstream** (${e.to?`${e.from??"none"} \u2192 ${e.to}`:"removed"}). ${t} upstream breaking ${Uf(t,"change was","changes were")} found, and no code in this repository was found to use the affected parts \u2014 but a completed search is not proof the change cannot reach this repository. Review before upgrading.`],relatedCandidates:[],ruleNameSuffix:"Outdated \u2014 review before upgrading"}}function Fx(e){let{change:t,blocks:n,upstreamOnlyCount:i,fix:r,ruleIdSuffix:o,ruleName:s,snippetOk:a,repoBlobUrl:c}=e,l=qk(t),u=t.to?`${t.from??"none"} \u2192 ${t.to}`:"removed",d=n.some(k=>k.primaryCandidate),p=UGe(t.kind),f=[l?`**${t.name}** (${t.ecosystem} ${p}) ${u} \u2014 ${l}`:`**${t.name}** (${t.ecosystem} ${p}) ${u}`];i>0&&f.push("",`${i} additional upstream breaking ${Uf(i,"change does","changes do")} not reach code in this repository and ${Uf(i,"is","are")} omitted here.`);let m=a?n.find(k=>k.primaryCandidate)?.primaryCandidate??{file:t.manifestPath,line:1}:{file:t.manifestPath,line:1},g=new Set([`${m.file}:${m.line}`]),h=[];for(let k of n){let _=k.primaryCandidate?[k.primaryCandidate,...k.relatedCandidates]:k.relatedCandidates;for(let S of _){let x=`${S.file}:${S.line}`;if(!g.has(x)&&(g.add(x),h.push(S),h.length>=mU))break}if(h.length>=mU)break}let b=new Map(h.map((k,_)=>[`${k.file}:${k.line}`,_+1])),y=k=>{let _=b.get(`${k.file}:${k.line}`);return _!==void 0?`[\`${k.file}:${k.line}\`](${_})`:DGe(k.file,k.line,c)},w=[f.join(` -`),...n.map(k=>{if(!k.primaryCandidate)return k.lines.join(` -`);let _=["**Seen at:**",`- ${y(k.primaryCandidate)}`,...k.relatedCandidates.map(S=>`- ${y(S)}`)];return[...k.lines,"","",..._].join(` -`)}),QGe(r,d)].join(` +`)}function cHe(e){let t=[`### \`${e.dependency}\` ${e.from} \u2192 ${e.to}`,"",`**Recommendation: ${Tu[e.assessment.recommendation]}**`,""],n=lHe(e.security);n&&t.push(n,"");let r=uHe(e.maintenance);if(r&&t.push(r,""),e.improvements.length>0){t.push("**Other improvements**","");for(let s of e.improvements)t.push(`- ${s.statement}${s.url?` ([source](${s.url}))`:""}`);t.push("")}let i=dHe(e.license);i&&t.push(i,"");let o=pHe(e.summary);if(o&&t.push(o,""),t.push(`**Evidence confidence:** ${sHe[e.assessment.confidence]} \u2014 ${e.assessment.confidenceBasis}`,""),e.assessment.reasons.length>0){t.push("
Why Drift concluded this","");for(let s of e.assessment.reasons)t.push(`- ${s}`);t.push("","
")}return t.join(` +`).trim()}function lHe(e){if(!e.checked)return`**Security** + +${e.reason??"The OSV advisory database could not be reached, so this upgrade's effect on known vulnerabilities is unknown."}`;let t=["**Security**",""];return e.resolved.length>0&&(t.push(`Upgrading resolves ${wv(e.resolved.length,"known vulnerability","known vulnerabilities")}:`),t.push(...xB(e.resolved)),t.push("")),e.introduced.length>0&&(t.push(`The target version is affected by ${wv(e.introduced.length,"advisory","advisories")} that ${e.introduced.length===1?"does":"do"} not affect the installed version:`),t.push(...xB(e.introduced)),t.push("")),e.carried.length>0&&(t.push(`${wv(e.carried.length,"advisory affects","advisories affect")} both versions and ${e.carried.length===1?"is":"are"} not addressed by this upgrade:`),t.push(...xB(e.carried)),t.push("")),e.target.length===0&&t.push("No known vulnerabilities were found for the target version."),t.join(` +`).trim()}function xB(e){let t=e.slice(0,aHe),n=t.map(r=>{let i=r.aliases.find(a=>a.startsWith("CVE-")),o=i&&i!==r.id?`${r.id} (${i})`:r.id,s=r.fixedIn?` \u2014 first fixed in ${r.fixedIn}`:" \u2014 no fixed version published";return`- [${o}](${r.url}) \u2014 ${oHe[r.severity]}${s}. ${r.summary}`});return e.length>t.length&&n.push(`- \u2026and ${e.length-t.length} more.`),n}function uHe(e){return e.facts.length===0?"":["**Maintenance**","",...[...e.facts].sort((n,r)=>Number(r.concerning??!1)-Number(n.concerning??!1)).map(n=>`- ${n.statement}${n.url?` ([source](${n.url}))`:""}`)].join(` +`)}function dHe(e){if(e.verdict==="ok"||e.verdict==="changed")return"";let n=[e.verdict==="policy-violation"?"**License review required**":"**License**","",e.statement],r=e.introduced.filter(i=>!i.allowed);if(r.length>0){n.push("","Newly introduced dependencies of this package:");for(let i of r)n.push(`- \`${i.name}\` \u2014 ${i.license??"no declared license"}`);n.push("","This covers the dependencies this package itself declares. Drift does not resolve the full transitive graph during analysis.")}return n.push("","_Drift reports what the metadata says and how it compares to your configured policy. It does not give legal advice._"),n.join(` +`)}function pHe(e){if(e.changes.length===0)return"";let t=[["Breaking changes",e.changes.filter(r=>r.category==="breaking")],["Security",e.changes.filter(r=>r.category==="security")],["Improvements",e.changes.filter(r=>r.category==="performance"||r.category==="improvement")],["Fixes",e.changes.filter(r=>r.category==="fix")]],n=["
What changed upstream",""];for(let[r,i]of t)if(i.length!==0){n.push(`**${r}**`,"");for(let o of i){let s=o.affectedSites!==void 0?` Drift found ${wv(o.affectedSites,"affected call","affected calls")} in this repository.`:"";n.push(`- ${o.text}${s}${o.url?` ([source](${o.url}))`:""}`)}n.push("")}return e.unrelated>0&&n.push("**Unrelated changes**","",`- ${wv(e.unrelated,"further change","further changes")} were read and judged not to concern this repository.`,""),n.push("
"),n.join(` +`)}function wv(e,t,n){return`${e} ${e===1?t:n}`}var fHe=["drift-schema","drift-plan","drift-plan-digest","drift-commit","drift-base-branch"],mHe=/^[ \t]*[ \t]*$/gm,gHe=/^[0-9a-f]{40}$/,hHe=/^plan_[0-9a-f]{10}$/,yHe=/^[0-9a-f]{64}$/;function bHe(e){return!(!e||e.length>255||/[\x00-\x20~^:?*[\\]/.test(e)||e.includes("..")||e.includes("@{")||e.startsWith("/")||e.endsWith("/")||e.includes("//")||e.startsWith("-")||e.startsWith(".")||e.endsWith(".")||e.endsWith(".lock"))}function lle(e){return[``,``,``,``,``].join(` +`)}function ule(e){if(!e)return{ok:!1,reason:"the issue has no body"};let t=new Map;for(let l of e.matchAll(mHe)){let u=l[1],d=(l[2]??"").trim(),p=t.get(u);p?p.push(d):t.set(u,[d])}if(t.size===0)return{ok:!1,reason:"the issue has no Drift plan footer, so it is not a Drift approval issue"};for(let l of fHe){let u=t.get(l);if(!u)return{ok:!1,reason:`the plan footer is missing \`${l}\``};if(u.length>1)return{ok:!1,reason:`the plan footer declares \`${l}\` ${u.length} times; a Drift issue declares each key exactly once`};if(u[0]==="")return{ok:!1,reason:`the plan footer has an empty \`${l}\``}}let n=l=>t.get(l)[0],r=n("drift-schema");if(!/^\d+$/.test(r))return{ok:!1,reason:`\`drift-schema\` must be an integer, not \`${TB(r)}\``};let i=Number(r);if(!FG.includes(i))return{ok:!1,reason:`this issue records plan schema v${i}, which this version of Drift cannot verify (it supports v${FG.join(", v")}). Re-run Drift to generate a current plan.`};let o=n("drift-plan");if(!hHe.test(o))return{ok:!1,reason:`\`drift-plan\` is not a Drift plan id: \`${TB(o)}\``};let s=n("drift-plan-digest");if(!yHe.test(s))return{ok:!1,reason:"`drift-plan-digest` is not a 64-character SHA-256 digest"};let a=n("drift-commit");if(!gHe.test(a))return{ok:!1,reason:"`drift-commit` must be a full 40-character commit SHA; an abbreviated SHA does not name one commit unambiguously"};let c=n("drift-base-branch");return bHe(c)?{ok:!0,metadata:{schemaVersion:i,planId:o,planDigest:s,headSha:a,baseBranch:c}}:{ok:!1,reason:`\`drift-base-branch\` is not a valid branch name: \`${TB(c)}\``}}function dle(e){let t=[``,``];return e.taskId&&t.push(``),e.pullRequestNumber!==void 0&&t.push(``),t.join(` +`)}function ple(e,t){for(let n of e){if(!n.authorIsDrift||!n.body)continue;let r=//.exec(n.body)?.[1];if(r!==t)continue;let i=//.exec(n.body)?.[1]?.trim(),o=//.exec(n.body)?.[1]?.trim(),s=//.exec(n.body)?.[1];return{planDigest:r,...i?{branchName:i}:{},...o?{taskId:o}:{},...s?{pullRequestNumber:Number(s)}:{}}}return null}function TB(e){let t=e.replace(/[`\r\n]/g," ").trim();return t.length<=40?t:`${t.slice(0,40)}\u2026`}var FB=require("node:crypto");var Rr=require("node:path");var ble=require("node:fs"),ls=require("node:fs/promises"),vle=require("node:child_process"),_le=require("node:util");function vHe(e){return e.verification?e.verification.status==="passed"?"passed":e.verification.status==="failed"?"failed":"skipped":"not-run"}function kv(e){if(e.status==="pending")return"pending";if(e.status==="error")return"error";let t=e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial";if((e.actionableImpactCount??(t?e.runtimeDeclarationSiteCount!==void 0?Math.max(0,e.impactCount-e.runtimeDeclarationSiteCount):e.impactConfidence==="high"?e.impactCount:0:e.impactConfidence==="low"||e.impactConfidence==="medium"?0:e.impactCount))>0)return"affected";if(e.verification?.status==="failed")return"verification-failed";let r=t?e.runtimeDeclarationSiteCount:0;if((r===void 0?t?0:e.impactCount:Math.max(0,e.impactCount-r))>0)return"review-required";if(e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial")return"runtime-unresolved";let o=e.runtimeAnalyses?.length??0,s=Math.max(0,e.breakingCount-o);return s>0&&(e.sourceCoverage?.localizationComplete===!1||e.sourceCoverage?.sourceTruncated)?"localization-incomplete":s>0?e.verifiedUnaffected===!0?"upstream-only":"review-required":e.breakingCount>0?"upstream-only":e.recommendation==="insufficient-evidence"?"evidence-missing":e.recommendation?"clean":e.gaps&&e.gaps.length>0?"evidence-missing":"clean"}function mle(e){let t=vHe(e),n=t==="not-run"?" \u2014 not deeply verified":t==="skipped"?" \u2014 deep verification did not complete":"",r=wHe(e);switch(kv(e)){case"pending":return"Not checked yet";case"error":return"Could not check";case"affected":{let i=e.actionableImpactCount!==void 0,o=e.actionableImpactFiles??e.impactFiles,s=e.actionableImpactCount??e.impactCount,a=i?"actionable site":"site",c=e.impactConfidence&&e.impactConfidence!=="high"||e.runtimeCompatibility==="partial"?"May affect":"Affects",l=e.impactPendingIsolatedClearance?" \u2014 not yet confirmed alone: a batch check passed without testing this package in isolation":"",u=t==="failed"?" \u2014 and its own checks fail with this installed, measured not predicted":n,d=r?` \xB7 ${r}`:"";return`${c} your code \xB7 ${s} ${a}${s===1?"":"s"} in ${o} file${o===1?"":"s"}${d}${l}${u}`}case"verification-failed":{let i=(e.verification?.checks??[]).filter(o=>o.status==="failed").map(o=>o.label);return i.length>0?`Verified breaking \xB7 ${i.join(", ")} failed with this upgrade installed \u2014 measured, not predicted`:"Verified breaking \xB7 this upgrade broke the project's own checks \u2014 measured, not predicted"}case"upstream-only":{let i=`${e.breakingCount} upstream change${e.breakingCount===1?"":"s"}, none used here`;return e.verifiedUnaffected===!0?`Verified safe \xB7 ${i}, and your own checks pass`:`Safe for your code \xB7 ${i}`}case"review-required":{let i=e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial"?e.runtimeDeclarationSiteCount??0:0;if(e.impactCount-i<=0){let a=e.breakingCount;return`Review Required \xB7 ${a} breaking change${a===1?"":"s"} upstream; Drift found no usage in this repository but could not prove none \u2014 verify before upgrading`+(r?` \xB7 ${r}`:"")}let o=Math.max(1,e.impactCount-i),s=r?` \xB7 ${r}`:"";return e.impactConfidence==="low"||e.impactConfidence==="medium"?`May affect your code \xB7 ${o} local site${o===1?"":"s"} Drift flagged but could not confirm \u2014 Review required; check before upgrading${s}`:`Review Required \xB7 ${o} local site${o===1?"":"s"} Drift flagged but could not confirm${s}`}case"runtime-unresolved":return r?`Runtime Unknown \xB7 ${r}`:"Runtime Unknown \xB7 Drift could not resolve this repository\u2019s runtime compatibility";case"localization-incomplete":return"Localization Incomplete \xB7 Drift searched the indexed source subset, but the file limit prevented proving the breaking API is unused";case"evidence-missing":return"Evidence Missing \xB7 Drift could not obtain enough upstream evidence to decide";case"clean":{let i=e.recommendation==="upgrade-recommended";return t==="passed"?i?"Verified worth taking \xB7 no breaking changes, it improves on what you have, and your own checks pass":"Verified safe \xB7 no breaking changes found, and your own checks pass":i?`Worth taking \xB7 no breaking changes, and it improves on what you have${n}`:`Safe for your code \xB7 no breaking changes found${n}`}}}function fle(e){return{affected:0,"verification-failed":1,error:2,"review-required":3,"runtime-unresolved":4,"localization-incomplete":5,"evidence-missing":6,"upstream-only":7,pending:8,clean:9}[e]}function _He(e,t){return fle(e)-fle(t)}function gle(e,t){return _He(kv(e),kv(t))}function wHe(e){if(e.runtimeCompatibility!=="unknown"&&e.runtimeCompatibility!=="partial")return;let t=e.runtimeAnalyses?.find(r=>r.state==="unknown"||r.state==="partial");if(t?.statement)return t.statement;if(t?.reason==="config-incomplete")return"Drift could not index every authoritative runtime configuration file";let n=e.runtimeDeclarationSiteCount??0;return n>0?`${n} runtime declaration${n===1?"":"s"} to review`:"Drift could not resolve this repository\u2019s runtime compatibility"}function AB(e,t){return Ne(e,t)}function Ic(e,t){return Xe(e,t)??0}function SA(e){switch(e){case"npm":return"the npm registry";case"pypi":return"PyPI";case"cargo":return"crates.io";case"go":return"the Go module proxy";case"maven":return"Maven Central";case"rubygems":return"RubyGems";case"nuget":return"NuGet";case"packagist":return"Packagist";case"hex":return"Hex";case"pub":return"pub.dev";case"cocoapods":return"CocoaPods Trunk";case"conan":return"ConanCenter";case"vcpkg":return"the vcpkg registry";case"arduino":return"the Arduino Library Manager";case"swift":return"the package\u2019s git tags";case"opam":return"the opam repository"}}async function hle(e){try{return await kHe(e)}catch(t){return{outcome:"unchecked",reason:`Checking ${SA(e.ecosystem)} for ${e.name} failed: ${t.message}`}}}async function kHe(e){let{name:t,ecosystem:n,current:r,range:i}=e,o=SA(n),s=AB(r,n);if(!s)return{outcome:"unchecked",reason:`${t} is installed at \u201C${r}\u201D, which Drift cannot compare against published versions.`};let a=await RB(e);if(!a)return{outcome:"unchecked",reason:`Drift could not reach ${o} for ${t}.`};if(a.complete===!1)return{outcome:"unchecked",reason:`Drift could not enumerate all of ${o} for ${t}, so it cannot establish whether a newer compatible version exists.`};if(a.versions.length===0)return{outcome:"unchecked",reason:`${o} returned no versions for ${t}, so Drift has nothing to compare against.`};let l=(n==="swift"?a.versions.filter(b=>IB(b)===IB(r)):a.versions).map(b=>AB(b,n)).filter(b=>b!==null);if(l.length===0)return n==="swift"?{outcome:"unchecked",reason:`${o} returned no tags in the installed version's ${IB(r)} family for ${t}.`}:{outcome:"unchecked",reason:`Drift could not read any of the ${a.versions.length} version numbers ${o} published for ${t}.`};let d=(s.prerelease?l:l.filter(b=>!b.prerelease)).filter(b=>Ic(b,s)>0).sort((b,_)=>Ic(_,b)),p=a.latest?AB(a.latest,n):null,f=n==="swift"?d[0]:p&&(s.prerelease||!p.prerelease)?p:d[0];if(!f||Ic(f,s)<=0)return{outcome:"up-to-date"};let m=RHe(d,s,i,n),g=d,h=IHe(g,s,n),v=[...new Map([f,...m?[m]:[],...h?[h]:[],...g.slice(0,18)].map(b=>[b.raw,b])).values()].filter(b=>Ic(b,s)>0).sort((b,_)=>Ic(_,b)).map(b=>b.raw);return{outcome:"upgrade",latest:f.raw,...m?{safeLatest:m.raw}:{},...h?{latestMinor:h.raw}:{},versions:v}}function IB(e){let t=e.trim().replace(/^[^\d]*/,"");return/^\d{4}[.-]\d{1,2}[.-]\d{1,2}(?:[.-]\d+)?(?:$|[-+])/.test(t)?"calendar":Ne(e,"swift")?"semver":"unknown"}var $He="https://repo1.maven.org/maven2";async function RB(e){switch(e.ecosystem){case"npm":return EHe(e.name);case"swift":return THe(e.name,e.githubToken);case"opam":return AHe(e.name,e.githubToken);case"maven":return SHe(e.name);default:{let t=await Qn(e.name,e.ecosystem,null);return t?{latest:null,versions:t.versions}:null}}}async function SHe(e){let[t,n]=e.split(":");if(!t||!n)return null;let r=await ot(`${$He}/${t.replace(/\./g,"/")}/${n}/maven-metadata.xml`);if(r===null){let s=await Qn(e,"maven",null);return s?{latest:null,versions:s.versions}:null}let i=/([^<]+)<\/release>/.exec(r)?.[1]?.trim()??null,o=[...r.matchAll(/([^<]+)<\/version>/g)].map(s=>s[1].trim());if(o.length===0){let s=await Qn(e,"maven",null);return s?{latest:null,versions:s.versions}:null}return{latest:i,versions:o}}var xHe="application/vnd.npm.install-v1+json, application/json";async function EHe(e){let t=await Ie(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`,{timeoutMs:12e3,headers:{Accept:xHe}});return t?{latest:t["dist-tags"]?.latest?.trim()??null,versions:Object.keys(t.versions??{})}:null}function yle(e){return{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28",...e?{Authorization:`Bearer ${e}`}:{}}}async function THe(e,t){if(!/^[\w.-]+\/[\w.-]+$/.test(e))return null;let n=100,r=20,i=[];for(let o=1;o<=r;o++){let s=await Ie(`https://api.github.com/repos/${e}/tags?per_page=${n}&page=${o}`,{headers:yle(t)});if(!s)return o===1?null:{latest:null,versions:[...new Set(i)],complete:!1};if(i.push(...s.map(a=>a.name).filter(a=>!!a)),s.lengthr.sameCompatibilityLine(t,i)===!0).sort((i,o)=>Ic(o,i))[0]}function RHe(e,t,n,r){let i=io(r),s=e.filter(a=>Ic(a,t)>0).map(a=>({version:a,satisfies:i.satisfies(a,n)}));if(!s.some(a=>a.satisfies===null))return s.filter(a=>a.satisfies).map(a=>a.version).sort((a,c)=>Ic(c,a))[0]}function xA(e,t,n,r,i){if(!i)return e>0?`${e} breaking change${e===1?"":"s"} found in ${r}.`:`No breaking changes found for this version of ${r}.`;let{assessment:o,security:s}=i,a=Tu[o.recommendation],c=[],l=new Map(t.map(g=>[g.id,g])),u=n.filter(g=>l.get(g.breakingChangeId)?.kind!=="runtime-requirement"),d=n.filter(g=>l.get(g.breakingChangeId)?.kind==="runtime-requirement");u.length>0&&c.push(`${u.length} place${u.length===1?"":"s"} in this repository use${u.length===1?"s":""} an API that ${r} changed`),c.push(...PHe(d));let p=o.runtimeCompatibility,f=p==="unknown"||p==="partial";d.length===0&&p==="unknown"&&c.push("this upgrade's runtime requirement could not be checked against this repository");let m=t.filter(g=>g.kind!=="runtime-requirement").length;if(u.length===0&&d.length===0&&m>0&&!f){let g=Gm(t);c.push(g?`${m} published ${g} change${m===1?"":"s"} ${m===1?"requires":"require"} review; ${m===1?"this package-role contract is":"these package-role contracts are"} assessed independently of source call signatures`:`${m} upstream API breaking change${m===1?"":"s"}, no usage of the changed parts located in this repository \u2014 review before upgrading`)}return s.checked&&s.resolved.length>0&&c.push(`fixes ${s.resolved.length} known ${s.resolved.length===1?"vulnerability":"vulnerabilities"}`),s.checked&&s.introduced.length>0&&c.push(`introduces ${s.introduced.length} known ${s.introduced.length===1?"vulnerability":"vulnerabilities"}`),c.length===0&&i.gaps.length>0?`${a}. ${i.gaps.join(" ")}`:c.length===0?`${a}. No breaking changes found for this version of ${r}.`:`${a}. ${CHe(c.join("; "))}.`}function PHe(e){let t=[],n=e.filter(o=>o.runtimeVerdict!=="partial"&&o.runtimeVerdict!=="unknown"),r=e.filter(o=>o.runtimeVerdict==="partial"),i=e.filter(o=>o.runtimeVerdict==="unknown");if(n.length>0){let o=n.length;t.push(`${o} runtime declaration${o===1?"":"s"} in this repository do${o===1?"es":""} not satisfy this upgrade's runtime requirement`)}if(r.length>0){let o=r.length;t.push(`${o} runtime declaration${o===1?"":"s"} only partially satisf${o===1?"ies":"y"} this upgrade's runtime requirement`)}if(i.length>0){let o=i.length;t.push(`${o} runtime declaration${o===1?"":"s"} could not be resolved, so compatibility is unknown`)}return t}function CHe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function EA(e,t){let n={...e,verification:t};if(!n.plan||(n.plan=_A(n.plan,t),t.status==="skipped"))return n;n.breakingCount=n.plan.upstreamBreakingCount??n.plan.breakingChanges.length,n.impactCount=n.plan.impactSites.length,n.impactFiles=new Set(n.plan.impactSites.map(i=>i.file)).size;let r=n.plan.dispositions;return r&&(n.actionableImpactCount=r.reduce((i,o)=>i+o.actionableSites.length,0),n.actionableImpactFiles=new Set(r.flatMap(i=>i.actionableSites.map(o=>o.file))).size,n.runtimeDeclarationSiteCount=r.filter(i=>i.runtimeAnalysis!==void 0).reduce((i,o)=>i+o.sites.length,0)),n.rationale&&(n.rationale=n.plan.rationale?.find(i=>i.dependency===n.rationale.dependency)??n.plan.rationale?.[0]??n.rationale),n.risk=n.plan.risk,n.verifiedUnaffected=t.status==="passed"&&bv(t)==="isolated"&&t.checks.some(i=>i.status==="passed"&&i.compileCapable)&&Array.isArray(n.plan.dispositions)&&n.plan.dispositions.every(i=>i.state==="unaffected")&&(n.plan.breakingChanges.length>0||(n.plan.upstreamBreakingCount??0)>0),n.impactPendingIsolatedClearance=bv(t)==="batch"&&t.checks.some(i=>i.status==="passed"&&i.compileCapable)&&n.plan.impactSites.some(i=>{let o=n.plan.breakingChanges.find(s=>s.id===i.breakingChangeId);return o!==void 0&&gB(o)}),n.summary=xA(n.breakingCount,n.plan.breakingChanges,n.plan.impactSites,n.name,n.rationale),n}var wle=(0,_le.promisify)(vle.execFile);function NHe(e,t){return t?[...e]:e.map(n=>n.state==="incompatible"||n.state==="partial"?n:{...n,state:"unknown",reason:"config-incomplete",statement:`${n.statement} Drift could not index every authoritative runtime configuration file, so this result is incomplete.`})}function kle(e,t){return`${e}\0${t}`}var OHe={includeDev:!0,maxSites:40,maxPackages:0};function $le(e){return{available:!1,reason:e.reason,inspection:e.reason==="no-public-surface"?"succeeded":e.reason==="artifact-type-unsupported"?"not-applicable":"failed",tool:e.tool,detail:e.detail,...e.packageRole?{packageRole:e.packageRole}:{},...e.diagnostic?{diagnostic:e.diagnostic}:{}}}async function NB(e,t=[""],n=new Map,r=Xn()){let i=[],o=[],s=await LHe(e,r);for(let a of t){let c=a?(0,Rr.join)(e,a):e,l=await r.readDirectory(c);if(l.length===0)continue;let u=[...l,...await DHe(c,l,r)],d=Fa({entries:u,read:p=>Rle((0,Rr.join)(c,p))});if(d.length!==0){for(let p of T8(d))(n.get(kle(a,p.ecosystem))??(a?s.get(p.ecosystem):void 0))||o.push({...p,dir:a});for(let p of MHe(d,a,n,s)){let f=p.manager.manifestPattern?u.filter(h=>p.manager.manifestPattern.test(h)):[],m=p.manager.manifests.find(h=>u.includes(h))??f.find(eM)??f[0];if(!m)continue;let g=p.manager.lockfiles.find(h=>u.includes(h))??null;if(p.manager.id==="pip"&&eM(m)){let h=m.replace(/\.in$/i,".txt");if(u.includes(h)){let v=await r.readFile((0,Rr.join)(c,h));v&&g$(v)&&(g=h)}}i.push({manager:p.manager,dir:a,manifestPath:a?`${a}/${m}`:m,lockfilePath:g?a?`${a}/${g}`:g:null})}}}return{targets:i,ambiguities:o}}async function DHe(e,t,n){let r=new Set;for(let o of La)for(let s of[...o.manifests,...o.lockfiles])s.includes("/")&&r.add(s);let i=[];for(let o of r){if(t.includes(o))continue;let s=o.slice(0,o.indexOf("/"));t.includes(s)&&await n.readFile((0,Rr.join)(e,o))!==null&&i.push(o)}return i}function MHe(e,t,n,r=new Map){let i=new Set,o=[];for(let s of new Set(e.map(a=>a.manager.ecosystem))){let a=e.filter(u=>u.manager.ecosystem===s),c=n.get(kle(t,s)),l=a.find(u=>u.manager.id===c)??a.find(u=>u.manager.id===r.get(s))??a[0];i.has(s)||(i.add(s),o.push(l))}return o}async function LHe(e,t){let n=await t.readDirectory(e),r=Fa({entries:n,read:o=>Rle((0,Rr.join)(e,o))}),i=new Map;for(let o of r)o.fromLockfile&&i.set(o.manager.ecosystem,o.manager.id);return i}async function Sle(e){let{root:t,repo:n,config:r,logger:i,githubToken:o,onProgress:s,onCandidate:a,onDropped:c,onOutdated:l,token:u,repoLabel:d}=e,p=e.breadth??OHe,f=e.fs??Xn(),m=e.env??process.env,g=Math.max(1,Math.min(32,Math.floor(e.concurrency??oB(m))||1));i.debug(`Scan parallelism: ${Nce(m)}`);let h={enabled:(e.verify?.enabled??!1)&&r.verify.enabled,checks:e.verify?.checks??r.verify.checks,timeoutMs:e.verify?.timeoutMs??r.verify.timeoutMs,generatedSourceGlobs:e.verify?.generatedSourceGlobs??r.verify.generatedSourceGlobs,baselineCache:e.verify?.baselineCache},v=Date.now(),b=(V,te,De=0,Ce=0)=>{let qe=Date.now();i.debug(`${V} (+${qe-v}ms): ${te}`),v=qe,s?.({phase:V,detail:te,done:De,total:Ce})},_=Dt("scan","total"),w=Dt("discover","manifests");b("Looking for manifests",t);let k=await Zd(t,f),x=Yd(k),A=await A$(t,f,x).catch(()=>[]),I=A.filter(V=>V.hasOwnGit),R=A.filter(V=>!V.hasOwnGit).map(V=>V.dir),C=[...x,...R],j=e.dirs??C;if(k.length>0||R.length>0){let V=[...k.map(te=>te.kind),...R.length>0?["undeclared"]:[]];b("Reading the workspace",`${j.length} package${j.length===1?"":"s"} \xB7 ${V.join(", ")}`)}let z=il("manifest.discovery"),{targets:Y,ambiguities:se}=await NB(t,j,e.managers??new Map,f);if(Y.length===0)return w.end({targets:0}),z.end({targets:0}),_.end({checked:0,candidates:0}),{candidates:[],checked:0,upToDate:0,unchecked:[],targets:Y,workspaces:k,ambiguities:se,nestedGitRepos:I};let L=new Map;for(let V of k)for(let te of V.members)te.name&&L.set(te.dir,te.name);for(let V of Y){if(L.has(V.dir))continue;let te=V.manifestPath.includes("/")?V.manifestPath.slice(V.manifestPath.lastIndexOf("/")+1):V.manifestPath,De=await qh(t,f,V.dir,te,V.manager.ecosystem).catch(()=>null);De&&L.set(V.dir,De)}w.end({targets:Y.length}),z.end({targets:Y.length,manifests:Y.length});let ee=new Set(r.ecosystems),ce=C.length>1||new Set(Y.map(V=>V.dir)).size>1,le=new Set,Ae=(V,te)=>{le.add(AA(V,d?t:void 0)),a?.(Ile({dep:V,member:ce?V.target.dir:void 0,memberName:ce?L.get(V.target.dir):void 0,repoRoot:d?t:void 0,repoLabel:d,phase:te}))},Ke=(V,te)=>VHe(V,te,"Waiting to be checked",{...ce?{member:V.target.dir}:{},...ce&&L.get(V.target.dir)?{memberName:L.get(V.target.dir)}:{},...d?{repoRoot:t,repoLabel:d}:{}}),ke=()=>{for(let V of pe)le.delete(V.id);for(let V of le)c?.(V);le.clear()},Ct=V=>{let te=AA(V,d?t:void 0);le.delete(te),c?.(te)},Tt=[],yt=[];for(let V of Y){if(!ee.has(V.manager.ecosystem))continue;b("Reading manifest",V.manifestPath);let te=await OB(t,V,p.includeDev,f),De=p.maxPackages>0?Math.max(0,p.maxPackages-Tt.length):te.dependencies.length;for(let Ce of te.dependencies.slice(0,De))Ae(Ce,"Waiting to be checked");Tt.push(...te.dependencies),yt.push(...te.unresolved)}if(yt.length>0){let V=[];await PB(yt,lA(m),async te=>{let De=te.ecosystem,Ce=te.current==="unspecified"?"*":te.current,qe=Y.find(ko=>ko.manifestPath===te.manifestPath);if(!qe){V.push(te);return}let Zi=((await RB({name:te.name,ecosystem:De,current:Ce,range:Ce,...o?{githubToken:o}:{}}).catch(()=>null))?.versions??[]).filter(ko=>HZ(ko,Ce,De)===!0).sort((ko,JA)=>Oh(JA,ko,De)??0)[0];if(!Zi){V.push(te);return}let Mv={name:te.name,kind:te.kind,current:Zi,range:Ce,assumed:!0,target:qe};Ae(Mv,"Waiting to be checked"),Tt.push(Mv)}),yt.length=0,yt.push(...V)}let bt=p.maxPackages>0?Tt.slice(0,p.maxPackages):Tt;b("Indexing your code","Walking source files",0,bt.length);let Ln=Dt("index","walk+build"),Ki=Xd(t,{members:j}).then(V=>{b("Indexing your code",`${V.length} file${V.length===1?"":"s"} indexed \xB7 ${bt.length} direct dependenc${bt.length===1?"y":"ies"} to check`,0,bt.length);let te={files:V,index:Pm(V)};return Ln.end({files:V.length}),te});Ki.catch(()=>{});let Hn=0,Ji=0,be=0,pe=[],Se=[...yt],Gt=V=>h.enabled&&V.size>0&&!u?.isCancellationRequested?Kce({root:t,targets:[],kinds:h.checks,env:m,logger:i,timeoutMs:h.timeoutMs,...h.generatedSourceGlobs?{allowedGlobs:h.generatedSourceGlobs}:{},...h.baselineCache?{baselineCache:h.baselineCache}:{},...u?{token:u}:{}},[...new Map(Y.filter(te=>V.has(te.dir)).map(te=>[te.dir,te])).values()].map(te=>({dir:te.dir,packageManager:te.manager.id})),te=>te.output!==void 0?s?.({phase:"",detail:"",done:0,total:0,output:te.output}):b(te.phase,te.detail)):void 0;b("Checking registries",`${bt.length} direct dependenc${bt.length===1?"y":"ies"}`,0,bt.length);let At=[],dn=new Map,$i=Dt("phase","version-discovery");await ni("version.discovery",{dependencies:bt.length},()=>PB(bt,lA(m),async V=>{if(u?.isCancellationRequested)return;let te=SA(V.target.manager.ecosystem);Ae(V,`Asking ${te} what has been published`);let De=il("registry.lookup",{package:V.name}),Ce=JSON.stringify([V.target.manager.ecosystem,V.name,V.current,V.range??null]),qe=dn.get(Ce);qe||(qe=Rn("versions",V.target.manager.ecosystem,()=>hle({name:V.name,ecosystem:V.target.manager.ecosystem,current:V.current,range:V.range,...o?{githubToken:o}:{}})),dn.set(Ce,qe),qe.then(Si=>{Si.outcome==="unchecked"&&dn.get(Ce)===qe&&dn.delete(Ce)},()=>{dn.get(Ce)===qe&&dn.delete(Ce)}));let Nt=await qe;if(De.end({outcome:Nt.outcome}),Nt.outcome==="up-to-date"){Hn+=1,Ji+=1,Ct(V),b("Up to date",`${V.name}@${V.current}`,Ji,bt.length);return}if(Nt.outcome==="unchecked"){Se.push({name:V.name,kind:V.kind,ecosystem:V.target.manager.ecosystem,packageManager:V.target.manager.id,manifestPath:V.target.manifestPath,current:V.current,reason:Nt.reason}),Ji+=1,Ct(V),b("Could not check",`${V.name}@${V.current} \xB7 ${Nt.reason}`,Ji,bt.length);return}At.push({dep:V,available:Nt}),Ji+=1,a?.(Ke(V,Nt)),b("Outdated",`${V.name} ${V.current} \u2192 ${Nt.safeLatest??Nt.latest}`,Ji,bt.length)})),$i.end({checked:bt.length,outdated:At.length}),At.sort((V,te)=>V.dep.name.localeCompare(te.dep.name));let wo=Gt(new Set(At.map(({dep:V})=>V.target.dir)));if(l?.({outdated:At.map(({dep:V,available:te})=>Ke(V,te)),checked:bt.length,upToDate:Hn,unchecked:[...Se]}),u?.isCancellationRequested)return ke(),await wo?.dispose(),_.end({cancelled:!0}),{candidates:[],checked:bt.length,upToDate:Hn,unchecked:Se,targets:Y,workspaces:k,ambiguities:se,nestedGitRepos:I};let Rt=Dt("phase","analysis"),rt=new Map;for(let{dep:V,available:te}of At){let De=te.safeLatest??te.latest,Ce=kM({ecosystem:V.target.manager.ecosystem,name:V.name,from:V.current,to:De});rt.has(Ce)||rt.set(Ce,{name:V.name,ecosystem:V.target.manager.ecosystem,from:V.current,to:De})}let Kn=r.rationale.security&&rt.size>0?ni("security.batch",{upgrades:rt.size},async()=>{let V=[...rt.keys()],te=[...rt.values()];try{let De=await gv(te,{});return new Map(V.map((Ce,qe)=>[Ce,De.get(te[qe])??as("The OSV advisory batch lookup did not return a result for this upgrade, so its effect on known vulnerabilities is unknown.")]))}catch(De){let Ce=`The OSV advisory batch lookup failed unexpectedly (${De.message}), so this upgrade's effect on known vulnerabilities is unknown.`;return new Map(V.map(qe=>[qe,as(Ce)]))}}):void 0;Kn?.catch(()=>{});let Dv=V=>Kn?.then(te=>te.get(V)),ea=new Map,Jn=new Map,us=new Map,Lu=new Map,KA=(V,te,De)=>{Lu.set(V,[te,De]);for(let Ce of us.get(V)??[])Ce(te,De)},cde=(V,te)=>{let De=us.get(V);De||(De=new Set,us.set(V,De)),De.add(te);let Ce=Lu.get(V);return Ce&&te(Ce[0],Ce[1]),()=>{De.delete(te),De.size===0&&(us.delete(V),Lu.delete(V))}},lde=(V,te,De)=>{let Ce={name:V.name,ecosystem:V.target.manager.ecosystem,from:V.current,to:te,kind:V.kind,bump:Aa(V.current,te,V.target.manager.ecosystem),manifestPath:V.target.manifestPath,rawFrom:V.current,rawTo:te},qe=kM(Ce),Nt=`${V.name} ${Ce.from} \u2192 ${Ce.to}`,Si=De?cde(qe,De):void 0,Zi=ea.get(qe),Mv=Zi!==void 0;if(!Zi){let $o=new Map,Fu=new Map,cV=new Set,ZA=new Map,YA=new Map;KA(qe,"Reading release notes and changelog",Nt);let Lv=ni("upstream.analysis",{package:V.name,ecosystem:Ce.ecosystem,from:Ce.from,to:Ce.to,shared:!1},()=>RL(Ce,{config:r,logger:i,...o?{githubToken:o}:{},env:m,workspaceRoot:t,onSurfaceComputed:(Rc,Yi)=>{let ds=fn(Rc);Yi.weight>=.8&&cV.add(ds),ZA.set(ds,{available:!0,inspection:"succeeded",tool:Yi.tool,...Yi.packageRole?{packageRole:Yi.packageRole}:{}}),$o.set(ds,{additions:Yi.additions??[],locator:Yi.locator}),KA(qe,"Comparing the public API surface",Nt)},onUnavailableSurface:(Rc,Yi)=>{let ds=fn(Rc);Fu.set(ds,Yi),ZA.set(ds,$le(Yi))},onProseConsulted:(Rc,Yi)=>{let ds=fn(Rc);YA.set(ds,[...YA.get(ds)??[],Yi])}}).then(Rc=>({evidence:Rc,additions:$o,surfaceGaps:Fu,surfaceCompared:cV,surfaceAssessments:ZA,prose:YA})));ea.set(qe,Lv),Zi=Lv,Lv.catch(()=>{ea.get(qe)===Lv&&ea.delete(qe)})}let ko=Jn.get(qe),JA=ko!==void 0;if(!ko){let $o=XG(Ce,{config:r,...o?{githubToken:o}:{},securityLookup:Dv(qe),onProgress:Fu=>KA(qe,Fu,Nt)});Jn.set(qe,$o),ko=$o,$o.catch(()=>{Jn.get(qe)===$o&&Jn.delete(qe)})}let ude=Zi,aV=ko;return ni("upstream.wait",{package:V.name,ecosystem:Ce.ecosystem,from:Ce.from,to:Ce.to,evidenceShared:Mv,rationaleShared:JA},async()=>{let[$o,Fu]=await Promise.allSettled([ude,aV]);return Si?.(),{evidence:$o.status==="fulfilled"?$o.value:void 0,rationaleFacts:Fu.status==="fulfilled"?aV:void 0}})};try{await ni("analysis",{packages:At.length},()=>PB(At,g,async({dep:te,available:De})=>{if(u?.isCancellationRequested)return;let Ce=De.safeLatest??De.latest,qe;try{qe=await lde(te,Ce,(Si,Zi)=>{b(Si,Zi,be,At.length),Ae(te,Si)})}catch(Si){i.debug(`Shared upstream analysis failed for ${te.name} ${te.current} \u2192 ${Ce}: ${Si.message}. Falling back to independent analysis for this row.`)}let Nt=await ni("package",{package:te.name,ecosystem:te.target.manager.ecosystem,from:te.current,to:Ce},()=>zHe({dep:te,selected:Ce,versions:De.versions,latest:De.latest,safeLatest:De.safeLatest,latestMinor:De.latestMinor,repo:n,config:r,githubToken:o,root:t,indexing:Ki,logger:i,env:m,maxSites:p.maxSites,member:ce?te.target.dir:void 0,allMembers:ce?C:void 0,memberName:ce?L.get(te.target.dir):void 0,repoRoot:d?t:void 0,repoLabel:d,prepared:qe,onProgress:(Si,Zi)=>{b(Si,Zi,be,At.length),Ae(te,Si)}}));pe.push(Nt),a?.(h.enabled?{...Nt,status:"checking",phase:"Waiting to be installed and tested"}:Nt),be+=1,b(kv(Nt)==="affected"?"Needs your attention":"Checked",`${Nt.name} ${Nt.current} \u2192 ${Nt.selected} \xB7 ${mle(Nt).toLowerCase()}`,be,At.length)})),Rt.end({packages:At.length});let V=Dt("phase","verification");try{h.enabled&&pe.length>0&&!u?.isCancellationRequested&&await ni("verification",{candidates:pe.length},()=>FHe({root:t,candidates:pe,checks:h.checks,timeoutMs:h.timeoutMs,generatedSourceGlobs:h.generatedSourceGlobs,...h.baselineCache?{baselineCache:h.baselineCache}:{},env:m,logger:i,...wo?{warm:wo}:{},...u?{token:u}:{},onProgress:te=>{if(te.output!==void 0){s?.({phase:"",detail:"",done:te.done,total:te.total,output:te.output});return}b(te.phase,te.detail,te.done,te.total);for(let De of te.targets??[]){let Ce=pe.findIndex(Nt=>Nt.id===De),qe=Ce>=0?pe[Ce]:void 0;!qe||qe.verification||a?.({...qe,status:"checking",phase:te.detail?`${te.phase} \xB7 ${te.detail}`:te.phase})}},onCandidate:a}))}finally{if(h.enabled)for(let[te,De]of pe.entries()){if(De.verification)continue;let Ce=EA(De,{status:"skipped",reason:u?.isCancellationRequested?`The scan was stopped before ${De.name} ${De.selected} could be installed and checked, so the findings below are predictions.`:`${De.name} ${De.selected} was not installed and checked, so the findings below are predictions.`,checks:[],failedFiles:[]});pe[te]=Ce,a?.(Ce)}await wo?.dispose(),V.end({candidates:pe.length})}}finally{ke()}return _.end({checked:bt.length,candidates:pe.length}),{candidates:pe.sort(WHe),checked:bt.length,upToDate:Hn,unchecked:Se,targets:Y,workspaces:k,ambiguities:se,nestedGitRepos:I}}async function FHe(e){let t=new Map(e.candidates.map(o=>[o.id,o])),n=e.candidates.filter(o=>o.rationale?.maintenance.deprecated);for(let o of n){let s=o.rationale?.maintenance.deprecated,a=EA(o,{status:"skipped",reason:`${o.name} ${o.selected} has been withdrawn (${s}), so it cannot be installed to test.`,checks:[],failedFiles:[]}),c=e.candidates.indexOf(o);c>=0&&(e.candidates[c]=a),e.onCandidate?.(a)}let i=e.candidates.filter(o=>!n.includes(o)).map(o=>({id:o.id,name:o.name,current:o.current,selected:o.selected,manifestPath:o.manifestPath,packageManager:o.packageManager,install:s=>UHe(s,o,"safe",Pu(e.env))}));await Wce({root:e.root,targets:i,installTogether:(o,s)=>jHe(o,s.map(a=>t.get(a.id)).filter(a=>a!==void 0),"safe",Pu(e.env)),kinds:e.checks,env:e.env,logger:e.logger,timeoutMs:e.timeoutMs,...e.generatedSourceGlobs?{allowedGlobs:e.generatedSourceGlobs}:{},...e.baselineCache?{baselineCache:e.baselineCache}:{},...e.warm?{warm:e.warm}:{},...e.token?{token:e.token}:{},onProgress:o=>e.onProgress?.({phase:o.phase,detail:o.detail,done:o.done,total:o.total,...o.targets?{targets:o.targets}:{},...o.output!==void 0?{output:o.output}:{}}),onVerified:(o,s)=>{let a=t.get(o.id);if(!a)return;let c=EA(a,s),l=e.candidates.indexOf(a);l>=0&&(e.candidates[l]=c);let u=(a.plan?.breakingChanges.length??0)-(c.plan?.breakingChanges.length??0);e.logger.info(`${o.name}@${o.selected}: ${vv(s)}`+(u>0?` ${u} predicted finding(s) dropped as disproved.`:"")),e.onCandidate?.(c)}})}async function PB(e,t,n){let r=0,i=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let o=r;r+=1;let s=e[o];if(s===void 0)return;await n(s)}});await Promise.all(i)}var CB=class extends Error{constructor(n){super(`${n.packageManager} cannot pin a version from the command line. Edit ${n.manifestPath} to require ${n.name} ${n.selected}, then re-run the scan.`);this.candidate=n}candidate};function xle(e,t="safe"){let n=Ele(e,t);return n?A8(n):null}function Ele(e,t){let r=al(e.packageManager)?.upgrade(TA(e));return r?t==="force"&&e.packageManager==="npm"?{...r,args:[...r.args,"--force"]}:r:null}function TA(e){return{name:e.name,version:e.selected,kind:e.kind,...e.cargo?{cargo:e.cargo}:{}}}async function UHe(e,t,n="safe",r=process.env){let i=Ele(t,n);if(!i)throw new CB(t);let o=al(t.packageManager),s=(0,Rr.join)(e,t.manifestPath),a=(0,Rr.dirname)(s),c=await Tle([s,...(o?.lockfiles??[]).map(l=>(0,Rr.join)(a,l))]);try{if(o?.rewriteManifest){let l=await(0,ls.readFile)(s,"utf8"),u=o.rewriteManifest(l,TA(t),t.manifestPath);u!==l&&await(0,ls.writeFile)(s,u,"utf8")}await wle(i.command,i.args,{cwd:a,env:r,shell:process.platform==="win32",windowsHide:!0,maxBuffer:8*1024*1024})}catch(l){throw await Ale(c),l.code==="ENOENT"?new Error(`${i.command} was not found on PATH. Run \`command -v ${i.command}\` to check, and install it if it is genuinely missing.`):l}}async function jHe(e,t,n="safe",r=process.env){if(t.length===0)return!1;let i=t[0];if(!t.every(d=>d.manifestPath===i.manifestPath&&d.packageManager===i.packageManager))return!1;let s=al(i.packageManager);if(!s)return!1;let a=E8(s,t.map(TA));if(!a)return!1;let c=(0,Rr.join)(e,i.manifestPath),l=(0,Rr.dirname)(c),u=await Tle([c,...(s.lockfiles??[]).map(d=>(0,Rr.join)(l,d))]);try{if(s.rewriteManifest){let d=await(0,ls.readFile)(c,"utf8"),p=d;for(let f of t)p=s.rewriteManifest(p,TA(f),f.manifestPath);p!==d&&await(0,ls.writeFile)(c,p,"utf8")}for(let d of a){let p=n==="force"&&i.packageManager==="npm"?[...d.args,"--force"]:d.args;await wle(d.command,p,{cwd:l,env:r,shell:process.platform==="win32",windowsHide:!0,maxBuffer:8*1024*1024})}}catch(d){throw await Ale(u),d.code==="ENOENT"?new Error(`${a[0].command} was not found on PATH. Run \`command -v ${a[0].command}\` to check, and install it if it is genuinely missing.`):d}return!0}async function Tle(e){return Promise.all(e.map(async t=>({path:t,content:await(0,ls.readFile)(t,"utf8").catch(()=>null)})))}async function Ale(e){await Promise.all(e.map(async({path:t,content:n})=>{try{n===null?await(0,ls.rm)(t,{force:!0}):await(0,ls.writeFile)(t,n,"utf8")}catch{}}))}async function zHe(e){let t=`${e.dep.name} ${e.dep.current} \u2192 ${e.selected}`,n=e.onProgress??(()=>{}),{target:r}=e.dep,i={name:e.dep.name,ecosystem:r.manager.ecosystem,from:e.dep.current,to:e.selected,kind:e.dep.kind,bump:Aa(e.dep.current,e.selected,r.manager.ecosystem),manifestPath:r.manifestPath,rawFrom:e.dep.current,rawTo:e.selected,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{}},o={id:AA(e.dep,e.repoRoot),name:e.dep.name,kind:e.dep.kind,ecosystem:r.manager.ecosystem,packageManager:r.manager.id,manifestPath:r.manifestPath,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{},...e.repoRoot?{repoRoot:e.repoRoot,repoLabel:e.repoLabel}:{},...e.allMembers?{allMembers:e.allMembers}:{},current:e.dep.current,...e.dep.assumed?{assumed:!0}:{},range:e.dep.range,safeLatest:e.safeLatest,latestMinor:e.latestMinor,selected:e.selected,latest:e.latest,versions:e.versions};try{n("Reading release notes and changelog",t);let s=new Map,a=new Map,c=new Set,l=new Map,u=new Map,d=e.prepared?.evidence?.evidence.map(R=>e.member===void 0?R:{...R,workspace:e.member})??await ni("evidence",{package:e.dep.name,ecosystem:r.manager.ecosystem},()=>Rn("evidence",r.manager.ecosystem,()=>RL(i,{config:e.config,logger:e.logger,githubToken:e.githubToken,env:e.env,workspaceRoot:e.root,onSurfaceComputed:(R,C)=>{let j=fn(R);C.weight>=.8&&c.add(j),l.set(j,{available:!0,inspection:"succeeded",tool:C.tool,...C.packageRole?{packageRole:C.packageRole}:{}}),s.set(j,{additions:C.additions??[],locator:C.locator})},onUnavailableSurface:(R,C)=>{let j=fn(R);a.set(j,C),l.set(j,$le(C))},onProseConsulted:(R,C)=>{let j=fn(R);u.set(j,[...u.get(j)??[],C])}}),{package:e.dep.name}));if(e.prepared?.evidence){let R=fn(i),C=fn({...i,workspace:void 0}),j=e.prepared.evidence;s.clear();let z=j.additions.get(C);z&&s.set(R,z),a.clear();let Y=j.surfaceGaps.get(C);Y&&a.set(R,Y),j.surfaceCompared.has(C)&&c.add(R),l.clear();let se=j.surfaceAssessments.get(C);se&&l.set(R,se),u.clear();let L=j.prose.get(C);L&&u.set(R,L)}n("Comparing the public API surface",`${t} \xB7 ${d.length} evidence source${d.length===1?"":"s"}`);let p=await ni("api.diff",{package:e.dep.name,evidenceSources:d.length},()=>Rn("analyze",r.manager.ecosystem,()=>DT([i],d,{config:e.config,logger:e.logger})));n(p.length>0?`Searching your code for ${p.length} breaking change${p.length===1?"":"s"}`:"No breaking changes to look for",t);let f=p.length>0?await Rn("module-maps",r.manager.ecosystem,()=>LT([i],{logger:e.logger})):void 0,m=Dt("index-wait",r.manager.ecosystem),{files:g,index:h}=await e.indexing;m.end();let v=Dt("localize",r.manager.ecosystem,{changes:p.length}),b=il("localization",{package:e.dep.name,changes:p.length,filesConsidered:g.length}),{sites:_,runtimeAnalyses:w}=HT(p,[i],h,g,{logger:e.logger,maxSitesPerChange:e.maxSites??40,member:e.member,members:e.allMembers,...f?{moduleMaps:f}:{}}),k=NHe(w,g.coverage.runtimeConfigComplete);v.end({sites:_.length}),b.end({sites:_.length}),n("Weighing what this upgrade is worth",t);let[x]=await Rn("rationale",r.manager.ecosystem,()=>iA({changes:[i],evidence:d,breakingChanges:p,impactSites:_,runtimeAnalyses:k,localizationRan:!0,localizationComplete:!g.coverage.sourceTruncated},{config:e.config,logger:e.logger,githubToken:e.githubToken,additions:s,surfaceCompared:c,surfaceGaps:a,prose:u,...e.prepared?.rationaleFacts?{preparedFacts:new Map([[i,e.prepared.rationaleFacts]])}:{},repoRuntime:Dm(g,e.member,e.allMembers),pythonRuntime:Mm(g,e.member,e.allMembers),onProgress:(R,C)=>n(C,t)})),A=tA({repo:e.repo,config:e.config,changes:[i],evidence:d,breakingChanges:p,impactSites:_,runtimeAnalyses:k,localizationRan:!0,localizationComplete:!g.coverage.sourceTruncated,runtimeConfigComplete:g.coverage.runtimeConfigComplete,...x?{rationale:[x]}:{}}),I=l.get(fn(i));return{...o,status:p.length>0?"ready":"clean",evidenceCount:d.length,breakingCount:p.length,impactCount:_.length,actionableImpactCount:(A.dispositions??[]).reduce((R,C)=>R+C.actionableSites.length,0),actionableImpactFiles:new Set((A.dispositions??[]).flatMap(R=>R.actionableSites.map(C=>C.file))).size,runtimeDeclarationSiteCount:(A.dispositions??[]).filter(R=>R.runtimeAnalysis!==void 0).reduce((R,C)=>R+C.sites.length,0),impactFiles:new Set(_.map(R=>R.file)).size,impactConfidence:GHe(_),sourceCoverage:g.coverage,...I?{surfaceAssessment:I}:{},risk:A.risk,summary:xA(p.length,p,_,e.dep.name,x),gaps:x?.gaps??[],toolRequests:BHe(a),...x?{rationale:x,recommendation:x.assessment.recommendation,...x.assessment.runtimeCompatibility?{runtimeCompatibility:x.assessment.runtimeCompatibility}:{},...k.length>0?{runtimeAnalyses:k.map(R=>({changeId:R.changeId,runtime:R.runtime,state:R.state,reason:R.reason,siteCount:R.sites.length,declarationCount:R.declarations.length,unresolvedCount:R.unresolved.length,statement:R.statement}))}:{}}:{},plan:A}}catch(s){return{...o,status:"error",evidenceCount:0,breakingCount:0,impactCount:0,actionableImpactCount:0,actionableImpactFiles:0,runtimeDeclarationSiteCount:0,impactFiles:0,impactConfidence:"none",risk:"unknown",summary:"Could not inspect this upgrade",gaps:[],toolRequests:[],error:s.message}}}function GHe(e){return e.some(t=>t.confidence==="high")?"high":e.some(t=>t.confidence==="medium")?"medium":e.some(t=>t.confidence==="low")?"low":"none"}function BHe(e){let t=new Set,n=[];for(let r of e.values())!r.install||t.has(r.install.id)||(t.add(r.install.id),n.push(r.install));return n}function AA(e,t){return`${t?`${t}::`:""}${e.target.manifestPath}#${e.name}@${e.current}`}function Ile(e){let{dep:t}=e;return{id:AA(t,e.repoRoot),name:t.name,kind:t.kind,...t.cargo?{cargo:t.cargo}:{},ecosystem:t.target.manager.ecosystem,packageManager:t.target.manager.id,manifestPath:t.target.manifestPath,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{},...e.repoRoot?{repoRoot:e.repoRoot,repoLabel:e.repoLabel}:{},current:t.current,...t.assumed?{assumed:!0}:{},range:t.range,selected:t.current,latest:t.current,versions:[],status:"pending",phase:e.phase,evidenceCount:0,breakingCount:0,impactCount:0,actionableImpactCount:0,actionableImpactFiles:0,runtimeDeclarationSiteCount:0,impactFiles:0,impactConfidence:"none",risk:"unknown",summary:"",gaps:[],toolRequests:[]}}function VHe(e,t,n,r){return{...Ile({dep:e,phase:n,...r?.member===void 0?{}:{member:r.member},...r?.memberName?{memberName:r.memberName}:{},...r?.repoRoot?{repoRoot:r.repoRoot}:{},...r?.repoLabel?{repoLabel:r.repoLabel}:{}}),selected:t.safeLatest??t.latest,latest:t.latest,...t.safeLatest?{safeLatest:t.safeLatest}:{},...t.latestMinor?{latestMinor:t.latestMinor}:{},versions:t.versions}}async function qHe(e){let t=new Map,n=new Map,r=c=>{let l=c;for(let u=0;u<4&&l.includes("${");u+=1)l=l.replace(/\$\{([^}]+)\}/g,(d,p)=>n.get(p)??d);return l},i=c=>{for(let[u,d]of c.properties)n.has(u)||n.set(u,d);let l=[];for(let[u,d]of c.dependencyManagement){let p=d.split("|"),f=p[0]??"";f&&(p.includes("import")?l.push(`${u}:${f}`):t.has(u)||t.set(u,f))}return l},o;try{o=vL(e)}catch{return t}let s=i(o);o.parent&&s.push(o.parent);let a=new Set;for(let c=0;c<8&&s.length>0;c+=1){let l=s.shift(),[u,d,p]=l.split(":");if(!u||!d||!p)continue;let f=r(p),m=`${u}:${d}:${f}`;if(a.has(m)||f.includes("${"))continue;a.add(m);let g=await FS({groupId:u,artifactId:d},f);if(g.ok){for(let h of i(g.contract))s.push(h);g.contract.parent&&s.push(g.contract.parent)}}for(let[c,l]of t)t.set(c,r(l));return t}async function OB(e,t,n,r){let i=h$(t.manifestPath),o=await r.readFile((0,Rr.join)(e,t.manifestPath));if(!i||o===null)return{dependencies:[],unresolved:[]};let s=i.parse(o,t.manifestPath),a=t.lockfilePath?await r.readFile((0,Rr.join)(e,t.lockfilePath)):null,c=a!==null&&t.lockfilePath?h$(t.lockfilePath)?.parse(a,t.lockfilePath):void 0,l=n?["runtime","dev","optional","peer"]:["runtime"],u=[],d=[];for(let[p,f]of s){if(!l.includes(f.kind))continue;let m=t.manager.ecosystem,g=c?.get(p)?.version??null,h=io(m),v=g?h.exactVersion(g)??h.parse(g)?.raw??null:h.exactVersion(f.version??"");if(!v){let b=f.version?.trim()??"";d.push({name:p,kind:f.kind,ecosystem:m,packageManager:t.manager.id,manifestPath:t.manifestPath,current:b||"unspecified",reason:b?`no lockfile entry, and "${b}" is a range rather than one version`:m==="maven"?"no version here and none in a lockfile \u2014 it is set by a parent POM or an imported BOM, which Drift does not fetch yet":"no version declared here, and no lockfile entry to resolve one from"});continue}u.push({name:p,kind:f.kind,...f.cargo?{cargo:f.cargo}:{},current:v,range:f.version??v,target:t})}if(d.length>0&&t.manager.ecosystem==="maven"&&t.manifestPath.endsWith("pom.xml")){let p=await qHe(o);if(p.size>0){let f=io("maven"),m=[];for(let g of d){let h=p.get(g.name),v=h?f.exactVersion(h):null;if(!v){m.push(g);continue}u.push({name:g.name,kind:g.kind,current:v,range:h??v,target:t})}d.length=0,d.push(...m)}}return{dependencies:u,unresolved:d}}function Rle(e){try{return(0,ble.readFileSync)(e,"utf8")}catch{return null}}function WHe(e,t){let n=gle(e,t);if(n!==0)return n;if(e.impactCount!==t.impactCount)return t.impactCount-e.impactCount;let r=e.name.localeCompare(t.name);return r!==0?r:e.manifestPath.localeCompare(t.manifestPath)}var HHe=12;async function Ple(e,t){if(!t)return e;let n=e.breakingChanges.filter(s=>s.symbols.length>0&&e.impactSites.some(a=>a.breakingChangeId===s.id));if(n.length===0)return e;let r=new Map,i=new Map,o=0;for(let s of n){if(o>=HHe)break;let a=e.changes.find(u=>u.name===s.dependency&&(u.workspace??"")===(s.workspace??""));if(!a?.to||a.ecosystem!=="npm")continue;let c=r.get(a.name);if(c===void 0&&(c=(await Qn(a.name,a.ecosystem,a.to))?.githubRepo??null,r.set(a.name,c)),!c)continue;o++;let l=await KHe(c,a.to,s.symbols[0],t);l&&i.set(s.id,l.url)}return i.size===0?e:{...e,breakingChanges:e.breakingChanges.map(s=>i.has(s.id)?{...s,sourceUrl:i.get(s.id)}:s)}}async function KHe(e,t,n,r){let i={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};r&&(i.Authorization=`Bearer ${r}`);let o=await JHe(e,t,i);if(!o)return null;let s=await ZHe(e,n,i);if(!s)return null;let a=await YHe(e,o,s,n);return a?{url:`https://github.com/${e}/blob/${o}/${s.split("/").map(encodeURIComponent).join("/")}#L${a}`,line:a}:null}async function JHe(e,t,n){return(await Ie(`https://api.github.com/repos/${e}/tags?per_page=100`,{headers:n})??[]).find(o=>!!o.name&&$p(o.name,t))?.name??null}async function ZHe(e,t,n){let r=encodeURIComponent(`${t} repo:${e} language:TypeScript`);return((await Ie(`https://api.github.com/search/code?q=${r}&per_page=5`,{headers:n}))?.items??[]).map(s=>s.path).find(s=>!!s&&!s.endsWith(".d.ts")&&!s.includes("node_modules/"))??null}async function YHe(e,t,n,r){let i=await ot(`https://raw.githubusercontent.com/${e}/${t}/${n}`);if(!i)return null;let o=new RegExp(`\\b(export\\s+)?(declare\\s+)?(default\\s+)?(function|const|class|interface|type|enum)\\s+${QHe(r)}\\b`),a=i.split(` +`).findIndex(c=>o.test(c));return a===-1?null:a+1}function QHe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var XHe="Drift",Cle="https://github.com/trydrift/drift",MB=9;function Fle(e,t){let n=new Map;for(let r of e)n.has(r.ruleId)||n.set(r.ruleId,{id:r.ruleId,name:r.ruleName,...r.helpUri?{helpUri:r.helpUri}:{}});return{$schema:"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",version:"2.1.0",runs:[{tool:{driver:{name:XHe,informationUri:Cle,rules:[...n.values()].map(r=>({id:r.id,name:r.name,shortDescription:{text:r.name},fullDescription:{text:"A Drift finding: what changed, where it's used, and the fix \u2014 see the alert body."},helpUri:r.helpUri??Cle,defaultConfiguration:{level:"warning"},properties:{tags:["dependencies","drift"]}}))}},...t?{automationDetails:{id:t}}:{},results:e.map(r=>({ruleId:r.ruleId,level:r.level,message:{text:eKe(r.message),markdown:r.message},locations:[Ole(r.primaryLocation,r.snippetOk)],...r.relatedLocations.length>0?{relatedLocations:r.relatedLocations.map((i,o)=>({id:o+1,...Ole(i)}))}:{},partialFingerprints:{primaryLocationLineHash:nKe(r)}}))}]}}function eKe(e){return e.replace(/\[([^\]]*)\]\(([^)]+)\)/g,"$1 ($2)").replace(/\*\*(.*?)\*\*/g,"$1").replace(/`([^`]*)`/g,"$1").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function Nle(e){return e.replace(/&/g,"&").replace(//g,">")}function tKe(e,t,n){let r=n?`${n}/${e}#L${t}`:`${e}#L${t}`;return`[\`${e}:${t}\`](${r})`}function Ole(e,t=!1){return{physicalLocation:{artifactLocation:{uri:e.file},region:{startLine:Math.max(1,e.line),...t&&e.excerpt?{snippet:{text:e.excerpt}}:{}}}}}function nKe(e){let t=`${e.ruleId}|${e.primaryLocation.file}|${(e.primaryLocation.excerpt??"").trim()}`;return(0,FB.createHash)("sha256").update(t).digest("hex").slice(0,40)}async function UB(e,t={}){let n=t.includeInformational??!1,r=t.granularity??"package",i=t.repoBlobUrl,o=[];e=await Ple(e,t.githubToken);for(let s of e.changes){let a=e.breakingChanges.filter(g=>g.dependency===s.name&&(g.workspace??"")===(s.workspace??"")),c=e.rationale?.find(g=>g.dependency===s.name),l=[],u=0,d=[...a].sort((g,h)=>RA(h.confidence)-RA(g.confidence));for(let g of d){let h=e.impactSites.filter(v=>v.breakingChangeId===g.id);if(h.length===0){u++;continue}l.push({breaking:g,block:cKe(g,h,e.evidence)})}let p=[];if(iKe(c)&&p.push(dKe(c)),e.verification?.status==="failed"&&p.push(pKe(e.verification)),l.length===0&&p.length===0)if(u>0){if(!n)continue;p.push(mKe(s,u))}else{if(!n||!c)continue;p.push(fKe(s,c))}let f=e.commits.find(g=>a.some(h=>g.breakingChangeIds.includes(h.id))),m=t.fixOf?.(s)??bKe(f,e);if(r==="package"){let g=[...l.map(h=>h.block),...p];o.push(IA({change:s,blocks:g,upstreamOnlyCount:u,fix:m,repoBlobUrl:i,ruleName:g.length===1&&g[0].ruleNameSuffix?`${s.name}: ${g[0].ruleNameSuffix}`:void 0}));continue}for(let{breaking:g,block:h}of l)if(r==="affectedSite"){let v=[h.primaryCandidate,...h.relatedCandidates].filter(b=>b!==void 0);for(let b of v)o.push(IA({change:s,blocks:[{...h,primaryCandidate:b,relatedCandidates:[]}],upstreamOnlyCount:0,fix:m,ruleIdSuffix:`${g.id}/${rKe(b)}`,ruleName:Dle(s,g),snippetOk:!0,repoBlobUrl:i}))}else o.push(IA({change:s,blocks:[h],upstreamOnlyCount:0,fix:m,ruleIdSuffix:g.id,ruleName:Dle(s,g),snippetOk:!0,repoBlobUrl:i}));for(let g of p)o.push(IA({change:s,blocks:[g],upstreamOnlyCount:0,fix:m,ruleIdSuffix:"other",ruleName:g.ruleNameSuffix?`${s.name}: ${g.ruleNameSuffix}`:void 0,repoBlobUrl:i}))}return o}function rKe(e){return(0,FB.createHash)("sha256").update(`${e.file}|${(e.excerpt??"").trim()}`).digest("hex").slice(0,10)}function iKe(e){if(!e)return!1;let t=e.security;return t.checked&&(t.resolved.length>0||t.introduced.length>0||t.current.length>0)}async function Ule(e,t={}){let n=[];for(let r of e){if(!r.plan)continue;let i=()=>{if(r.plan.commits.length>0)return;let o=xle(r);if(o)return{description:r.verification?.status==="failed"?"The project's own checks failed with this upgrade installed \u2014 measured, not predicted. Do not treat this as safe to upgrade without investigating.":r.breakingCount>0?"The upstream API changed, but no code in this repository was found to use the affected parts. Review before upgrading.":"Safe to upgrade \u2014 no breaking changes found.",command:o}};n.push(...await UB(r.plan,{...t,fixOf:i}))}return n}var oKe={"removed-export":"Removed export used in this repository","renamed-export":"Renamed export used in this repository","moved-export":"Export moved to a different module","signature-change":"Call signature changed","type-change":"Type changed in a breaking way","behaviour-change":"Runtime behaviour changed","removed-endpoint":"API endpoint removed","changed-endpoint":"API endpoint changed","required-field-added":"New required field","default-change":"Default value changed","config-change":"Configuration shape changed","module-system-change":"Module loading compatibility changed","runtime-requirement":"Runtime requirement changed",unknown:"Unclassified breaking change"};function jle(e){return oKe[e]??"Breaking change"}function Dle(e,t){let n=`${e.name}: ${jle(t.kind)}`;if(t.symbols.length===0)return n;let r=t.symbols.slice(0,2).join(", "),i=t.symbols.length>2?", \u2026":"";return`${n} (${r}${i})`}var $v={runtime:"dependency",dev:"devDependency",peer:"peerDependency",optional:"optionalDependency",transitive:"transitive dependency"};function sKe(e){return $v[e]??e}var Mle={error:2,warning:1,note:0};function aKe(e){return e.reduce((t,n)=>Mle[n]>Mle[t]?n:t,"note")}function cKe(e,t,n){let r=[...t].sort((d,p)=>RA(p.confidence)-RA(d.confidence)||d.file.localeCompare(p.file)||d.line-p.line),i=r[0],o=r.slice(1,1+MB),s=i.confidence,a=new Set(t.map(d=>d.file)),c=gKe(e,n),l=e.sourceUrl??(c?hKe(c,e):void 0),u=[`**${jle(e.kind)}:** ${lKe(e.summary,l)}`,"",`Upstream confidence: ${e.confidence}. Local confidence: ${s}`+(t.length>1?` (best of ${t.length} matches across ${a.size} file(s)).`:".")];return e.before&&e.after&&e.before!==e.after&&u.push("",`- \`${Nle(LB(e.before,300))}\``,`+ \`${Nle(LB(e.after,300))}\``),l&&u.push("",`${e.sourceUrl?"GitHub source":"Declaration source"}: ${l}`),{level:uKe(e.confidence,s),lines:u,primaryCandidate:{file:i.file,line:i.line,excerpt:i.excerpt},relatedCandidates:o.map(d=>({file:d.file,line:d.line,excerpt:d.excerpt})),helpUri:l}}function LB(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e}function lKe(e,t){return t?e.replace(/`([^`]+)`/g,(n,r)=>`[\`${r}\`](${t})`):e}function uKe(e,t){return e==="high"&&t==="high"?"error":e==="high"||t==="high"||e==="medium"&&t==="medium"?"warning":"note"}function RA(e){return e==="high"?2:e==="medium"?1:0}function dKe(e){let t=e.security,n,r,i=[];if(t.current.length>0){n=`Currently affected by ${t.current.length} known ${Hm(t.current.length,"advisory","advisories")}`;let s=Lle(t.current);r=s==="critical"||s==="high"?"error":"warning",i.push(["**Currently affected:**",...t.current.map(a=>`- ${DB(a)}`)].join(` +`))}else if(t.introduced.length>0){n=`Upgrading would introduce ${t.introduced.length} new known ${Hm(t.introduced.length,"advisory","advisories")}`;let s=Lle(t.introduced);r=s==="critical"||s==="high"?"error":"warning"}else n=`Resolves ${t.resolved.length} known ${Hm(t.resolved.length,"advisory","advisories")}`,r="note";t.introduced.length>0&&i.push(["**Would introduce:**",...t.introduced.map(s=>`- ${DB(s)}`)].join(` +`)),t.resolved.length>0&&i.push(["**Resolves:**",...t.resolved.map(s=>`- ${DB(s)}`)].join(` +`));let o=[`**${n}**`];for(let s of i)o.push("",s);o.push("",`Drift's assessment: **${Tu[e.assessment.recommendation]}**.`);for(let s of e.assessment.reasons)o.push(`- ${s}`);return{level:r,lines:o,relatedCandidates:[],helpUri:t.current[0]?.url??t.introduced[0]?.url??t.resolved[0]?.url,ruleNameSuffix:n}}function pKe(e){let n=e.checks.filter(o=>o.status==="failed").map(o=>`\`${o.label}\``).join(", "),i=[`**The project's own checks fail with this upgrade installed${e.failedFiles.length>0?` in ${e.failedFiles.length} file${e.failedFiles.length===1?"":"s"}`:""}** \u2014 measured, not predicted. Drift's static analysis found no specific call site to point at, but the upgrade should not be treated as safe.`];return n&&i.push("",`Failing: ${n}`),e.diagnostics&&i.push("",LB(e.diagnostics,4e3)),{level:"error",lines:i,relatedCandidates:[],ruleNameSuffix:"Project's own checks fail with this upgrade"}}function fKe(e,t){return{level:"note",lines:[`**Update available** (${e.to?`${e.from??"none"} \u2192 ${e.to}`:"removed"}), with no breaking changes or advisories found.`],relatedCandidates:[],ruleNameSuffix:"Outdated \u2014 safe to upgrade"}}function mKe(e,t){return{level:"warning",lines:[`**Breaking change detected upstream** (${e.to?`${e.from??"none"} \u2192 ${e.to}`:"removed"}). ${t} upstream breaking ${Hm(t,"change was","changes were")} found, and no code in this repository was found to use the affected parts \u2014 but a completed search is not proof the change cannot reach this repository. Review before upgrading.`],relatedCandidates:[],ruleNameSuffix:"Outdated \u2014 review before upgrading"}}function IA(e){let{change:t,blocks:n,upstreamOnlyCount:r,fix:i,ruleIdSuffix:o,ruleName:s,snippetOk:a,repoBlobUrl:c}=e,l=x$(t),u=t.to?`${t.from??"none"} \u2192 ${t.to}`:"removed",d=n.some(w=>w.primaryCandidate),p=sKe(t.kind),f=[l?`**${t.name}** (${t.ecosystem} ${p}) ${u} \u2014 ${l}`:`**${t.name}** (${t.ecosystem} ${p}) ${u}`];r>0&&f.push("",`${r} additional upstream breaking ${Hm(r,"change does","changes do")} not reach code in this repository and ${Hm(r,"is","are")} omitted here.`);let m=a?n.find(w=>w.primaryCandidate)?.primaryCandidate??{file:t.manifestPath,line:1}:{file:t.manifestPath,line:1},g=new Set([`${m.file}:${m.line}`]),h=[];for(let w of n){let k=w.primaryCandidate?[w.primaryCandidate,...w.relatedCandidates]:w.relatedCandidates;for(let x of k){let A=`${x.file}:${x.line}`;if(!g.has(A)&&(g.add(A),h.push(x),h.length>=MB))break}if(h.length>=MB)break}let v=new Map(h.map((w,k)=>[`${w.file}:${w.line}`,k+1])),b=w=>{let k=v.get(`${w.file}:${w.line}`);return k!==void 0?`[\`${w.file}:${w.line}\`](${k})`:tKe(w.file,w.line,c)},_=[f.join(` +`),...n.map(w=>{if(!w.primaryCandidate)return w.lines.join(` +`);let k=["**Seen at:**",`- ${b(w.primaryCandidate)}`,...w.relatedCandidates.map(x=>`- ${b(x)}`)];return[...w.lines,"","",...k].join(` +`)}),vKe(i,d)].join(` --- -`);return{ruleId:o?`drift/${t.ecosystem}/${t.name}/${o}`:`drift/${t.ecosystem}/${t.name}`,ruleName:s??`${t.name}: dependency finding`,dependency:t.name,ecosystem:t.ecosystem,dependencyKind:t.kind,from:t.from,to:t.to,manifestPath:t.manifestPath,workspace:t.workspace,workspaceLabel:l,level:jGe(n.map(k=>k.level)),message:w,primaryLocation:m,relatedLocations:h,snippetOk:a,fix:r,helpUri:n.find(k=>k.helpUri)?.helpUri}}function Uf(e,t,n){return e===1?t:n}function cre(e){return e.reduce((t,n)=>I1(n.severity,t)<0?n.severity:t,"unknown")}function fU(e){let t=e.fixedIn?`, fixed in ${e.fixedIn}`:"";return`[${e.id}](${e.url}) (${e.severity}${t}): ${e.summary}`}function KGe(e,t){for(let n of e.citations){let i=t.find(r=>r.id===n)?.url;if(i)return i}}function JGe(e,t){let n=ZGe(t);return n?`${e}#:~:text=${encodeURIComponent(n)}`:e}function ZGe(e){let n=(e.after??e.before)?.split(` -`)[0]?.trim()||e.symbols[0];if(n)return n.length>80?n.slice(0,80):n}function YGe(e,t){if(!e)return;if((e.codemod?.length??0)>0)return{description:`Deterministic fix available: "${e.message}". Drift can commit this itself once approved.`};if(e.fixPlan){let{plan:i,covered:r,residual:o}=e.fixPlan,s=r+o;return{description:`Validated fix plan \`${i.id}\` covers ${r}/${s} call site(s): ${i.migration} `+(o>0?`The remaining ${o} need an agent. `:"")+"Run `drift fix --plan` to read the full plan before applying it."}}return{description:t.risk==="none"?"No deterministic fix; comment `/drift apply` on Drift's approval issue for this plan to dispatch GitHub Copilot.":`No deterministic fix, and this plan carries risk: \`${t.risk}\`. Review the plan Drift filed, then comment \`/drift apply\` to dispatch a fix.`}}function QGe(e,t){return e?.url?`**Fix:** ${e.description} \u2192 ${e.url}`:e?.command?`**Fix:** ${e.description} Run: \`${e.command}\``:e?`**Fix:** ${e.description}`:t?"**Fix:** Drift did not produce a plan for this finding \u2014 see the workflow run for why.":"**Fix:** No action required; this is informational."}function bU(e){switch(e.kind){case"rename-identifier":return`Rename the identifier \`${e.from}\` to \`${e.to}\` at each call site Drift localized (bare uses only \u2014 never \`something.${e.from}\`, and never another \`${e.from}\` on the same line that was not localized).`;case"rename-member":return`Rename the member \`.${e.from}\` to \`.${e.to}\` at each call site Drift localized (member access only, and only on the receiver that was localized \u2014 a different object's \`.${e.from}\` on the same line is left alone).`;case"replace-import-path":return`Change the import path \`${e.from}\` to \`${e.to}\`, on localized lines that actually import, and only where that specifier appears once.`;case"insert-argument":return`Insert \`${e.text}\` as argument ${e.index+1} of each localized \`${e.callee}(\u2026)\` call that closes on its own line.`;case"wrap-call":return`Prefix each localized \`${e.callee}(\u2026)\` call with \`${e.wrapper}\`, where it is not already prefixed.`}}function XGe(e){return e==="proven"?"Every operation swaps one token or string for another of the same kind, at one anchored occurrence, so applying this cannot change whether the file parses and cannot touch anything Drift did not localize.":"At least one operation changes the structure of an expression. Drift knows exactly what it will write, but cannot promise the result compiles \u2014 so this plan is only applied automatically once the project\u2019s own checks have actually passed."}function pre(e){let{provenance:t}=e;switch(t.author){case"model":return`Authored by \`${t.model??"a model"}\` from the cited evidence, then validated by Drift.`;case"builtin":return"Derived by Drift\u2019s own codemod engine from a computed API diff. No model was involved.";case"recipe":return t.recipe?`Inferred from what \`${t.recipe.name}@${t.recipe.version}\` (${t.recipe.publisher}) did in a throwaway worktree, then re-derived and validated by Drift. The recipe\u2019s own output was not used \u2014 see ${t.recipe.source}.`:"Inferred from a community recipe, then re-derived and validated by Drift.";case"cache":return`Restored from a previously validated plan for this same migration (\`${t.sourceId??e.id}\`), then re-validated against this repository\u2019s own call sites.`;case"user":return"Supplied by a human. Validated by Drift exactly as an authored plan would be."}}function By(e,t={}){let{plan:n}=e,i=t.headingLevel??3,r=s=>"#".repeat(Math.min(6,i+s)),o=[];if(o.push(`${r(0)} Fix plan: ${n.migration}`),o.push(""),o.push(`\`${n.id}\` \xB7 **${n.dependency}** ${n.fromVersion??"?"} \u2192 ${n.toVersion??"?"} \xB7 ${n.changeKind}`),o.push(""),e.verdict==="rejected"){o.push("**Drift rejected this plan.** It was not applied, and the finding falls through to the tier below."),o.push("");for(let s of e.rejections)o.push(`- ${s}`);return o.push(""),o.push(pre(n)),o.join(` -`)}o.push(`${r(1)} What it does`),o.push("");for(let s of n.ops)o.push(`1. ${bU(s)}`);return o.push(""),n.rationale&&(o.push(`${r(1)} Why`),o.push(""),o.push(n.rationale),o.push("")),o.push(`${r(1)} What Drift checked`),o.push(""),o.push("- **Grounding.** Every operation acts on a symbol this finding names."),o.push("- **Exact occurrences.** Every edit is anchored to one call site Drift localized \u2014 file, line, column, and the exact text matched there. An operation cannot reach a same-named identifier elsewhere on the line, let alone elsewhere in the file."),o.push(`- **Attestation.** Every name introduced (${n.ops.flatMap(tVe).map(s=>`\`${s}\``).join(", ")||"none"}) appears in the cited evidence${n.citations.length?` (${n.citations.map(s=>`\`${s}\``).join(", ")})`:""}.`),o.push("- **Convergence.** Applying the plan twice was tested, and gives the same result as applying it once."),o.push("- **Line preservation.** No operation splits or joins a line."),o.push(`- **Assurance.** ${XGe(e.assurance)}`),o.push(""),o.push(`${r(1)} Coverage`),o.push(""),o.push(e.residual===0?`All ${e.covered} call site${e.covered===1?"":"s"} are resolved deterministically. No agent is asked about this finding.`:`${e.covered} of ${e.covered+e.residual} call sites are resolved deterministically. The remaining ${e.residual} ${e.residual===1?"is":"are"} listed below and ${e.residual===1?"is":"are"} handed to an agent individually \u2014 the plan is not abandoned because of them.`),o.push(""),t.sites!==!1&&e.sites.length>0&&(o.push(eVe(e.sites)),o.push("")),o.push(pre(n)),o.join(` -`)}function mre(e){if(e.verdict==="rejected")return`Fix plan rejected: ${e.rejections[0]??"it did not pass validation"}`;let t=e.plan.ops.length,n=e.covered+e.residual;return`${t} deterministic rule${t===1?"":"s"} covering ${e.covered}/${n} call site${n===1?"":"s"} (${e.assurance})`}function eVe(e){let t=["| Site | Change |","| --- | --- |"];for(let n of e){let i=`\`${n.file}:${n.line}\``;n.status==="covered"?t.push(`| ${i} | \`${fre(n.before)}\` \u2192 \`${fre(n.after??"")}\` |`):t.push(`| ${i} | _Not covered_ \u2014 ${n.reason??"no rule matched."} |`)}return t.join(` -`)}function tVe(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return[e.to];default:return[]}}function fre(e){let t=e.trim();return t.length<=90?t:`${t.slice(0,87)}\u2026`}var nVe={high:"\u{1F7E2} high",medium:"\u{1F7E1} medium",low:"\u{1F7E0} low"},rVe={none:"\u26AA none",low:"\u{1F7E2} low",medium:"\u{1F7E1} medium",high:"\u{1F534} high"};function jf(e,t){let n=[];return n.push(iVe(e)),n.push(hre(e)),e.blockers.length>0&&n.push(yre(e)),e.warnings.length>0&&n.push(bre(e)),n.push(vre(e)),n.push(iU(e)),n.push(wre(e)),n.push(uVe(e)),n.push(X1(e.gaps)),n.push(eU(e)),n.push(kre(e)),n.push(dVe(e,t)),n.push($re(e)),n.filter(Boolean).join(` - -`)}function gre(e,t){let n=[];return n.push("## Drift found breaking changes that need your call"),n.push(e.blockers.length>0?"Drift analysed this dependency change and prepared a fix, then stopped. The reasons are listed below.":"Drift analysed this dependency change and prepared a fix. This repository runs in `approve` mode, so nothing has been changed yet."),n.push(hre(e)),e.blockers.length>0&&n.push(yre(e)),e.warnings.length>0&&n.push(bre(e)),n.push(vre(e)),n.push(iU(e)),n.push(wre(e)),n.push(X1(e.gaps)),n.push(eU(e)),n.push(kre(e)),n.push(["## To proceed","","Comment `/drift apply` on this issue and Drift will create the branch and","hand the plan to GitHub Copilot, one commit at a time. You will get a pull","request to review \u2014 nothing merges automatically.","","Comment `/drift dismiss` to close this out.","","To stop being asked for changes like this, adjust `.github/drift.yml` \u2014 see the [configuration reference](https://github.com/trydrift/drift/blob/main/docs/configuration.md)."].join(` -`)),n.push($re(e)),n.filter(Boolean).join(` - -`)}function iVe(e){let t=new Set(e.changes.map(i=>i.workspace).filter(i=>i!==void 0));return["## Drift: dependency compatibility fix","",`${e.changes.map(i=>{let r=t.size>1?qk(i):null,o=i.kind==="runtime"?null:Vy[i.kind],s=[i.ecosystem,o].filter(Boolean).join(", ");return`\`${i.name}\` _(${s})_ ${i.from??"\u2014"} \u2192 **${i.to??"\u2014"}**${r?` _(in ${r})_`:""}`}).join(", ")}`,"",e.commits.length>0?`Drift found **${e.breakingChanges.length} breaking change(s)** affecting **${new Set(e.impactSites.map(i=>i.file)).size} file(s)** in this repository, and planned **${e.commits.length} commit(s)** to fix them.`:Lf(e)].join(` -`)}function hre(e){let t=new Set(e.impactSites.map(n=>n.file)).size;return["| | |","|---|---|",`| **Risk** | ${rVe[e.risk]??e.risk} |`,`| **Breaking changes** | ${e.upstreamBreakingCount??e.breakingChanges.length} |`,`| **Impact sites** | ${e.impactSites.length} across ${t} file(s) |`,`| **Planned commits** | ${e.commits.length} |`,`| **Evidence sources** | ${oVe(e.evidence)} |`,`| **Base branch** | \`${e.baseBranch}\` |`].join(` -`)}function oVe(e){let t=new Map;for(let n of e)t.set(n.source,(t.get(n.source)??0)+1);return t.size===0?"none":[...t.entries()].map(([n,i])=>`${n} (${i})`).join(", ")}function yre(e){return["## \u26D4 Why Drift stopped","","Drift did not dispatch this automatically. Each reason below is a guardrail","from `.github/drift.yml`:","",...e.blockers.map(t=>`- ${t}`)].join(` -`)}function bre(e){return["## \u26A0\uFE0F Worth checking","",...e.warnings.map(t=>`- ${t}`)].join(` -`)}function vre(e){if(e.breakingChanges.length===0)return["## Breaking changes","","None identified from the available evidence."].join(` -`);let t=new Map(e.evidence.map(i=>[i.id,i])),n=["## Breaking changes",""];for(let i of e.breakingChanges){let r=e.impactSites.filter(a=>a.breakingChangeId===i.id).length,o=Y1(i);n.push(`### ${Rx(i).text} \xB7 \`${i.dependency}\` \xB7 ${i.kind}`),n.push(""),n.push(i.summary),n.push(""),i.before&&i.after&&i.before!==i.after&&n.push("```diff",`- ${vU(i.before,300)}`,`+ ${vU(i.after,300)}`,"```",""),n.push(`**Verdict:** ${Ine(o,i.assessment)}.`),n.push(""),n.push(Nne(i)),n.push(""),i.assessment&&(n.push(Rne(i.assessment)),n.push(""),n.push(Cne(i.assessment)),n.push("")),i.symbols.length>0&&(n.push(`**Symbols:** ${i.symbols.map(a=>`\`${a}\``).join(", ")}`),n.push("")),n.push(r>0?`**Found in this repo:** ${r} location(s)`:i.assessment?.localImpact.penalties.some(a=>a.code==="localization-unavailable")?"**Found in this repo:** not searched \u2014 no checkout was available. This is not evidence the change is unused.":"**Found in this repo:** no usages found in the files that import this dependency \u2014 no fix planned"),n.push(""),n.push(...sVe(i.remediation)),n.push("");let s=i.citations.map(a=>t.get(a)).filter(a=>a!==void 0);if(s.length>0){n.push("**Evidence:**");for(let a of s)n.push(`- ${_re(a)}`);n.push("")}}return n.join(` -`).trim()}function sVe(e){let t=aVe(e);return t.length===1?[`**Fix:** ${t[0]}`]:["**Fix:**","",...t]}function aVe(e){let t=[],n=[],i=()=>{let r=n.join(" ").trim();n.length=0,r&&t.push(r)};for(let r of e.split(/\r?\n/)){let o=r.trim(),s=/^(before|after):(.*)$/i.exec(o);if(s){i(),t.push(`**${lVe(s[1])}:**`,"",cVe(s[2].trimStart()),"");continue}if(!o){i();continue}n.push(o)}return i(),t.filter((r,o,s)=>r||s[o-1]&&s[o+1])}function cVe(e){let t=e.match(/`+/g)?.reduce((i,r)=>Math.max(i,r.length),2)??2,n="`".repeat(t+1);return[n,e,n].join(` -`)}function lVe(e){return e&&`${e[0].toUpperCase()}${e.slice(1).toLowerCase()}`}function wre(e){if(e.commits.length===0)return["## Commit plan","",`No commits planned. ${Lf(e)}`].join(` -`);let t=["## Commit plan","","Each commit addresses one concern. The graph below records only necessary","dependencies; commits in the same execution layer have disjoint file scope and","may run in parallel.",""];for(let n of e.commits){if(t.push(`**${n.order}. \`${n.message}\`**`),t.push(""),t.push(`Unit: \`${n.id}\``),t.push(`Layer: ${n.executionLayer}`),n.dependsOn.length>0&&(t.push(`Depends on: ${n.dependsOn.map(i=>`\`${i}\``).join(", ")}`),t.push(`Why: ${n.dependencyReasons.map(i=>`${i.reason}${i.evidence.length?` (${i.evidence.slice(0,3).join("; ")})`:""}`).join("; ")}`)),t.push(`Files: ${n.allowedFiles.map(i=>`\`${i}\``).join(", ")}`),(n.allowedSymbols??[]).length>0&&t.push(`Symbols: ${n.allowedSymbols.map(i=>`\`${i}\``).join(", ")}`),n.expectedChecks.length>0&&t.push(`Expected checks: ${n.expectedChecks.map(i=>i.kind).join(", ")}`),n.codemod?.length){let i=n.codemod.map(r=>`\`${r.from}\` \u2192 \`${r.to}\``).join(", ");t.push(`**Resolved deterministically** by Drift's codemod engine (${i}) \u2014 no model call was needed for this commit.`)}else if(n.fixPlan){let{plan:i,covered:r,residual:o,assurance:s}=n.fixPlan,a=r+o;t.push(`**Deterministic fix plan** \`${i.id}\` \u2014 ${i.migration} ${i.ops.length} rule${i.ops.length===1?"":"s"}, ${r}/${a} call site${a===1?"":"s"} covered, assurance \`${s}\`.`);for(let c of i.ops)t.push(` - ${bU(c)}`);if(o>0&&t.push(` - ${o} call site${o===1?"":"s"} not covered by the plan; an agent handles ${o===1?"it":"them"} individually.`),n.recipe?.length){let c=[...new Map(n.recipe.map(l=>[`${l.provider}:${l.name}@${l.version}`,l])).values()];t.push(` - Consulted: ${c.map(l=>`[\`${l.name}@${l.version}\`](${l.source}) from ${l.publisher}`).join(", ")}`)}}else if(n.recipe?.length){let i=[...new Map(n.recipe.map(o=>[`${o.provider}:${o.name}@${o.version}`,o])).values()],r=i.map(o=>`[\`${o.name}@${o.version}\`](${o.source}) from ${o.publisher} (${o.provider})`).join(", ");t.push(`**Community recipe consulted**: ${r} \u2014 ${i[0].migration} Drift could not re-derive its edits as deterministic operations, so this commit goes to an agent.`)}t.push("")}return t.join(` -`).trim()}function uVe(e){if(e.impactSites.length===0)return"";let t=new Map;for(let i of e.impactSites){let r=t.get(i.file);r?r.push(i):t.set(i.file,[i])}let n=["
",`All ${e.impactSites.length} impact site(s)`,""];for(let[i,r]of[...t.entries()].sort()){let o=r.every(s=>s.siteKind==="manifest");n.push(`**\`${i}\`**${o?" \u2014 the declaration, not a call site":""}`),n.push("");for(let s of r.slice(0,25)){let a=s.enclosingSymbol?` (in \`${s.enclosingSymbol}\`)`:"";n.push(`- L${s.line}${a} \u2014 \`${s.excerpt}\` \xB7 ${nVe[s.confidence]}`)}r.length>25&&n.push(`- \u2026and ${r.length-25} more in this file`),n.push("")}return n.push("
"),n.join(` -`)}function kre(e){if(e.evidence.length===0)return"";let t=["
",`Evidence Drift used (${e.evidence.length} source(s))`,"","Every finding above traces back to one of these. Open them to check the work.",""];for(let n of e.evidence)t.push(`#### ${_re(n)}`),t.push(""),t.push(`\`${n.source}\` \xB7 ${Ane(n.weight)} (weight ${n.weight.toFixed(2)})`),t.push(""),t.push("```"),t.push(vU(n.content,2e3)),t.push("```"),t.push("");return t.push("
"),t.join(` -`)}function dVe(e,t){let n=["Every edit corresponds to a breaking change listed above \u2014 no unrelated refactoring crept in","The fixes match what the cited evidence actually says","CI passes on this branch"];return e.impactSites.some(i=>i.file.includes("test"))&&n.push("Test changes update assertions to the new API rather than weakening them"),e.breakingChanges.some(i=>i.kind==="behaviour-change"||i.kind==="default-change")&&n.push("Behaviour changes were handled deliberately \u2014 these compile either way, so the type checker will not catch a wrong choice"),e.breakingChanges.some(i=>i.confidence==="low")&&n.push("Low-confidence findings were verified against the upstream source before accepting"),["## Review checklist","",...n.map(i=>`- [ ] ${i}`)].join(` -`)}function $re(e){return["---","",Dne({schemaVersion:Cf,planId:e.id,planDigest:lx(e),headSha:e.headSha,baseBranch:e.baseBranch}),"",`Generated by [Drift](https://github.com/trydrift/drift) \xB7 plan \`${e.id}\` \xB7 ${e.createdAt}
`,"Drift reads dependency changes, proves which ones break your code, and drives","GitHub Copilot to fix them. It never merges anything.
"].join(` -`)}function _re(e){let t=e.title;return e.url?`[${t}](${e.url})`:e.locator?`${t} (\`${e.locator}\`)`:t}function vU(e,t){return e.length<=t?e:`${e.slice(0,t)} -\u2026(truncated)`}function jx(e){if(e.commits.length===0)return`${Lf(e)} (${e.changes.length} dependency change(s) checked)`;let t=new Set(e.impactSites.map(n=>n.file)).size;return`${e.breakingChanges.length} breaking change(s), ${t} file(s) affected, ${e.commits.length} commit(s) planned (risk: ${e.risk})`}var zf=require("node:fs/promises"),Wy=require("node:path");function Sre(e){return e.codemod?"builtin":e.fixPlan?"fix-plan":"ai"}function wU(e,t){let n=new Set(t.map(r=>r.id)),i=new Set(t.flatMap(r=>r.breakingChangeIds));return{...e,commits:e.commits.filter(r=>n.has(r.id)),breakingChanges:e.breakingChanges.filter(r=>i.has(r.id))}}function zx(e,t){let n=new Map(t);for(let s of e.codemod??[])for(let a of s.files){let c=n.get(a);c!==void 0&&n.set(a,bee(c,s,a))}let i=[];for(let[s,a]of t){let c=n.get(s);c!==void 0&&c!==a&&i.push({path:s,content:c})}if(i.length===0)return{status:"no-changes",edits:[],message:"The deterministic fix produced no changes here \u2014 likely already applied by an earlier commit."};let r=new Set(i.map(s=>s.path)).size,o=e.codemod?.length??0;return{status:"applied",edits:i,message:`Applied ${o} deterministic rename${o===1?"":"s"} across ${r} file${r===1?"":"s"} \u2014 no agent call was made.`}}function Gx(e,t){let n=e.fixPlan;if(!n)return{status:"no-changes",edits:[],message:"This commit has no fix plan."};let i=new Map(t);for(let a of n.files){let c=i.get(a);c!==void 0&&i.set(a,Aee(c,n.plan.ops,n.anchors,a))}let r=[];for(let[a,c]of t){let l=i.get(a);l!==void 0&&l!==c&&r.push({path:a,content:l})}if(r.length===0)return{status:"no-changes",edits:[],message:"The fix plan produced no changes here \u2014 likely already applied by an earlier commit."};let o=new Set(r.map(a=>a.path)).size,s=mre({plan:n.plan,verdict:n.residual===0?"accepted":"partial",assurance:n.assurance,sites:[],covered:n.covered,residual:n.residual,rejections:[],anchors:n.anchors});return{status:"applied",edits:r,message:`Applied fix plan \`${n.plan.id}\` \u2014 ${s} \u2014 across ${o} file${o===1?"":"s"}.`+(n.residual>0?` ${n.residual} call site${n.residual===1?"":"s"} remain${n.residual===1?"s":""} for an agent.`:" No agent call was made.")}}function Vx(e,t,n={}){let{fixPlans:i}=t.remediation;if(e.verdict==="rejected")return{action:"skip",reason:e.rejections[0]??"The plan did not pass validation."};let r=e.covered+e.residual,o=r===0?0:e.covered/r;return ow.level)),message:_,primaryLocation:m,relatedLocations:h,snippetOk:a,fix:i,helpUri:n.find(w=>w.helpUri)?.helpUri}}function Hm(e,t,n){return e===1?t:n}function Lle(e){return e.reduce((t,n)=>ZG(n.severity,t)<0?n.severity:t,"unknown")}function DB(e){let t=e.fixedIn?`, fixed in ${e.fixedIn}`:"";return`[${e.id}](${e.url}) (${e.severity}${t}): ${e.summary}`}function gKe(e,t){for(let n of e.citations){let r=t.find(i=>i.id===n)?.url;if(r)return r}}function hKe(e,t){let n=yKe(t);return n?`${e}#:~:text=${encodeURIComponent(n)}`:e}function yKe(e){let n=(e.after??e.before)?.split(` +`)[0]?.trim()||e.symbols[0];if(n)return n.length>80?n.slice(0,80):n}function bKe(e,t){if(!e)return;if((e.codemod?.length??0)>0)return{description:`Deterministic fix available: "${e.message}". Drift can commit this itself once approved.`};if(e.fixPlan){let{plan:r,covered:i,residual:o}=e.fixPlan,s=i+o;return{description:`Validated fix plan \`${r.id}\` covers ${i}/${s} call site(s): ${r.migration} `+(o>0?`The remaining ${o} need an agent. `:"")+"Run `drift fix --plan` to read the full plan before applying it."}}return{description:t.risk==="none"?"No deterministic fix; comment `/drift apply` on Drift's approval issue for this plan to dispatch GitHub Copilot.":`No deterministic fix, and this plan carries risk: \`${t.risk}\`. Review the plan Drift filed, then comment \`/drift apply\` to dispatch a fix.`}}function vKe(e,t){return e?.url?`**Fix:** ${e.description} \u2192 ${e.url}`:e?.command?`**Fix:** ${e.description} Run: \`${e.command}\``:e?`**Fix:** ${e.description}`:t?"**Fix:** Drift did not produce a plan for this finding \u2014 see the workflow run for why.":"**Fix:** No action required; this is informational."}function jB(e){switch(e.kind){case"rename-identifier":return`Rename the identifier \`${e.from}\` to \`${e.to}\` at each call site Drift localized (bare uses only \u2014 never \`something.${e.from}\`, and never another \`${e.from}\` on the same line that was not localized).`;case"rename-member":return`Rename the member \`.${e.from}\` to \`.${e.to}\` at each call site Drift localized (member access only, and only on the receiver that was localized \u2014 a different object's \`.${e.from}\` on the same line is left alone).`;case"replace-import-path":return`Change the import path \`${e.from}\` to \`${e.to}\`, on localized lines that actually import, and only where that specifier appears once.`;case"insert-argument":return`Insert \`${e.text}\` as argument ${e.index+1} of each localized \`${e.callee}(\u2026)\` call that closes on its own line.`;case"wrap-call":return`Prefix each localized \`${e.callee}(\u2026)\` call with \`${e.wrapper}\`, where it is not already prefixed.`}}function _Ke(e){return e==="proven"?"Every operation swaps one token or string for another of the same kind, at one anchored occurrence, so applying this cannot change whether the file parses and cannot touch anything Drift did not localize.":"At least one operation changes the structure of an expression. Drift knows exactly what it will write, but cannot promise the result compiles \u2014 so this plan is only applied automatically once the project\u2019s own checks have actually passed."}function zle(e){let{provenance:t}=e;switch(t.author){case"model":return`Authored by \`${t.model??"a model"}\` from the cited evidence, then validated by Drift.`;case"builtin":return"Derived by Drift\u2019s own codemod engine from a computed API diff. No model was involved.";case"recipe":return t.recipe?`Inferred from what \`${t.recipe.name}@${t.recipe.version}\` (${t.recipe.publisher}) did in a throwaway worktree, then re-derived and validated by Drift. The recipe\u2019s own output was not used \u2014 see ${t.recipe.source}.`:"Inferred from a community recipe, then re-derived and validated by Drift.";case"cache":return`Restored from a previously validated plan for this same migration (\`${t.sourceId??e.id}\`), then re-validated against this repository\u2019s own call sites.`;case"user":return"Supplied by a human. Validated by Drift exactly as an authored plan would be."}}function Sv(e,t={}){let{plan:n}=e,r=t.headingLevel??3,i=s=>"#".repeat(Math.min(6,r+s)),o=[];if(o.push(`${i(0)} Fix plan: ${n.migration}`),o.push(""),o.push(`\`${n.id}\` \xB7 **${n.dependency}** ${n.fromVersion??"?"} \u2192 ${n.toVersion??"?"} \xB7 ${n.changeKind}`),o.push(""),e.verdict==="rejected"){o.push("**Drift rejected this plan.** It was not applied, and the finding falls through to the tier below."),o.push("");for(let s of e.rejections)o.push(`- ${s}`);return o.push(""),o.push(zle(n)),o.join(` +`)}o.push(`${i(1)} What it does`),o.push("");for(let s of n.ops)o.push(`1. ${jB(s)}`);return o.push(""),n.rationale&&(o.push(`${i(1)} Why`),o.push(""),o.push(n.rationale),o.push("")),o.push(`${i(1)} What Drift checked`),o.push(""),o.push("- **Grounding.** Every operation acts on a symbol this finding names."),o.push("- **Exact occurrences.** Every edit is anchored to one call site Drift localized \u2014 file, line, column, and the exact text matched there. An operation cannot reach a same-named identifier elsewhere on the line, let alone elsewhere in the file."),o.push(`- **Attestation.** Every name introduced (${n.ops.flatMap(kKe).map(s=>`\`${s}\``).join(", ")||"none"}) appears in the cited evidence${n.citations.length?` (${n.citations.map(s=>`\`${s}\``).join(", ")})`:""}.`),o.push("- **Convergence.** Applying the plan twice was tested, and gives the same result as applying it once."),o.push("- **Line preservation.** No operation splits or joins a line."),o.push(`- **Assurance.** ${_Ke(e.assurance)}`),o.push(""),o.push(`${i(1)} Coverage`),o.push(""),o.push(e.residual===0?`All ${e.covered} call site${e.covered===1?"":"s"} are resolved deterministically. No agent is asked about this finding.`:`${e.covered} of ${e.covered+e.residual} call sites are resolved deterministically. The remaining ${e.residual} ${e.residual===1?"is":"are"} listed below and ${e.residual===1?"is":"are"} handed to an agent individually \u2014 the plan is not abandoned because of them.`),o.push(""),t.sites!==!1&&e.sites.length>0&&(o.push(wKe(e.sites)),o.push("")),o.push(zle(n)),o.join(` +`)}function Ble(e){if(e.verdict==="rejected")return`Fix plan rejected: ${e.rejections[0]??"it did not pass validation"}`;let t=e.plan.ops.length,n=e.covered+e.residual;return`${t} deterministic rule${t===1?"":"s"} covering ${e.covered}/${n} call site${n===1?"":"s"} (${e.assurance})`}function wKe(e){let t=["| Site | Change |","| --- | --- |"];for(let n of e){let r=`\`${n.file}:${n.line}\``;n.status==="covered"?t.push(`| ${r} | \`${Gle(n.before)}\` \u2192 \`${Gle(n.after??"")}\` |`):t.push(`| ${r} | _Not covered_ \u2014 ${n.reason??"no rule matched."} |`)}return t.join(` +`)}function kKe(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return[e.to];default:return[]}}function Gle(e){let t=e.trim();return t.length<=90?t:`${t.slice(0,87)}\u2026`}var $Ke={high:"\u{1F7E2} high",medium:"\u{1F7E1} medium",low:"\u{1F7E0} low"},SKe={none:"\u26AA none",low:"\u{1F7E2} low",medium:"\u{1F7E1} medium",high:"\u{1F534} high"};function Km(e,t){let n=[];return n.push(xKe(e)),n.push(qle(e)),e.blockers.length>0&&n.push(Wle(e)),e.warnings.length>0&&n.push(Hle(e)),n.push(Kle(e)),n.push(EB(e)),n.push(Jle(e)),n.push(PKe(e)),n.push(wB(e.gaps)),n.push(kB(e)),n.push(Zle(e)),n.push(CKe(e,t)),n.push(Yle(e)),n.filter(Boolean).join(` + +`)}function Vle(e,t){let n=[];return n.push("## Drift found breaking changes that need your call"),n.push(e.blockers.length>0?"Drift analysed this dependency change and prepared a fix, then stopped. The reasons are listed below.":"Drift analysed this dependency change and prepared a fix. This repository runs in `approve` mode, so nothing has been changed yet."),n.push(qle(e)),e.blockers.length>0&&n.push(Wle(e)),e.warnings.length>0&&n.push(Hle(e)),n.push(Kle(e)),n.push(EB(e)),n.push(Jle(e)),n.push(wB(e.gaps)),n.push(kB(e)),n.push(Zle(e)),n.push(["## To proceed","","Comment `/drift apply` on this issue and Drift will create the branch and","hand the plan to GitHub Copilot, one commit at a time. You will get a pull","request to review \u2014 nothing merges automatically.","","Comment `/drift dismiss` to close this out.","","To stop being asked for changes like this, adjust `.github/drift.yml` \u2014 see the [configuration reference](https://github.com/trydrift/drift/blob/main/docs/configuration.md)."].join(` +`)),n.push(Yle(e)),n.filter(Boolean).join(` + +`)}function xKe(e){let t=new Set(e.changes.map(r=>r.workspace).filter(r=>r!==void 0));return["## Drift: dependency compatibility fix","",`${e.changes.map(r=>{let i=t.size>1?x$(r):null,o=r.kind==="runtime"?null:$v[r.kind],s=[r.ecosystem,o].filter(Boolean).join(", ");return`\`${r.name}\` _(${s})_ ${r.from??"\u2014"} \u2192 **${r.to??"\u2014"}**${i?` _(in ${i})_`:""}`}).join(", ")}`,"",e.commits.length>0?`Drift found **${e.breakingChanges.length} breaking change(s)** affecting **${new Set(e.impactSites.map(r=>r.file)).size} file(s)** in this repository, and planned **${e.commits.length} commit(s)** to fix them.`:qm(e)].join(` +`)}function qle(e){let t=new Set(e.impactSites.map(n=>n.file)).size;return["| | |","|---|---|",`| **Risk** | ${SKe[e.risk]??e.risk} |`,`| **Breaking changes** | ${e.upstreamBreakingCount??e.breakingChanges.length} |`,`| **Impact sites** | ${e.impactSites.length} across ${t} file(s) |`,`| **Planned commits** | ${e.commits.length} |`,`| **Evidence sources** | ${EKe(e.evidence)} |`,`| **Base branch** | \`${e.baseBranch}\` |`].join(` +`)}function EKe(e){let t=new Map;for(let n of e)t.set(n.source,(t.get(n.source)??0)+1);return t.size===0?"none":[...t.entries()].map(([n,r])=>`${n} (${r})`).join(", ")}function Wle(e){return["## \u26D4 Why Drift stopped","","Drift did not dispatch this automatically. Each reason below is a guardrail","from `.github/drift.yml`:","",...e.blockers.map(t=>`- ${t}`)].join(` +`)}function Hle(e){return["## \u26A0\uFE0F Worth checking","",...e.warnings.map(t=>`- ${t}`)].join(` +`)}function Kle(e){if(e.breakingChanges.length===0)return["## Breaking changes","","None identified from the available evidence."].join(` +`);let t=new Map(e.evidence.map(r=>[r.id,r])),n=["## Breaking changes",""];for(let r of e.breakingChanges){let i=e.impactSites.filter(a=>a.breakingChangeId===r.id).length,o=vB(r);n.push(`### ${wA(r).text} \xB7 \`${r.dependency}\` \xB7 ${r.kind}`),n.push(""),n.push(r.summary),n.push(""),r.before&&r.after&&r.before!==r.after&&n.push("```diff",`- ${zB(r.before,300)}`,`+ ${zB(r.after,300)}`,"```",""),n.push(`**Verdict:** ${rle(o,r.assessment)}.`),n.push(""),n.push(sle(r)),n.push(""),r.assessment&&(n.push(ole(r.assessment)),n.push(""),n.push(ale(r.assessment)),n.push("")),r.symbols.length>0&&(n.push(`**Symbols:** ${r.symbols.map(a=>`\`${a}\``).join(", ")}`),n.push("")),n.push(i>0?`**Found in this repo:** ${i} location(s)`:r.assessment?.localImpact.penalties.some(a=>a.code==="localization-unavailable")?"**Found in this repo:** not searched \u2014 no checkout was available. This is not evidence the change is unused.":"**Found in this repo:** no usages found in the files that import this dependency \u2014 no fix planned"),n.push(""),n.push(...TKe(r.remediation)),n.push("");let s=r.citations.map(a=>t.get(a)).filter(a=>a!==void 0);if(s.length>0){n.push("**Evidence:**");for(let a of s)n.push(`- ${Qle(a)}`);n.push("")}}return n.join(` +`).trim()}function TKe(e){let t=AKe(e);return t.length===1?[`**Fix:** ${t[0]}`]:["**Fix:**","",...t]}function AKe(e){let t=[],n=[],r=()=>{let i=n.join(" ").trim();n.length=0,i&&t.push(i)};for(let i of e.split(/\r?\n/)){let o=i.trim(),s=/^(before|after):(.*)$/i.exec(o);if(s){r(),t.push(`**${RKe(s[1])}:**`,"",IKe(s[2].trimStart()),"");continue}if(!o){r();continue}n.push(o)}return r(),t.filter((i,o,s)=>i||s[o-1]&&s[o+1])}function IKe(e){let t=e.match(/`+/g)?.reduce((r,i)=>Math.max(r,i.length),2)??2,n="`".repeat(t+1);return[n,e,n].join(` +`)}function RKe(e){return e&&`${e[0].toUpperCase()}${e.slice(1).toLowerCase()}`}function Jle(e){if(e.commits.length===0)return["## Commit plan","",`No commits planned. ${qm(e)}`].join(` +`);let t=["## Commit plan","","Each commit addresses one concern. The graph below records only necessary","dependencies; commits in the same execution layer have disjoint file scope and","may run in parallel.",""];for(let n of e.commits){if(t.push(`**${n.order}. \`${n.message}\`**`),t.push(""),t.push(`Unit: \`${n.id}\``),t.push(`Layer: ${n.executionLayer}`),n.dependsOn.length>0&&(t.push(`Depends on: ${n.dependsOn.map(r=>`\`${r}\``).join(", ")}`),t.push(`Why: ${n.dependencyReasons.map(r=>`${r.reason}${r.evidence.length?` (${r.evidence.slice(0,3).join("; ")})`:""}`).join("; ")}`)),t.push(`Files: ${n.allowedFiles.map(r=>`\`${r}\``).join(", ")}`),(n.allowedSymbols??[]).length>0&&t.push(`Symbols: ${n.allowedSymbols.map(r=>`\`${r}\``).join(", ")}`),n.expectedChecks.length>0&&t.push(`Expected checks: ${n.expectedChecks.map(r=>r.kind).join(", ")}`),n.codemod?.length){let r=n.codemod.map(i=>`\`${i.from}\` \u2192 \`${i.to}\``).join(", ");t.push(`**Resolved deterministically** by Drift's codemod engine (${r}) \u2014 no model call was needed for this commit.`)}else if(n.fixPlan){let{plan:r,covered:i,residual:o,assurance:s}=n.fixPlan,a=i+o;t.push(`**Deterministic fix plan** \`${r.id}\` \u2014 ${r.migration} ${r.ops.length} rule${r.ops.length===1?"":"s"}, ${i}/${a} call site${a===1?"":"s"} covered, assurance \`${s}\`.`);for(let c of r.ops)t.push(` - ${jB(c)}`);if(o>0&&t.push(` - ${o} call site${o===1?"":"s"} not covered by the plan; an agent handles ${o===1?"it":"them"} individually.`),n.recipe?.length){let c=[...new Map(n.recipe.map(l=>[`${l.provider}:${l.name}@${l.version}`,l])).values()];t.push(` - Consulted: ${c.map(l=>`[\`${l.name}@${l.version}\`](${l.source}) from ${l.publisher}`).join(", ")}`)}}else if(n.recipe?.length){let r=[...new Map(n.recipe.map(o=>[`${o.provider}:${o.name}@${o.version}`,o])).values()],i=r.map(o=>`[\`${o.name}@${o.version}\`](${o.source}) from ${o.publisher} (${o.provider})`).join(", ");t.push(`**Community recipe consulted**: ${i} \u2014 ${r[0].migration} Drift could not re-derive its edits as deterministic operations, so this commit goes to an agent.`)}t.push("")}return t.join(` +`).trim()}function PKe(e){if(e.impactSites.length===0)return"";let t=new Map;for(let r of e.impactSites){let i=t.get(r.file);i?i.push(r):t.set(r.file,[r])}let n=["
",`All ${e.impactSites.length} impact site(s)`,""];for(let[r,i]of[...t.entries()].sort()){let o=i.every(s=>s.siteKind==="manifest");n.push(`**\`${r}\`**${o?" \u2014 the declaration, not a call site":""}`),n.push("");for(let s of i.slice(0,25)){let a=s.enclosingSymbol?` (in \`${s.enclosingSymbol}\`)`:"";n.push(`- L${s.line}${a} \u2014 \`${s.excerpt}\` \xB7 ${$Ke[s.confidence]}`)}i.length>25&&n.push(`- \u2026and ${i.length-25} more in this file`),n.push("")}return n.push("
"),n.join(` +`)}function Zle(e){if(e.evidence.length===0)return"";let t=["
",`Evidence Drift used (${e.evidence.length} source(s))`,"","Every finding above traces back to one of these. Open them to check the work.",""];for(let n of e.evidence)t.push(`#### ${Qle(n)}`),t.push(""),t.push(`\`${n.source}\` \xB7 ${ile(n.weight)} (weight ${n.weight.toFixed(2)})`),t.push(""),t.push("```"),t.push(zB(n.content,2e3)),t.push("```"),t.push("");return t.push("
"),t.join(` +`)}function CKe(e,t){let n=["Every edit corresponds to a breaking change listed above \u2014 no unrelated refactoring crept in","The fixes match what the cited evidence actually says","CI passes on this branch"];return e.impactSites.some(r=>r.file.includes("test"))&&n.push("Test changes update assertions to the new API rather than weakening them"),e.breakingChanges.some(r=>r.kind==="behaviour-change"||r.kind==="default-change")&&n.push("Behaviour changes were handled deliberately \u2014 these compile either way, so the type checker will not catch a wrong choice"),e.breakingChanges.some(r=>r.confidence==="low")&&n.push("Low-confidence findings were verified against the upstream source before accepting"),["## Review checklist","",...n.map(r=>`- [ ] ${r}`)].join(` +`)}function Yle(e){return["---","",lle({schemaVersion:jm,planId:e.id,planDigest:eA(e),headSha:e.headSha,baseBranch:e.baseBranch}),"",`Generated by [Drift](https://github.com/trydrift/drift) \xB7 plan \`${e.id}\` \xB7 ${e.createdAt}
`,"Drift reads dependency changes, proves which ones break your code, and drives","GitHub Copilot to fix them. It never merges anything.
"].join(` +`)}function Qle(e){let t=e.title;return e.url?`[${t}](${e.url})`:e.locator?`${t} (\`${e.locator}\`)`:t}function zB(e,t){return e.length<=t?e:`${e.slice(0,t)} +\u2026(truncated)`}function PA(e){if(e.commits.length===0)return`${qm(e)} (${e.changes.length} dependency change(s) checked)`;let t=new Set(e.impactSites.map(n=>n.file)).size;return`${e.breakingChanges.length} breaking change(s), ${t} file(s) affected, ${e.commits.length} commit(s) planned (risk: ${e.risk})`}var Jm=require("node:fs/promises"),Ev=require("node:path");function Xle(e){return e.codemod?"builtin":e.fixPlan?"fix-plan":"ai"}function GB(e,t){let n=new Set(t.map(i=>i.id)),r=new Set(t.flatMap(i=>i.breakingChangeIds));return{...e,commits:e.commits.filter(i=>n.has(i.id)),breakingChanges:e.breakingChanges.filter(i=>r.has(i.id))}}function CA(e,t){let n=new Map(t);for(let s of e.codemod??[])for(let a of s.files){let c=n.get(a);c!==void 0&&n.set(a,Hse(c,s,a))}let r=[];for(let[s,a]of t){let c=n.get(s);c!==void 0&&c!==a&&r.push({path:s,content:c})}if(r.length===0)return{status:"no-changes",edits:[],message:"The deterministic fix produced no changes here \u2014 likely already applied by an earlier commit."};let i=new Set(r.map(s=>s.path)).size,o=e.codemod?.length??0;return{status:"applied",edits:r,message:`Applied ${o} deterministic rename${o===1?"":"s"} across ${i} file${i===1?"":"s"} \u2014 no agent call was made.`}}function NA(e,t){let n=e.fixPlan;if(!n)return{status:"no-changes",edits:[],message:"This commit has no fix plan."};let r=new Map(t);for(let a of n.files){let c=r.get(a);c!==void 0&&r.set(a,iae(c,n.plan.ops,n.anchors,a))}let i=[];for(let[a,c]of t){let l=r.get(a);l!==void 0&&l!==c&&i.push({path:a,content:l})}if(i.length===0)return{status:"no-changes",edits:[],message:"The fix plan produced no changes here \u2014 likely already applied by an earlier commit."};let o=new Set(i.map(a=>a.path)).size,s=Ble({plan:n.plan,verdict:n.residual===0?"accepted":"partial",assurance:n.assurance,sites:[],covered:n.covered,residual:n.residual,rejections:[],anchors:n.anchors});return{status:"applied",edits:i,message:`Applied fix plan \`${n.plan.id}\` \u2014 ${s} \u2014 across ${o} file${o===1?"":"s"}.`+(n.residual>0?` ${n.residual} call site${n.residual===1?"":"s"} remain${n.residual===1?"s":""} for an agent.`:" No agent call was made.")}}function OA(e,t,n={}){let{fixPlans:r}=t.remediation;if(e.verdict==="rejected")return{action:"skip",reason:e.rejections[0]??"The plan did not pass validation."};let i=e.covered+e.residual,o=i===0?0:e.covered/i;return ou.to),r=i.map(u=>u.name),o=i.map(u=>`${u.name} from ${u.from??"its previous version"} to ${u.to}`),s=n.id!==Bx,a=[`The dependenc${i.length===1?"y":"ies"} ${o.join(", ")||"in this repository"} ${i.length===1?"has":"have"} been upgraded.`,"","Update this repository so that it works correctly with the new version.",""];if(s){let u=t.breakingChanges.filter(p=>n.breakingChangeIds.includes(p.id)),d=t.impactSites.filter(p=>n.breakingChangeIds.includes(p.breakingChangeId));a.push("Fix only this problem, which the developer chose to fix on its own:","",...u.map(p=>`- ${p.summary}`),...d.slice(0,20).map(p=>` at ${p.file}:${p.line}`),"","Leave any other breakage for its own fix, and change another file only where","this fix needs it.","")}else a.push("Find and fix all relevant incompatibilities.","");let c=[...e.protectedPaths??[]];a.push(`Do not revert or downgrade ${r.length===1?"the dependency":"the dependencies"}. A companion package the new version requires may move with it.`,"","Run the appropriate tests/build/typecheck and leave the repository in a working state.","","Do not make a check pass by checking less: no lowered coverage thresholds, relaxed","compiler strictness, disabled lint rules, skipped or deleted tests, or suppression","directives."+(c.length?` Do not edit ${c.join(", ")}.`:""),"Drift reverts any file that breaks these rules.");let l=[a.join(` +${m.message}`)?(a.add(c.id),o.info(`Resolved commit ${c.order} directly (builtin): ${m.message}`)):await xv(t.workspace,c.files,s);continue}let u=c.fixPlan,d=OA({plan:u.plan,verdict:u.residual===0?"accepted":"partial",assurance:u.assurance,sites:[],covered:u.covered,residual:u.residual,rejections:[],anchors:u.anchors},r,{verificationPassed:n.verification?.status==="passed"});if(d.action!=="apply"){o.info(`Commit ${c.order} has a validated fix plan that will not be applied unattended: ${d.reason} The plan document is included for review.`);continue}let p=await OKe(t.workspace,c);if(!p){await xv(t.workspace,c.files,s);continue}await i.commitFiles(t,n.branchName,p.edits,[`${c.message}`,"",c.body,"",p.message,"",Sv({plan:u.plan,verdict:u.residual===0?"accepted":"partial",assurance:u.assurance,sites:[],covered:u.covered,residual:u.residual,rejections:[],anchors:u.anchors},{sites:!1,headingLevel:2})].join(` +`))?(a.add(c.id),o.info(`Resolved commit ${c.order} directly (fix plan): ${p.message}`)):await xv(t.workspace,c.files,s)}catch(u){o.warn(`Deterministic remediation failed for commit ${c.order}, falling back to an agent: ${u.message}`),await xv(t.workspace,c.files,s)}}return{committedIds:a}}async function NKe(e,t){let n=new Map;for(let i of t.files)try{n.set(i,await(0,Jm.readFile)((0,Ev.join)(e,i),"utf8"))}catch{}let r=CA(t,n);if(r.status!=="applied")return null;for(let i of r.edits)await(0,Jm.writeFile)((0,Ev.join)(e,i.path),i.content,"utf8");return{edits:r.edits,message:r.message}}async function OKe(e,t){let n=new Map;for(let i of t.fixPlan?.files??[])try{n.set(i,await(0,Jm.readFile)((0,Ev.join)(e,i),"utf8"))}catch{}let r=NA(t,n);if(r.status!=="applied")return null;for(let i of r.edits)await(0,Jm.writeFile)((0,Ev.join)(e,i.path),i.content,"utf8");return{edits:r.edits,message:r.message}}async function xv(e,t,n){t.length!==0&&await n("git",["checkout","--",...t],{cwd:e})}var Qm=require("node:fs/promises"),vue=require("node:crypto"),_ue=require("node:os"),Xs=require("node:path");var DA="upgrade";function DKe(e){return{plan:e.plan,commit:e.commit,files:e.files,customInstructions:e.customInstructions,context:e.context,diagnostics:e.diagnostics,revision:e.revision,repair:e.repair,mode:e.mode,protectedPaths:e.protectedPaths}}function nue(e,t=""){let n=e.mode==="upgrade"?[]:["","## Your task","",e.commit.instructions];return[MKe(e),...n,...t?["",t]:[]].join(` +`)}function MKe(e){return LKe(DKe(e))}function BB(e){let{plan:t,commit:n}=e,r=t.changes.filter(u=>u.to),i=r.map(u=>u.name),o=r.map(u=>`${u.name} from ${u.from??"its previous version"} to ${u.to}`),s=n.id!==DA,a=[`The dependenc${r.length===1?"y":"ies"} ${o.join(", ")||"in this repository"} ${r.length===1?"has":"have"} been upgraded.`,"","Update this repository so that it works correctly with the new version.",""];if(s){let u=t.breakingChanges.filter(p=>n.breakingChangeIds.includes(p.id)),d=t.impactSites.filter(p=>n.breakingChangeIds.includes(p.breakingChangeId));a.push("Fix only this problem, which the developer chose to fix on its own:","",...u.map(p=>`- ${p.summary}`),...d.slice(0,20).map(p=>` at ${p.file}:${p.line}`),"","Leave any other breakage for its own fix, and change another file only where","this fix needs it.","")}else a.push("Find and fix all relevant incompatibilities.","");let c=[...e.protectedPaths??[]];a.push(`Do not revert or downgrade ${i.length===1?"the dependency":"the dependencies"}. A companion package the new version requires may move with it.`,"","Run the appropriate tests/build/typecheck and leave the repository in a working state.","","Do not make a check pass by checking less: no lowered coverage thresholds, relaxed","compiler strictness, disabled lint rules, skipped or deleted tests, or suppression","directives."+(c.length?` Do not edit ${c.join(", ")}.`:""),"Drift reverts any file that breaks these rules.");let l=[a.join(` `)];if(e.customInstructions?.trim()&&l.push(`## Repository conventions ${e.customInstructions.trim()}`),e.context?.length){let u=["## Context the developer attached","","Reference material. Read it to match this codebase, but do NOT edit any of it.",""];for(let d of e.context)u.push(`### ${d.kind}: ${d.value}`),d.content&&u.push("```",d.content.slice(0,4e3),"```"),u.push("");l.push(u.join(` `))}return e.revision?.guidance.trim()&&l.push(["## The developer rejected your previous attempt","",`This is attempt ${e.revision.attempt}. What they said:`,"","```",e.revision.guidance.trim().slice(0,4e3),"```"].join(` `)),l.join(` -`)}function hVe(e){if(e.mode==="upgrade")return kU(e);let{plan:t,commit:n}=e,i=new Map(t.evidence.map(s=>[s.id,s])),r=t.breakingChanges.filter(s=>n.breakingChangeIds.includes(s.id)),o=[];o.push(["You are fixing code that a dependency upgrade broke.","","The dependency versions have ALREADY been updated. Your job is to update","this repository's own code so it works with the new version.","",`Dependencies that moved: ${t.changes.map(s=>`${s.name} ${s.from??"\u2014"} \u2192 ${s.to??"\u2014"}`).join(", ")}`].join(` -`));for(let s of r){let a=[`## ${s.summary}`,""];a.push(`- Package: ${s.dependency}`),a.push(`- Kind: ${s.kind}`),a.push(`- Confidence: ${s.confidence}`),s.symbols.length&&a.push(`- Symbols: ${s.symbols.join(", ")}`),a.push(""),a.push(`**Required fix:** ${s.remediation}`),a.push("");for(let l of s.citations){let u=i.get(l);u&&(a.push(`Evidence \u2014 ${u.title}:`),a.push("```"),a.push(u.content.slice(0,1200)),a.push("```"),u.url&&a.push(`Source: ${u.url}`),a.push(""))}let c=t.impactSites.filter(l=>l.breakingChangeId===s.id);if(c.length){a.push("Known locations (verify each; there may be others):");for(let l of c.slice(0,30)){let u=l.enclosingSymbol?` in ${l.enclosingSymbol}`:"";a.push(`- ${l.file}:${l.line}${u} \u2014 ${l.excerpt}`)}a.push("")}o.push(a.join(` +`)}function LKe(e){if(e.mode==="upgrade")return BB(e);let{plan:t,commit:n}=e,r=new Map(t.evidence.map(s=>[s.id,s])),i=t.breakingChanges.filter(s=>n.breakingChangeIds.includes(s.id)),o=[];o.push(["You are fixing code that a dependency upgrade broke.","","The dependency versions have ALREADY been updated. Your job is to update","this repository's own code so it works with the new version.","",`Dependencies that moved: ${t.changes.map(s=>`${s.name} ${s.from??"\u2014"} \u2192 ${s.to??"\u2014"}`).join(", ")}`].join(` +`));for(let s of i){let a=[`## ${s.summary}`,""];a.push(`- Package: ${s.dependency}`),a.push(`- Kind: ${s.kind}`),a.push(`- Confidence: ${s.confidence}`),s.symbols.length&&a.push(`- Symbols: ${s.symbols.join(", ")}`),a.push(""),a.push(`**Required fix:** ${s.remediation}`),a.push("");for(let l of s.citations){let u=r.get(l);u&&(a.push(`Evidence \u2014 ${u.title}:`),a.push("```"),a.push(u.content.slice(0,1200)),a.push("```"),u.url&&a.push(`Source: ${u.url}`),a.push(""))}let c=t.impactSites.filter(l=>l.breakingChangeId===s.id);if(c.length){a.push("Known locations (verify each; there may be others):");for(let l of c.slice(0,30)){let u=l.enclosingSymbol?` in ${l.enclosingSymbol}`:"";a.push(`- ${l.file}:${l.line}${u} \u2014 ${l.excerpt}`)}a.push("")}o.push(a.join(` `))}if(e.diagnostics?.trim()&&o.push(["## What the project's own checks report right now","","These ran against the tree you are about to edit, after the dependency","versions moved. Unlike everything above, this is measured rather than","predicted \u2014 where it disagrees with the analysis, believe this.","","Diagnostics are grouped by root cause with a count. A problem reported","many times is one problem: find what it shares before editing any","individual site, and do not work through occurrences one by one.","","Some of these may have nothing to do with the upgrade. Fixing unrelated","pre-existing errors is out of scope \u2014 leave them alone.","",e.diagnostics.trim()].join(` -`)),o.push(["## Rules","",`0. You may edit ONLY these ${e.files.length} file${e.files.length===1?"":"s"}, whose current contents`," accompany this prompt \u2014 nothing else, including generated/bundled output,"," lockfiles, or a file you notice is *also* broken by this upgrade. This"," is enforced after you finish: an edit to any other file throws out"," this whole commit's work. If the real fix needs a file outside this"," list, say so and stop rather than making the edit.",` In scope: ${e.files.map(s=>s.path).join(", ")}`,"1. Change ONLY what is required for this specific fix. No refactoring,"," renaming, reformatting, or tidying of code you happen to pass by.","2. Do NOT change dependency versions in any manifest or lockfile.","3. Do NOT weaken, skip, or delete tests to make them pass. Update a test"," to exercise the new API while asserting the same behaviour.","4. If you cannot determine the correct fix for a location, leave it alone"," and add a `TODO(drift):` comment explaining what is unresolved. A"," flagged unknown is useful; a confident guess is not.","5. Do not invent APIs. If the evidence names no replacement, say so.","6. If a decision genuinely needs the developer \u2014 two valid migrations, a"," behaviour change only they can rule on \u2014 ask instead of guessing. Emit",` \`${yVe} |