@sourcegraph/amp 0.0.1761436902-g59a6f7 → 0.0.1761458743-ge8ce60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +28 -34
  2. package/dist/main.js +9 -9
  3. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env -S node --no-warnings
2
2
  import{createRequire as vF6}from"node:module";var PF6=Object.create;var{getPrototypeOf:TF6,defineProperty:GS,getOwnPropertyNames:qp1,getOwnPropertyDescriptor:CF6}=Object,zp1=Object.prototype.hasOwnProperty;var C6=(J,Q,Z)=>{Z=J!=null?PF6(TF6(J)):{};let X=Q||!J||!J.__esModule?GS(Z,"default",{value:J,enumerable:!0}):Z;for(let Y of qp1(J))if(!zp1.call(X,Y))GS(X,Y,{get:()=>J[Y],enumerable:!0});return X},Gp1=new WeakMap,SF6=(J)=>{var Q=Gp1.get(J),Z;if(Q)return Q;if(Q=GS({},"__esModule",{value:!0}),J&&typeof J==="object"||typeof J==="function")qp1(J).map((X)=>!zp1.call(Q,X)&&GS(Q,X,{get:()=>J[X],enumerable:!(Z=CF6(J,X))||Z.enumerable}));return Gp1.set(J,Q),Q},a=(J,Q)=>()=>(Q||J((Q={exports:{}}).exports,Q),Q.exports);var R6=(J,Q)=>{for(var Z in Q)GS(J,Z,{get:Q[Z],enumerable:!0,configurable:!0,set:(X)=>Q[Z]=()=>X})};var B1=(J,Q)=>()=>(J&&(Q=J(J=0)),Q);var n1=vF6(import.meta.url);function Up1(){if(typeof process==="object")return process.platform==="win32"?"windows":"posix";else if(typeof navigator==="object")return navigator.userAgent.indexOf("Windows")>=0?"windows":"posix";return"posix"}function Wp1(J,Q){if(!J.scheme&&Q)throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${J.authority}", path: "${J.path}", query: "${J.query}", fragment: "${J.fragment}"}`);if(J.scheme&&!kF6.test(J.scheme))throw Error("[UriError]: Scheme contains illegal characters.");if(J.path){if(J.authority){if(!_F6.test(J.path))throw Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(xF6.test(J.path))throw Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function bF6(J,Q){if(!J&&!Q)return"file";return J}function yF6(J,Q){switch(J){case"https":case"http":case"file":if(!Q)Q=XG;else if(Q[0]!==XG)Q=XG+Q;break}return Q}class w0{static isUri(J){if(J instanceof w0)return!0;if(!J)return!1;let Q=J;return typeof Q.authority==="string"&&typeof Q.fragment==="string"&&typeof Q.path==="string"&&typeof Q.query==="string"&&typeof Q.scheme==="string"&&typeof Q.fsPath==="string"&&typeof Q.with==="function"&&typeof Q.toString==="function"}scheme;authority;path;query;fragment;platform;constructor(J,Q,Z,X,Y,K=!1,G){if(typeof J==="object")this.scheme=J.scheme||p2,this.authority=J.authority||p2,this.path=J.path||p2,this.query=J.query||p2,this.fragment=J.fragment||p2,this.platform=J.platform;else this.scheme=bF6(J,K),this.authority=Q||p2,this.path=yF6(this.scheme,Z||p2),this.query=X||p2,this.fragment=Y||p2,this.platform=G,Wp1(this,K)}get fsPath(){return Mp1(this,!1)}with(J){if(!J)return this;let{scheme:Q,authority:Z,path:X,query:Y,fragment:K,platform:G}=J;if(Q===void 0)Q=this.scheme;else if(Q===null)Q=p2;if(Z===void 0)Z=this.authority;else if(Z===null)Z=p2;if(X===void 0)X=this.path;else if(X===null)X=p2;if(Y===void 0)Y=this.query;else if(Y===null)Y=p2;if(K===void 0)K=this.fragment;else if(K===null)K=p2;if(G===void 0)G=this.platform;else if(G===null)G=void 0;if(Q===this.scheme&&Z===this.authority&&X===this.path&&Y===this.query&&K===this.fragment&&G===this.platform)return this;return new IN(Q,Z,X,Y,K,!1,G)}static parse(J,Q=!1){let Z=fF6.exec(J);if(!Z)return new IN(p2,p2,p2,p2,p2);return new IN(Z[2]||p2,jd(Z[4]||p2),jd(Z[5]||p2),jd(Z[7]||p2),jd(Z[9]||p2),Q)}static file(J,Q=Up1()){let Z=p2;if(Q==="windows")J=J.replace(/\\/g,XG);if(J[0]===XG&&J[1]===XG){let X=J.indexOf(XG,2);if(X===-1)Z=J.substring(2),J=XG;else Z=J.substring(2,X),J=J.substring(X)||XG}return new IN("file",Z,J,p2,p2,!1,Q)}static from(J){let Q=new IN(J.scheme,J.authority,J.path,J.query,J.fragment,!0,J.platform);return Wp1(Q,!0),Q}toString(J=!1){return pQ1(this,J)}toJSON(){return this}static revive(J){if(!J)return J;if(J instanceof w0)return J;let Q=new IN(J),Z=J;return Q._formatted=Z.external,Q._fsPath=Z._sep===Bp1(Q.platform)?Z.fsPath:null,Q}}function Bp1(J){return J==="windows"?1:void 0}function Fp1(J,Q,Z){let X=void 0;for(let Y=0;Y<J.length;Y++){let K=J.charCodeAt(Y);if(K>=97&&K<=122||K>=65&&K<=90||K>=48&&K<=57||K===45||K===46||K===95||K===126||Q&&K===47||Z&&K===91||Z&&K===93||Z&&K===58){if(X!==void 0)X+=J.charAt(Y)}else{if(X===void 0)X=J.substring(0,Y);let G=Dp1[K];if(G!==void 0)X+=G;else X+=encodeURIComponent(J.charAt(Y))}}return X!==void 0?X:J}function hF6(J){let Q=void 0;for(let Z=0;Z<J.length;Z++){let X=J.charCodeAt(Z);if(X===35||X===63){if(Q===void 0)Q=J.substring(0,Z);Q+=Dp1[X]}else if(Q!==void 0)Q+=J[Z]}return Q!==void 0?Q:J}function Mp1(J,Q){let Z;if(J.authority&&J.path.length>1&&J.scheme==="file")Z=`//${J.authority}${J.path}`;else if(J.path.charCodeAt(0)===47&&(J.path.charCodeAt(1)>=65&&J.path.charCodeAt(1)<=90||J.path.charCodeAt(1)>=97&&J.path.charCodeAt(1)<=122)&&J.path.charCodeAt(2)===58)if(!Q)Z=J.path[1].toLowerCase()+J.path.substring(2);else Z=J.path.substring(1);else Z=J.path;if(J.platform==="windows")Z=Z.replace(/\//g,"\\");return Z}function pQ1(J,Q){let Z=!Q?Fp1:hF6,X="",{scheme:Y,authority:K,path:G,query:q,fragment:z}=J;if(Y)X+=Y,X+=":";if(K||Y==="file")X+=XG,X+=XG;if(K){let U=K.indexOf("@");if(U!==-1){let W=K.substring(0,U);if(K=K.substring(U+1),U=W.lastIndexOf(":"),U===-1)X+=Z(W,!1,!1);else X+=Z(W.substring(0,U),!1,!1),X+=":",X+=Z(W.substring(U+1),!1,!0);X+="@"}if(K=K.toLowerCase(),U=K.lastIndexOf(":"),U===-1)X+=Z(K,!1,!0);else X+=Z(K.substring(0,U),!1,!0),X+=K.substring(U)}if(G){if(G.length>=3&&G.charCodeAt(0)===47&&G.charCodeAt(2)===58){let U=G.charCodeAt(1);if(U>=65&&U<=90)G=`/${String.fromCharCode(U+32)}:${G.substring(3)}`}else if(G.length>=2&&G.charCodeAt(1)===58){let U=G.charCodeAt(0);if(U>=65&&U<=90)G=`${String.fromCharCode(U+32)}:${G.substring(2)}`}X+=Z(G,!0,!1)}if(q)X+="?",X+=Z(q,!1,!1);if(z)X+="#",X+=!Q?Fp1(z,!1,!1):z;return X}function Vp1(J){try{return decodeURIComponent(J)}catch{if(J.length>3)return J.substring(0,3)+Vp1(J.substring(3));else return J}}function jd(J){if(!J.match(Hp1))return J;return J.replace(Hp1,(Q)=>Vp1(Q))}function MB(J){return J.scheme==="file"}function NQ(J){return w0.parse(J)}function k6(J){return J.toString()}function D8(J){if(typeof J==="string"||J instanceof URL)return w0.parse(J.toString());return J}function qS(J){if(!URL.canParse(J))throw Error(`invalid URI string: ${JSON.stringify(J)}`);return J}var kF6,_F6,xF6,p2="",XG="/",fF6,IN,Dp1,Hp1;var zS=B1(()=>{kF6=/^\w[\w\d+.-]*$/,_F6=/^\//,xF6=/^\/\//;fF6=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;IN=class IN extends w0{_formatted=null;_fsPath=null;get fsPath(){if(!this._fsPath)this._fsPath=Mp1(this,!1);return this._fsPath}toString(J=!1){if(!J){if(!this._formatted)this._formatted=pQ1(this,!1);return this._formatted}return pQ1(this,!0)}toJSON(){let J={};if(this._fsPath)J.fsPath=this._fsPath,J._sep=Bp1(this.platform);if(this._formatted)J.external=this._formatted;if(J.scheme=this.scheme,J.authority=this.authority,J.path=this.path,J.query=this.query,J.fragment=this.fragment,this.platform)J.platform=this.platform;return J}};Dp1={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};Hp1=/(%[0-9A-Za-z][0-9A-Za-z])+/g});function dQ1(J){if(J==="/")return"/";if(J==="")return".";let Q=J.replace(/\/+$/,"");if(!Q)return".";let Z=Q.lastIndexOf("/");if(Z===-1)return".";if(Z===0)return"/";return Q.slice(0,Z)}function PN(J){let Q=J.replace(/\/+$/,"");if(!Q)return"";let Z=Q.lastIndexOf("/");return Z===-1?Q:Q.slice(Z+1)}function lR(...J){if(J.length===0)return".";let Q="";for(let G of J)if(G)if(Q)Q+="/"+G;else Q=G;if(!Q)return".";let Z=Q.endsWith("/"),X=Q.split("/").filter(Boolean),Y=[];for(let G of X)if(G===".."){if(Y.length>0&&Y[Y.length-1]!=="..")Y.pop();else if(!Q.startsWith("/"))Y.push("..")}else if(G!==".")Y.push(G);let K=Q.startsWith("/")?"/"+Y.join("/"):Y.join("/");if(!K)K=Q.startsWith("/")?"/":".";if(Z&&K!=="/"&&K!==".")K+="/";return K}function Np1(J,Q,Z="/",X="/",Y=!0){function K(F,H){return Y?F===H:F.toLowerCase()===H.toLowerCase()}if(Z==="/")J=J.replaceAll(/\/{2,}/g,"/"),Q=Q.replaceAll(/\/{2,}/g,"/");else J=J.replaceAll(/\\{2,}/g,"\\"),Q=Q.replaceAll(/\\{2,}/g,"\\");if(J!==Z&&J.endsWith(Z))J=J.slice(0,-1);if(Q!==Z&&Q.endsWith(Z))Q=Q.slice(0,-1);if(K(J,Q))return"";if(!J.startsWith(Z)&&Q.startsWith(Z))return Q;let G=J===Z?[""]:J.split(Z),q=Q===Z?[""]:Q.split(Z),z=0;while(z<G.length&&z<q.length&&K(G[z],q[z]))z++;let U=G.length-z,W=[];for(let F=0;F<U;F++)W.push("..");return W.push(...q.slice(z)),W.join(X)}function $d(J){let Q=PN(J.replace(/\/+$/,"")),Z=Q.lastIndexOf(".");if(Z===0||Z===-1)return"";return Q.slice(Z)}function LQ(J){if(J=D8(J),J.scheme==="file")return J.path;return J.toString()}var iR=B1(()=>{zS()});function gF6(J,...Q){return J=D8(J),J.with({path:lR(J.path,...Q)})}function mF6(J,...Q){let Z=J.path,X=!1;if(Z[0]!==Ed)Z=Ed+Z,X=!0;let Y=Z;for(let K of Q)if(K.startsWith("/"))Y=lR(K);else Y=lR(Y,K);if(Y!=="/"&&Y.endsWith("/"))Y=Y.replace(/\/+$/,"");if(X&&Y[0]===Ed&&!J.authority)Y=Y.substring(1);return J.with({path:Y})}function uF6(J){if(J=D8(J),J.path.length===0||J.path===Ed)return J;let Q=dQ1(J.path);if(Q.length===1&&Q===".")Q="";return J.with({path:Q})}function pF6(J,Q){if(Q.scheme!==J.scheme||(Q.authority??"")!==(J.authority??""))return!1;let Z=Q.scheme==="file"&&Q.path.match(/^\/[A-Za-z]:/),X=Z?Q.path.slice(0,2).toUpperCase()+Q.path.slice(2):Q.path,Y=Z?J.path.slice(0,2).toUpperCase()+J.path.slice(2):J.path;return Y===X||Y.startsWith(X.endsWith("/")?X:`${X}/`)||X.endsWith("/")&&Y===X.slice(0,-1)}function dF6(J,Q){if(J.scheme!==Q.scheme||J.authority!==Q.authority||J.query!==Q.query||J.fragment!==Q.fragment)return null;let Z=J.platform==="windows"?"\\":"/";return Np1(J.path,Q.path,Z,Z)}function cF6(J,Q){let Z=k6(J),X=k6(Q);if(Z.startsWith("file:///")&&X.startsWith("file:///"))return Lp1(Z)===Lp1(X);return Z===X}function Lp1(J){return J.replace(/^file:\/\/\/([A-Za-z]):/,(Q)=>`file:///${Q.toLowerCase()}:`)}var Ed="/",b0;var Id=B1(()=>{iR();zS();b0={joinPath:gF6,resolvePath:mF6,dirname:uF6,basename:(J)=>PN(D8(J).path),extname:(J)=>$d(D8(J).path),hasPrefix:pF6,relativePath:dF6,equalURIs:cF6}});var Rp1=a((Ap1)=>{Object.defineProperty(Ap1,"__esModule",{value:!0});Ap1._globalThis=void 0;Ap1._globalThis=typeof globalThis==="object"?globalThis:global});var Op1=a((TN)=>{var lF6=TN&&TN.__createBinding||(Object.create?function(J,Q,Z,X){if(X===void 0)X=Z;Object.defineProperty(J,X,{enumerable:!0,get:function(){return Q[Z]}})}:function(J,Q,Z,X){if(X===void 0)X=Z;J[X]=Q[Z]}),iF6=TN&&TN.__exportStar||function(J,Q){for(var Z in J)if(Z!=="default"&&!Object.prototype.hasOwnProperty.call(Q,Z))lF6(Q,J,Z)};Object.defineProperty(TN,"__esModule",{value:!0});iF6(Rp1(),TN)});var jp1=a((CN)=>{var nF6=CN&&CN.__createBinding||(Object.create?function(J,Q,Z,X){if(X===void 0)X=Z;Object.defineProperty(J,X,{enumerable:!0,get:function(){return Q[Z]}})}:function(J,Q,Z,X){if(X===void 0)X=Z;J[X]=Q[Z]}),aF6=CN&&CN.__exportStar||function(J,Q){for(var Z in J)if(Z!=="default"&&!Object.prototype.hasOwnProperty.call(Q,Z))nF6(Q,J,Z)};Object.defineProperty(CN,"__esModule",{value:!0});aF6(Op1(),CN)});var cQ1=a(($p1)=>{Object.defineProperty($p1,"__esModule",{value:!0});$p1.VERSION=void 0;$p1.VERSION="1.9.0"});var Sp1=a((Tp1)=>{Object.defineProperty(Tp1,"__esModule",{value:!0});Tp1.isCompatible=Tp1._makeCompatibilityCheck=void 0;var rF6=cQ1(),Ip1=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Pp1(J){let Q=new Set([J]),Z=new Set,X=J.match(Ip1);if(!X)return()=>!1;let Y={major:+X[1],minor:+X[2],patch:+X[3],prerelease:X[4]};if(Y.prerelease!=null)return function(z){return z===J};function K(q){return Z.add(q),!1}function G(q){return Q.add(q),!0}return function(z){if(Q.has(z))return!0;if(Z.has(z))return!1;let U=z.match(Ip1);if(!U)return K(z);let W={major:+U[1],minor:+U[2],patch:+U[3],prerelease:U[4]};if(W.prerelease!=null)return K(z);if(Y.major!==W.major)return K(z);if(Y.major===0){if(Y.minor===W.minor&&Y.patch<=W.patch)return G(z);return K(z)}if(Y.minor<=W.minor)return G(z);return K(z)}}Tp1._makeCompatibilityCheck=Pp1;Tp1.isCompatible=Pp1(rF6.VERSION)});var SN=a((vp1)=>{Object.defineProperty(vp1,"__esModule",{value:!0});vp1.unregisterGlobal=vp1.getGlobal=vp1.registerGlobal=void 0;var oF6=jp1(),nR=cQ1(),tF6=Sp1(),eF6=nR.VERSION.split(".")[0],US=Symbol.for(`opentelemetry.js.api.${eF6}`),WS=oF6._globalThis;function JH6(J,Q,Z,X=!1){var Y;let K=WS[US]=(Y=WS[US])!==null&&Y!==void 0?Y:{version:nR.VERSION};if(!X&&K[J]){let G=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${J}`);return Z.error(G.stack||G.message),!1}if(K.version!==nR.VERSION){let G=Error(`@opentelemetry/api: Registration of version v${K.version} for ${J} does not match previously registered API v${nR.VERSION}`);return Z.error(G.stack||G.message),!1}return K[J]=Q,Z.debug(`@opentelemetry/api: Registered a global for ${J} v${nR.VERSION}.`),!0}vp1.registerGlobal=JH6;function QH6(J){var Q,Z;let X=(Q=WS[US])===null||Q===void 0?void 0:Q.version;if(!X||!(0,tF6.isCompatible)(X))return;return(Z=WS[US])===null||Z===void 0?void 0:Z[J]}vp1.getGlobal=QH6;function ZH6(J,Q){Q.debug(`@opentelemetry/api: Unregistering a global for ${J} v${nR.VERSION}.`);let Z=WS[US];if(Z)delete Z[J]}vp1.unregisterGlobal=ZH6});var yp1=a((xp1)=>{Object.defineProperty(xp1,"__esModule",{value:!0});xp1.DiagComponentLogger=void 0;var KH6=SN();class _p1{constructor(J){this._namespace=J.namespace||"DiagComponentLogger"}debug(...J){return FS("debug",this._namespace,J)}error(...J){return FS("error",this._namespace,J)}info(...J){return FS("info",this._namespace,J)}warn(...J){return FS("warn",this._namespace,J)}verbose(...J){return FS("verbose",this._namespace,J)}}xp1.DiagComponentLogger=_p1;function FS(J,Q,Z){let X=(0,KH6.getGlobal)("diag");if(!X)return;return Z.unshift(Q),X[J](...Z)}});var Pd=a((fp1)=>{Object.defineProperty(fp1,"__esModule",{value:!0});fp1.DiagLogLevel=void 0;var GH6;(function(J){J[J.NONE=0]="NONE",J[J.ERROR=30]="ERROR",J[J.WARN=50]="WARN",J[J.INFO=60]="INFO",J[J.DEBUG=70]="DEBUG",J[J.VERBOSE=80]="VERBOSE",J[J.ALL=9999]="ALL"})(GH6=fp1.DiagLogLevel||(fp1.DiagLogLevel={}))});var mp1=a((hp1)=>{Object.defineProperty(hp1,"__esModule",{value:!0});hp1.createLogLevelDiagLogger=void 0;var HW=Pd();function qH6(J,Q){if(J<HW.DiagLogLevel.NONE)J=HW.DiagLogLevel.NONE;else if(J>HW.DiagLogLevel.ALL)J=HW.DiagLogLevel.ALL;Q=Q||{};function Z(X,Y){let K=Q[X];if(typeof K==="function"&&J>=Y)return K.bind(Q);return function(){}}return{error:Z("error",HW.DiagLogLevel.ERROR),warn:Z("warn",HW.DiagLogLevel.WARN),info:Z("info",HW.DiagLogLevel.INFO),debug:Z("debug",HW.DiagLogLevel.DEBUG),verbose:Z("verbose",HW.DiagLogLevel.VERBOSE)}}hp1.createLogLevelDiagLogger=qH6});var vN=a((pp1)=>{Object.defineProperty(pp1,"__esModule",{value:!0});pp1.DiagAPI=void 0;var zH6=yp1(),UH6=mp1(),up1=Pd(),Td=SN(),WH6="diag";class iQ1{constructor(){function J(X){return function(...Y){let K=(0,Td.getGlobal)("diag");if(!K)return;return K[X](...Y)}}let Q=this,Z=(X,Y={logLevel:up1.DiagLogLevel.INFO})=>{var K,G,q;if(X===Q){let W=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return Q.error((K=W.stack)!==null&&K!==void 0?K:W.message),!1}if(typeof Y==="number")Y={logLevel:Y};let z=(0,Td.getGlobal)("diag"),U=(0,UH6.createLogLevelDiagLogger)((G=Y.logLevel)!==null&&G!==void 0?G:up1.DiagLogLevel.INFO,X);if(z&&!Y.suppressOverrideMessage){let W=(q=Error().stack)!==null&&q!==void 0?q:"<failed to generate stacktrace>";z.warn(`Current logger will be overwritten from ${W}`),U.warn(`Current logger will overwrite one already registered from ${W}`)}return(0,Td.registerGlobal)("diag",U,Q,!0)};Q.setLogger=Z,Q.disable=()=>{(0,Td.unregisterGlobal)(WH6,Q)},Q.createComponentLogger=(X)=>{return new zH6.DiagComponentLogger(X)},Q.verbose=J("verbose"),Q.debug=J("debug"),Q.info=J("info"),Q.warn=J("warn"),Q.error=J("error")}static instance(){if(!this._instance)this._instance=new iQ1;return this._instance}}pp1.DiagAPI=iQ1});var ip1=a((cp1)=>{Object.defineProperty(cp1,"__esModule",{value:!0});cp1.BaggageImpl=void 0;class aR{constructor(J){this._entries=J?new Map(J):new Map}getEntry(J){let Q=this._entries.get(J);if(!Q)return;return Object.assign({},Q)}getAllEntries(){return Array.from(this._entries.entries()).map(([J,Q])=>[J,Q])}setEntry(J,Q){let Z=new aR(this._entries);return Z._entries.set(J,Q),Z}removeEntry(J){let Q=new aR(this._entries);return Q._entries.delete(J),Q}removeEntries(...J){let Q=new aR(this._entries);for(let Z of J)Q._entries.delete(Z);return Q}clear(){return new aR}}cp1.BaggageImpl=aR});var rp1=a((np1)=>{Object.defineProperty(np1,"__esModule",{value:!0});np1.baggageEntryMetadataSymbol=void 0;np1.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")});var nQ1=a((sp1)=>{Object.defineProperty(sp1,"__esModule",{value:!0});sp1.baggageEntryMetadataFromString=sp1.createBaggage=void 0;var FH6=vN(),HH6=ip1(),BH6=rp1(),DH6=FH6.DiagAPI.instance();function MH6(J={}){return new HH6.BaggageImpl(new Map(Object.entries(J)))}sp1.createBaggage=MH6;function VH6(J){if(typeof J!=="string")DH6.error(`Cannot create baggage metadata from unknown type: ${typeof J}`),J="";return{__TYPE__:BH6.baggageEntryMetadataSymbol,toString(){return J}}}sp1.baggageEntryMetadataFromString=VH6});var HS=a((tp1)=>{Object.defineProperty(tp1,"__esModule",{value:!0});tp1.ROOT_CONTEXT=tp1.createContextKey=void 0;function LH6(J){return Symbol.for(J)}tp1.createContextKey=LH6;class Cd{constructor(J){let Q=this;Q._currentContext=J?new Map(J):new Map,Q.getValue=(Z)=>Q._currentContext.get(Z),Q.setValue=(Z,X)=>{let Y=new Cd(Q._currentContext);return Y._currentContext.set(Z,X),Y},Q.deleteValue=(Z)=>{let X=new Cd(Q._currentContext);return X._currentContext.delete(Z),X}}}tp1.ROOT_CONTEXT=new Cd});var Xd1=a((Qd1)=>{Object.defineProperty(Qd1,"__esModule",{value:!0});Qd1.DiagConsoleLogger=void 0;var aQ1=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class Jd1{constructor(){function J(Q){return function(...Z){if(console){let X=console[Q];if(typeof X!=="function")X=console.log;if(typeof X==="function")return X.apply(console,Z)}}}for(let Q=0;Q<aQ1.length;Q++)this[aQ1[Q].n]=J(aQ1[Q].c)}}Qd1.DiagConsoleLogger=Jd1});var XZ1=a((Yd1)=>{Object.defineProperty(Yd1,"__esModule",{value:!0});Yd1.createNoopMeter=Yd1.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=Yd1.NOOP_OBSERVABLE_GAUGE_METRIC=Yd1.NOOP_OBSERVABLE_COUNTER_METRIC=Yd1.NOOP_UP_DOWN_COUNTER_METRIC=Yd1.NOOP_HISTOGRAM_METRIC=Yd1.NOOP_GAUGE_METRIC=Yd1.NOOP_COUNTER_METRIC=Yd1.NOOP_METER=Yd1.NoopObservableUpDownCounterMetric=Yd1.NoopObservableGaugeMetric=Yd1.NoopObservableCounterMetric=Yd1.NoopObservableMetric=Yd1.NoopHistogramMetric=Yd1.NoopGaugeMetric=Yd1.NoopUpDownCounterMetric=Yd1.NoopCounterMetric=Yd1.NoopMetric=Yd1.NoopMeter=void 0;class rQ1{constructor(){}createGauge(J,Q){return Yd1.NOOP_GAUGE_METRIC}createHistogram(J,Q){return Yd1.NOOP_HISTOGRAM_METRIC}createCounter(J,Q){return Yd1.NOOP_COUNTER_METRIC}createUpDownCounter(J,Q){return Yd1.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(J,Q){return Yd1.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(J,Q){return Yd1.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(J,Q){return Yd1.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(J,Q){}removeBatchObservableCallback(J){}}Yd1.NoopMeter=rQ1;class rR{}Yd1.NoopMetric=rR;class sQ1 extends rR{add(J,Q){}}Yd1.NoopCounterMetric=sQ1;class oQ1 extends rR{add(J,Q){}}Yd1.NoopUpDownCounterMetric=oQ1;class tQ1 extends rR{record(J,Q){}}Yd1.NoopGaugeMetric=tQ1;class eQ1 extends rR{record(J,Q){}}Yd1.NoopHistogramMetric=eQ1;class BS{addCallback(J){}removeCallback(J){}}Yd1.NoopObservableMetric=BS;class JZ1 extends BS{}Yd1.NoopObservableCounterMetric=JZ1;class QZ1 extends BS{}Yd1.NoopObservableGaugeMetric=QZ1;class ZZ1 extends BS{}Yd1.NoopObservableUpDownCounterMetric=ZZ1;Yd1.NOOP_METER=new rQ1;Yd1.NOOP_COUNTER_METRIC=new sQ1;Yd1.NOOP_GAUGE_METRIC=new tQ1;Yd1.NOOP_HISTOGRAM_METRIC=new eQ1;Yd1.NOOP_UP_DOWN_COUNTER_METRIC=new oQ1;Yd1.NOOP_OBSERVABLE_COUNTER_METRIC=new JZ1;Yd1.NOOP_OBSERVABLE_GAUGE_METRIC=new QZ1;Yd1.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new ZZ1;function wH6(){return Yd1.NOOP_METER}Yd1.createNoopMeter=wH6});var Md1=a((Dd1)=>{Object.defineProperty(Dd1,"__esModule",{value:!0});Dd1.ValueType=void 0;var vH6;(function(J){J[J.INT=0]="INT",J[J.DOUBLE=1]="DOUBLE"})(vH6=Dd1.ValueType||(Dd1.ValueType={}))});var KZ1=a((Vd1)=>{Object.defineProperty(Vd1,"__esModule",{value:!0});Vd1.defaultTextMapSetter=Vd1.defaultTextMapGetter=void 0;Vd1.defaultTextMapGetter={get(J,Q){if(J==null)return;return J[Q]},keys(J){if(J==null)return[];return Object.keys(J)}};Vd1.defaultTextMapSetter={set(J,Q,Z){if(J==null)return;J[Q]=Z}}});var Rd1=a((Ad1)=>{Object.defineProperty(Ad1,"__esModule",{value:!0});Ad1.NoopContextManager=void 0;var _H6=HS();class Ld1{active(){return _H6.ROOT_CONTEXT}with(J,Q,Z,...X){return Q.call(Z,...X)}bind(J,Q){return Q}enable(){return this}disable(){return this}}Ad1.NoopContextManager=Ld1});var DS=a((jd1)=>{Object.defineProperty(jd1,"__esModule",{value:!0});jd1.ContextAPI=void 0;var xH6=Rd1(),GZ1=SN(),Od1=vN(),qZ1="context",bH6=new xH6.NoopContextManager;class zZ1{constructor(){}static getInstance(){if(!this._instance)this._instance=new zZ1;return this._instance}setGlobalContextManager(J){return(0,GZ1.registerGlobal)(qZ1,J,Od1.DiagAPI.instance())}active(){return this._getContextManager().active()}with(J,Q,Z,...X){return this._getContextManager().with(J,Q,Z,...X)}bind(J,Q){return this._getContextManager().bind(J,Q)}_getContextManager(){return(0,GZ1.getGlobal)(qZ1)||bH6}disable(){this._getContextManager().disable(),(0,GZ1.unregisterGlobal)(qZ1,Od1.DiagAPI.instance())}}jd1.ContextAPI=zZ1});var WZ1=a((Ed1)=>{Object.defineProperty(Ed1,"__esModule",{value:!0});Ed1.TraceFlags=void 0;var yH6;(function(J){J[J.NONE=0]="NONE",J[J.SAMPLED=1]="SAMPLED"})(yH6=Ed1.TraceFlags||(Ed1.TraceFlags={}))});var Sd=a((Id1)=>{Object.defineProperty(Id1,"__esModule",{value:!0});Id1.INVALID_SPAN_CONTEXT=Id1.INVALID_TRACEID=Id1.INVALID_SPANID=void 0;var fH6=WZ1();Id1.INVALID_SPANID="0000000000000000";Id1.INVALID_TRACEID="00000000000000000000000000000000";Id1.INVALID_SPAN_CONTEXT={traceId:Id1.INVALID_TRACEID,spanId:Id1.INVALID_SPANID,traceFlags:fH6.TraceFlags.NONE}});var vd=a((vd1)=>{Object.defineProperty(vd1,"__esModule",{value:!0});vd1.NonRecordingSpan=void 0;var hH6=Sd();class Sd1{constructor(J=hH6.INVALID_SPAN_CONTEXT){this._spanContext=J}spanContext(){return this._spanContext}setAttribute(J,Q){return this}setAttributes(J){return this}addEvent(J,Q){return this}addLink(J){return this}addLinks(J){return this}setStatus(J){return this}updateName(J){return this}end(J){}isRecording(){return!1}recordException(J,Q){}}vd1.NonRecordingSpan=Sd1});var BZ1=a((xd1)=>{Object.defineProperty(xd1,"__esModule",{value:!0});xd1.getSpanContext=xd1.setSpanContext=xd1.deleteSpan=xd1.setSpan=xd1.getActiveSpan=xd1.getSpan=void 0;var gH6=HS(),mH6=vd(),uH6=DS(),FZ1=(0,gH6.createContextKey)("OpenTelemetry Context Key SPAN");function HZ1(J){return J.getValue(FZ1)||void 0}xd1.getSpan=HZ1;function pH6(){return HZ1(uH6.ContextAPI.getInstance().active())}xd1.getActiveSpan=pH6;function _d1(J,Q){return J.setValue(FZ1,Q)}xd1.setSpan=_d1;function dH6(J){return J.deleteValue(FZ1)}xd1.deleteSpan=dH6;function cH6(J,Q){return _d1(J,new mH6.NonRecordingSpan(Q))}xd1.setSpanContext=cH6;function lH6(J){var Q;return(Q=HZ1(J))===null||Q===void 0?void 0:Q.spanContext()}xd1.getSpanContext=lH6});var kd=a((gd1)=>{Object.defineProperty(gd1,"__esModule",{value:!0});gd1.wrapSpanContext=gd1.isSpanContextValid=gd1.isValidSpanId=gd1.isValidTraceId=void 0;var yd1=Sd(),oH6=vd(),tH6=/^([0-9a-f]{32})$/i,eH6=/^[0-9a-f]{16}$/i;function fd1(J){return tH6.test(J)&&J!==yd1.INVALID_TRACEID}gd1.isValidTraceId=fd1;function hd1(J){return eH6.test(J)&&J!==yd1.INVALID_SPANID}gd1.isValidSpanId=hd1;function JB6(J){return fd1(J.traceId)&&hd1(J.spanId)}gd1.isSpanContextValid=JB6;function QB6(J){return new oH6.NonRecordingSpan(J)}gd1.wrapSpanContext=QB6});var VZ1=a((dd1)=>{Object.defineProperty(dd1,"__esModule",{value:!0});dd1.NoopTracer=void 0;var KB6=DS(),ud1=BZ1(),DZ1=vd(),GB6=kd(),MZ1=KB6.ContextAPI.getInstance();class pd1{startSpan(J,Q,Z=MZ1.active()){if(Boolean(Q===null||Q===void 0?void 0:Q.root))return new DZ1.NonRecordingSpan;let Y=Z&&(0,ud1.getSpanContext)(Z);if(qB6(Y)&&(0,GB6.isSpanContextValid)(Y))return new DZ1.NonRecordingSpan(Y);else return new DZ1.NonRecordingSpan}startActiveSpan(J,Q,Z,X){let Y,K,G;if(arguments.length<2)return;else if(arguments.length===2)G=Q;else if(arguments.length===3)Y=Q,G=Z;else Y=Q,K=Z,G=X;let q=K!==null&&K!==void 0?K:MZ1.active(),z=this.startSpan(J,Y,q),U=(0,ud1.setSpan)(q,z);return MZ1.with(U,G,void 0,z)}}dd1.NoopTracer=pd1;function qB6(J){return typeof J==="object"&&typeof J.spanId==="string"&&typeof J.traceId==="string"&&typeof J.traceFlags==="number"}});var NZ1=a((id1)=>{Object.defineProperty(id1,"__esModule",{value:!0});id1.ProxyTracer=void 0;var zB6=VZ1(),UB6=new zB6.NoopTracer;class ld1{constructor(J,Q,Z,X){this._provider=J,this.name=Q,this.version=Z,this.options=X}startSpan(J,Q,Z){return this._getTracer().startSpan(J,Q,Z)}startActiveSpan(J,Q,Z,X){let Y=this._getTracer();return Reflect.apply(Y.startActiveSpan,Y,arguments)}_getTracer(){if(this._delegate)return this._delegate;let J=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!J)return UB6;return this._delegate=J,this._delegate}}id1.ProxyTracer=ld1});var od1=a((rd1)=>{Object.defineProperty(rd1,"__esModule",{value:!0});rd1.NoopTracerProvider=void 0;var WB6=VZ1();class ad1{getTracer(J,Q,Z){return new WB6.NoopTracer}}rd1.NoopTracerProvider=ad1});var LZ1=a((ed1)=>{Object.defineProperty(ed1,"__esModule",{value:!0});ed1.ProxyTracerProvider=void 0;var FB6=NZ1(),HB6=od1(),BB6=new HB6.NoopTracerProvider;class td1{getTracer(J,Q,Z){var X;return(X=this.getDelegateTracer(J,Q,Z))!==null&&X!==void 0?X:new FB6.ProxyTracer(this,J,Q,Z)}getDelegate(){var J;return(J=this._delegate)!==null&&J!==void 0?J:BB6}setDelegate(J){this._delegate=J}getDelegateTracer(J,Q,Z){var X;return(X=this._delegate)===null||X===void 0?void 0:X.getTracer(J,Q,Z)}}ed1.ProxyTracerProvider=td1});var Zc1=a((Qc1)=>{Object.defineProperty(Qc1,"__esModule",{value:!0});Qc1.SamplingDecision=void 0;var DB6;(function(J){J[J.NOT_RECORD=0]="NOT_RECORD",J[J.RECORD=1]="RECORD",J[J.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(DB6=Qc1.SamplingDecision||(Qc1.SamplingDecision={}))});var Yc1=a((Xc1)=>{Object.defineProperty(Xc1,"__esModule",{value:!0});Xc1.SpanKind=void 0;var MB6;(function(J){J[J.INTERNAL=0]="INTERNAL",J[J.SERVER=1]="SERVER",J[J.CLIENT=2]="CLIENT",J[J.PRODUCER=3]="PRODUCER",J[J.CONSUMER=4]="CONSUMER"})(MB6=Xc1.SpanKind||(Xc1.SpanKind={}))});var Gc1=a((Kc1)=>{Object.defineProperty(Kc1,"__esModule",{value:!0});Kc1.SpanStatusCode=void 0;var VB6;(function(J){J[J.UNSET=0]="UNSET",J[J.OK=1]="OK",J[J.ERROR=2]="ERROR"})(VB6=Kc1.SpanStatusCode||(Kc1.SpanStatusCode={}))});var Uc1=a((qc1)=>{Object.defineProperty(qc1,"__esModule",{value:!0});qc1.validateValue=qc1.validateKey=void 0;var OZ1="[_0-9a-z-*/]",NB6=`[a-z]${OZ1}{0,255}`,LB6=`[a-z0-9]${OZ1}{0,240}@[a-z]${OZ1}{0,13}`,AB6=new RegExp(`^(?:${NB6}|${LB6})$`),wB6=/^[ -~]{0,255}[!-~]$/,RB6=/,|=/;function OB6(J){return AB6.test(J)}qc1.validateKey=OB6;function jB6(J){return wB6.test(J)&&!RB6.test(J)}qc1.validateValue=jB6});var Vc1=a((Dc1)=>{Object.defineProperty(Dc1,"__esModule",{value:!0});Dc1.TraceStateImpl=void 0;var Wc1=Uc1(),Fc1=32,EB6=512,Hc1=",",Bc1="=";class jZ1{constructor(J){if(this._internalState=new Map,J)this._parse(J)}set(J,Q){let Z=this._clone();if(Z._internalState.has(J))Z._internalState.delete(J);return Z._internalState.set(J,Q),Z}unset(J){let Q=this._clone();return Q._internalState.delete(J),Q}get(J){return this._internalState.get(J)}serialize(){return this._keys().reduce((J,Q)=>{return J.push(Q+Bc1+this.get(Q)),J},[]).join(Hc1)}_parse(J){if(J.length>EB6)return;if(this._internalState=J.split(Hc1).reverse().reduce((Q,Z)=>{let X=Z.trim(),Y=X.indexOf(Bc1);if(Y!==-1){let K=X.slice(0,Y),G=X.slice(Y+1,Z.length);if((0,Wc1.validateKey)(K)&&(0,Wc1.validateValue)(G))Q.set(K,G)}return Q},new Map),this._internalState.size>Fc1)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Fc1))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let J=new jZ1;return J._internalState=new Map(this._internalState),J}}Dc1.TraceStateImpl=jZ1});var Ac1=a((Nc1)=>{Object.defineProperty(Nc1,"__esModule",{value:!0});Nc1.createTraceState=void 0;var IB6=Vc1();function PB6(J){return new IB6.TraceStateImpl(J)}Nc1.createTraceState=PB6});var Oc1=a((wc1)=>{Object.defineProperty(wc1,"__esModule",{value:!0});wc1.context=void 0;var TB6=DS();wc1.context=TB6.ContextAPI.getInstance()});var Ec1=a((jc1)=>{Object.defineProperty(jc1,"__esModule",{value:!0});jc1.diag=void 0;var CB6=vN();jc1.diag=CB6.DiagAPI.instance()});var Tc1=a((Ic1)=>{Object.defineProperty(Ic1,"__esModule",{value:!0});Ic1.NOOP_METER_PROVIDER=Ic1.NoopMeterProvider=void 0;var SB6=XZ1();class $Z1{getMeter(J,Q,Z){return SB6.NOOP_METER}}Ic1.NoopMeterProvider=$Z1;Ic1.NOOP_METER_PROVIDER=new $Z1});var kc1=a((Sc1)=>{Object.defineProperty(Sc1,"__esModule",{value:!0});Sc1.MetricsAPI=void 0;var kB6=Tc1(),EZ1=SN(),Cc1=vN(),IZ1="metrics";class PZ1{constructor(){}static getInstance(){if(!this._instance)this._instance=new PZ1;return this._instance}setGlobalMeterProvider(J){return(0,EZ1.registerGlobal)(IZ1,J,Cc1.DiagAPI.instance())}getMeterProvider(){return(0,EZ1.getGlobal)(IZ1)||kB6.NOOP_METER_PROVIDER}getMeter(J,Q,Z){return this.getMeterProvider().getMeter(J,Q,Z)}disable(){(0,EZ1.unregisterGlobal)(IZ1,Cc1.DiagAPI.instance())}}Sc1.MetricsAPI=PZ1});var bc1=a((_c1)=>{Object.defineProperty(_c1,"__esModule",{value:!0});_c1.metrics=void 0;var _B6=kc1();_c1.metrics=_B6.MetricsAPI.getInstance()});var gc1=a((fc1)=>{Object.defineProperty(fc1,"__esModule",{value:!0});fc1.NoopTextMapPropagator=void 0;class yc1{inject(J,Q){}extract(J,Q){return J}fields(){return[]}}fc1.NoopTextMapPropagator=yc1});var dc1=a((uc1)=>{Object.defineProperty(uc1,"__esModule",{value:!0});uc1.deleteBaggage=uc1.setBaggage=uc1.getActiveBaggage=uc1.getBaggage=void 0;var xB6=DS(),bB6=HS(),TZ1=(0,bB6.createContextKey)("OpenTelemetry Baggage Key");function mc1(J){return J.getValue(TZ1)||void 0}uc1.getBaggage=mc1;function yB6(){return mc1(xB6.ContextAPI.getInstance().active())}uc1.getActiveBaggage=yB6;function fB6(J,Q){return J.setValue(TZ1,Q)}uc1.setBaggage=fB6;function hB6(J){return J.deleteValue(TZ1)}uc1.deleteBaggage=hB6});var ac1=a((ic1)=>{Object.defineProperty(ic1,"__esModule",{value:!0});ic1.PropagationAPI=void 0;var CZ1=SN(),pB6=gc1(),cc1=KZ1(),_d=dc1(),dB6=nQ1(),lc1=vN(),SZ1="propagation",cB6=new pB6.NoopTextMapPropagator;class vZ1{constructor(){this.createBaggage=dB6.createBaggage,this.getBaggage=_d.getBaggage,this.getActiveBaggage=_d.getActiveBaggage,this.setBaggage=_d.setBaggage,this.deleteBaggage=_d.deleteBaggage}static getInstance(){if(!this._instance)this._instance=new vZ1;return this._instance}setGlobalPropagator(J){return(0,CZ1.registerGlobal)(SZ1,J,lc1.DiagAPI.instance())}inject(J,Q,Z=cc1.defaultTextMapSetter){return this._getGlobalPropagator().inject(J,Q,Z)}extract(J,Q,Z=cc1.defaultTextMapGetter){return this._getGlobalPropagator().extract(J,Q,Z)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,CZ1.unregisterGlobal)(SZ1,lc1.DiagAPI.instance())}_getGlobalPropagator(){return(0,CZ1.getGlobal)(SZ1)||cB6}}ic1.PropagationAPI=vZ1});var oc1=a((rc1)=>{Object.defineProperty(rc1,"__esModule",{value:!0});rc1.propagation=void 0;var lB6=ac1();rc1.propagation=lB6.PropagationAPI.getInstance()});var Xl1=a((Ql1)=>{Object.defineProperty(Ql1,"__esModule",{value:!0});Ql1.TraceAPI=void 0;var kZ1=SN(),tc1=LZ1(),ec1=kd(),sR=BZ1(),Jl1=vN(),_Z1="trace";class xZ1{constructor(){this._proxyTracerProvider=new tc1.ProxyTracerProvider,this.wrapSpanContext=ec1.wrapSpanContext,this.isSpanContextValid=ec1.isSpanContextValid,this.deleteSpan=sR.deleteSpan,this.getSpan=sR.getSpan,this.getActiveSpan=sR.getActiveSpan,this.getSpanContext=sR.getSpanContext,this.setSpan=sR.setSpan,this.setSpanContext=sR.setSpanContext}static getInstance(){if(!this._instance)this._instance=new xZ1;return this._instance}setGlobalTracerProvider(J){let Q=(0,kZ1.registerGlobal)(_Z1,this._proxyTracerProvider,Jl1.DiagAPI.instance());if(Q)this._proxyTracerProvider.setDelegate(J);return Q}getTracerProvider(){return(0,kZ1.getGlobal)(_Z1)||this._proxyTracerProvider}getTracer(J,Q){return this.getTracerProvider().getTracer(J,Q)}disable(){(0,kZ1.unregisterGlobal)(_Z1,Jl1.DiagAPI.instance()),this._proxyTracerProvider=new tc1.ProxyTracerProvider}}Ql1.TraceAPI=xZ1});var Gl1=a((Yl1)=>{Object.defineProperty(Yl1,"__esModule",{value:!0});Yl1.trace=void 0;var iB6=Xl1();Yl1.trace=iB6.TraceAPI.getInstance()});var xd=a((S2)=>{Object.defineProperty(S2,"__esModule",{value:!0});S2.trace=S2.propagation=S2.metrics=S2.diag=S2.context=S2.INVALID_SPAN_CONTEXT=S2.INVALID_TRACEID=S2.INVALID_SPANID=S2.isValidSpanId=S2.isValidTraceId=S2.isSpanContextValid=S2.createTraceState=S2.TraceFlags=S2.SpanStatusCode=S2.SpanKind=S2.SamplingDecision=S2.ProxyTracerProvider=S2.ProxyTracer=S2.defaultTextMapSetter=S2.defaultTextMapGetter=S2.ValueType=S2.createNoopMeter=S2.DiagLogLevel=S2.DiagConsoleLogger=S2.ROOT_CONTEXT=S2.createContextKey=S2.baggageEntryMetadataFromString=void 0;var nB6=nQ1();Object.defineProperty(S2,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return nB6.baggageEntryMetadataFromString}});var ql1=HS();Object.defineProperty(S2,"createContextKey",{enumerable:!0,get:function(){return ql1.createContextKey}});Object.defineProperty(S2,"ROOT_CONTEXT",{enumerable:!0,get:function(){return ql1.ROOT_CONTEXT}});var aB6=Xd1();Object.defineProperty(S2,"DiagConsoleLogger",{enumerable:!0,get:function(){return aB6.DiagConsoleLogger}});var rB6=Pd();Object.defineProperty(S2,"DiagLogLevel",{enumerable:!0,get:function(){return rB6.DiagLogLevel}});var sB6=XZ1();Object.defineProperty(S2,"createNoopMeter",{enumerable:!0,get:function(){return sB6.createNoopMeter}});var oB6=Md1();Object.defineProperty(S2,"ValueType",{enumerable:!0,get:function(){return oB6.ValueType}});var zl1=KZ1();Object.defineProperty(S2,"defaultTextMapGetter",{enumerable:!0,get:function(){return zl1.defaultTextMapGetter}});Object.defineProperty(S2,"defaultTextMapSetter",{enumerable:!0,get:function(){return zl1.defaultTextMapSetter}});var tB6=NZ1();Object.defineProperty(S2,"ProxyTracer",{enumerable:!0,get:function(){return tB6.ProxyTracer}});var eB6=LZ1();Object.defineProperty(S2,"ProxyTracerProvider",{enumerable:!0,get:function(){return eB6.ProxyTracerProvider}});var JD6=Zc1();Object.defineProperty(S2,"SamplingDecision",{enumerable:!0,get:function(){return JD6.SamplingDecision}});var QD6=Yc1();Object.defineProperty(S2,"SpanKind",{enumerable:!0,get:function(){return QD6.SpanKind}});var ZD6=Gc1();Object.defineProperty(S2,"SpanStatusCode",{enumerable:!0,get:function(){return ZD6.SpanStatusCode}});var XD6=WZ1();Object.defineProperty(S2,"TraceFlags",{enumerable:!0,get:function(){return XD6.TraceFlags}});var YD6=Ac1();Object.defineProperty(S2,"createTraceState",{enumerable:!0,get:function(){return YD6.createTraceState}});var bZ1=kd();Object.defineProperty(S2,"isSpanContextValid",{enumerable:!0,get:function(){return bZ1.isSpanContextValid}});Object.defineProperty(S2,"isValidTraceId",{enumerable:!0,get:function(){return bZ1.isValidTraceId}});Object.defineProperty(S2,"isValidSpanId",{enumerable:!0,get:function(){return bZ1.isValidSpanId}});var yZ1=Sd();Object.defineProperty(S2,"INVALID_SPANID",{enumerable:!0,get:function(){return yZ1.INVALID_SPANID}});Object.defineProperty(S2,"INVALID_TRACEID",{enumerable:!0,get:function(){return yZ1.INVALID_TRACEID}});Object.defineProperty(S2,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return yZ1.INVALID_SPAN_CONTEXT}});var Ul1=Oc1();Object.defineProperty(S2,"context",{enumerable:!0,get:function(){return Ul1.context}});var Wl1=Ec1();Object.defineProperty(S2,"diag",{enumerable:!0,get:function(){return Wl1.diag}});var Fl1=bc1();Object.defineProperty(S2,"metrics",{enumerable:!0,get:function(){return Fl1.metrics}});var Hl1=oc1();Object.defineProperty(S2,"propagation",{enumerable:!0,get:function(){return Hl1.propagation}});var Bl1=Gl1();Object.defineProperty(S2,"trace",{enumerable:!0,get:function(){return Bl1.trace}});S2.default={context:Ul1.context,diag:Wl1.diag,metrics:Fl1.metrics,propagation:Hl1.propagation,trace:Bl1.trace}});function zD6(){return qD6}function Dl1(J){let Q=kN;return kN=J,Q}class rq{baseLogger;scope;context={};constructor(J=Ml1){this.baseLogger=J}with(J){let Q=new rq(this.baseLogger);return Q.scope=this.scope,Q.context={...this.context,...J},Q}scoped(J){let Q=new rq(this.baseLogger);return Q.scope=this.scope?`${this.scope}.${J}`:J,Q.context={...this.context},Q}error(J,...Q){let Z=this.mergeContextWithMeta(Q);this.baseLogger.error(this.messageWithPrefix(J),...Z)}warn(J,...Q){let Z=this.mergeContextWithMeta(Q);this.baseLogger.warn(this.messageWithPrefix(J),...Z)}info(J,...Q){let Z=this.mergeContextWithMeta(Q);this.baseLogger.info(this.messageWithPrefix(J),...Z)}debug(J,...Q){let Z=this.mergeContextWithMeta(Q);this.baseLogger.debug(this.messageWithPrefix(J),...Z)}audit(J,...Q){let Z=this.mergeContextWithMeta(Q);this.baseLogger.audit(this.messageWithPrefix(J),...Z)}messageWithPrefix(J){return this.scope?`${this.scope}: ${J}`:J}mergeContextWithMeta(J){let Q={...this.context},Z=fZ1.trace.getActiveSpan();if(Z){let Y=Z.spanContext();if(Y.traceId)Q.traceId=Y.traceId,Q.spanId=Y.spanId}if(J.length===0)return[Q];let X=J[0];if(typeof X==="object"&&X!==null)return[{...X,...Q},...J.slice(1)];else return[Q,...J]}}var fZ1,qD6=!1,UD6,kN,Ml1,u;var G0=B1(()=>{fZ1=C6(xd(),1);UD6={error:(J,...Q)=>console.error(J,...Q),warn:(J,...Q)=>console.warn(J,...Q),info:(J,...Q)=>console.info(J,...Q),debug:(J,...Q)=>{if(zD6())console.debug(J,...Q)},audit:(J,...Q)=>{let Z=Q.length>0?Q[0]:{};if(typeof Z==="object"&&Z!==null&&!("audit"in Z))Z.audit=!0;let X=fZ1.trace.getActiveSpan();if(X){let Y=X.spanContext();if(Y.traceId)Z.traceId=Y.traceId,Z.spanId=Y.spanId}console.info(J,Z)}},kN=UD6;Ml1={error:(J,...Q)=>kN.error(J,...Q),warn:(J,...Q)=>kN.warn(J,...Q),info:(J,...Q)=>kN.info(J,...Q),debug:(J,...Q)=>kN.debug(J,...Q),audit:(J,...Q)=>kN.audit(J,...Q)};u=Ml1});function bd(J){Promise.resolve().then(()=>{try{J()}catch(Q){console.error(Q)}})}function Vl1(J){let Q=J._cleanup;if(Q===void 0)return;if(J._cleanup=void 0,!Q)return;try{if(typeof Q==="function")Q();else if(Q&&typeof Q.unsubscribe==="function")Q.unsubscribe()}catch(Z){console.error("cleanupSubscription",Z)}}function mZ1(J){J._observer=void 0,J._queue=void 0,J._state="closed"}function FD6(J){let Q=J._queue;if(!Q)return;J._queue=void 0,J._state="ready";for(let Z of Q)if(Nl1(J,Z.type,Z.value),J._state==="closed")break}function Nl1(J,Q,Z){J._state="running";let X=J._observer;try{switch(Q){case"next":if(X&&typeof X.next==="function")X.next(Z);break;case"error":if(mZ1(J),X&&typeof X.error==="function")X.error(Z);else throw Z;break;case"complete":if(mZ1(J),X&&typeof X.complete==="function")X.complete();break}}catch(Y){console.error("notifySubscription",Y)}if(J._state==="closed")Vl1(J);else if(J._state==="running")J._state="ready"}function gZ1(J,Q,Z){if(J._state==="closed")return;if(J._state==="buffering"){J._queue=J._queue||[],J._queue.push({type:Q,value:Z});return}if(J._state!=="ready"){J._state="buffering",J._queue=[{type:Q,value:Z}],bd(()=>FD6(J));return}Nl1(J,Q,Z)}class Ll1{_cleanup;_observer;_queue;_state;constructor(J,Q){this._cleanup=void 0,this._observer=J,this._queue=void 0,this._state="initializing";let Z=new Al1(this);try{this._cleanup=Q.call(void 0,Z)}catch(X){Z.error(X)}if(this._state==="initializing")this._state="ready"}get closed(){return this._state==="closed"}unsubscribe(){if(this._state!=="closed")mZ1(this),Vl1(this)}}class Al1{_subscription;constructor(J){this._subscription=J}get closed(){return this._subscription._state==="closed"}next(J){gZ1(this._subscription,"next",J)}error(J){gZ1(this._subscription,"error",J)}complete(){gZ1(this._subscription,"complete")}}function U4(J){if(typeof J==="function")J();else if(J&&typeof J.unsubscribe==="function")J.unsubscribe()}class oR{_baseObserver;_pendingPromises;constructor(J){this._baseObserver=J,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then(()=>this._baseObserver.complete()).catch((J)=>this._baseObserver.error(J))}error(J){this._baseObserver.error(J)}schedule(J){let Q=Promise.all(this._pendingPromises),Z=[],X=(K)=>Z.push(K),Y=Promise.resolve().then(async()=>{await Q,await J(X),this._pendingPromises.delete(Y);for(let K of Z)this._baseObserver.next(K)}).catch((K)=>{this._pendingPromises.delete(Y),this._baseObserver.error(K)});this._pendingPromises.add(Y)}}function uZ1(J){return J&&typeof J.subscribe==="function"&&typeof J[Symbol.observable]==="function"}function pZ1(J){if(uZ1(J))return J;return e1.of(J)}var e1;var tR=B1(()=>{if(!Symbol.observable)Symbol.observable=Symbol("observable");e1=class e1{_subscriber;constructor(J){if(!(this instanceof e1))throw TypeError("Observable cannot be called as a function");if(typeof J!=="function")throw TypeError("Observable initializer must be a function");this._subscriber=J}subscribe(J,Q,Z){if(typeof J!=="object"||J===null)J={next:J,error:Q,complete:Z};return new Ll1(J,this._subscriber)}pipe(J,...Q){let Z=this;for(let X of[J,...Q])Z=X(Z);return Z}[Symbol.observable](){return this}static from(J){let Q=typeof this==="function"?this:e1;if(J==null)throw TypeError(J+" is not an object");let Z=J[Symbol.observable];if(typeof Z==="function"){let Y=Z.call(J);if(Object(Y)!==Y)throw TypeError(Y+" is not an object");if(Y instanceof e1)return Y;return new Q((K)=>Y.subscribe(K))}let X=J[Symbol.iterator];if(typeof X==="function")return new Q((Y)=>{bd(()=>{if(Y.closed)return;for(let K of X.call(J))if(Y.next(K),Y.closed)return;Y.complete()})});if(Array.isArray(J))return new Q((Y)=>{bd(()=>{if(Y.closed)return;for(let K of J)if(Y.next(K),Y.closed)return;Y.complete()})});throw TypeError(J+" is not observable")}static of(...J){return new(typeof this==="function"?this:e1)((Z)=>{bd(()=>{if(Z.closed)return;for(let X of J)if(Z.next(X),Z.closed)return;Z.complete()})})}static get[Symbol.species](){return this}}});var b8,W4;var yd=B1(()=>{tR();b8=class b8 extends e1{_observers=new Set;constructor(){super((J)=>{return this._observers.add(J),()=>this._observers.delete(J)})}next(J){for(let Q of this._observers)Q.next(J)}error(J){for(let Q of this._observers)Q.error(J)}complete(){for(let J of this._observers)J.complete()}};W4=class W4 extends b8{currentValue;constructor(J){super();this.currentValue=J}next(J){this.currentValue=J,super.next(J)}subscribe(J,Q,Z){if(typeof J!=="object"||J===null){let X={};if(J)X.next=J;if(Q)X.error=Q;if(Z)X.complete=Z;J=X}return J.next?.(this.currentValue),super.subscribe(J)}getValue(){return this.currentValue}}});var dZ1,MS;var wl1=B1(()=>{tR();yd();dZ1=class dZ1 extends Set{subject=new W4(this);add(J){return super.add(J),this.subject.next(this),this}delete(J){let Q=super.delete(J);if(Q)this.subject.next(this);return Q}clear(){super.clear(),this.subject.next(this)}get observable(){return e1.from(this.subject)}dispose(){this.subject.complete()}};MS=class MS extends Map{subject=new W4(this);set(J,Q){return super.set(J,Q),this.subject.next(this),this}delete(J){let Q=super.delete(J);if(Q)this.subject.next(this);return Q}clear(){super.clear(),this.subject.next(this)}get observable(){return e1.from(this.subject)}dispose(){this.subject.complete()}}});function fd(J,Q){if(J===Q)return!0;if(J==null||Q==null||typeof J!=="object"||typeof Q!=="object")return!1;let Z=Array.isArray(J),X=Array.isArray(Q);if(Z!==X)return!1;if(Z&&X)return J.length===Q.length&&J.every((K,G)=>fd(K,Q[G]));let Y=new Set([...Object.keys(J),...Object.keys(Q)]);for(let K of Y)if(!fd(J[K],Q[K]))return!1;return!0}function cZ1(J){return{dispose:J.unsubscribe.bind(J)}}async function G6(J,Q){return new Promise((Z,X)=>{let Y=void 0,K=()=>{Y?.unsubscribe(),X(new DOMException("Aborted","AbortError"))};Q?.addEventListener("abort",K,{once:!0}),Y=J.subscribe({next:(G)=>{Y?.unsubscribe(),Q?.removeEventListener("abort",K),Z(G)},error:(G)=>{Q?.removeEventListener("abort",K),X(G)},complete:()=>{Q?.removeEventListener("abort",K),X("Observable completed without emitting a value")}})})}async function VB(J,Q){return new Promise((Z,X)=>{let Y,K=!1,G=void 0,q=()=>{G?.unsubscribe(),X(new DOMException("Aborted","AbortError"))};Q?.addEventListener("abort",q,{once:!0}),G=J.subscribe({next:(z)=>{Y=z,K=!0},error:(z)=>{Q?.removeEventListener("abort",q),X(z)},complete:()=>{if(Q?.removeEventListener("abort",q),K)Z(Y);else X("Observable completed without emitting a value")}})})}function E7(J){return new e1((Q)=>{J.then((Z)=>{Q.next(Z),Q.complete()}).catch((Z)=>{Q.error(Z)})})}function d6(J){return new e1((Q)=>{let Z=!1,X=new AbortController,Y=X.signal;return(async()=>{try{Y?.throwIfAborted();let G=await J(Y);if(Y?.throwIfAborted(),!Z)Q.next(G),Q.complete()}catch(G){if(!Z)if(Y.aborted)Q.complete();else Q.error(G)}})(),()=>{Z=!0,X.abort()}})}function k0(J){return(Q)=>{return new e1((Z)=>{let X=new oR(Z),Y=0,K=Q.subscribe({complete(){X.complete()},error(G){X.error(G)},next(G){X.schedule(async(q)=>{let z=await J(G,Y);Y++,q(z)})}});return()=>U4(K)})}}function hd(J){return new e1((Q)=>{let Z=0,X=setInterval(()=>{Q.next(Z++)},J);return()=>clearInterval(X)})}function VS(...J){return new e1((Q)=>{let Z=0,X=J.map((Y)=>Y.subscribe({next:(K)=>Q.next(K),error:(K)=>Q.error(K),complete:()=>{if(Z++,Z===J.length)Q.complete()}}));return()=>{Ol1(X)}})}function b9(...J){if(J.length===0)return lZ1;return new e1((Q)=>{let Z=Array(J.length),X=Array(J.length).fill(0),Y=Array(J.length).fill(!1),K=0,G=[],q=new oR(Q);for(let z=0;z<J.length;z++){let U=J[z];G.push(U.subscribe({next(W){Z[z]=W,Y[z]=!0;let F=++X[z];if(Y.every(Boolean))q.schedule(async(H)=>{if(X[z]===F)H([...Z])})},error(W){q.error(W)},complete(){if(K++,K===J.length)q.complete()}}))}return()=>{Ol1(G)}})}function M9(J){let Z=J?.shouldCountRefs??!0,X=HD6++,Y=(K,...G)=>{};return(K)=>{let G=new b8,q=null,z=!1,U,W=0;return new e1((F)=>{if(W++,z)Y("new subscriber, emitting buffered value",U),F.next(U);else Y("new subscriber, no buffered value to emit");if(!q)q=K.subscribe({next:(B)=>{z=!0,U=B,G.next(B)},error:(B)=>G.error(B),complete:()=>G.complete()});let H=G.subscribe(F);return()=>{if(W--,H.unsubscribe(),Z&&W===0){if(q)U4(q),q=null;z=!1}}})}}function Ol1(J){for(let Q of J)if(Q)U4(Q)}function eR(J){return(Q)=>{return new e1((Z)=>{let X=Q.subscribe({next:(K)=>Z.next(K),error:(K)=>Z.error(K),complete:()=>Z.complete()}),Y=J.subscribe({next:()=>{Z.complete(),X.unsubscribe(),Y.unsubscribe()},error:(K)=>{Z.error(K),X.unsubscribe()}});return()=>{X.unsubscribe(),Y.unsubscribe()}})}}function YG(J){return(Q)=>{return new e1((Z)=>{let X,Y=Q.subscribe({next(K){X=K,Z.next(K)},error(K){Z.error(K)},complete(){Z.complete()}});return()=>{U4(Y),J(X)}})}}function J8(J=fd){return(Q)=>{return new e1((Z)=>{let X=Rl1,Y=new oR(Z),K=Q.subscribe({complete(){Y.complete()},error(G){Y.error(G)},next(G){Y.schedule(async(q)=>{if(X===Rl1||!J(X,G))X=G,q(G)})}});return()=>U4(K)})}}function _N(J){return BD6(typeof J==="function"?{next:J}:J)}function BD6(J){return(Q)=>new e1((Z)=>{let X=typeof J==="function"?J():J,Y=Q.subscribe({next(K){if(X.next)try{X.next(K)}catch(G){Z.error(G);return}Z.next(K)},error(K){if(X.error)try{X.error(K)}catch(G){Z.error(G);return}Z.error(K)},complete(){if(X.complete)try{X.complete()}catch(K){Z.error(K);return}Z.complete()}});return()=>U4(Y)})}function JO(J){return(Q)=>{return new e1((Z)=>{let X=!1,Y=Q.subscribe({next:(G)=>{X=!0,clearTimeout(K),Z.next(G)},error:(G)=>{clearTimeout(K),Z.error(G)},complete:()=>{clearTimeout(K),Z.complete()}}),K=setTimeout(()=>{if(!X)Y.unsubscribe(),Z.error(new jl1(`Operation timed out after ${J}ms`))},J);return()=>{clearTimeout(K),Y.unsubscribe()}})}}function v2(J){return(Q)=>new e1((Z)=>{let X;try{Z.next(J),X=Q.subscribe({next(Y){Z.next(Y)},error(Y){Z.error(Y)},complete(){Z.complete()}})}catch(Y){Z.error(Y)}return()=>{if(X)U4(X)}})}function xN(J){return(Q)=>new e1((Z)=>{let X=0,Y=Q.subscribe({next(K){if(X<J){if(Z.next(K),X++,X===J)Z.complete(),U4(Y)}},error(K){Z.error(K)},complete(){Z.complete()}});return()=>{U4(Y)}})}function $l1(J){return(Q)=>new e1((Z)=>{let X=0,Y=Q.subscribe({next(K){if(X>=J)Z.next(K);else X++},error(K){Z.error(K)},complete(){Z.complete()}});return()=>{U4(Y)}})}function q8(J){return(Q)=>{return new e1((Z)=>{let X=0,Y=null,K=!1,G=()=>{if(K&&!Y)Z.complete()},q=Q.subscribe({next(z){if(Y)U4(Y),Y=null;let U;try{U=J(z,X++)}catch(W){Z.error(W);return}Y=U.subscribe({next(W){Z.next(W)},error(W){Z.error(W)},complete(){Y=null,G()}})},error(z){Z.error(z)},complete(){K=!0,G()}});return()=>{if(U4(q),Y)U4(Y)}})}}function El1(J){let Q={last:void 0,isSet:!1},Z=J.subscribe((X)=>{Object.assign(Q,{last:X,isSet:!0})});return{value:Q,observable:J,subscription:Z}}function KG(J){return(Q)=>new e1((Z)=>{let X=null,Y=null,K=!1,G=Q.subscribe({next:(q)=>{if(Y=q,K=!0,X===null)X=setTimeout(()=>{if(K)Z.next(Y),K=!1;X=null},J)},error:(q)=>Z.error(q),complete:()=>{if(X!==null)clearTimeout(X);if(K)Z.next(Y);Z.complete()}});return()=>{if(U4(G),X!==null)clearTimeout(X)}})}function iZ1(J,Q){if(!Q.leading||!Q.trailing)throw Error("leading and trailing must be true");return(Z)=>new e1((X)=>{let Y=0,K=null,G=null,q=!1,z=Z.subscribe({next:(U)=>{let W=Date.now();if(G=U,q=!0,W-Y>=J)X.next(U),Y=W,q=!1;else if(K===null)K=setTimeout(()=>{if(q)X.next(G),Y=Date.now(),q=!1;K=null},J-(W-Y));if(Y===0)X.next(U),Y=W,q=!1},error:(U)=>X.error(U),complete:()=>{if(K!==null)clearTimeout(K);if(q)X.next(G);X.complete()}});return()=>{if(U4(z),K!==null)clearTimeout(K)}})}function NS(...J){return new e1((Q)=>{let Z=0,X=null;function Y(){if(Z>=J.length){Q.complete();return}X=J[Z].subscribe({next:(G)=>Q.next(G),error:(G)=>Q.error(G),complete:()=>{Z++,Y()}})}return Y(),()=>{if(X)U4(X)}})}function GG(J){return(Q)=>new e1((Z)=>{let X=0,Y=!1,K=null,G=Q.subscribe({next(q){try{let z=J(q,X++);if(K)U4(K);K=z.subscribe({next(U){Z.next(U)},error(U){Z.error(U)},complete(){if(K=null,Y&&!K)Z.complete()}})}catch(z){Z.error(z)}},error(q){Z.error(q)},complete(){if(Y=!0,!K)Z.complete()}});return()=>{if(U4(G),K)U4(K)}})}function gd({onSubscribe:J,onUnsubscribe:Q}){return(Z)=>new e1((X)=>{J?.();let Y=Z.subscribe(X);return()=>{U4(Y),Q?.()}})}function BW(J){return(Q)=>e1.from(Q).pipe(q8((Z)=>d6((X)=>J(Z,X))))}function AQ(J){return(Q)=>new e1((Z)=>{let X,Y=Q.subscribe({next(K){Z.next(K)},error(K){try{X=J(K).subscribe({next(q){Z.next(q)},error(q){Z.error(q)},complete(){Z.complete()}})}catch(G){Z.error(G)}},complete(){Z.complete()}});return()=>{if(U4(Y),X)U4(X)}})}function T5(J){return(Q)=>{return new e1((Z)=>{let X=Q.subscribe({next(Y){if(J(Y))Z.next(Y)},error(Y){Z.error(Y)},complete(){Z.complete()}});return()=>U4(X)})}}function Il1(J,Q){return(Z)=>{return new e1((X)=>{let Y,K=0,G=new oR(X),q=Z.subscribe({complete(){G.complete()},error(z){G.error(z)},next(z){G.schedule(async(U)=>{Y=await J(K===0?typeof Q>"u"?z:Q:Y,z,K++),U(Y)})}});return()=>U4(q)})}}var lZ1,$Y,oD9,HD6=0,Rl1,jl1;var nZ1=B1(()=>{tR();yd();lZ1=new e1((J)=>{J.complete()}),$Y=new e1(()=>{});oD9=Symbol("noInitialValue");Rl1={};jl1=class jl1 extends Error{constructor(J="Timeout has occurred"){super(J);this.name="TimeoutError"}}});function bN(J,Q){return(Z)=>{return e1.from(Z).pipe(q8((X)=>X===vJ?e1.of(vJ):J(X).pipe(AQ((Y)=>e1.of(Y instanceof Error?Y:Error(Y))),v2(vJ))),M9(Q))}}function DD6(){return(J)=>e1.from(J).pipe(T5((Q)=>Q!==vJ))}async function LS(J,Q){let Z=await G6(e1.from(J).pipe(DD6()),Q);if(Z instanceof Error)throw Z;return Z}var vJ;var Pl1=B1(()=>{tR();nZ1();vJ=Symbol.for("@@pendingOperation")});var C0=B1(()=>{wl1();tR();Pl1();nZ1();yd()});var b6=B1(()=>{zS();Id();iR()});import MD6 from"os";import md from"path";var NB,yN,LB,AB,Tl1,DM9,MM9,VD6,ND6;var QO=B1(()=>{NB=MD6.homedir(),{env:yN}=process,LB=yN.XDG_DATA_HOME||(NB?md.join(NB,".local","share"):void 0),AB=yN.XDG_CONFIG_HOME||(NB?md.join(NB,".config"):void 0),Tl1=yN.XDG_STATE_HOME||(NB?md.join(NB,".local","state"):void 0),DM9=yN.XDG_CACHE_HOME||(NB?md.join(NB,".cache"):void 0),MM9=yN.XDG_RUNTIME_DIR||void 0,VD6=(yN.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");if(LB)VD6.unshift(LB);ND6=(yN.XDG_CONFIG_DIRS||"/etc/xdg").split(":");if(AB)ND6.unshift(AB)});import{promises as LD6}from"node:fs";import*as fN from"node:path";async function Cl1(J){try{let Q=await LD6.open(J,"r");try{let Z=Buffer.alloc(128);await Q.read(Z,0,128,0);let X=Z.toString("utf-8").split(`
3
- `)[0];if(!X?.startsWith("#!"))return{interpreter:null,isValid:!1};let Y=X.slice(2).trim();if(!Y)return{interpreter:null,isValid:!1};let K=Y.split(/\s+/).filter((G)=>G.length>0);if(K[0]?.endsWith("/env")&&K.length>1)return{interpreter:K.slice(1),isValid:!0};return{interpreter:K,isValid:!0}}finally{await Q.close()}}catch{return{interpreter:null,isValid:!1}}}function Sl1(J,Q){let Z=(J&73)!==0;if(process.platform==="win32"){let X=fN.extname(Q).toLowerCase();return Z||[".exe",".bat",".cmd",".ps1"].includes(X)}return Z}function vl1(J){return fN.extname(J).toLowerCase()===".md"}function kl1(J){let Q=J.replace(/\\/g,"/"),Z=fN.basename(Q);return fN.basename(Z,fN.extname(Z))}function _l1(J){return/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(J)&&J.length>0}var xl1=()=>{};var hl1={};R6(hl1,{CommandDiscovery:()=>fl1});import*as yl1 from"node:fs";import{promises as ud}from"node:fs";import{homedir as bl1}from"node:os";import*as RX from"node:path";function rZ1(J,Q,Z){return Promise.race([J,new Promise((X,Y)=>setTimeout(()=>Y(Error(`${Z} timed out after ${Q}ms`)),Q))])}class fl1{config;workspaceRoots;watchFactory;debounceMs;changes=new b8;watchers=new Map;debounceTimer;disposed=!1;constructor(J,Q,Z={}){this.config=J,this.workspaceRoots=Q,this.watchFactory=Z.watchFactory??AD6,this.debounceMs=Z.debounceMs??200}get commandChanges(){return this.changes}async discoverCommands(){if(this.disposed)return[];try{let[J,Q]=await Promise.all([this.discoverWorkspaceCommands(),this.discoverGlobalCommands()]),Z=new Map;for(let Y of Q)Z.set(Y.name,Y);for(let Y of J)Z.set(Y.name,Y);let X=Array.from(Z.values());if(u.debug("Discovered commands",{count:X.length,workspace:J.length,global:Q.length}),this.config.enableWatching)await this.setupWatching();return X}catch(J){return u.error("Failed to discover commands",{error:J}),[]}}async discoverWorkspaceCommands(){let J=[];for(let Q of this.workspaceRoots)for(let Z of this.config.workspacePaths){let X=b0.joinPath(Q,Z),Y=await this.discoverCommandsInDirectory(X,"workspace");J.push(...Y)}return J}async discoverGlobalCommands(){let J=[];for(let Q of this.config.globalPaths){let Z=this.resolveGlobalPath(Q),X=w0.file(Z),Y=await this.discoverCommandsInDirectory(X,"global");J.push(...Y)}return J}async discoverCommandsInDirectory(J,Q){try{let Z=J.fsPath;try{await rZ1(ud.access(Z),aZ1,"directory access")}catch{return[]}let Y=(await rZ1(ud.readdir(Z,{withFileTypes:!0}),aZ1,"directory read")).filter((G)=>G.isFile()),K=[];for(let G of Y){let q=RX.join(Z,G.name),z=await this.createCommand(q);if(z)K.push(z)}return u.debug(`Discovered ${K.length} commands in ${Q} directory`,{directory:Z,commands:K.map((G)=>G.name)}),K}catch(Z){return u.warn(`Failed to discover commands in directory: ${J.fsPath}`,{error:Z}),[]}}ignoreCommandName(J){return J.startsWith(".")||J==="README.md"}async createCommand(J){try{let Q=await ud.stat(J),Z=RX.basename(J);if(this.ignoreCommandName(Z))return null;let X=kl1(Z);if(!_l1(X))return u.warn(`Invalid command name: ${X}`,{filePath:J}),null;if(vl1(Z))return this.createMarkdownCommand(J,Q,X);else return this.createExecutableCommand(J,Q,X)}catch(Q){return u.warn(`Failed to process file: ${J}`,{error:Q}),null}}async createMarkdownCommand(J,Q,Z){return{kind:"markdown",name:Z,filePath:J,sourceDirectory:RX.dirname(J),lastModified:Q.mtimeMs,available:!0,unavailableReason:void 0}}async createExecutableCommand(J,Q,Z){let X=RX.basename(J),Y=Sl1(Q.mode,X),K=await Cl1(J),G=RX.extname(X);if(!Y&&!K.isValid&&!this.isNativeBinary(G))return u.debug(`Skipping non-executable file without shebang: ${J}`),null;let q=Y&&(K.isValid||this.isNativeBinary(G)),z=this.getExecutableUnavailableReason(Y,K.isValid,G);return{kind:"executable",name:Z,filePath:J,sourceDirectory:RX.dirname(J),lastModified:Q.mtimeMs,isExecutable:Y,interpreter:K.interpreter,extension:G,available:q,unavailableReason:z}}isNativeBinary(J){if(process.platform==="win32")return[".exe",".bat",".cmd",".ps1"].includes(J.toLowerCase());return J===""}getExecutableUnavailableReason(J,Q,Z){let X=this.isNativeBinary(Z);if(!J)return"File is not executable (missing execute permissions)";if(!Q&&!X)return"Missing shebang and not a recognized binary type";return}resolveGlobalPath(J){if(J.startsWith("~/"))return RX.join(bl1(),J.slice(2));if(J.startsWith("~/.config/amp/")){let Q=AB||RX.join(bl1(),".config");return RX.join(Q,J.slice(10))}return J}async setupWatching(){if(this.disposed)return;this.stopWatching();let J=new Set;for(let Q of this.workspaceRoots)for(let Z of this.config.workspacePaths){let X=b0.joinPath(Q,Z);J.add(X.fsPath)}for(let Q of this.config.globalPaths){let Z=this.resolveGlobalPath(Q);J.add(Z)}for(let Q of J)await this.watchDirectory(Q)}async watchDirectory(J){try{await rZ1(ud.access(J),aZ1,"watcher access check");try{let Q=this.watchFactory(J,(Z,X)=>{u.debug("Command directory change detected",{directory:J,eventType:Z,filename:X}),this.scheduleRefresh()});Q.on("error",(Z)=>{u.debug("transient file watcher error",{error:Z}),this.scheduleRefresh()}),this.watchers.set(J,Q),u.debug("Started watching command directory",{directory:J})}catch(Q){u.warn("Failed to setup file watcher",{directory:J,error:Q})}}catch(Q){u.debug("Skipping watch for non-existent directory",{directory:J})}}scheduleRefresh(){if(this.disposed)return;if(this.debounceTimer)clearTimeout(this.debounceTimer);this.debounceTimer=setTimeout(async()=>{try{let[J,Q]=await Promise.all([this.discoverWorkspaceCommands(),this.discoverGlobalCommands()]),Z=new Map;for(let Y of Q)Z.set(Y.name,Y);for(let Y of J)Z.set(Y.name,Y);let X=Array.from(Z.values());u.debug("Refreshed commands during file watch",{count:X.length,workspace:J.length,global:Q.length}),this.changes.next(X)}catch(J){u.warn("Failed to refresh commands during file watch",{error:J})}},this.debounceMs)}stopWatching(){try{for(let[J,Q]of this.watchers)try{Q.close(),u.debug("Stopped watching command directory",{directory:J})}catch(Z){u.warn("Failed to close watcher",{directory:J,error:Z})}this.watchers.clear()}finally{if(this.debounceTimer)clearTimeout(this.debounceTimer),this.debounceTimer=void 0}}dispose(){this.disposed=!0;try{this.stopWatching()}catch(J){u.warn("Error during command discovery cleanup",{error:J})}}}var aZ1=5000,AD6=(J,Q)=>yl1.watch(J,Q);var gl1=B1(()=>{b6();C0();QO();G0();xl1()});import{homedir as pd}from"node:os";import hN from"node:path";var ul1,RD6,pl1,OD6,dd,jD6,ZO,wB,sZ1;var DW=B1(()=>{QO();ul1=hN.join(pd(),".local/share"),RD6=process.platform==="win32"||process.platform==="darwin"?ul1:LB??ul1,pl1=hN.join(pd(),".config"),OD6=process.platform==="win32"||process.platform==="darwin"?pl1:AB??pl1,dd=hN.join(RD6,"amp"),jD6=hN.join(OD6,"amp"),ZO=hN.join(jD6,"tools"),wB=hN.join(pd(),".cache","amp"),sZ1=hN.join(pd(),".cache","amp","http-debug-logs")});function wQ(J,Q,Z=Q+"s"){return J===1?Q:Z}var rl1="run_terminal_command",sl1="read_file",e5="Task",ol1="chat_llm",C5="finder",RB="fast_finder",sq="xai_finder",oq="kimiK2_finder",OB="gossip_finder",jB="sonoma_finder",gN="get_diagnostics",i4="Bash",JJ="oracle",wS="mermaid",$B="todo_read",QJ="todo_write",tq="read_web_page",tl1="run_javascript",HZ="create_file",EB="glob",el1="Glob",cd="undo_edit",ld="read_mcp_resource",G9="Read",OX="edit_file",id="format_file",IB="web_search",k4="Grep",RS="Check",eq="librarian",nd="read_github",ad="search_github",rd="commit_search",sd="list_directory_github",od="list_repositories",td="glob_github",ed="diff",Ji1;var N8=B1(()=>{Ji1=["Task","chat_llm","finder","fast_finder","xai_finder","kimiK2_finder","gossip_finder","sonoma_finder","get_diagnostics","Bash","oracle","mermaid","todo_read","todo_write","read_web_page","run_javascript","create_file","glob","Glob","undo_edit","Read","edit_file","format_file","web_search","Grep","search_documents","get_document","Check","code_review","librarian"]});var OS=a((eM9,Zi1)=>{var Qi1={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},yD6={...Qi1,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},fD6={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Zi1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:fD6,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(J){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${J.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(J){return J===!0?yD6:Qi1}}});var jS=a((pD6)=>{var{REGEX_BACKSLASH:hD6,REGEX_REMOVE_BACKSLASH:gD6,REGEX_SPECIAL_CHARS:mD6,REGEX_SPECIAL_CHARS_GLOBAL:uD6}=OS();pD6.isObject=(J)=>J!==null&&typeof J==="object"&&!Array.isArray(J);pD6.hasRegexChars=(J)=>mD6.test(J);pD6.isRegexChar=(J)=>J.length===1&&pD6.hasRegexChars(J);pD6.escapeRegex=(J)=>J.replace(uD6,"\\$1");pD6.toPosixSlashes=(J)=>J.replace(hD6,"/");pD6.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let J=navigator.platform.toLowerCase();return J==="win32"||J==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};pD6.removeBackslashes=(J)=>{return J.replace(gD6,(Q)=>{return Q==="\\"?"":Q})};pD6.escapeLast=(J,Q,Z)=>{let X=J.lastIndexOf(Q,Z);if(X===-1)return J;if(J[X-1]==="\\")return pD6.escapeLast(J,Q,X-1);return`${J.slice(0,X)}\\${J.slice(X)}`};pD6.removePrefix=(J,Q={})=>{let Z=J;if(Z.startsWith("./"))Z=Z.slice(2),Q.prefix="./";return Z};pD6.wrapOutput=(J,Q={},Z={})=>{let X=Z.contains?"":"^",Y=Z.contains?"":"$",K=`${X}(?:${J})${Y}`;if(Q.negated===!0)K=`(?:^(?!${K}).*$)`;return K};pD6.basename=(J,{windows:Q}={})=>{let Z=J.split(Q?/[\\/]/:"/"),X=Z[Z.length-1];if(X==="")return Z[Z.length-2];return X}});var Hi1=a((QV9,Fi1)=>{var Ki1=jS(),{CHAR_ASTERISK:tZ1,CHAR_AT:tD6,CHAR_BACKWARD_SLASH:$S,CHAR_COMMA:eD6,CHAR_DOT:eZ1,CHAR_EXCLAMATION_MARK:JX1,CHAR_FORWARD_SLASH:Wi1,CHAR_LEFT_CURLY_BRACE:QX1,CHAR_LEFT_PARENTHESES:ZX1,CHAR_LEFT_SQUARE_BRACKET:JM6,CHAR_PLUS:QM6,CHAR_QUESTION_MARK:Gi1,CHAR_RIGHT_CURLY_BRACE:ZM6,CHAR_RIGHT_PARENTHESES:qi1,CHAR_RIGHT_SQUARE_BRACKET:XM6}=OS(),zi1=(J)=>{return J===Wi1||J===$S},Ui1=(J)=>{if(J.isPrefix!==!0)J.depth=J.isGlobstar?1/0:1},YM6=(J,Q)=>{let Z=Q||{},X=J.length-1,Y=Z.parts===!0||Z.scanToEnd===!0,K=[],G=[],q=[],z=J,U=-1,W=0,F=0,H=!1,B=!1,M=!1,V=!1,N=!1,L=!1,A=!1,w=!1,R=!1,O=!1,j=0,$,E,I={value:"",depth:0,isGlob:!1},T=()=>U>=X,S=()=>z.charCodeAt(U+1),x=()=>{return $=E,z.charCodeAt(++U)};while(U<X){E=x();let g;if(E===$S){if(A=I.backslashes=!0,E=x(),E===QX1)L=!0;continue}if(L===!0||E===QX1){j++;while(T()!==!0&&(E=x())){if(E===$S){A=I.backslashes=!0,x();continue}if(E===QX1){j++;continue}if(L!==!0&&E===eZ1&&(E=x())===eZ1){if(H=I.isBrace=!0,M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(L!==!0&&E===eD6){if(H=I.isBrace=!0,M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===ZM6){if(j--,j===0){L=!1,H=I.isBrace=!0,O=!0;break}}}if(Y===!0)continue;break}if(E===Wi1){if(K.push(U),G.push(I),I={value:"",depth:0,isGlob:!1},O===!0)continue;if($===eZ1&&U===W+1){W+=2;continue}F=U+1;continue}if(Z.noext!==!0){if((E===QM6||E===tD6||E===tZ1||E===Gi1||E===JX1)===!0&&S()===ZX1){if(M=I.isGlob=!0,V=I.isExtglob=!0,O=!0,E===JX1&&U===W)R=!0;if(Y===!0){while(T()!==!0&&(E=x())){if(E===$S){A=I.backslashes=!0,E=x();continue}if(E===qi1){M=I.isGlob=!0,O=!0;break}}continue}break}}if(E===tZ1){if($===tZ1)N=I.isGlobstar=!0;if(M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===Gi1){if(M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===JM6){while(T()!==!0&&(g=x())){if(g===$S){A=I.backslashes=!0,x();continue}if(g===XM6){B=I.isBracket=!0,M=I.isGlob=!0,O=!0;break}}if(Y===!0)continue;break}if(Z.nonegate!==!0&&E===JX1&&U===W){w=I.negated=!0,W++;continue}if(Z.noparen!==!0&&E===ZX1){if(M=I.isGlob=!0,Y===!0){while(T()!==!0&&(E=x())){if(E===ZX1){A=I.backslashes=!0,E=x();continue}if(E===qi1){O=!0;break}}continue}break}if(M===!0){if(O=!0,Y===!0)continue;break}}if(Z.noext===!0)V=!1,M=!1;let h=z,v="",_="";if(W>0)v=z.slice(0,W),z=z.slice(W),F-=W;if(h&&M===!0&&F>0)h=z.slice(0,F),_=z.slice(F);else if(M===!0)h="",_=z;else h=z;if(h&&h!==""&&h!=="/"&&h!==z){if(zi1(h.charCodeAt(h.length-1)))h=h.slice(0,-1)}if(Z.unescape===!0){if(_)_=Ki1.removeBackslashes(_);if(h&&A===!0)h=Ki1.removeBackslashes(h)}let b={prefix:v,input:J,start:W,base:h,glob:_,isBrace:H,isBracket:B,isGlob:M,isExtglob:V,isGlobstar:N,negated:w,negatedExtglob:R};if(Z.tokens===!0){if(b.maxDepth=0,!zi1(E))G.push(I);b.tokens=G}if(Z.parts===!0||Z.tokens===!0){let g;for(let k=0;k<K.length;k++){let y=g?g+1:W,f=K[k],m=J.slice(y,f);if(Z.tokens){if(k===0&&W!==0)G[k].isPrefix=!0,G[k].value=v;else G[k].value=m;Ui1(G[k]),b.maxDepth+=G[k].depth}if(k!==0||m!=="")q.push(m);g=f}if(g&&g+1<J.length){let k=J.slice(g+1);if(q.push(k),Z.tokens)G[G.length-1].value=k,Ui1(G[G.length-1]),b.maxDepth+=G[G.length-1].depth}b.slashes=K,b.parts=q}return b};Fi1.exports=YM6});var Mi1=a((ZV9,Di1)=>{var Jc=OS(),Jz=jS(),{MAX_LENGTH:Qc,POSIX_REGEX_SOURCE:KM6,REGEX_NON_SPECIAL_CHARS:GM6,REGEX_SPECIAL_CHARS_BACKREF:qM6,REPLACEMENTS:Bi1}=Jc,zM6=(J,Q)=>{if(typeof Q.expandRange==="function")return Q.expandRange(...J,Q);J.sort();let Z=`[${J.join("-")}]`;try{new RegExp(Z)}catch(X){return J.map((Y)=>Jz.escapeRegex(Y)).join("..")}return Z},YO=(J,Q)=>{return`Missing ${J}: "${Q}" - use "\\\\${Q}" to match literal characters`},XX1=(J,Q)=>{if(typeof J!=="string")throw TypeError("Expected a string");J=Bi1[J]||J;let Z={...Q},X=typeof Z.maxLength==="number"?Math.min(Qc,Z.maxLength):Qc,Y=J.length;if(Y>X)throw SyntaxError(`Input length: ${Y}, exceeds maximum allowed length: ${X}`);let K={type:"bos",value:"",output:Z.prepend||""},G=[K],q=Z.capture?"":"?:",z=Jc.globChars(Z.windows),U=Jc.extglobChars(z),{DOT_LITERAL:W,PLUS_LITERAL:F,SLASH_LITERAL:H,ONE_CHAR:B,DOTS_SLASH:M,NO_DOT:V,NO_DOT_SLASH:N,NO_DOTS_SLASH:L,QMARK:A,QMARK_NO_DOT:w,STAR:R,START_ANCHOR:O}=z,j=(F1)=>{return`(${q}(?:(?!${O}${F1.dot?M:W}).)*?)`},$=Z.dot?"":V,E=Z.dot?A:w,I=Z.bash===!0?j(Z):R;if(Z.capture)I=`(${I})`;if(typeof Z.noext==="boolean")Z.noextglob=Z.noext;let T={input:J,index:-1,start:0,dot:Z.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:G};J=Jz.removePrefix(J,T),Y=J.length;let S=[],x=[],h=[],v=K,_,b=()=>T.index===Y-1,g=T.peek=(F1=1)=>J[T.index+F1],k=T.advance=()=>J[++T.index]||"",y=()=>J.slice(T.index+1),f=(F1="",l=0)=>{T.consumed+=F1,T.index+=l},m=(F1)=>{T.output+=F1.output!=null?F1.output:F1.value,f(F1.value)},n=()=>{let F1=1;while(g()==="!"&&(g(2)!=="("||g(3)==="?"))k(),T.start++,F1++;if(F1%2===0)return!1;return T.negated=!0,T.start++,!0},p=(F1)=>{T[F1]++,h.push(F1)},e=(F1)=>{T[F1]--,h.pop()},G1=(F1)=>{if(v.type==="globstar"){let l=T.braces>0&&(F1.type==="comma"||F1.type==="brace"),d=F1.extglob===!0||S.length&&(F1.type==="pipe"||F1.type==="paren");if(F1.type!=="slash"&&F1.type!=="paren"&&!l&&!d)T.output=T.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=I,T.output+=v.output}if(S.length&&F1.type!=="paren")S[S.length-1].inner+=F1.value;if(F1.value||F1.output)m(F1);if(v&&v.type==="text"&&F1.type==="text"){v.output=(v.output||v.value)+F1.value,v.value+=F1.value;return}F1.prev=v,G.push(F1),v=F1},U1=(F1,l)=>{let d={...U[l],conditions:1,inner:""};d.prev=v,d.parens=T.parens,d.output=T.output;let i=(Z.capture?"(":"")+d.open;p("parens"),G1({type:F1,value:l,output:T.output?"":B}),G1({type:"paren",extglob:!0,value:k(),output:i}),S.push(d)},Z1=(F1)=>{let l=F1.close+(Z.capture?")":""),d;if(F1.type==="negate"){let i=I;if(F1.inner&&F1.inner.length>1&&F1.inner.includes("/"))i=j(Z);if(i!==I||b()||/^\)+$/.test(y()))l=F1.close=`)$))${i}`;if(F1.inner.includes("*")&&(d=y())&&/^\.[^\\/.]+$/.test(d)){let r=XX1(d,{...Q,fastpaths:!1}).output;l=F1.close=`)${r})${i})`}if(F1.prev.type==="bos")T.negatedExtglob=!0}G1({type:"paren",extglob:!0,value:_,output:l}),e("parens")};if(Z.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(J)){let F1=!1,l=J.replace(qM6,(d,i,r,o,Y1,J1)=>{if(o==="\\")return F1=!0,d;if(o==="?"){if(i)return i+o+(Y1?A.repeat(Y1.length):"");if(J1===0)return E+(Y1?A.repeat(Y1.length):"");return A.repeat(r.length)}if(o===".")return W.repeat(r.length);if(o==="*"){if(i)return i+o+(Y1?I:"");return I}return i?d:`\\${d}`});if(F1===!0)if(Z.unescape===!0)l=l.replace(/\\/g,"");else l=l.replace(/\\+/g,(d)=>{return d.length%2===0?"\\\\":d?"\\":""});if(l===J&&Z.contains===!0)return T.output=J,T;return T.output=Jz.wrapOutput(l,T,Q),T}while(!b()){if(_=k(),_==="\x00")continue;if(_==="\\"){let d=g();if(d==="/"&&Z.bash!==!0)continue;if(d==="."||d===";")continue;if(!d){_+="\\",G1({type:"text",value:_});continue}let i=/^\\+/.exec(y()),r=0;if(i&&i[0].length>2){if(r=i[0].length,T.index+=r,r%2!==0)_+="\\"}if(Z.unescape===!0)_=k();else _+=k();if(T.brackets===0){G1({type:"text",value:_});continue}}if(T.brackets>0&&(_!=="]"||v.value==="["||v.value==="[^")){if(Z.posix!==!1&&_===":"){let d=v.value.slice(1);if(d.includes("[")){if(v.posix=!0,d.includes(":")){let i=v.value.lastIndexOf("["),r=v.value.slice(0,i),o=v.value.slice(i+2),Y1=KM6[o];if(Y1){if(v.value=r+Y1,T.backtrack=!0,k(),!K.output&&G.indexOf(v)===1)K.output=B;continue}}}}if(_==="["&&g()!==":"||_==="-"&&g()==="]")_=`\\${_}`;if(_==="]"&&(v.value==="["||v.value==="[^"))_=`\\${_}`;if(Z.posix===!0&&_==="!"&&v.value==="[")_="^";v.value+=_,m({value:_});continue}if(T.quotes===1&&_!=='"'){_=Jz.escapeRegex(_),v.value+=_,m({value:_});continue}if(_==='"'){if(T.quotes=T.quotes===1?0:1,Z.keepQuotes===!0)G1({type:"text",value:_});continue}if(_==="("){p("parens"),G1({type:"paren",value:_});continue}if(_===")"){if(T.parens===0&&Z.strictBrackets===!0)throw SyntaxError(YO("opening","("));let d=S[S.length-1];if(d&&T.parens===d.parens+1){Z1(S.pop());continue}G1({type:"paren",value:_,output:T.parens?")":"\\)"}),e("parens");continue}if(_==="["){if(Z.nobracket===!0||!y().includes("]")){if(Z.nobracket!==!0&&Z.strictBrackets===!0)throw SyntaxError(YO("closing","]"));_=`\\${_}`}else p("brackets");G1({type:"bracket",value:_});continue}if(_==="]"){if(Z.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){G1({type:"text",value:_,output:`\\${_}`});continue}if(T.brackets===0){if(Z.strictBrackets===!0)throw SyntaxError(YO("opening","["));G1({type:"text",value:_,output:`\\${_}`});continue}e("brackets");let d=v.value.slice(1);if(v.posix!==!0&&d[0]==="^"&&!d.includes("/"))_=`/${_}`;if(v.value+=_,m({value:_}),Z.literalBrackets===!1||Jz.hasRegexChars(d))continue;let i=Jz.escapeRegex(v.value);if(T.output=T.output.slice(0,-v.value.length),Z.literalBrackets===!0){T.output+=i,v.value=i;continue}v.value=`(${q}${i}|${v.value})`,T.output+=v.value;continue}if(_==="{"&&Z.nobrace!==!0){p("braces");let d={type:"brace",value:_,output:"(",outputIndex:T.output.length,tokensIndex:T.tokens.length};x.push(d),G1(d);continue}if(_==="}"){let d=x[x.length-1];if(Z.nobrace===!0||!d){G1({type:"text",value:_,output:_});continue}let i=")";if(d.dots===!0){let r=G.slice(),o=[];for(let Y1=r.length-1;Y1>=0;Y1--){if(G.pop(),r[Y1].type==="brace")break;if(r[Y1].type!=="dots")o.unshift(r[Y1].value)}i=zM6(o,Z),T.backtrack=!0}if(d.comma!==!0&&d.dots!==!0){let r=T.output.slice(0,d.outputIndex),o=T.tokens.slice(d.tokensIndex);d.value=d.output="\\{",_=i="\\}",T.output=r;for(let Y1 of o)T.output+=Y1.output||Y1.value}G1({type:"brace",value:_,output:i}),e("braces"),x.pop();continue}if(_==="|"){if(S.length>0)S[S.length-1].conditions++;G1({type:"text",value:_});continue}if(_===","){let d=_,i=x[x.length-1];if(i&&h[h.length-1]==="braces")i.comma=!0,d="|";G1({type:"comma",value:_,output:d});continue}if(_==="/"){if(v.type==="dot"&&T.index===T.start+1){T.start=T.index+1,T.consumed="",T.output="",G.pop(),v=K;continue}G1({type:"slash",value:_,output:H});continue}if(_==="."){if(T.braces>0&&v.type==="dot"){if(v.value===".")v.output=W;let d=x[x.length-1];v.type="dots",v.output+=_,v.value+=_,d.dots=!0;continue}if(T.braces+T.parens===0&&v.type!=="bos"&&v.type!=="slash"){G1({type:"text",value:_,output:W});continue}G1({type:"dot",value:_,output:W});continue}if(_==="?"){if(!(v&&v.value==="(")&&Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){U1("qmark",_);continue}if(v&&v.type==="paren"){let i=g(),r=_;if(v.value==="("&&!/[!=<:]/.test(i)||i==="<"&&!/<([!=]|\w+>)/.test(y()))r=`\\${_}`;G1({type:"text",value:_,output:r});continue}if(Z.dot!==!0&&(v.type==="slash"||v.type==="bos")){G1({type:"qmark",value:_,output:w});continue}G1({type:"qmark",value:_,output:A});continue}if(_==="!"){if(Z.noextglob!==!0&&g()==="("){if(g(2)!=="?"||!/[!=<:]/.test(g(3))){U1("negate",_);continue}}if(Z.nonegate!==!0&&T.index===0){n();continue}}if(_==="+"){if(Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){U1("plus",_);continue}if(v&&v.value==="("||Z.regex===!1){G1({type:"plus",value:_,output:F});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||T.parens>0){G1({type:"plus",value:_});continue}G1({type:"plus",value:F});continue}if(_==="@"){if(Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){G1({type:"at",extglob:!0,value:_,output:""});continue}G1({type:"text",value:_});continue}if(_!=="*"){if(_==="$"||_==="^")_=`\\${_}`;let d=GM6.exec(y());if(d)_+=d[0],T.index+=d[0].length;G1({type:"text",value:_});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=_,v.output=I,T.backtrack=!0,T.globstar=!0,f(_);continue}let F1=y();if(Z.noextglob!==!0&&/^\([^?]/.test(F1)){U1("star",_);continue}if(v.type==="star"){if(Z.noglobstar===!0){f(_);continue}let d=v.prev,i=d.prev,r=d.type==="slash"||d.type==="bos",o=i&&(i.type==="star"||i.type==="globstar");if(Z.bash===!0&&(!r||F1[0]&&F1[0]!=="/")){G1({type:"star",value:_,output:""});continue}let Y1=T.braces>0&&(d.type==="comma"||d.type==="brace"),J1=S.length&&(d.type==="pipe"||d.type==="paren");if(!r&&d.type!=="paren"&&!Y1&&!J1){G1({type:"star",value:_,output:""});continue}while(F1.slice(0,3)==="/**"){let H1=J[T.index+4];if(H1&&H1!=="/")break;F1=F1.slice(3),f("/**",3)}if(d.type==="bos"&&b()){v.type="globstar",v.value+=_,v.output=j(Z),T.output=v.output,T.globstar=!0,f(_);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&!o&&b()){T.output=T.output.slice(0,-(d.output+v.output).length),d.output=`(?:${d.output}`,v.type="globstar",v.output=j(Z)+(Z.strictSlashes?")":"|$)"),v.value+=_,T.globstar=!0,T.output+=d.output+v.output,f(_);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&F1[0]==="/"){let H1=F1[1]!==void 0?"|$":"";T.output=T.output.slice(0,-(d.output+v.output).length),d.output=`(?:${d.output}`,v.type="globstar",v.output=`${j(Z)}${H}|${H}${H1})`,v.value+=_,T.output+=d.output+v.output,T.globstar=!0,f(_+k()),G1({type:"slash",value:"/",output:""});continue}if(d.type==="bos"&&F1[0]==="/"){v.type="globstar",v.value+=_,v.output=`(?:^|${H}|${j(Z)}${H})`,T.output=v.output,T.globstar=!0,f(_+k()),G1({type:"slash",value:"/",output:""});continue}T.output=T.output.slice(0,-v.output.length),v.type="globstar",v.output=j(Z),v.value+=_,T.output+=v.output,T.globstar=!0,f(_);continue}let l={type:"star",value:_,output:I};if(Z.bash===!0){if(l.output=".*?",v.type==="bos"||v.type==="slash")l.output=$+l.output;G1(l);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&Z.regex===!0){l.output=_,G1(l);continue}if(T.index===T.start||v.type==="slash"||v.type==="dot"){if(v.type==="dot")T.output+=N,v.output+=N;else if(Z.dot===!0)T.output+=L,v.output+=L;else T.output+=$,v.output+=$;if(g()!=="*")T.output+=B,v.output+=B}G1(l)}while(T.brackets>0){if(Z.strictBrackets===!0)throw SyntaxError(YO("closing","]"));T.output=Jz.escapeLast(T.output,"["),e("brackets")}while(T.parens>0){if(Z.strictBrackets===!0)throw SyntaxError(YO("closing",")"));T.output=Jz.escapeLast(T.output,"("),e("parens")}while(T.braces>0){if(Z.strictBrackets===!0)throw SyntaxError(YO("closing","}"));T.output=Jz.escapeLast(T.output,"{"),e("braces")}if(Z.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket"))G1({type:"maybe_slash",value:"",output:`${H}?`});if(T.backtrack===!0){T.output="";for(let F1 of T.tokens)if(T.output+=F1.output!=null?F1.output:F1.value,F1.suffix)T.output+=F1.suffix}return T};XX1.fastpaths=(J,Q)=>{let Z={...Q},X=typeof Z.maxLength==="number"?Math.min(Qc,Z.maxLength):Qc,Y=J.length;if(Y>X)throw SyntaxError(`Input length: ${Y}, exceeds maximum allowed length: ${X}`);J=Bi1[J]||J;let{DOT_LITERAL:K,SLASH_LITERAL:G,ONE_CHAR:q,DOTS_SLASH:z,NO_DOT:U,NO_DOTS:W,NO_DOTS_SLASH:F,STAR:H,START_ANCHOR:B}=Jc.globChars(Z.windows),M=Z.dot?W:U,V=Z.dot?F:U,N=Z.capture?"":"?:",L={negated:!1,prefix:""},A=Z.bash===!0?".*?":H;if(Z.capture)A=`(${A})`;let w=($)=>{if($.noglobstar===!0)return A;return`(${N}(?:(?!${B}${$.dot?z:K}).)*?)`},R=($)=>{switch($){case"*":return`${M}${q}${A}`;case".*":return`${K}${q}${A}`;case"*.*":return`${M}${A}${K}${q}${A}`;case"*/*":return`${M}${A}${G}${q}${V}${A}`;case"**":return M+w(Z);case"**/*":return`(?:${M}${w(Z)}${G})?${V}${q}${A}`;case"**/*.*":return`(?:${M}${w(Z)}${G})?${V}${A}${K}${q}${A}`;case"**/.*":return`(?:${M}${w(Z)}${G})?${K}${q}${A}`;default:{let E=/^(.*?)\.(\w+)$/.exec($);if(!E)return;let I=R(E[1]);if(!I)return;return I+K+E[2]}}},O=Jz.removePrefix(J,L),j=R(O);if(j&&Z.strictSlashes!==!0)j+=`${G}?`;return j};Di1.exports=XX1});var ES=a((XV9,Ni1)=>{var UM6=Hi1(),YX1=Mi1(),Vi1=jS(),WM6=OS(),FM6=(J)=>J&&typeof J==="object"&&!Array.isArray(J),W7=(J,Q,Z=!1)=>{if(Array.isArray(J)){let W=J.map((H)=>W7(H,Q,Z));return(H)=>{for(let B of W){let M=B(H);if(M)return M}return!1}}let X=FM6(J)&&J.tokens&&J.input;if(J===""||typeof J!=="string"&&!X)throw TypeError("Expected pattern to be a non-empty string");let Y=Q||{},K=Y.windows,G=X?W7.compileRe(J,Q):W7.makeRe(J,Q,!1,!0),q=G.state;delete G.state;let z=()=>!1;if(Y.ignore){let W={...Q,ignore:null,onMatch:null,onResult:null};z=W7(Y.ignore,W,Z)}let U=(W,F=!1)=>{let{isMatch:H,match:B,output:M}=W7.test(W,G,Q,{glob:J,posix:K}),V={glob:J,state:q,regex:G,posix:K,input:W,output:M,match:B,isMatch:H};if(typeof Y.onResult==="function")Y.onResult(V);if(H===!1)return V.isMatch=!1,F?V:!1;if(z(W)){if(typeof Y.onIgnore==="function")Y.onIgnore(V);return V.isMatch=!1,F?V:!1}if(typeof Y.onMatch==="function")Y.onMatch(V);return F?V:!0};if(Z)U.state=q;return U};W7.test=(J,Q,Z,{glob:X,posix:Y}={})=>{if(typeof J!=="string")throw TypeError("Expected input to be a string");if(J==="")return{isMatch:!1,output:""};let K=Z||{},G=K.format||(Y?Vi1.toPosixSlashes:null),q=J===X,z=q&&G?G(J):J;if(q===!1)z=G?G(J):J,q=z===X;if(q===!1||K.capture===!0)if(K.matchBase===!0||K.basename===!0)q=W7.matchBase(J,Q,Z,Y);else q=Q.exec(z);return{isMatch:Boolean(q),match:q,output:z}};W7.matchBase=(J,Q,Z)=>{return(Q instanceof RegExp?Q:W7.makeRe(Q,Z)).test(Vi1.basename(J))};W7.isMatch=(J,Q,Z)=>W7(Q,Z)(J);W7.parse=(J,Q)=>{if(Array.isArray(J))return J.map((Z)=>W7.parse(Z,Q));return YX1(J,{...Q,fastpaths:!1})};W7.scan=(J,Q)=>UM6(J,Q);W7.compileRe=(J,Q,Z=!1,X=!1)=>{if(Z===!0)return J.output;let Y=Q||{},K=Y.contains?"":"^",G=Y.contains?"":"$",q=`${K}(?:${J.output})${G}`;if(J&&J.negated===!0)q=`^(?!${q}).*$`;let z=W7.toRegex(q,Q);if(X===!0)z.state=J;return z};W7.makeRe=(J,Q={},Z=!1,X=!1)=>{if(!J||typeof J!=="string")throw TypeError("Expected a non-empty string");let Y={negated:!1,fastpaths:!0};if(Q.fastpaths!==!1&&(J[0]==="."||J[0]==="*"))Y.output=YX1.fastpaths(J,Q);if(!Y.output)Y=YX1(J,Q);return W7.compileRe(Y,Q,Z,X)};W7.toRegex=(J,Q)=>{try{let Z=Q||{};return new RegExp(J,Z.flags||(Z.nocase?"i":""))}catch(Z){if(Q&&Q.debug===!0)throw Z;return/$^/}};W7.constants=WM6;Ni1.exports=W7});var mN=a((YV9,wi1)=>{var Li1=ES(),HM6=jS();function Ai1(J,Q,Z=!1){if(Q&&(Q.windows===null||Q.windows===void 0))Q={...Q,windows:HM6.isWindows()};return Li1(J,Q,Z)}Object.assign(Ai1,Li1);wi1.exports=Ai1});function Zc(J){if(!J)return null;let Z=Yc(J)?.toolAllowlist;if(!Z)return null;let X=Object.entries(IS).find(([K,G])=>G.includes(J))?.[0],Y=ji1.filter((K)=>K!==X).map((K)=>`!${K}`);if(X&&X!=="finder")Y.push("!finder");return[...Z,...Y]}function Xc(J,Q){let Z=!1;for(let X of Q){if(X==="")continue;if(X.startsWith("!")){let Y=X.slice(1);if(Ri1(J,Y))return!1;continue}if(Ri1(J,X))Z=!0}return Z}function Ri1(J,Q){if(Q==="")return!1;if(Q.length===1){if(Q==="*")return!0;return!1}if(J===Q)return!0;if(Q.includes("*")||Q.includes("?")||Q.includes("[")||Q.includes("{"))try{return Oi1.default(Q,{dot:!0})(J)}catch(Z){return!1}return!1}var Oi1;var KX1=B1(()=>{W2();Oi1=C6(mN(),1)});function y8(J){let Q=d2[J];return`${Q.provider}/${Q.name}`}function jX(J){let[Q,Z]=J.split("/");for(let X of Object.values(d2))if(X.provider===Q&&X.name===Z)return X;switch(Q){case"anthropic":return d2.CLAUDE_SONNET_4_5;case"openai":return d2.GPT_5;case"xai":return d2.GROK_CODE_FAST_1;case"cerebras":return d2.QWEN_3_CODER_480B;case"moonshotai":return d2.KIMI_K2_INSTRUCT;case"openrouter":return d2.SONOMA_SKY_ALPHA;case"supernova":return d2.CODE_SUPERNOVA;case"groq":return d2.GPT_OSS_120B;default:throw Error(`Unknown provider: ${Q}`)}}function KO(J){let[,Q]=J.split("/");return Q||J}function Qz(J){let Q=jX(J);return Q.contextWindow-Q.maxOutputTokens}function EY(J){let Q=J?.["internal.visibleModes"]??[];return Object.values(uN).filter((Z)=>{if(Q.includes(`!${Z.key}`))return!1;let Y="visible"in Z?Z.visible:!1,K=Q.includes(Z.key);return Y||K}).map((Z)=>({mode:Z.key,description:"description"in Z?Z.description:void 0})).sort((Z,X)=>Z.mode.localeCompare(X.mode))}function Yc(J){return Object.values(uN).find((Q)=>Q.key===J)}function $i1(J){return Yc(J)?.primaryModel??y8("CLAUDE_SONNET_4_5")}function Kc(J){let Q=Yc(J);if(!Q)return!1;return jX(Q.primaryModel).capabilities?.vision??!1}function qO(J,Q){return Q.find((Z)=>Z.mode===J)?.description}function Gc(J,Q){let X=(Q.findIndex((K)=>K.mode===J)+1)%Q.length;return Q[X]?.mode??"smart"}var k2,d2,uN,GO,IS,ji1;var W2=B1(()=>{k2={ANTHROPIC:"anthropic",OPENAI:"openai",XAI:"xai",CEREBRAS:"cerebras",GROQ:"groq",MOONSHOT:"moonshotai",OPENROUTER:"openrouter",VERTEXAI:"vertexai",SUPERNOVA:"supernova"},d2={CLAUDE_SONNET_4:{provider:k2.ANTHROPIC,name:"claude-sonnet-4-20250514",displayName:"Claude Sonnet 4",contextWindow:1e6,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_SONNET_4_5:{provider:k2.ANTHROPIC,name:"claude-sonnet-4-5-20250929",displayName:"Claude Sonnet 4.5",contextWindow:1e6,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4:{provider:k2.ANTHROPIC,name:"claude-opus-4-20250514",displayName:"Claude Opus 4",contextWindow:200000,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4_1:{provider:k2.ANTHROPIC,name:"claude-opus-4-1-20250805",displayName:"Claude Opus 4.1",contextWindow:200000,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_HAIKU_4_5:{provider:k2.ANTHROPIC,name:"claude-haiku-4-5-20251001",displayName:"Claude Haiku 4.5",contextWindow:200000,maxOutputTokens:64000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_3_5_HAIKU:{provider:k2.ANTHROPIC,name:"claude-3-5-haiku-20241022",displayName:"Claude 3.5 Haiku",contextWindow:200000,maxOutputTokens:8000,capabilities:{reasoning:!0,vision:!0,tools:!0},freeTierEligible:!0},CLAUDE_3_5_SONNET:{provider:k2.ANTHROPIC,name:"claude-3-5-sonnet-20241022",displayName:"Claude 3.5 Sonnet",contextWindow:200000,maxOutputTokens:8000,capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5:{provider:k2.OPENAI,name:"gpt-5",displayName:"GPT-5",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_CODEX:{provider:k2.OPENAI,name:"gpt-5-codex",displayName:"GPT-5 Codex",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,tools:!0}},GPT_5_MINI:{provider:k2.OPENAI,name:"gpt-5-mini",displayName:"GPT-5 Mini",contextWindow:400000,maxOutputTokens:128000,pricing:{input:0.25,output:2,cached:0.025},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_NANO:{provider:k2.OPENAI,name:"gpt-5-nano",displayName:"GPT-5 Nano",contextWindow:400000,maxOutputTokens:128000,pricing:{input:0.05,output:0.4,cached:0.005},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_4_1:{provider:k2.OPENAI,name:"gpt-4.1",displayName:"GPT-4.1",contextWindow:1047576,maxOutputTokens:32768,pricing:{input:2,output:8,cached:0.5},capabilities:{vision:!0,tools:!0}},GPT_4O:{provider:k2.OPENAI,name:"gpt-4o",displayName:"GPT-4o",contextWindow:128000,maxOutputTokens:16384,pricing:{input:2.5,output:10,cached:1.25},capabilities:{vision:!0,tools:!0}},O3:{provider:k2.OPENAI,name:"o3",displayName:"o3",contextWindow:200000,maxOutputTokens:1e5,pricing:{input:2,output:8,cached:0.5},capabilities:{reasoning:!0,tools:!0}},O3_MINI:{provider:k2.OPENAI,name:"o3-mini",displayName:"o3-mini",contextWindow:200000,maxOutputTokens:1e5,pricing:{input:1.1,output:4.4,cached:0.55},capabilities:{reasoning:!0,tools:!0}},GPT_OSS_120B:{provider:k2.OPENAI,name:"openai/gpt-oss-120b",displayName:"GPT OSS 120B",contextWindow:128000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0}},GROK_CODE_FAST_1:{provider:k2.XAI,name:"grok-code-fast-1",displayName:"Grok Code Fast 1",contextWindow:256000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0},freeTierEligible:!0},GROK_CODE:{provider:k2.XAI,name:"grok-code",displayName:"Grok Code",contextWindow:256000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0},freeTierEligible:!0},GEMINI_2_5_PRO:{provider:k2.VERTEXAI,name:"gemini-2.5-pro",displayName:"Gemini 2.5 Pro",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH:{provider:k2.VERTEXAI,name:"gemini-2.5-flash",displayName:"Gemini 2.5 Flash",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_PREVIEW_09_2025:{provider:k2.VERTEXAI,name:"gemini-2.5-flash-preview-09-2025",displayName:"Gemini 2.5 Flash (Preview)",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0},freeTierEligible:!0},GEMINI_2_5_FLASH_LITE:{provider:k2.VERTEXAI,name:"gemini-2.5-flash-lite",displayName:"Gemini 2.5 Flash Lite",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_LITE_PREVIEW_09_2025:{provider:k2.VERTEXAI,name:"gemini-2.5-flash-lite-preview-09-2025",displayName:"Gemini 2.5 Flash Lite (Preview)",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0},freeTierEligible:!0},QWEN_3_CODER_480B:{provider:k2.CEREBRAS,name:"qwen-3-coder-480b",displayName:"Qwen 3 Coder 480B",contextWindow:128000,maxOutputTokens:32000,capabilities:{tools:!0}},KIMI_K2_INSTRUCT:{provider:k2.MOONSHOT,name:"kimi-k2-instruct-0905",displayName:"Kimi K2 Instruct",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0}},SONOMA_SKY_ALPHA:{provider:k2.OPENROUTER,name:"sonoma-sky-alpha",displayName:"Sonoma Sky Alpha",contextWindow:256000,maxOutputTokens:32000,capabilities:{tools:!0}},CODE_SUPERNOVA:{provider:k2.SUPERNOVA,name:"code-supernova",displayName:"Code Supernova",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0},freeTierEligible:!0}};uN={SMART:{key:"smart",displayName:"Smart",description:"Smarter, but slower",primaryModel:y8("CLAUDE_SONNET_4_5"),visible:!0},FREE:{key:"free",displayName:"Free",description:"Amp Free",primaryModel:y8("GROK_CODE_FAST_1"),visible:!0,toolAllowlist:["*","!oracle","!librarian","!Task"]},FREE_NEXT:{key:"free-next",displayName:"Free (Next)",description:"Preview of Amp Free configuration in testing",primaryModel:y8("GEMINI_2_5_FLASH_PREVIEW_09_2025"),toolAllowlist:["*","!oracle","!librarian","!Task"]},GRONK_FAST_MAIN:{key:"gronk-fast:main",displayName:"Gronk Fast Main",primaryModel:y8("GROK_CODE_FAST_1")},GRONK_FAST_SEARCH:{key:"gronk-fast:search",displayName:"Gronk Fast Search",primaryModel:y8("CLAUDE_SONNET_4_5"),searchModel:y8("GROK_CODE_FAST_1")},GRONK_FAST_MAIN_SEARCH:{key:"gronk-fast:main+search",displayName:"Gronk Fast Main+Search",primaryModel:y8("GROK_CODE_FAST_1"),searchModel:y8("GROK_CODE_FAST_1")},BOLT_SEARCH:{key:"bolt:search",displayName:"Bolt Search",primaryModel:y8("CLAUDE_SONNET_4_5"),searchModel:y8("QWEN_3_CODER_480B")},BOLT_MAIN:{key:"bolt:main",displayName:"Bolt Main",primaryModel:y8("QWEN_3_CODER_480B")},BOLT_MAIN_SEARCH:{key:"bolt:main+search",displayName:"Bolt Main+Search",primaryModel:y8("QWEN_3_CODER_480B"),searchModel:y8("QWEN_3_CODER_480B")},GEPPETTO_MAIN:{key:"geppetto:main",displayName:"Geppetto Main",primaryModel:y8("GPT_5")},GEPPETTO_PRO_MAIN:{key:"geppetto-pro:main",displayName:"Geppetto Pro Main",primaryModel:y8("GPT_5")},PINOCCHIO_MAIN:{key:"pinocchio:main",displayName:"Pinocchio Main",primaryModel:y8("GPT_5_CODEX")},CLAUDIUS_MAIN:{key:"claudius:main",displayName:"Claudius Main",primaryModel:y8("CLAUDE_OPUS_4")},OPUS_4_1:{key:"opus4.1",displayName:"Opus 4.1",primaryModel:y8("CLAUDE_OPUS_4_1")},HYDROGEN_MAIN:{key:"hydrogen:main",displayName:"Hydrogen Main",primaryModel:y8("CODE_SUPERNOVA")},KASHMIR_MAIN:{key:"kashmir:main",displayName:"Kashmir Main",primaryModel:y8("KIMI_K2_INSTRUCT")},KASHMIR_SEARCH:{key:"kashmir:search",displayName:"Kashmir Search",primaryModel:y8("CLAUDE_SONNET_4_5"),searchModel:y8("KIMI_K2_INSTRUCT")},KASHMIR_MAIN_SEARCH:{key:"kashmir:main+search",displayName:"Kashmir Main+Search",primaryModel:y8("KIMI_K2_INSTRUCT"),searchModel:y8("KIMI_K2_INSTRUCT")},GOSSIP_MAIN:{key:"gossip:main",displayName:"Gossip Main",primaryModel:y8("GPT_OSS_120B")},GOSSIP_SEARCH:{key:"gossip:search",displayName:"Gossip Search",primaryModel:y8("CLAUDE_SONNET_4_5"),searchModel:y8("GPT_OSS_120B")},GOSSIP_MAIN_SEARCH:{key:"gossip:main+search",displayName:"Gossip Main+Search",primaryModel:y8("GPT_OSS_120B"),searchModel:y8("GPT_OSS_120B")},SONOMOON_MAIN:{key:"sonomoon:main",displayName:"Sonomoon Main",primaryModel:y8("SONOMA_SKY_ALPHA")},SONOMOON_SEARCH:{key:"sonomoon:search",displayName:"Sonomoon Search",primaryModel:y8("CLAUDE_SONNET_4_5"),searchModel:y8("SONOMA_SKY_ALPHA")},SONOMOON_MAIN_SEARCH:{key:"sonomoon:main+search",displayName:"Sonomoon Main+Search",primaryModel:y8("SONOMA_SKY_ALPHA"),searchModel:y8("SONOMA_SKY_ALPHA")}},GO=Object.values(uN).map((J)=>J.key),IS={xai_finder:["free","gronk-fast:search","gronk-fast:main+search"],fast_finder:["bolt:search","bolt:main+search"],kimiK2_finder:["kashmir:search","kashmir:main+search"],gossip_finder:["gossip:search","gossip:main+search"],sonoma_finder:["sonomoon:search","sonomoon:main+search"]},ji1=Object.keys(IS)});function GX1(J){return BM6.includes(J)}function Pi1(J){let Q=J["internal.oracleModel"]?.trim();if(Q&&Q.length>0)return Q;return d2.GPT_5.name}function Ti1(J){let Q=J["internal.model"]?.trim();if(!Q||Q.length===0)return null;let Z=Q.indexOf(":");if(Z===-1)return null;let X=Q.slice(0,Z).trim(),Y=Q.slice(Z+1).trim();if(!X||!Y)return null;return`${X}/${Y}`}var BM6,Ei1,Ii1;var zO=B1(()=>{W2();BM6=["guardedFiles.allowlist","mcpPermissions","tools.disable","permissions"];Ei1=["mcpServers","mcpPermissions","url"],Ii1=["apiKey","buildkite-access-token","github-access-token","gitlab-access-token","gitlab-instance-url"]});function PB(J){let Q=typeof J==="string"?J:J.toString();return Q===DZ||Q===DZ.slice(0,-1)}function UO(J){return PB(J)?DZ:J}var VM6,DZ,NM6,MV9;var TB=B1(()=>{VM6=new URL("https://ampcode.com/"),DZ=VM6.toString(),NM6=new URL("https://api.anthropic.com/"),MV9=NM6.toString()});var O9,qX1,e0,Zz=(J)=>{switch(typeof J){case"undefined":return e0.undefined;case"string":return e0.string;case"number":return Number.isNaN(J)?e0.nan:e0.number;case"boolean":return e0.boolean;case"function":return e0.function;case"bigint":return e0.bigint;case"symbol":return e0.symbol;case"object":if(Array.isArray(J))return e0.array;if(J===null)return e0.null;if(J.then&&typeof J.then==="function"&&J.catch&&typeof J.catch==="function")return e0.promise;if(typeof Map<"u"&&J instanceof Map)return e0.map;if(typeof Set<"u"&&J instanceof Set)return e0.set;if(typeof Date<"u"&&J instanceof Date)return e0.date;return e0.object;default:return e0.unknown}};var TS=B1(()=>{(function(J){J.assertEqual=(Y)=>{};function Q(Y){}J.assertIs=Q;function Z(Y){throw Error()}J.assertNever=Z,J.arrayToEnum=(Y)=>{let K={};for(let G of Y)K[G]=G;return K},J.getValidEnumValues=(Y)=>{let K=J.objectKeys(Y).filter((q)=>typeof Y[Y[q]]!=="number"),G={};for(let q of K)G[q]=Y[q];return J.objectValues(G)},J.objectValues=(Y)=>{return J.objectKeys(Y).map(function(K){return Y[K]})},J.objectKeys=typeof Object.keys==="function"?(Y)=>Object.keys(Y):(Y)=>{let K=[];for(let G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))K.push(G);return K},J.find=(Y,K)=>{for(let G of Y)if(K(G))return G;return},J.isInteger=typeof Number.isInteger==="function"?(Y)=>Number.isInteger(Y):(Y)=>typeof Y==="number"&&Number.isFinite(Y)&&Math.floor(Y)===Y;function X(Y,K=" | "){return Y.map((G)=>typeof G==="string"?`'${G}'`:G).join(K)}J.joinValues=X,J.jsonStringifyReplacer=(Y,K)=>{if(typeof K==="bigint")return K.toString();return K}})(O9||(O9={}));(function(J){J.mergeShapes=(Q,Z)=>{return{...Q,...Z}}})(qX1||(qX1={}));e0=O9.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var f0,LM6=(J)=>{return JSON.stringify(J,null,2).replace(/"([^"]+)":/g,"$1:")},MZ;var zc=B1(()=>{TS();f0=O9.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);MZ=class MZ extends Error{get errors(){return this.issues}constructor(J){super();this.issues=[],this.addIssue=(Z)=>{this.issues=[...this.issues,Z]},this.addIssues=(Z=[])=>{this.issues=[...this.issues,...Z]};let Q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,Q);else this.__proto__=Q;this.name="ZodError",this.issues=J}format(J){let Q=J||function(Y){return Y.message},Z={_errors:[]},X=(Y)=>{for(let K of Y.issues)if(K.code==="invalid_union")K.unionErrors.map(X);else if(K.code==="invalid_return_type")X(K.returnTypeError);else if(K.code==="invalid_arguments")X(K.argumentsError);else if(K.path.length===0)Z._errors.push(Q(K));else{let G=Z,q=0;while(q<K.path.length){let z=K.path[q];if(q!==K.path.length-1)G[z]=G[z]||{_errors:[]};else G[z]=G[z]||{_errors:[]},G[z]._errors.push(Q(K));G=G[z],q++}}};return X(this),Z}static assert(J){if(!(J instanceof MZ))throw Error(`Not a ZodError: ${J}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,O9.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(J=(Q)=>Q.message){let Q={},Z=[];for(let X of this.issues)if(X.path.length>0){let Y=X.path[0];Q[Y]=Q[Y]||[],Q[Y].push(J(X))}else Z.push(J(X));return{formErrors:Z,fieldErrors:Q}}get formErrors(){return this.flatten()}};MZ.create=(J)=>{return new MZ(J)}});var AM6=(J,Q)=>{let Z;switch(J.code){case f0.invalid_type:if(J.received===e0.undefined)Z="Required";else Z=`Expected ${J.expected}, received ${J.received}`;break;case f0.invalid_literal:Z=`Invalid literal value, expected ${JSON.stringify(J.expected,O9.jsonStringifyReplacer)}`;break;case f0.unrecognized_keys:Z=`Unrecognized key(s) in object: ${O9.joinValues(J.keys,", ")}`;break;case f0.invalid_union:Z="Invalid input";break;case f0.invalid_union_discriminator:Z=`Invalid discriminator value. Expected ${O9.joinValues(J.options)}`;break;case f0.invalid_enum_value:Z=`Invalid enum value. Expected ${O9.joinValues(J.options)}, received '${J.received}'`;break;case f0.invalid_arguments:Z="Invalid function arguments";break;case f0.invalid_return_type:Z="Invalid function return type";break;case f0.invalid_date:Z="Invalid date";break;case f0.invalid_string:if(typeof J.validation==="object")if("includes"in J.validation){if(Z=`Invalid input: must include "${J.validation.includes}"`,typeof J.validation.position==="number")Z=`${Z} at one or more positions greater than or equal to ${J.validation.position}`}else if("startsWith"in J.validation)Z=`Invalid input: must start with "${J.validation.startsWith}"`;else if("endsWith"in J.validation)Z=`Invalid input: must end with "${J.validation.endsWith}"`;else O9.assertNever(J.validation);else if(J.validation!=="regex")Z=`Invalid ${J.validation}`;else Z="Invalid";break;case f0.too_small:if(J.type==="array")Z=`Array must contain ${J.exact?"exactly":J.inclusive?"at least":"more than"} ${J.minimum} element(s)`;else if(J.type==="string")Z=`String must contain ${J.exact?"exactly":J.inclusive?"at least":"over"} ${J.minimum} character(s)`;else if(J.type==="number")Z=`Number must be ${J.exact?"exactly equal to ":J.inclusive?"greater than or equal to ":"greater than "}${J.minimum}`;else if(J.type==="bigint")Z=`Number must be ${J.exact?"exactly equal to ":J.inclusive?"greater than or equal to ":"greater than "}${J.minimum}`;else if(J.type==="date")Z=`Date must be ${J.exact?"exactly equal to ":J.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(J.minimum))}`;else Z="Invalid input";break;case f0.too_big:if(J.type==="array")Z=`Array must contain ${J.exact?"exactly":J.inclusive?"at most":"less than"} ${J.maximum} element(s)`;else if(J.type==="string")Z=`String must contain ${J.exact?"exactly":J.inclusive?"at most":"under"} ${J.maximum} character(s)`;else if(J.type==="number")Z=`Number must be ${J.exact?"exactly":J.inclusive?"less than or equal to":"less than"} ${J.maximum}`;else if(J.type==="bigint")Z=`BigInt must be ${J.exact?"exactly":J.inclusive?"less than or equal to":"less than"} ${J.maximum}`;else if(J.type==="date")Z=`Date must be ${J.exact?"exactly":J.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(J.maximum))}`;else Z="Invalid input";break;case f0.custom:Z="Invalid input";break;case f0.invalid_intersection_types:Z="Intersection results could not be merged";break;case f0.not_multiple_of:Z=`Number must be a multiple of ${J.multipleOf}`;break;case f0.not_finite:Z="Number must be finite";break;default:Z=Q.defaultError,O9.assertNever(J)}return{message:Z}},MW;var zX1=B1(()=>{zc();TS();MW=AM6});function wM6(J){Ci1=J}function WO(){return Ci1}var Ci1;var Uc=B1(()=>{zX1();Ci1=MW});function W6(J,Q){let Z=WO(),X=CS({issueData:Q,data:J.data,path:J.path,errorMaps:[J.common.contextualErrorMap,J.schemaErrorMap,Z,Z===MW?void 0:MW].filter((Y)=>!!Y)});J.common.issues.push(X)}class ZJ{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(J,Q){let Z=[];for(let X of Q){if(X.status==="aborted")return M8;if(X.status==="dirty")J.dirty();Z.push(X.value)}return{status:J.value,value:Z}}static async mergeObjectAsync(J,Q){let Z=[];for(let X of Q){let Y=await X.key,K=await X.value;Z.push({key:Y,value:K})}return ZJ.mergeObjectSync(J,Z)}static mergeObjectSync(J,Q){let Z={};for(let X of Q){let{key:Y,value:K}=X;if(Y.status==="aborted")return M8;if(K.status==="aborted")return M8;if(Y.status==="dirty")J.dirty();if(K.status==="dirty")J.dirty();if(Y.value!=="__proto__"&&(typeof K.value<"u"||X.alwaysSet))Z[Y.value]=K.value}return{status:J.value,value:Z}}}var CS=(J)=>{let{data:Q,path:Z,errorMaps:X,issueData:Y}=J,K=[...Z,...Y.path||[]],G={...Y,path:K};if(Y.message!==void 0)return{...Y,path:K,message:Y.message};let q="",z=X.filter((U)=>!!U).slice().reverse();for(let U of z)q=U(G,{data:Q,defaultError:q}).message;return{...Y,path:K,message:q}},RM6,M8,pN=(J)=>({status:"dirty",value:J}),kJ=(J)=>({status:"valid",value:J}),Wc=(J)=>J.status==="aborted",Fc=(J)=>J.status==="dirty",CB=(J)=>J.status==="valid",FO=(J)=>typeof Promise<"u"&&J instanceof Promise;var UX1=B1(()=>{Uc();zX1();RM6=[];M8=Object.freeze({status:"aborted"})});var Si1=()=>{};var _6;var vi1=B1(()=>{(function(J){J.errToObj=(Q)=>typeof Q==="string"?{message:Q}:Q||{},J.toString=(Q)=>typeof Q==="string"?Q:Q?.message})(_6||(_6={}))});class WG{constructor(J,Q,Z,X){this._cachedPath=[],this.parent=J,this.data=Q,this._path=Z,this._key=X}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function i8(J){if(!J)return{};let{errorMap:Q,invalid_type_error:Z,required_error:X,description:Y}=J;if(Q&&(Z||X))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(Q)return{errorMap:Q,description:Y};return{errorMap:(G,q)=>{let{message:z}=J;if(G.code==="invalid_enum_value")return{message:z??q.defaultError};if(typeof q.data>"u")return{message:z??X??q.defaultError};if(G.code!=="invalid_type")return{message:q.defaultError};return{message:z??Z??q.defaultError}},description:Y}}class q9{get description(){return this._def.description}_getType(J){return Zz(J.data)}_getOrReturnCtx(J,Q){return Q||{common:J.parent.common,data:J.data,parsedType:Zz(J.data),schemaErrorMap:this._def.errorMap,path:J.path,parent:J.parent}}_processInputParams(J){return{status:new ZJ,ctx:{common:J.parent.common,data:J.data,parsedType:Zz(J.data),schemaErrorMap:this._def.errorMap,path:J.path,parent:J.parent}}}_parseSync(J){let Q=this._parse(J);if(FO(Q))throw Error("Synchronous parse encountered promise.");return Q}_parseAsync(J){let Q=this._parse(J);return Promise.resolve(Q)}parse(J,Q){let Z=this.safeParse(J,Q);if(Z.success)return Z.data;throw Z.error}safeParse(J,Q){let Z={common:{issues:[],async:Q?.async??!1,contextualErrorMap:Q?.errorMap},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:Zz(J)},X=this._parseSync({data:J,path:Z.path,parent:Z});return ki1(Z,X)}"~validate"(J){let Q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:Zz(J)};if(!this["~standard"].async)try{let Z=this._parseSync({data:J,path:[],parent:Q});return CB(Z)?{value:Z.value}:{issues:Q.common.issues}}catch(Z){if(Z?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;Q.common={issues:[],async:!0}}return this._parseAsync({data:J,path:[],parent:Q}).then((Z)=>CB(Z)?{value:Z.value}:{issues:Q.common.issues})}async parseAsync(J,Q){let Z=await this.safeParseAsync(J,Q);if(Z.success)return Z.data;throw Z.error}async safeParseAsync(J,Q){let Z={common:{issues:[],contextualErrorMap:Q?.errorMap,async:!0},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:Zz(J)},X=this._parse({data:J,path:Z.path,parent:Z}),Y=await(FO(X)?X:Promise.resolve(X));return ki1(Z,Y)}refine(J,Q){let Z=(X)=>{if(typeof Q==="string"||typeof Q>"u")return{message:Q};else if(typeof Q==="function")return Q(X);else return Q};return this._refinement((X,Y)=>{let K=J(X),G=()=>Y.addIssue({code:f0.custom,...Z(X)});if(typeof Promise<"u"&&K instanceof Promise)return K.then((q)=>{if(!q)return G(),!1;else return!0});if(!K)return G(),!1;else return!0})}refinement(J,Q){return this._refinement((Z,X)=>{if(!J(Z))return X.addIssue(typeof Q==="function"?Q(Z,X):Q),!1;else return!0})}_refinement(J){return new FG({schema:this,typeName:w8.ZodEffects,effect:{type:"refinement",refinement:J}})}superRefine(J){return this._refinement(J)}constructor(J){this.spa=this.safeParseAsync,this._def=J,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(Q)=>this["~validate"](Q)}}optional(){return UG.create(this,this._def)}nullable(){return NW.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zG.create(this)}promise(){return iN.create(this,this._def)}or(J){return NO.create([this,J],this._def)}and(J){return LO.create(this,J,this._def)}transform(J){return new FG({...i8(this._def),schema:this,typeName:w8.ZodEffects,effect:{type:"transform",transform:J}})}default(J){let Q=typeof J==="function"?J:()=>J;return new OO({...i8(this._def),innerType:this,defaultValue:Q,typeName:w8.ZodDefault})}brand(){return new Bc({typeName:w8.ZodBranded,type:this,...i8(this._def)})}catch(J){let Q=typeof J==="function"?J:()=>J;return new jO({...i8(this._def),innerType:this,catchValue:Q,typeName:w8.ZodCatch})}describe(J){return new this.constructor({...this._def,description:J})}pipe(J){return bS.create(this,J)}readonly(){return $O.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function bi1(J){let Q="[0-5]\\d";if(J.precision)Q=`${Q}\\.\\d{${J.precision}}`;else if(J.precision==null)Q=`${Q}(\\.\\d+)?`;let Z=J.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${Q})${Z}`}function hM6(J){return new RegExp(`^${bi1(J)}$`)}function yi1(J){let Q=`${xi1}T${bi1(J)}`,Z=[];if(Z.push(J.local?"Z?":"Z"),J.offset)Z.push("([+-]\\d{2}:?\\d{2})");return Q=`${Q}(${Z.join("|")})`,new RegExp(`^${Q}$`)}function gM6(J,Q){if((Q==="v4"||!Q)&&vM6.test(J))return!0;if((Q==="v6"||!Q)&&_M6.test(J))return!0;return!1}function mM6(J,Q){if(!PM6.test(J))return!1;try{let[Z]=J.split(".");if(!Z)return!1;let X=Z.replace(/-/g,"+").replace(/_/g,"/").padEnd(Z.length+(4-Z.length%4)%4,"="),Y=JSON.parse(atob(X));if(typeof Y!=="object"||Y===null)return!1;if("typ"in Y&&Y?.typ!=="JWT")return!1;if(!Y.alg)return!1;if(Q&&Y.alg!==Q)return!1;return!0}catch{return!1}}function uM6(J,Q){if((Q==="v4"||!Q)&&kM6.test(J))return!0;if((Q==="v6"||!Q)&&xM6.test(J))return!0;return!1}function pM6(J,Q){let Z=(J.toString().split(".")[1]||"").length,X=(Q.toString().split(".")[1]||"").length,Y=Z>X?Z:X,K=Number.parseInt(J.toFixed(Y).replace(".","")),G=Number.parseInt(Q.toFixed(Y).replace(".",""));return K%G/10**Y}function HO(J){if(J instanceof _4){let Q={};for(let Z in J.shape){let X=J.shape[Z];Q[Z]=UG.create(HO(X))}return new _4({...J._def,shape:()=>Q})}else if(J instanceof zG)return new zG({...J._def,type:HO(J.element)});else if(J instanceof UG)return UG.create(HO(J.unwrap()));else if(J instanceof NW)return NW.create(HO(J.unwrap()));else if(J instanceof Yz)return Yz.create(J.items.map((Q)=>HO(Q)));else return J}function FX1(J,Q){let Z=Zz(J),X=Zz(Q);if(J===Q)return{valid:!0,data:J};else if(Z===e0.object&&X===e0.object){let Y=O9.objectKeys(Q),K=O9.objectKeys(J).filter((q)=>Y.indexOf(q)!==-1),G={...J,...Q};for(let q of K){let z=FX1(J[q],Q[q]);if(!z.valid)return{valid:!1};G[q]=z.data}return{valid:!0,data:G}}else if(Z===e0.array&&X===e0.array){if(J.length!==Q.length)return{valid:!1};let Y=[];for(let K=0;K<J.length;K++){let G=J[K],q=Q[K],z=FX1(G,q);if(!z.valid)return{valid:!1};Y.push(z.data)}return{valid:!0,data:Y}}else if(Z===e0.date&&X===e0.date&&+J===+Q)return{valid:!0,data:J};else return{valid:!1}}function fi1(J,Q){return new _B({values:J,typeName:w8.ZodEnum,...i8(Q)})}function _i1(J,Q){let Z=typeof J==="function"?J(Q):typeof J==="string"?{message:J}:J;return typeof Z==="string"?{message:Z}:Z}function hi1(J,Q={},Z){if(J)return cN.create().superRefine((X,Y)=>{let K=J(X);if(K instanceof Promise)return K.then((G)=>{if(!G){let q=_i1(Q,X),z=q.fatal??Z??!0;Y.addIssue({code:"custom",...q,fatal:z})}});if(!K){let G=_i1(Q,X),q=G.fatal??Z??!0;Y.addIssue({code:"custom",...G,fatal:q})}return});return cN.create()}var ki1=(J,Q)=>{if(CB(Q))return{success:!0,data:Q.value};else{if(!J.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let Z=new MZ(J.common.issues);return this._error=Z,this._error}}}},OM6,jM6,$M6,EM6,IM6,PM6,TM6,CM6,SM6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",WX1,vM6,kM6,_M6,xM6,bM6,yM6,xi1="((\\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])))",fM6,qG,vB,kB,DO,dN,SS,MO,VO,cN,SB,Xz,vS,zG,_4,NO,VW=(J)=>{if(J instanceof AO)return VW(J.schema);else if(J instanceof FG)return VW(J.innerType());else if(J instanceof wO)return[J.value];else if(J instanceof _B)return J.options;else if(J instanceof RO)return O9.objectValues(J.enum);else if(J instanceof OO)return VW(J._def.innerType);else if(J instanceof MO)return[void 0];else if(J instanceof VO)return[null];else if(J instanceof UG)return[void 0,...VW(J.unwrap())];else if(J instanceof NW)return[null,...VW(J.unwrap())];else if(J instanceof Bc)return VW(J.unwrap());else if(J instanceof $O)return VW(J.unwrap());else if(J instanceof jO)return VW(J._def.innerType);else return[]},Hc,LO,Yz,kS,_S,lN,BO,AO,wO,_B,RO,iN,FG,UG,NW,OO,jO,xS,dM6,Bc,bS,$O,cM6,w8,lM6=(J,Q={message:`Input not instance of ${J.name}`})=>hi1((Z)=>Z instanceof J,Q),gi1,mi1,iM6,nM6,ui1,aM6,rM6,sM6,oM6,tM6,eM6,JV6,QV6,ZV6,XV6,YV6,KV6,GV6,qV6,zV6,UV6,WV6,FV6,HV6,BV6,DV6,MV6,VV6,NV6,LV6,AV6,wV6,RV6,OV6,jV6=()=>gi1().optional(),$V6=()=>mi1().optional(),EV6=()=>ui1().optional(),IV6,PV6;var pi1=B1(()=>{zc();Uc();vi1();UX1();TS();OM6=/^c[^\s-]{8,}$/i,jM6=/^[0-9a-z]+$/,$M6=/^[0-9A-HJKMNP-TV-Z]{26}$/i,EM6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,IM6=/^[a-z0-9_-]{21}$/i,PM6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,TM6=/^[-+]?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)?)??$/,CM6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vM6=/^(?:(?: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])$/,kM6=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,_M6=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,xM6=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bM6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yM6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fM6=new RegExp(`^${xi1}$`);qG=class qG extends q9{_parse(J){if(this._def.coerce)J.data=String(J.data);if(this._getType(J)!==e0.string){let Y=this._getOrReturnCtx(J);return W6(Y,{code:f0.invalid_type,expected:e0.string,received:Y.parsedType}),M8}let Z=new ZJ,X=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(J.data.length<Y.value)X=this._getOrReturnCtx(J,X),W6(X,{code:f0.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),Z.dirty()}else if(Y.kind==="max"){if(J.data.length>Y.value)X=this._getOrReturnCtx(J,X),W6(X,{code:f0.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),Z.dirty()}else if(Y.kind==="length"){let K=J.data.length>Y.value,G=J.data.length<Y.value;if(K||G){if(X=this._getOrReturnCtx(J,X),K)W6(X,{code:f0.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});else if(G)W6(X,{code:f0.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});Z.dirty()}}else if(Y.kind==="email"){if(!CM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"email",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="emoji"){if(!WX1)WX1=new RegExp(SM6,"u");if(!WX1.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"emoji",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="uuid"){if(!EM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"uuid",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="nanoid"){if(!IM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"nanoid",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cuid"){if(!OM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"cuid",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cuid2"){if(!jM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"cuid2",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="ulid"){if(!$M6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"ulid",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="url")try{new URL(J.data)}catch{X=this._getOrReturnCtx(J,X),W6(X,{validation:"url",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="regex"){if(Y.regex.lastIndex=0,!Y.regex.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"regex",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="trim")J.data=J.data.trim();else if(Y.kind==="includes"){if(!J.data.includes(Y.value,Y.position))X=this._getOrReturnCtx(J,X),W6(X,{code:f0.invalid_string,validation:{includes:Y.value,position:Y.position},message:Y.message}),Z.dirty()}else if(Y.kind==="toLowerCase")J.data=J.data.toLowerCase();else if(Y.kind==="toUpperCase")J.data=J.data.toUpperCase();else if(Y.kind==="startsWith"){if(!J.data.startsWith(Y.value))X=this._getOrReturnCtx(J,X),W6(X,{code:f0.invalid_string,validation:{startsWith:Y.value},message:Y.message}),Z.dirty()}else if(Y.kind==="endsWith"){if(!J.data.endsWith(Y.value))X=this._getOrReturnCtx(J,X),W6(X,{code:f0.invalid_string,validation:{endsWith:Y.value},message:Y.message}),Z.dirty()}else if(Y.kind==="datetime"){if(!yi1(Y).test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{code:f0.invalid_string,validation:"datetime",message:Y.message}),Z.dirty()}else if(Y.kind==="date"){if(!fM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{code:f0.invalid_string,validation:"date",message:Y.message}),Z.dirty()}else if(Y.kind==="time"){if(!hM6(Y).test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{code:f0.invalid_string,validation:"time",message:Y.message}),Z.dirty()}else if(Y.kind==="duration"){if(!TM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"duration",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="ip"){if(!gM6(J.data,Y.version))X=this._getOrReturnCtx(J,X),W6(X,{validation:"ip",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="jwt"){if(!mM6(J.data,Y.alg))X=this._getOrReturnCtx(J,X),W6(X,{validation:"jwt",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cidr"){if(!uM6(J.data,Y.version))X=this._getOrReturnCtx(J,X),W6(X,{validation:"cidr",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="base64"){if(!bM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"base64",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="base64url"){if(!yM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"base64url",code:f0.invalid_string,message:Y.message}),Z.dirty()}else O9.assertNever(Y);return{status:Z.value,value:J.data}}_regex(J,Q,Z){return this.refinement((X)=>J.test(X),{validation:Q,code:f0.invalid_string,..._6.errToObj(Z)})}_addCheck(J){return new qG({...this._def,checks:[...this._def.checks,J]})}email(J){return this._addCheck({kind:"email",..._6.errToObj(J)})}url(J){return this._addCheck({kind:"url",..._6.errToObj(J)})}emoji(J){return this._addCheck({kind:"emoji",..._6.errToObj(J)})}uuid(J){return this._addCheck({kind:"uuid",..._6.errToObj(J)})}nanoid(J){return this._addCheck({kind:"nanoid",..._6.errToObj(J)})}cuid(J){return this._addCheck({kind:"cuid",..._6.errToObj(J)})}cuid2(J){return this._addCheck({kind:"cuid2",..._6.errToObj(J)})}ulid(J){return this._addCheck({kind:"ulid",..._6.errToObj(J)})}base64(J){return this._addCheck({kind:"base64",..._6.errToObj(J)})}base64url(J){return this._addCheck({kind:"base64url",..._6.errToObj(J)})}jwt(J){return this._addCheck({kind:"jwt",..._6.errToObj(J)})}ip(J){return this._addCheck({kind:"ip",..._6.errToObj(J)})}cidr(J){return this._addCheck({kind:"cidr",..._6.errToObj(J)})}datetime(J){if(typeof J==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:J});return this._addCheck({kind:"datetime",precision:typeof J?.precision>"u"?null:J?.precision,offset:J?.offset??!1,local:J?.local??!1,..._6.errToObj(J?.message)})}date(J){return this._addCheck({kind:"date",message:J})}time(J){if(typeof J==="string")return this._addCheck({kind:"time",precision:null,message:J});return this._addCheck({kind:"time",precision:typeof J?.precision>"u"?null:J?.precision,..._6.errToObj(J?.message)})}duration(J){return this._addCheck({kind:"duration",..._6.errToObj(J)})}regex(J,Q){return this._addCheck({kind:"regex",regex:J,..._6.errToObj(Q)})}includes(J,Q){return this._addCheck({kind:"includes",value:J,position:Q?.position,..._6.errToObj(Q?.message)})}startsWith(J,Q){return this._addCheck({kind:"startsWith",value:J,..._6.errToObj(Q)})}endsWith(J,Q){return this._addCheck({kind:"endsWith",value:J,..._6.errToObj(Q)})}min(J,Q){return this._addCheck({kind:"min",value:J,..._6.errToObj(Q)})}max(J,Q){return this._addCheck({kind:"max",value:J,..._6.errToObj(Q)})}length(J,Q){return this._addCheck({kind:"length",value:J,..._6.errToObj(Q)})}nonempty(J){return this.min(1,_6.errToObj(J))}trim(){return new qG({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new qG({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new qG({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((J)=>J.kind==="datetime")}get isDate(){return!!this._def.checks.find((J)=>J.kind==="date")}get isTime(){return!!this._def.checks.find((J)=>J.kind==="time")}get isDuration(){return!!this._def.checks.find((J)=>J.kind==="duration")}get isEmail(){return!!this._def.checks.find((J)=>J.kind==="email")}get isURL(){return!!this._def.checks.find((J)=>J.kind==="url")}get isEmoji(){return!!this._def.checks.find((J)=>J.kind==="emoji")}get isUUID(){return!!this._def.checks.find((J)=>J.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((J)=>J.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((J)=>J.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((J)=>J.kind==="cuid2")}get isULID(){return!!this._def.checks.find((J)=>J.kind==="ulid")}get isIP(){return!!this._def.checks.find((J)=>J.kind==="ip")}get isCIDR(){return!!this._def.checks.find((J)=>J.kind==="cidr")}get isBase64(){return!!this._def.checks.find((J)=>J.kind==="base64")}get isBase64url(){return!!this._def.checks.find((J)=>J.kind==="base64url")}get minLength(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J}get maxLength(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J}};qG.create=(J)=>{return new qG({checks:[],typeName:w8.ZodString,coerce:J?.coerce??!1,...i8(J)})};vB=class vB extends q9{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(J){if(this._def.coerce)J.data=Number(J.data);if(this._getType(J)!==e0.number){let Y=this._getOrReturnCtx(J);return W6(Y,{code:f0.invalid_type,expected:e0.number,received:Y.parsedType}),M8}let Z=void 0,X=new ZJ;for(let Y of this._def.checks)if(Y.kind==="int"){if(!O9.isInteger(J.data))Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.invalid_type,expected:"integer",received:"float",message:Y.message}),X.dirty()}else if(Y.kind==="min"){if(Y.inclusive?J.data<Y.value:J.data<=Y.value)Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.too_small,minimum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),X.dirty()}else if(Y.kind==="max"){if(Y.inclusive?J.data>Y.value:J.data>=Y.value)Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),X.dirty()}else if(Y.kind==="multipleOf"){if(pM6(J.data,Y.value)!==0)Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.not_multiple_of,multipleOf:Y.value,message:Y.message}),X.dirty()}else if(Y.kind==="finite"){if(!Number.isFinite(J.data))Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.not_finite,message:Y.message}),X.dirty()}else O9.assertNever(Y);return{status:X.value,value:J.data}}gte(J,Q){return this.setLimit("min",J,!0,_6.toString(Q))}gt(J,Q){return this.setLimit("min",J,!1,_6.toString(Q))}lte(J,Q){return this.setLimit("max",J,!0,_6.toString(Q))}lt(J,Q){return this.setLimit("max",J,!1,_6.toString(Q))}setLimit(J,Q,Z,X){return new vB({...this._def,checks:[...this._def.checks,{kind:J,value:Q,inclusive:Z,message:_6.toString(X)}]})}_addCheck(J){return new vB({...this._def,checks:[...this._def.checks,J]})}int(J){return this._addCheck({kind:"int",message:_6.toString(J)})}positive(J){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_6.toString(J)})}negative(J){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_6.toString(J)})}nonpositive(J){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_6.toString(J)})}nonnegative(J){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_6.toString(J)})}multipleOf(J,Q){return this._addCheck({kind:"multipleOf",value:J,message:_6.toString(Q)})}finite(J){return this._addCheck({kind:"finite",message:_6.toString(J)})}safe(J){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_6.toString(J)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_6.toString(J)})}get minValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J}get maxValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J}get isInt(){return!!this._def.checks.find((J)=>J.kind==="int"||J.kind==="multipleOf"&&O9.isInteger(J.value))}get isFinite(){let J=null,Q=null;for(let Z of this._def.checks)if(Z.kind==="finite"||Z.kind==="int"||Z.kind==="multipleOf")return!0;else if(Z.kind==="min"){if(Q===null||Z.value>Q)Q=Z.value}else if(Z.kind==="max"){if(J===null||Z.value<J)J=Z.value}return Number.isFinite(Q)&&Number.isFinite(J)}};vB.create=(J)=>{return new vB({checks:[],typeName:w8.ZodNumber,coerce:J?.coerce||!1,...i8(J)})};kB=class kB extends q9{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(J){if(this._def.coerce)try{J.data=BigInt(J.data)}catch{return this._getInvalidInput(J)}if(this._getType(J)!==e0.bigint)return this._getInvalidInput(J);let Z=void 0,X=new ZJ;for(let Y of this._def.checks)if(Y.kind==="min"){if(Y.inclusive?J.data<Y.value:J.data<=Y.value)Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.too_small,type:"bigint",minimum:Y.value,inclusive:Y.inclusive,message:Y.message}),X.dirty()}else if(Y.kind==="max"){if(Y.inclusive?J.data>Y.value:J.data>=Y.value)Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.too_big,type:"bigint",maximum:Y.value,inclusive:Y.inclusive,message:Y.message}),X.dirty()}else if(Y.kind==="multipleOf"){if(J.data%Y.value!==BigInt(0))Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.not_multiple_of,multipleOf:Y.value,message:Y.message}),X.dirty()}else O9.assertNever(Y);return{status:X.value,value:J.data}}_getInvalidInput(J){let Q=this._getOrReturnCtx(J);return W6(Q,{code:f0.invalid_type,expected:e0.bigint,received:Q.parsedType}),M8}gte(J,Q){return this.setLimit("min",J,!0,_6.toString(Q))}gt(J,Q){return this.setLimit("min",J,!1,_6.toString(Q))}lte(J,Q){return this.setLimit("max",J,!0,_6.toString(Q))}lt(J,Q){return this.setLimit("max",J,!1,_6.toString(Q))}setLimit(J,Q,Z,X){return new kB({...this._def,checks:[...this._def.checks,{kind:J,value:Q,inclusive:Z,message:_6.toString(X)}]})}_addCheck(J){return new kB({...this._def,checks:[...this._def.checks,J]})}positive(J){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_6.toString(J)})}negative(J){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_6.toString(J)})}nonpositive(J){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_6.toString(J)})}nonnegative(J){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_6.toString(J)})}multipleOf(J,Q){return this._addCheck({kind:"multipleOf",value:J,message:_6.toString(Q)})}get minValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J}get maxValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J}};kB.create=(J)=>{return new kB({checks:[],typeName:w8.ZodBigInt,coerce:J?.coerce??!1,...i8(J)})};DO=class DO extends q9{_parse(J){if(this._def.coerce)J.data=Boolean(J.data);if(this._getType(J)!==e0.boolean){let Z=this._getOrReturnCtx(J);return W6(Z,{code:f0.invalid_type,expected:e0.boolean,received:Z.parsedType}),M8}return kJ(J.data)}};DO.create=(J)=>{return new DO({typeName:w8.ZodBoolean,coerce:J?.coerce||!1,...i8(J)})};dN=class dN extends q9{_parse(J){if(this._def.coerce)J.data=new Date(J.data);if(this._getType(J)!==e0.date){let Y=this._getOrReturnCtx(J);return W6(Y,{code:f0.invalid_type,expected:e0.date,received:Y.parsedType}),M8}if(Number.isNaN(J.data.getTime())){let Y=this._getOrReturnCtx(J);return W6(Y,{code:f0.invalid_date}),M8}let Z=new ZJ,X=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(J.data.getTime()<Y.value)X=this._getOrReturnCtx(J,X),W6(X,{code:f0.too_small,message:Y.message,inclusive:!0,exact:!1,minimum:Y.value,type:"date"}),Z.dirty()}else if(Y.kind==="max"){if(J.data.getTime()>Y.value)X=this._getOrReturnCtx(J,X),W6(X,{code:f0.too_big,message:Y.message,inclusive:!0,exact:!1,maximum:Y.value,type:"date"}),Z.dirty()}else O9.assertNever(Y);return{status:Z.value,value:new Date(J.data.getTime())}}_addCheck(J){return new dN({...this._def,checks:[...this._def.checks,J]})}min(J,Q){return this._addCheck({kind:"min",value:J.getTime(),message:_6.toString(Q)})}max(J,Q){return this._addCheck({kind:"max",value:J.getTime(),message:_6.toString(Q)})}get minDate(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J!=null?new Date(J):null}get maxDate(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J!=null?new Date(J):null}};dN.create=(J)=>{return new dN({checks:[],coerce:J?.coerce||!1,typeName:w8.ZodDate,...i8(J)})};SS=class SS extends q9{_parse(J){if(this._getType(J)!==e0.symbol){let Z=this._getOrReturnCtx(J);return W6(Z,{code:f0.invalid_type,expected:e0.symbol,received:Z.parsedType}),M8}return kJ(J.data)}};SS.create=(J)=>{return new SS({typeName:w8.ZodSymbol,...i8(J)})};MO=class MO extends q9{_parse(J){if(this._getType(J)!==e0.undefined){let Z=this._getOrReturnCtx(J);return W6(Z,{code:f0.invalid_type,expected:e0.undefined,received:Z.parsedType}),M8}return kJ(J.data)}};MO.create=(J)=>{return new MO({typeName:w8.ZodUndefined,...i8(J)})};VO=class VO extends q9{_parse(J){if(this._getType(J)!==e0.null){let Z=this._getOrReturnCtx(J);return W6(Z,{code:f0.invalid_type,expected:e0.null,received:Z.parsedType}),M8}return kJ(J.data)}};VO.create=(J)=>{return new VO({typeName:w8.ZodNull,...i8(J)})};cN=class cN extends q9{constructor(){super(...arguments);this._any=!0}_parse(J){return kJ(J.data)}};cN.create=(J)=>{return new cN({typeName:w8.ZodAny,...i8(J)})};SB=class SB extends q9{constructor(){super(...arguments);this._unknown=!0}_parse(J){return kJ(J.data)}};SB.create=(J)=>{return new SB({typeName:w8.ZodUnknown,...i8(J)})};Xz=class Xz extends q9{_parse(J){let Q=this._getOrReturnCtx(J);return W6(Q,{code:f0.invalid_type,expected:e0.never,received:Q.parsedType}),M8}};Xz.create=(J)=>{return new Xz({typeName:w8.ZodNever,...i8(J)})};vS=class vS extends q9{_parse(J){if(this._getType(J)!==e0.undefined){let Z=this._getOrReturnCtx(J);return W6(Z,{code:f0.invalid_type,expected:e0.void,received:Z.parsedType}),M8}return kJ(J.data)}};vS.create=(J)=>{return new vS({typeName:w8.ZodVoid,...i8(J)})};zG=class zG extends q9{_parse(J){let{ctx:Q,status:Z}=this._processInputParams(J),X=this._def;if(Q.parsedType!==e0.array)return W6(Q,{code:f0.invalid_type,expected:e0.array,received:Q.parsedType}),M8;if(X.exactLength!==null){let K=Q.data.length>X.exactLength.value,G=Q.data.length<X.exactLength.value;if(K||G)W6(Q,{code:K?f0.too_big:f0.too_small,minimum:G?X.exactLength.value:void 0,maximum:K?X.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:X.exactLength.message}),Z.dirty()}if(X.minLength!==null){if(Q.data.length<X.minLength.value)W6(Q,{code:f0.too_small,minimum:X.minLength.value,type:"array",inclusive:!0,exact:!1,message:X.minLength.message}),Z.dirty()}if(X.maxLength!==null){if(Q.data.length>X.maxLength.value)W6(Q,{code:f0.too_big,maximum:X.maxLength.value,type:"array",inclusive:!0,exact:!1,message:X.maxLength.message}),Z.dirty()}if(Q.common.async)return Promise.all([...Q.data].map((K,G)=>{return X.type._parseAsync(new WG(Q,K,Q.path,G))})).then((K)=>{return ZJ.mergeArray(Z,K)});let Y=[...Q.data].map((K,G)=>{return X.type._parseSync(new WG(Q,K,Q.path,G))});return ZJ.mergeArray(Z,Y)}get element(){return this._def.type}min(J,Q){return new zG({...this._def,minLength:{value:J,message:_6.toString(Q)}})}max(J,Q){return new zG({...this._def,maxLength:{value:J,message:_6.toString(Q)}})}length(J,Q){return new zG({...this._def,exactLength:{value:J,message:_6.toString(Q)}})}nonempty(J){return this.min(1,J)}};zG.create=(J,Q)=>{return new zG({type:J,minLength:null,maxLength:null,exactLength:null,typeName:w8.ZodArray,...i8(Q)})};_4=class _4 extends q9{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let J=this._def.shape(),Q=O9.objectKeys(J);return this._cached={shape:J,keys:Q},this._cached}_parse(J){if(this._getType(J)!==e0.object){let z=this._getOrReturnCtx(J);return W6(z,{code:f0.invalid_type,expected:e0.object,received:z.parsedType}),M8}let{status:Z,ctx:X}=this._processInputParams(J),{shape:Y,keys:K}=this._getCached(),G=[];if(!(this._def.catchall instanceof Xz&&this._def.unknownKeys==="strip")){for(let z in X.data)if(!K.includes(z))G.push(z)}let q=[];for(let z of K){let U=Y[z],W=X.data[z];q.push({key:{status:"valid",value:z},value:U._parse(new WG(X,W,X.path,z)),alwaysSet:z in X.data})}if(this._def.catchall instanceof Xz){let z=this._def.unknownKeys;if(z==="passthrough")for(let U of G)q.push({key:{status:"valid",value:U},value:{status:"valid",value:X.data[U]}});else if(z==="strict"){if(G.length>0)W6(X,{code:f0.unrecognized_keys,keys:G}),Z.dirty()}else if(z==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let z=this._def.catchall;for(let U of G){let W=X.data[U];q.push({key:{status:"valid",value:U},value:z._parse(new WG(X,W,X.path,U)),alwaysSet:U in X.data})}}if(X.common.async)return Promise.resolve().then(async()=>{let z=[];for(let U of q){let W=await U.key,F=await U.value;z.push({key:W,value:F,alwaysSet:U.alwaysSet})}return z}).then((z)=>{return ZJ.mergeObjectSync(Z,z)});else return ZJ.mergeObjectSync(Z,q)}get shape(){return this._def.shape()}strict(J){return _6.errToObj,new _4({...this._def,unknownKeys:"strict",...J!==void 0?{errorMap:(Q,Z)=>{let X=this._def.errorMap?.(Q,Z).message??Z.defaultError;if(Q.code==="unrecognized_keys")return{message:_6.errToObj(J).message??X};return{message:X}}}:{}})}strip(){return new _4({...this._def,unknownKeys:"strip"})}passthrough(){return new _4({...this._def,unknownKeys:"passthrough"})}extend(J){return new _4({...this._def,shape:()=>({...this._def.shape(),...J})})}merge(J){return new _4({unknownKeys:J._def.unknownKeys,catchall:J._def.catchall,shape:()=>({...this._def.shape(),...J._def.shape()}),typeName:w8.ZodObject})}setKey(J,Q){return this.augment({[J]:Q})}catchall(J){return new _4({...this._def,catchall:J})}pick(J){let Q={};for(let Z of O9.objectKeys(J))if(J[Z]&&this.shape[Z])Q[Z]=this.shape[Z];return new _4({...this._def,shape:()=>Q})}omit(J){let Q={};for(let Z of O9.objectKeys(this.shape))if(!J[Z])Q[Z]=this.shape[Z];return new _4({...this._def,shape:()=>Q})}deepPartial(){return HO(this)}partial(J){let Q={};for(let Z of O9.objectKeys(this.shape)){let X=this.shape[Z];if(J&&!J[Z])Q[Z]=X;else Q[Z]=X.optional()}return new _4({...this._def,shape:()=>Q})}required(J){let Q={};for(let Z of O9.objectKeys(this.shape))if(J&&!J[Z])Q[Z]=this.shape[Z];else{let Y=this.shape[Z];while(Y instanceof UG)Y=Y._def.innerType;Q[Z]=Y}return new _4({...this._def,shape:()=>Q})}keyof(){return fi1(O9.objectKeys(this.shape))}};_4.create=(J,Q)=>{return new _4({shape:()=>J,unknownKeys:"strip",catchall:Xz.create(),typeName:w8.ZodObject,...i8(Q)})};_4.strictCreate=(J,Q)=>{return new _4({shape:()=>J,unknownKeys:"strict",catchall:Xz.create(),typeName:w8.ZodObject,...i8(Q)})};_4.lazycreate=(J,Q)=>{return new _4({shape:J,unknownKeys:"strip",catchall:Xz.create(),typeName:w8.ZodObject,...i8(Q)})};NO=class NO extends q9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=this._def.options;function X(Y){for(let G of Y)if(G.result.status==="valid")return G.result;for(let G of Y)if(G.result.status==="dirty")return Q.common.issues.push(...G.ctx.common.issues),G.result;let K=Y.map((G)=>new MZ(G.ctx.common.issues));return W6(Q,{code:f0.invalid_union,unionErrors:K}),M8}if(Q.common.async)return Promise.all(Z.map(async(Y)=>{let K={...Q,common:{...Q.common,issues:[]},parent:null};return{result:await Y._parseAsync({data:Q.data,path:Q.path,parent:K}),ctx:K}})).then(X);else{let Y=void 0,K=[];for(let q of Z){let z={...Q,common:{...Q.common,issues:[]},parent:null},U=q._parseSync({data:Q.data,path:Q.path,parent:z});if(U.status==="valid")return U;else if(U.status==="dirty"&&!Y)Y={result:U,ctx:z};if(z.common.issues.length)K.push(z.common.issues)}if(Y)return Q.common.issues.push(...Y.ctx.common.issues),Y.result;let G=K.map((q)=>new MZ(q));return W6(Q,{code:f0.invalid_union,unionErrors:G}),M8}}get options(){return this._def.options}};NO.create=(J,Q)=>{return new NO({options:J,typeName:w8.ZodUnion,...i8(Q)})};Hc=class Hc extends q9{_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==e0.object)return W6(Q,{code:f0.invalid_type,expected:e0.object,received:Q.parsedType}),M8;let Z=this.discriminator,X=Q.data[Z],Y=this.optionsMap.get(X);if(!Y)return W6(Q,{code:f0.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Z]}),M8;if(Q.common.async)return Y._parseAsync({data:Q.data,path:Q.path,parent:Q});else return Y._parseSync({data:Q.data,path:Q.path,parent:Q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(J,Q,Z){let X=new Map;for(let Y of Q){let K=VW(Y.shape[J]);if(!K.length)throw Error(`A discriminator value for key \`${J}\` could not be extracted from all schema options`);for(let G of K){if(X.has(G))throw Error(`Discriminator property ${String(J)} has duplicate value ${String(G)}`);X.set(G,Y)}}return new Hc({typeName:w8.ZodDiscriminatedUnion,discriminator:J,options:Q,optionsMap:X,...i8(Z)})}};LO=class LO extends q9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J),X=(Y,K)=>{if(Wc(Y)||Wc(K))return M8;let G=FX1(Y.value,K.value);if(!G.valid)return W6(Z,{code:f0.invalid_intersection_types}),M8;if(Fc(Y)||Fc(K))Q.dirty();return{status:Q.value,value:G.data}};if(Z.common.async)return Promise.all([this._def.left._parseAsync({data:Z.data,path:Z.path,parent:Z}),this._def.right._parseAsync({data:Z.data,path:Z.path,parent:Z})]).then(([Y,K])=>X(Y,K));else return X(this._def.left._parseSync({data:Z.data,path:Z.path,parent:Z}),this._def.right._parseSync({data:Z.data,path:Z.path,parent:Z}))}};LO.create=(J,Q,Z)=>{return new LO({left:J,right:Q,typeName:w8.ZodIntersection,...i8(Z)})};Yz=class Yz extends q9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==e0.array)return W6(Z,{code:f0.invalid_type,expected:e0.array,received:Z.parsedType}),M8;if(Z.data.length<this._def.items.length)return W6(Z,{code:f0.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),M8;if(!this._def.rest&&Z.data.length>this._def.items.length)W6(Z,{code:f0.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q.dirty();let Y=[...Z.data].map((K,G)=>{let q=this._def.items[G]||this._def.rest;if(!q)return null;return q._parse(new WG(Z,K,Z.path,G))}).filter((K)=>!!K);if(Z.common.async)return Promise.all(Y).then((K)=>{return ZJ.mergeArray(Q,K)});else return ZJ.mergeArray(Q,Y)}get items(){return this._def.items}rest(J){return new Yz({...this._def,rest:J})}};Yz.create=(J,Q)=>{if(!Array.isArray(J))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yz({items:J,typeName:w8.ZodTuple,rest:null,...i8(Q)})};kS=class kS extends q9{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==e0.object)return W6(Z,{code:f0.invalid_type,expected:e0.object,received:Z.parsedType}),M8;let X=[],Y=this._def.keyType,K=this._def.valueType;for(let G in Z.data)X.push({key:Y._parse(new WG(Z,G,Z.path,G)),value:K._parse(new WG(Z,Z.data[G],Z.path,G)),alwaysSet:G in Z.data});if(Z.common.async)return ZJ.mergeObjectAsync(Q,X);else return ZJ.mergeObjectSync(Q,X)}get element(){return this._def.valueType}static create(J,Q,Z){if(Q instanceof q9)return new kS({keyType:J,valueType:Q,typeName:w8.ZodRecord,...i8(Z)});return new kS({keyType:qG.create(),valueType:J,typeName:w8.ZodRecord,...i8(Q)})}};_S=class _S extends q9{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==e0.map)return W6(Z,{code:f0.invalid_type,expected:e0.map,received:Z.parsedType}),M8;let X=this._def.keyType,Y=this._def.valueType,K=[...Z.data.entries()].map(([G,q],z)=>{return{key:X._parse(new WG(Z,G,Z.path,[z,"key"])),value:Y._parse(new WG(Z,q,Z.path,[z,"value"]))}});if(Z.common.async){let G=new Map;return Promise.resolve().then(async()=>{for(let q of K){let z=await q.key,U=await q.value;if(z.status==="aborted"||U.status==="aborted")return M8;if(z.status==="dirty"||U.status==="dirty")Q.dirty();G.set(z.value,U.value)}return{status:Q.value,value:G}})}else{let G=new Map;for(let q of K){let{key:z,value:U}=q;if(z.status==="aborted"||U.status==="aborted")return M8;if(z.status==="dirty"||U.status==="dirty")Q.dirty();G.set(z.value,U.value)}return{status:Q.value,value:G}}}};_S.create=(J,Q,Z)=>{return new _S({valueType:Q,keyType:J,typeName:w8.ZodMap,...i8(Z)})};lN=class lN extends q9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==e0.set)return W6(Z,{code:f0.invalid_type,expected:e0.set,received:Z.parsedType}),M8;let X=this._def;if(X.minSize!==null){if(Z.data.size<X.minSize.value)W6(Z,{code:f0.too_small,minimum:X.minSize.value,type:"set",inclusive:!0,exact:!1,message:X.minSize.message}),Q.dirty()}if(X.maxSize!==null){if(Z.data.size>X.maxSize.value)W6(Z,{code:f0.too_big,maximum:X.maxSize.value,type:"set",inclusive:!0,exact:!1,message:X.maxSize.message}),Q.dirty()}let Y=this._def.valueType;function K(q){let z=new Set;for(let U of q){if(U.status==="aborted")return M8;if(U.status==="dirty")Q.dirty();z.add(U.value)}return{status:Q.value,value:z}}let G=[...Z.data.values()].map((q,z)=>Y._parse(new WG(Z,q,Z.path,z)));if(Z.common.async)return Promise.all(G).then((q)=>K(q));else return K(G)}min(J,Q){return new lN({...this._def,minSize:{value:J,message:_6.toString(Q)}})}max(J,Q){return new lN({...this._def,maxSize:{value:J,message:_6.toString(Q)}})}size(J,Q){return this.min(J,Q).max(J,Q)}nonempty(J){return this.min(1,J)}};lN.create=(J,Q)=>{return new lN({valueType:J,minSize:null,maxSize:null,typeName:w8.ZodSet,...i8(Q)})};BO=class BO extends q9{constructor(){super(...arguments);this.validate=this.implement}_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==e0.function)return W6(Q,{code:f0.invalid_type,expected:e0.function,received:Q.parsedType}),M8;function Z(G,q){return CS({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,WO(),MW].filter((z)=>!!z),issueData:{code:f0.invalid_arguments,argumentsError:q}})}function X(G,q){return CS({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,WO(),MW].filter((z)=>!!z),issueData:{code:f0.invalid_return_type,returnTypeError:q}})}let Y={errorMap:Q.common.contextualErrorMap},K=Q.data;if(this._def.returns instanceof iN){let G=this;return kJ(async function(...q){let z=new MZ([]),U=await G._def.args.parseAsync(q,Y).catch((H)=>{throw z.addIssue(Z(q,H)),z}),W=await Reflect.apply(K,this,U);return await G._def.returns._def.type.parseAsync(W,Y).catch((H)=>{throw z.addIssue(X(W,H)),z})})}else{let G=this;return kJ(function(...q){let z=G._def.args.safeParse(q,Y);if(!z.success)throw new MZ([Z(q,z.error)]);let U=Reflect.apply(K,this,z.data),W=G._def.returns.safeParse(U,Y);if(!W.success)throw new MZ([X(U,W.error)]);return W.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...J){return new BO({...this._def,args:Yz.create(J).rest(SB.create())})}returns(J){return new BO({...this._def,returns:J})}implement(J){return this.parse(J)}strictImplement(J){return this.parse(J)}static create(J,Q,Z){return new BO({args:J?J:Yz.create([]).rest(SB.create()),returns:Q||SB.create(),typeName:w8.ZodFunction,...i8(Z)})}};AO=class AO extends q9{get schema(){return this._def.getter()}_parse(J){let{ctx:Q}=this._processInputParams(J);return this._def.getter()._parse({data:Q.data,path:Q.path,parent:Q})}};AO.create=(J,Q)=>{return new AO({getter:J,typeName:w8.ZodLazy,...i8(Q)})};wO=class wO extends q9{_parse(J){if(J.data!==this._def.value){let Q=this._getOrReturnCtx(J);return W6(Q,{received:Q.data,code:f0.invalid_literal,expected:this._def.value}),M8}return{status:"valid",value:J.data}}get value(){return this._def.value}};wO.create=(J,Q)=>{return new wO({value:J,typeName:w8.ZodLiteral,...i8(Q)})};_B=class _B extends q9{_parse(J){if(typeof J.data!=="string"){let Q=this._getOrReturnCtx(J),Z=this._def.values;return W6(Q,{expected:O9.joinValues(Z),received:Q.parsedType,code:f0.invalid_type}),M8}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(J.data)){let Q=this._getOrReturnCtx(J),Z=this._def.values;return W6(Q,{received:Q.data,code:f0.invalid_enum_value,options:Z}),M8}return kJ(J.data)}get options(){return this._def.values}get enum(){let J={};for(let Q of this._def.values)J[Q]=Q;return J}get Values(){let J={};for(let Q of this._def.values)J[Q]=Q;return J}get Enum(){let J={};for(let Q of this._def.values)J[Q]=Q;return J}extract(J,Q=this._def){return _B.create(J,{...this._def,...Q})}exclude(J,Q=this._def){return _B.create(this.options.filter((Z)=>!J.includes(Z)),{...this._def,...Q})}};_B.create=fi1;RO=class RO extends q9{_parse(J){let Q=O9.getValidEnumValues(this._def.values),Z=this._getOrReturnCtx(J);if(Z.parsedType!==e0.string&&Z.parsedType!==e0.number){let X=O9.objectValues(Q);return W6(Z,{expected:O9.joinValues(X),received:Z.parsedType,code:f0.invalid_type}),M8}if(!this._cache)this._cache=new Set(O9.getValidEnumValues(this._def.values));if(!this._cache.has(J.data)){let X=O9.objectValues(Q);return W6(Z,{received:Z.data,code:f0.invalid_enum_value,options:X}),M8}return kJ(J.data)}get enum(){return this._def.values}};RO.create=(J,Q)=>{return new RO({values:J,typeName:w8.ZodNativeEnum,...i8(Q)})};iN=class iN extends q9{unwrap(){return this._def.type}_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==e0.promise&&Q.common.async===!1)return W6(Q,{code:f0.invalid_type,expected:e0.promise,received:Q.parsedType}),M8;let Z=Q.parsedType===e0.promise?Q.data:Promise.resolve(Q.data);return kJ(Z.then((X)=>{return this._def.type.parseAsync(X,{path:Q.path,errorMap:Q.common.contextualErrorMap})}))}};iN.create=(J,Q)=>{return new iN({type:J,typeName:w8.ZodPromise,...i8(Q)})};FG=class FG extends q9{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w8.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J),X=this._def.effect||null,Y={addIssue:(K)=>{if(W6(Z,K),K.fatal)Q.abort();else Q.dirty()},get path(){return Z.path}};if(Y.addIssue=Y.addIssue.bind(Y),X.type==="preprocess"){let K=X.transform(Z.data,Y);if(Z.common.async)return Promise.resolve(K).then(async(G)=>{if(Q.value==="aborted")return M8;let q=await this._def.schema._parseAsync({data:G,path:Z.path,parent:Z});if(q.status==="aborted")return M8;if(q.status==="dirty")return pN(q.value);if(Q.value==="dirty")return pN(q.value);return q});else{if(Q.value==="aborted")return M8;let G=this._def.schema._parseSync({data:K,path:Z.path,parent:Z});if(G.status==="aborted")return M8;if(G.status==="dirty")return pN(G.value);if(Q.value==="dirty")return pN(G.value);return G}}if(X.type==="refinement"){let K=(G)=>{let q=X.refinement(G,Y);if(Z.common.async)return Promise.resolve(q);if(q instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return G};if(Z.common.async===!1){let G=this._def.schema._parseSync({data:Z.data,path:Z.path,parent:Z});if(G.status==="aborted")return M8;if(G.status==="dirty")Q.dirty();return K(G.value),{status:Q.value,value:G.value}}else return this._def.schema._parseAsync({data:Z.data,path:Z.path,parent:Z}).then((G)=>{if(G.status==="aborted")return M8;if(G.status==="dirty")Q.dirty();return K(G.value).then(()=>{return{status:Q.value,value:G.value}})})}if(X.type==="transform")if(Z.common.async===!1){let K=this._def.schema._parseSync({data:Z.data,path:Z.path,parent:Z});if(!CB(K))return M8;let G=X.transform(K.value,Y);if(G instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:Q.value,value:G}}else return this._def.schema._parseAsync({data:Z.data,path:Z.path,parent:Z}).then((K)=>{if(!CB(K))return M8;return Promise.resolve(X.transform(K.value,Y)).then((G)=>({status:Q.value,value:G}))});O9.assertNever(X)}};FG.create=(J,Q,Z)=>{return new FG({schema:J,typeName:w8.ZodEffects,effect:Q,...i8(Z)})};FG.createWithPreprocess=(J,Q,Z)=>{return new FG({schema:Q,effect:{type:"preprocess",transform:J},typeName:w8.ZodEffects,...i8(Z)})};UG=class UG extends q9{_parse(J){if(this._getType(J)===e0.undefined)return kJ(void 0);return this._def.innerType._parse(J)}unwrap(){return this._def.innerType}};UG.create=(J,Q)=>{return new UG({innerType:J,typeName:w8.ZodOptional,...i8(Q)})};NW=class NW extends q9{_parse(J){if(this._getType(J)===e0.null)return kJ(null);return this._def.innerType._parse(J)}unwrap(){return this._def.innerType}};NW.create=(J,Q)=>{return new NW({innerType:J,typeName:w8.ZodNullable,...i8(Q)})};OO=class OO extends q9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=Q.data;if(Q.parsedType===e0.undefined)Z=this._def.defaultValue();return this._def.innerType._parse({data:Z,path:Q.path,parent:Q})}removeDefault(){return this._def.innerType}};OO.create=(J,Q)=>{return new OO({innerType:J,typeName:w8.ZodDefault,defaultValue:typeof Q.default==="function"?Q.default:()=>Q.default,...i8(Q)})};jO=class jO extends q9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z={...Q,common:{...Q.common,issues:[]}},X=this._def.innerType._parse({data:Z.data,path:Z.path,parent:{...Z}});if(FO(X))return X.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new MZ(Z.common.issues)},input:Z.data})}});else return{status:"valid",value:X.status==="valid"?X.value:this._def.catchValue({get error(){return new MZ(Z.common.issues)},input:Z.data})}}removeCatch(){return this._def.innerType}};jO.create=(J,Q)=>{return new jO({innerType:J,typeName:w8.ZodCatch,catchValue:typeof Q.catch==="function"?Q.catch:()=>Q.catch,...i8(Q)})};xS=class xS extends q9{_parse(J){if(this._getType(J)!==e0.nan){let Z=this._getOrReturnCtx(J);return W6(Z,{code:f0.invalid_type,expected:e0.nan,received:Z.parsedType}),M8}return{status:"valid",value:J.data}}};xS.create=(J)=>{return new xS({typeName:w8.ZodNaN,...i8(J)})};dM6=Symbol("zod_brand");Bc=class Bc extends q9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=Q.data;return this._def.type._parse({data:Z,path:Q.path,parent:Q})}unwrap(){return this._def.type}};bS=class bS extends q9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.common.async)return(async()=>{let Y=await this._def.in._parseAsync({data:Z.data,path:Z.path,parent:Z});if(Y.status==="aborted")return M8;if(Y.status==="dirty")return Q.dirty(),pN(Y.value);else return this._def.out._parseAsync({data:Y.value,path:Z.path,parent:Z})})();else{let X=this._def.in._parseSync({data:Z.data,path:Z.path,parent:Z});if(X.status==="aborted")return M8;if(X.status==="dirty")return Q.dirty(),{status:"dirty",value:X.value};else return this._def.out._parseSync({data:X.value,path:Z.path,parent:Z})}}static create(J,Q){return new bS({in:J,out:Q,typeName:w8.ZodPipeline})}};$O=class $O extends q9{_parse(J){let Q=this._def.innerType._parse(J),Z=(X)=>{if(CB(X))X.value=Object.freeze(X.value);return X};return FO(Q)?Q.then((X)=>Z(X)):Z(Q)}unwrap(){return this._def.innerType}};$O.create=(J,Q)=>{return new $O({innerType:J,typeName:w8.ZodReadonly,...i8(Q)})};cM6={object:_4.lazycreate};(function(J){J.ZodString="ZodString",J.ZodNumber="ZodNumber",J.ZodNaN="ZodNaN",J.ZodBigInt="ZodBigInt",J.ZodBoolean="ZodBoolean",J.ZodDate="ZodDate",J.ZodSymbol="ZodSymbol",J.ZodUndefined="ZodUndefined",J.ZodNull="ZodNull",J.ZodAny="ZodAny",J.ZodUnknown="ZodUnknown",J.ZodNever="ZodNever",J.ZodVoid="ZodVoid",J.ZodArray="ZodArray",J.ZodObject="ZodObject",J.ZodUnion="ZodUnion",J.ZodDiscriminatedUnion="ZodDiscriminatedUnion",J.ZodIntersection="ZodIntersection",J.ZodTuple="ZodTuple",J.ZodRecord="ZodRecord",J.ZodMap="ZodMap",J.ZodSet="ZodSet",J.ZodFunction="ZodFunction",J.ZodLazy="ZodLazy",J.ZodLiteral="ZodLiteral",J.ZodEnum="ZodEnum",J.ZodEffects="ZodEffects",J.ZodNativeEnum="ZodNativeEnum",J.ZodOptional="ZodOptional",J.ZodNullable="ZodNullable",J.ZodDefault="ZodDefault",J.ZodCatch="ZodCatch",J.ZodPromise="ZodPromise",J.ZodBranded="ZodBranded",J.ZodPipeline="ZodPipeline",J.ZodReadonly="ZodReadonly"})(w8||(w8={}));gi1=qG.create,mi1=vB.create,iM6=xS.create,nM6=kB.create,ui1=DO.create,aM6=dN.create,rM6=SS.create,sM6=MO.create,oM6=VO.create,tM6=cN.create,eM6=SB.create,JV6=Xz.create,QV6=vS.create,ZV6=zG.create,XV6=_4.create,YV6=_4.strictCreate,KV6=NO.create,GV6=Hc.create,qV6=LO.create,zV6=Yz.create,UV6=kS.create,WV6=_S.create,FV6=lN.create,HV6=BO.create,BV6=AO.create,DV6=wO.create,MV6=_B.create,VV6=RO.create,NV6=iN.create,LV6=FG.create,AV6=UG.create,wV6=NW.create,RV6=FG.createWithPreprocess,OV6=bS.create,IV6={string:(J)=>qG.create({...J,coerce:!0}),number:(J)=>vB.create({...J,coerce:!0}),boolean:(J)=>DO.create({...J,coerce:!0}),bigint:(J)=>kB.create({...J,coerce:!0}),date:(J)=>dN.create({...J,coerce:!0})},PV6=M8});var Q1={};R6(Q1,{void:()=>QV6,util:()=>O9,unknown:()=>eM6,union:()=>KV6,undefined:()=>sM6,tuple:()=>zV6,transformer:()=>LV6,symbol:()=>rM6,string:()=>gi1,strictObject:()=>YV6,setErrorMap:()=>wM6,set:()=>FV6,record:()=>UV6,quotelessJson:()=>LM6,promise:()=>NV6,preprocess:()=>RV6,pipeline:()=>OV6,ostring:()=>jV6,optional:()=>AV6,onumber:()=>$V6,oboolean:()=>EV6,objectUtil:()=>qX1,object:()=>XV6,number:()=>mi1,nullable:()=>wV6,null:()=>oM6,never:()=>JV6,nativeEnum:()=>VV6,nan:()=>iM6,map:()=>WV6,makeIssue:()=>CS,literal:()=>DV6,lazy:()=>BV6,late:()=>cM6,isValid:()=>CB,isDirty:()=>Fc,isAsync:()=>FO,isAborted:()=>Wc,intersection:()=>qV6,instanceof:()=>lM6,getParsedType:()=>Zz,getErrorMap:()=>WO,function:()=>HV6,enum:()=>MV6,effect:()=>LV6,discriminatedUnion:()=>GV6,defaultErrorMap:()=>MW,datetimeRegex:()=>yi1,date:()=>aM6,custom:()=>hi1,coerce:()=>IV6,boolean:()=>ui1,bigint:()=>nM6,array:()=>ZV6,any:()=>tM6,addIssueToContext:()=>W6,ZodVoid:()=>vS,ZodUnknown:()=>SB,ZodUnion:()=>NO,ZodUndefined:()=>MO,ZodType:()=>q9,ZodTuple:()=>Yz,ZodTransformer:()=>FG,ZodSymbol:()=>SS,ZodString:()=>qG,ZodSet:()=>lN,ZodSchema:()=>q9,ZodRecord:()=>kS,ZodReadonly:()=>$O,ZodPromise:()=>iN,ZodPipeline:()=>bS,ZodParsedType:()=>e0,ZodOptional:()=>UG,ZodObject:()=>_4,ZodNumber:()=>vB,ZodNullable:()=>NW,ZodNull:()=>VO,ZodNever:()=>Xz,ZodNativeEnum:()=>RO,ZodNaN:()=>xS,ZodMap:()=>_S,ZodLiteral:()=>wO,ZodLazy:()=>AO,ZodIssueCode:()=>f0,ZodIntersection:()=>LO,ZodFunction:()=>BO,ZodFirstPartyTypeKind:()=>w8,ZodError:()=>MZ,ZodEnum:()=>_B,ZodEffects:()=>FG,ZodDiscriminatedUnion:()=>Hc,ZodDefault:()=>OO,ZodDate:()=>dN,ZodCatch:()=>jO,ZodBranded:()=>Bc,ZodBoolean:()=>DO,ZodBigInt:()=>kB,ZodArray:()=>zG,ZodAny:()=>cN,Schema:()=>q9,ParseStatus:()=>ZJ,OK:()=>kJ,NEVER:()=>PV6,INVALID:()=>M8,EMPTY_PATH:()=>RM6,DIRTY:()=>pN,BRAND:()=>dM6});var HX1=B1(()=>{Uc();UX1();Si1();TS();pi1();zc()});var LW=B1(()=>{HX1();HX1()});function CV6(J){return di1.safeParse(J)}function xB(J){return TV6.safeParse(J)}function EO(J){if(!J||!Array.isArray(J))return[];let Q=[];for(let[Z,X]of J.entries()){let Y=CV6(X);if(Y.success)Q.push(Y.data);else{let K=typeof X==="object"&&X!==null&&"tool"in X?String(X.tool):`entry at index ${Z}`;u.warn(`Permission entry for tool "${K}" is invalid: ${Y.error.errors.map((G)=>`${G.path.join(".")}: ${G.message}`).join(", ")}`)}}return Q}var BX1,di1,TV6;var nN=B1(()=>{LW();G0();BX1=Q1.lazy(()=>Q1.union([Q1.string().describe('Pattern match where "*" matches any number of any characters'),Q1.array(BX1).min(1).describe("OR match of each entry"),Q1.boolean().describe("A literal boolean match"),Q1.number().describe("A literal number match"),Q1.null().describe("A literal null match"),Q1.undefined().describe("A literal undefined match"),Q1.record(Q1.string(),BX1).describe("Matching individual keys of an object")])),di1=Q1.object({tool:Q1.string().min(1).describe("The name of the tool to which this entry applies"),matches:Q1.record(Q1.string(),BX1).optional().describe("Maps tool inputs to conditions"),action:Q1.enum(["allow","reject","ask","delegate"]).describe("How Amp should proceed in case of a match"),context:Q1.enum(["thread","subagent"]).optional().describe("Only apply this entry in this context"),to:Q1.string().min(1).optional().describe('Command to delegate to when action is "delegate"')}).superRefine((J,Q)=>{if(J.action==="delegate"&&!J.to)Q.addIssue({code:Q1.ZodIssueCode.custom,message:'delegate action requires "to" field',path:["to"]});if(J.action!=="delegate"&&J.to)Q.addIssue({code:Q1.ZodIssueCode.custom,message:'"to" field only allowed with delegate action',path:["to"]})}),TV6=Q1.array(di1).describe("Entries checked in sequence to configure tool permissions")});function VZ(J,Q){let Z=SV6(J,Q);return typeof Z==="string"?Z:Z.toString()}function SV6(J,Q,Z=!0){if(!Q)Q=vV6();let{workspaceFolders:X,isWindows:Y,homeDir:K}=Q,G=typeof J==="string"?w0.parse(J):w0.from(J);if(X)for(let q of X){let z=D8(q);if(b0.hasPrefix(G,z)){let U=z.path.endsWith("/")?z.path.slice(0,-1):z.path,F=Z&&X&&X.length>=2?PN(z.path)+(Y?"\\":"/"):"";return DX1(F+G.path.slice(U.length+1),Y,G.scheme)}}if(G?.scheme==="file"){if(K){let q=D8(K);if(b0.hasPrefix(G,q)){let z=q.path.endsWith("/")?q.path.slice(0,-1):q.path,U=G.path.slice(z.length+1);return DX1("~"+(Y?"\\":"/")+U,Y,G.scheme)}}return DX1(G.fsPath,Y,G.scheme)}return G}function DX1(J,Q,Z){return Q&&Z==="file"?J.replaceAll("/","\\"):J}function Mc(J){let Q=Dc;return Dc=J,Q}function vV6(){if(Dc)return Dc;throw Error("must call setDisplayPathEnvInfo before calling displayPath() and related functions")}var Dc=null;var bB=B1(()=>{b6();iR();Id()});function _J(J,...Q){throw Error(`[Immer] minified error nr: ${J}. Full error at: https://bit.ly/3cXEKWf`)}function sN(J){return!!J&&!!J[$X]}function yB(J){if(!J)return!1;return ai1(J)||Array.isArray(J)||!!J[yS]||!!J.constructor?.[yS]||uS(J)||pS(J)}function ai1(J){if(!J||typeof J!=="object")return!1;let Q=rN(J);if(Q===null)return!0;let Z=Object.hasOwnProperty.call(Q,"constructor")&&Q.constructor;if(Z===Object)return!0;return typeof Z=="function"&&Function.toString.call(Z)===kV6}function fS(J,Q){if(oN(J)===0)Reflect.ownKeys(J).forEach((Z)=>{Q(Z,J[Z],J)});else J.forEach((Z,X)=>Q(X,Z,J))}function oN(J){let Q=J[$X];return Q?Q.type_:Array.isArray(J)?1:uS(J)?2:pS(J)?3:0}function hS(J,Q){return oN(J)===2?J.has(Q):Object.prototype.hasOwnProperty.call(J,Q)}function MX1(J,Q){return oN(J)===2?J.get(Q):J[Q]}function ri1(J,Q,Z){let X=oN(J);if(X===2)J.set(Q,Z);else if(X===3)J.add(Z);else J[Q]=Z}function _V6(J,Q){if(J===Q)return J!==0||1/J===1/Q;else return J!==J&&Q!==Q}function uS(J){return J instanceof Map}function pS(J){return J instanceof Set}function aN(J){return J.copy_||J.base_}function LX1(J,Q){if(uS(J))return new Map(J);if(pS(J))return new Set(J);if(Array.isArray(J))return Array.prototype.slice.call(J);let Z=ai1(J);if(Q===!0||Q==="class_only"&&!Z){let X=Object.getOwnPropertyDescriptors(J);delete X[$X];let Y=Reflect.ownKeys(X);for(let K=0;K<Y.length;K++){let G=Y[K],q=X[G];if(q.writable===!1)q.writable=!0,q.configurable=!0;if(q.get||q.set)X[G]={configurable:!0,writable:!0,enumerable:q.enumerable,value:J[G]}}return Object.create(rN(J),X)}else{let X=rN(J);if(X!==null&&Z)return{...J};let Y=Object.create(X);return Object.assign(Y,J)}}function RQ(J,Q=!1){if(Lc(J)||sN(J)||!yB(J))return J;if(oN(J)>1)J.set=J.add=J.clear=J.delete=xV6;if(Object.freeze(J),Q)Object.entries(J).forEach(([Z,X])=>RQ(X,!0));return J}function xV6(){_J(2)}function Lc(J){return Object.isFrozen(J)}function tN(J){let Q=AX1[J];if(!Q)_J(0,J);return Q}function bV6(J,Q){if(!AX1[J])AX1[J]=Q}function si1(){return gS}function yV6(J,Q){return{drafts_:[],parent_:J,immer_:Q,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ci1(J,Q){if(Q)tN("Patches"),J.patches_=[],J.inversePatches_=[],J.patchListener_=Q}function wX1(J){RX1(J),J.drafts_.forEach(fV6),J.drafts_=null}function RX1(J){if(J===gS)gS=J.parent_}function li1(J){return gS=yV6(gS,J)}function fV6(J){let Q=J[$X];if(Q.type_===0||Q.type_===1)Q.revoke_();else Q.revoked_=!0}function ii1(J,Q){Q.unfinalizedDrafts_=Q.drafts_.length;let Z=Q.drafts_[0];if(J!==void 0&&J!==Z){if(Z[$X].modified_)wX1(Q),_J(4);if(yB(J)){if(J=Vc(Q,J),!Q.parent_)Nc(Q,J)}if(Q.patches_)tN("Patches").generateReplacementPatches_(Z[$X].base_,J,Q.patches_,Q.inversePatches_)}else J=Vc(Q,Z,[]);if(wX1(Q),Q.patches_)Q.patchListener_(Q.patches_,Q.inversePatches_);return J!==$X1?J:void 0}function Vc(J,Q,Z){if(Lc(Q))return Q;let X=Q[$X];if(!X)return fS(Q,(Y,K)=>ni1(J,X,Q,Y,K,Z)),Q;if(X.scope_!==J)return Q;if(!X.modified_)return Nc(J,X.base_,!0),X.base_;if(!X.finalized_){X.finalized_=!0,X.scope_.unfinalizedDrafts_--;let Y=X.copy_,K=Y,G=!1;if(X.type_===3)K=new Set(Y),Y.clear(),G=!0;if(fS(K,(q,z)=>ni1(J,X,Y,q,z,Z,G)),Nc(J,Y,!1),Z&&J.patches_)tN("Patches").generatePatches_(X,Z,J.patches_,J.inversePatches_)}return X.copy_}function ni1(J,Q,Z,X,Y,K,G){if(sN(Y)){let q=K&&Q&&Q.type_!==3&&!hS(Q.assigned_,X)?K.concat(X):void 0,z=Vc(J,Y,q);if(ri1(Z,X,z),sN(z))J.canAutoFreeze_=!1;else return}else if(G)Z.add(Y);if(yB(Y)&&!Lc(Y)){if(!J.immer_.autoFreeze_&&J.unfinalizedDrafts_<1)return;if(Vc(J,Y),(!Q||!Q.scope_.parent_)&&typeof X!=="symbol"&&Object.prototype.propertyIsEnumerable.call(Z,X))Nc(J,Y)}}function Nc(J,Q,Z=!1){if(!J.parent_&&J.immer_.autoFreeze_&&J.canAutoFreeze_)RQ(Q,Z)}function hV6(J,Q){let Z=Array.isArray(J),X={type_:Z?1:0,scope_:Q?Q.scope_:si1(),modified_:!1,finalized_:!1,assigned_:{},parent_:Q,base_:J,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=X,K=EX1;if(Z)Y=[X],K=mS;let{revoke:G,proxy:q}=Proxy.revocable(Y,K);return X.draft_=q,X.revoke_=G,q}function VX1(J,Q){let Z=J[$X];return(Z?aN(Z):J)[Q]}function gV6(J,Q,Z){let X=oi1(Q,Z);return X?"value"in X?X.value:X.get?.call(J.draft_):void 0}function oi1(J,Q){if(!(Q in J))return;let Z=rN(J);while(Z){let X=Object.getOwnPropertyDescriptor(Z,Q);if(X)return X;Z=rN(Z)}return}function OX1(J){if(!J.modified_){if(J.modified_=!0,J.parent_)OX1(J.parent_)}}function NX1(J){if(!J.copy_)J.copy_=LX1(J.base_,J.scope_.immer_.useStrictShallowCopy_)}function jX1(J,Q){let Z=uS(J)?tN("MapSet").proxyMap_(J,Q):pS(J)?tN("MapSet").proxySet_(J,Q):hV6(J,Q);return(Q?Q.scope_:si1()).drafts_.push(Z),Z}function uV6(J){if(!sN(J))_J(10,J);return ti1(J)}function ti1(J){if(!yB(J)||Lc(J))return J;let Q=J[$X],Z;if(Q){if(!Q.modified_)return Q.base_;Q.finalized_=!0,Z=LX1(J,Q.scope_.immer_.useStrictShallowCopy_)}else Z=LX1(J,!0);if(fS(Z,(X,Y)=>{ri1(Z,X,ti1(Y))}),Q)Q.finalized_=!1;return Z}function Ac(){let Q="replace",Z="add",X="remove";function Y(H,B,M,V){switch(H.type_){case 0:case 2:return G(H,B,M,V);case 1:return K(H,B,M,V);case 3:return q(H,B,M,V)}}function K(H,B,M,V){let{base_:N,assigned_:L}=H,A=H.copy_;if(A.length<N.length)[N,A]=[A,N],[M,V]=[V,M];for(let w=0;w<N.length;w++)if(L[w]&&A[w]!==N[w]){let R=B.concat([w]);M.push({op:Q,path:R,value:F(A[w])}),V.push({op:Q,path:R,value:F(N[w])})}for(let w=N.length;w<A.length;w++){let R=B.concat([w]);M.push({op:Z,path:R,value:F(A[w])})}for(let w=A.length-1;N.length<=w;--w){let R=B.concat([w]);V.push({op:X,path:R})}}function G(H,B,M,V){let{base_:N,copy_:L}=H;fS(H.assigned_,(A,w)=>{let R=MX1(N,A),O=MX1(L,A),j=!w?X:hS(N,A)?Q:Z;if(R===O&&j===Q)return;let $=B.concat(A);M.push(j===X?{op:j,path:$}:{op:j,path:$,value:O}),V.push(j===Z?{op:X,path:$}:j===X?{op:Z,path:$,value:F(R)}:{op:Q,path:$,value:F(R)})})}function q(H,B,M,V){let{base_:N,copy_:L}=H,A=0;N.forEach((w)=>{if(!L.has(w)){let R=B.concat([A]);M.push({op:X,path:R,value:w}),V.unshift({op:Z,path:R,value:w})}A++}),A=0,L.forEach((w)=>{if(!N.has(w)){let R=B.concat([A]);M.push({op:Z,path:R,value:w}),V.unshift({op:X,path:R,value:w})}A++})}function z(H,B,M,V){M.push({op:Q,path:[],value:B===$X1?void 0:B}),V.push({op:Q,path:[],value:H})}function U(H,B){return B.forEach((M)=>{let{path:V,op:N}=M,L=H;for(let O=0;O<V.length-1;O++){let j=oN(L),$=V[O];if(typeof $!=="string"&&typeof $!=="number")$=""+$;if((j===0||j===1)&&($==="__proto__"||$==="constructor"))_J(19);if(typeof L==="function"&&$==="prototype")_J(19);if(L=MX1(L,$),typeof L!=="object")_J(18,V.join("/"))}let A=oN(L),w=W(M.value),R=V[V.length-1];switch(N){case Q:switch(A){case 2:return L.set(R,w);case 3:_J(16);default:return L[R]=w}case Z:switch(A){case 1:return R==="-"?L.push(w):L.splice(R,0,w);case 2:return L.set(R,w);case 3:return L.add(w);default:return L[R]=w}case X:switch(A){case 1:return L.splice(R,1);case 2:return L.delete(R);case 3:return L.delete(M.value);default:return delete L[R]}default:_J(17,N)}}),H}function W(H){if(!yB(H))return H;if(Array.isArray(H))return H.map(W);if(uS(H))return new Map(Array.from(H.entries()).map(([M,V])=>[M,W(V)]));if(pS(H))return new Set(Array.from(H).map(W));let B=Object.create(rN(H));for(let M in H)B[M]=W(H[M]);if(hS(H,yS))B[yS]=H[yS];return B}function F(H){if(sN(H))return W(H);else return H}bV6("Patches",{applyPatches_:U,generatePatches_:Y,generateReplacementPatches_:z})}function t8(J){return J}var $X1,yS,$X,rN,kV6,AX1,gS,EX1,mS,mV6=class{constructor(J){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(Q,Z,X)=>{if(typeof Q==="function"&&typeof Z!=="function"){let K=Z;Z=Q;let G=this;return function(z=K,...U){return G.produce(z,(W)=>Z.call(this,W,...U))}}if(typeof Z!=="function")_J(6);if(X!==void 0&&typeof X!=="function")_J(7);let Y;if(yB(Q)){let K=li1(this),G=jX1(Q,void 0),q=!0;try{Y=Z(G),q=!1}finally{if(q)wX1(K);else RX1(K)}return ci1(K,X),ii1(Y,K)}else if(!Q||typeof Q!=="object"){if(Y=Z(Q),Y===void 0)Y=Q;if(Y===$X1)Y=void 0;if(this.autoFreeze_)RQ(Y,!0);if(X){let K=[],G=[];tN("Patches").generateReplacementPatches_(Q,Y,K,G),X(K,G)}return Y}else _J(1,Q)},this.produceWithPatches=(Q,Z)=>{if(typeof Q==="function")return(G,...q)=>this.produceWithPatches(G,(z)=>Q(z,...q));let X,Y;return[this.produce(Q,Z,(G,q)=>{X=G,Y=q}),X,Y]},typeof J?.autoFreeze==="boolean")this.setAutoFreeze(J.autoFreeze);if(typeof J?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy(J.useStrictShallowCopy)}createDraft(J){if(!yB(J))_J(8);if(sN(J))J=uV6(J);let Q=li1(this),Z=jX1(J,void 0);return Z[$X].isManual_=!0,RX1(Q),Z}finishDraft(J,Q){let Z=J&&J[$X];if(!Z||!Z.isManual_)_J(9);let{scope_:X}=Z;return ci1(X,Q),ii1(void 0,X)}setAutoFreeze(J){this.autoFreeze_=J}setUseStrictShallowCopy(J){this.useStrictShallowCopy_=J}applyPatches(J,Q){let Z;for(Z=Q.length-1;Z>=0;Z--){let Y=Q[Z];if(Y.path.length===0&&Y.op==="replace"){J=Y.value;break}}if(Z>-1)Q=Q.slice(Z+1);let X=tN("Patches").applyPatches_;if(sN(J))return X(J,Q);return this.produce(J,(Y)=>X(Y,Q))}},EX,wc,dS,tV9,eV9,ei1,JN9,QN9;var OQ=B1(()=>{$X1=Symbol.for("immer-nothing"),yS=Symbol.for("immer-draftable"),$X=Symbol.for("immer-state");rN=Object.getPrototypeOf;kV6=Object.prototype.constructor.toString();AX1={};EX1={get(J,Q){if(Q===$X)return J;let Z=aN(J);if(!hS(Z,Q))return gV6(J,Z,Q);let X=Z[Q];if(J.finalized_||!yB(X))return X;if(X===VX1(J.base_,Q))return NX1(J),J.copy_[Q]=jX1(X,J);return X},has(J,Q){return Q in aN(J)},ownKeys(J){return Reflect.ownKeys(aN(J))},set(J,Q,Z){let X=oi1(aN(J),Q);if(X?.set)return X.set.call(J.draft_,Z),!0;if(!J.modified_){let Y=VX1(aN(J),Q),K=Y?.[$X];if(K&&K.base_===Z)return J.copy_[Q]=Z,J.assigned_[Q]=!1,!0;if(_V6(Z,Y)&&(Z!==void 0||hS(J.base_,Q)))return!0;NX1(J),OX1(J)}if(J.copy_[Q]===Z&&(Z!==void 0||(Q in J.copy_))||Number.isNaN(Z)&&Number.isNaN(J.copy_[Q]))return!0;return J.copy_[Q]=Z,J.assigned_[Q]=!0,!0},deleteProperty(J,Q){if(VX1(J.base_,Q)!==void 0||Q in J.base_)J.assigned_[Q]=!1,NX1(J),OX1(J);else delete J.assigned_[Q];if(J.copy_)delete J.copy_[Q];return!0},getOwnPropertyDescriptor(J,Q){let Z=aN(J),X=Reflect.getOwnPropertyDescriptor(Z,Q);if(!X)return X;return{writable:!0,configurable:J.type_!==1||Q!=="length",enumerable:X.enumerable,value:Z[Q]}},defineProperty(){_J(11)},getPrototypeOf(J){return rN(J.base_)},setPrototypeOf(){_J(12)}},mS={};fS(EX1,(J,Q)=>{mS[J]=function(){return arguments[0]=arguments[0][0],Q.apply(this,arguments)}});mS.deleteProperty=function(J,Q){return mS.set.call(this,J,Q,void 0)};mS.set=function(J,Q,Z){return EX1.set.call(this,J[0],Q,Z,J[0])};EX=new mV6,wc=EX.produce,dS=EX.produceWithPatches.bind(EX),tV9=EX.setAutoFreeze.bind(EX),eV9=EX.setUseStrictShallowCopy.bind(EX),ei1=EX.applyPatches.bind(EX),JN9=EX.createDraft.bind(EX),QN9=EX.finishDraft.bind(EX)});function IX1({onlyFirst:J=!1}={}){let Z=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(Z,J?void 0:"g")}function cS(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(pV6,"")}var pV6;var PX1=B1(()=>{pV6=IX1()});var Qn1=a((qN9,Jn1)=>{Jn1.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var Rc;var Zn1=B1(()=>{Rc={name:"amp",description:"An agentic coding tool, built by Sourcegraph.",private:!0,displayName:"Amp (Research Preview)",version:"0.0.0-dev",publisher:"sourcegraph",license:"Apache-2.0",categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["sourcegraph","amp","amp code","ampcode","ai","assistant","llm","Claude","Claude Sonnet 4","Claude Sonnet"],icon:"./resources/amp-icon.png",scripts:{dev:"pnpm run -s dev:desktop","dev:insiders":"pnpm run -s dev:desktop:insiders","start:dev:desktop":"node scripts/start-dev.js","start:dev:desktop:insiders":"node scripts/start-dev.js --insiders","start:dev:web":"vscode-test-web --extensionDevelopmentPath=. --browserOption=--disable-web-security --verbose --open-devtools --verbose --printServerLog","start:dev:debugger":"pnpm run -s build:dev:desktop && pnpm run -s ./src/autoedit/webview dev","dev:desktop":"pnpm run -s build:dev:desktop && pnpm run start:dev:desktop","dev:desktop:insiders":"pnpm run -s build:dev:desktop && pnpm run start:dev:desktop:insiders","build:dev:desktop":"vite build",build:"pnpm run -s _build:extension && concurrently -n 'debugger,web,review' 'pnpm run -s _build:debugger' 'pnpm run -s _build:web' 'pnpm run -s _build:tab:review'","build:production":"pnpm run -s _build:extension:production && concurrently -n 'debugger,web,review' 'pnpm run -s _build:debugger:production' 'pnpm run -s _build:web:production' 'pnpm run -s _build:tab:review:production'","_build:extension":"vite build","_build:extension:production":"cross-env NODE_ENV=production vite build","_build:web":"pnpm -C ../web run build && cp -R ../web/build dist/web-build","_build:web:production":"pnpm -C ../web run build:production && cp -R ../web/build dist/web-build","_build:debugger":"pnpm -C ./src/autoedit/webview run build && cp -R ./src/autoedit/webview/build dist/autoedit","_build:debugger:production":"cross-env NODE_ENV=production pnpm -C ./src/autoedit/webview run build && cp -R ./src/autoedit/webview/build dist/autoedit","_build:tab:review":"pnpm -C ./src/autoedit/review-panel-webview run build && mkdir -p dist/autoedit && cp -R ./src/autoedit/review-panel-webview/build dist/autoedit/review-panel","_build:tab:review:production":"cross-env NODE_ENV=production pnpm -C ./src/autoedit/review-panel-webview run build && mkdir -p dist/autoedit && cp -R ./src/autoedit/review-panel-webview/build dist/autoedit/review-panel","build:icon-font":"npx -y svgtofont --sources ./icon-font/svg --output ./icon-font/build && cp ./icon-font/build/amp-icons.woff ./resources","dev:forks":"pnpm dev:vsix && cursor --install-extension dist/amp-dev.vsix --force && windsurf --install-extension dist/amp-dev.vsix --force","dev:vsix":"vite build && pnpm run -s _build:web && pnpm run -s _build:debugger && pnpm run -s _build:tab:review && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code --install-extension dist/amp-dev.vsix --force","dev:insiders:vsix":"vite build && pnpm run -s _build:web && pnpm run -s _build:debugger && pnpm run -s _build:tab:review && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code-insiders --install-extension dist/amp-dev.vsix --force",test:"vitest run","test:dev":"vitest"},homepage:"https://ampcode.com",repository:{type:"git",url:"https://github.com/sourcegraph/amp",directory:"vscode"},author:{name:"The Amp Team at Sourcegraph",email:"amp-devs@sourcegraph.com"},engines:{vscode:"^1.79.0",node:">=22.0.0"},main:"./dist/extension.js",activationEvents:["onStartupFinished"],extensionDependencies:["vscode.git"],contributes:{languages:[{id:"jsonc",filenamePatterns:["**/Library/Application Support/ampcode/managed-settings.json","**/etc/ampcode/managed-settings.json","**/ProgramData/ampcode/managed-settings.json"]}],viewsContainers:{activitybar:[{id:"sourcegraph-amp",title:"Amp",icon:"./resources/amp-mark.svg"}]},views:{"sourcegraph-amp":[{type:"webview",id:"amp.sidebarView",name:"Amp",icon:"./resources/amp-mark.svg",visibility:"visible"}]},commands:[{command:"amp.agent.newThread",title:"New Thread",category:"Amp",icon:"$(add)"},{command:"amp.agent.newWindow",title:"New Agent Window",category:"Amp",icon:"$(browser)",enablement:"amp.activated"},{command:"amp.agent.toggleVisibility",title:"Toggle Agent",category:"Amp"},{command:"amp.agent.openReview",title:"Open Amp Review",category:"Amp",icon:"$(compare-changes)",enablement:"amp.activated"},{command:"amp.agent.focusPromptEditor",title:"Focus Prompt Editor",category:"Amp"},{command:"amp.agent.addSelectionToPromptEditor",title:"Add Selection to Prompt",category:"Amp",enablement:"editorHasSelection"},{command:"amp.agent.switchAgentMode",title:"Switch Agent Mode for Current Thread",category:"Amp",enablement:"amp.hasMultipleVisibleModes"},{command:"amp.agent.setPromptFromRecentActions",title:"Create Prompt from Recent Actions",category:"Amp"},{command:"amp.agent.findInThread",title:"Find in Thread",category:"Amp",enablement:"amp.agent.active"},{command:"amp.agent.collapseAllInThread",title:"Collapse All Blocks in Thread",category:"Amp"},{command:"amp.agent.expandAllInThread",title:"Expand All Blocks in Thread",category:"Amp"},{command:"amp.agent.expandToggleInThread",title:"Toggle Expand All Blocks in Thread",category:"Amp"},{command:"amp.agent.toggleThreadSwitcher",title:"Switch to Thread...",category:"Amp",enablement:"amp.agent.active"},{command:"amp.agent.toggleCostDisplay",title:"Toggle Cost Display",category:"Amp"},{command:"amp.agent.navigateThreadPrevious",title:"Navigate to Previous Thread",category:"Amp",enablement:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.navigateThreadNext",title:"Navigate to Next Thread",category:"Amp",enablement:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.openThreadJSON",title:"Open Thread JSON",category:"Amp",enablement:"amp.isDevelopmentMode"},{command:"amp.testThreadSummary",title:"Test Thread Summary",category:"Amp",enablement:"amp.isDevelopmentMode"},{command:"amp.tab.quickPickMenu",title:"Show Tab Menu",category:"Amp",icon:"$(debug)",enablement:"amp.activated"},{command:"amp.tab.showDebugPanel",title:"Show Tab Debug Panel",category:"Amp",icon:"$(debug)",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.showDiff",title:"Tab: Show Diff",category:"Amp",icon:"$(diff)",enablement:"amp.activated && config.amp.tab.enabled && config.amp.tab.experimental.review"},{command:"amp.tab.diffPanel.acceptAll",title:"Tab Review: Accept All Changes",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled && config.amp.tab.experimental.review"},{command:"amp.tab.diffPanel.instruct",title:"Tab Review: Open Instruct Mode",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled && config.amp.tab.experimental.review"},{command:"amp.tab.manualTrigger",title:"Tab Manual Trigger",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.enable",title:"Enable Tab",category:"Amp",enablement:"amp.activated && !config.amp.tab.enabled"},{command:"amp.tab.disable",title:"Disable Tab",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.toggleForCurrentDocument",title:"Toggle Tab for Current Document",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.debugInfo",title:"Open Tab Debug Info",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.autoAcceptChain",title:"Accept Suggestion Chain",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.mcp.restartServers",title:"Restart MCP Servers",category:"Amp"},{command:"amp.agent.editUserPermissions",title:"Edit User Permissions",category:"Amp"},{command:"amp.agent.editWorkspacePermissions",title:"Edit Workspace Permissions",category:"Amp"},{command:"amp.commandPalette.show",title:"Show Amp Command Palette",category:"Amp",icon:"$(list-flat)"}],menus:{"editor/context":[{command:"amp.agent.addSelectionToPromptEditor",when:"editorHasSelection",group:"amp@1"}]},keybindings:[{command:"amp.agent.newThread",key:"ctrl+l",mac:"cmd+l",when:"amp.primaryShortcuts"},{command:"amp.agent.newThread",key:"ctrl+alt+j",mac:"cmd+alt+j",when:"!amp.primaryShortcuts"},{command:"amp.agent.newWindow",key:"ctrl+shift+l",mac:"cmd+shift+l"},{command:"amp.agent.toggleVisibility",key:"ctrl+i",mac:"cmd+i",when:"amp.primaryShortcuts"},{command:"amp.agent.toggleVisibility",key:"ctrl+alt+u",mac:"cmd+alt+u",when:"!amp.primaryShortcuts"},{command:"amp.agent.findInThread",key:"ctrl+f",mac:"cmd+f",when:"amp.agent.active"},{command:"amp.agent.toggleThreadSwitcher",key:"ctrl+k",mac:"cmd+k",when:"amp.agent.active"},{command:"amp.agent.toggleCostDisplay",key:"ctrl+d",mac:"cmd+d",when:"amp.agent.active && amp.isSourcegraphTeammate || isWeb"},{command:"amp.agent.navigateThreadPrevious",key:"ctrl+shift+[",mac:"cmd+shift+[",when:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.navigateThreadNext",key:"ctrl+shift+]",mac:"cmd+shift+]",when:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.savePermissions",key:"ctrl+s",mac:"cmd+s",enablement:"editorTextFocus && resourcePath =~ /[\\\\/]amp[\\\\/]permissions-.*\\.sh$/i",when:"editorTextFocus && resourcePath =~ /[\\\\/]amp[\\\\/]permissions-.*\\.sh$/i"},{command:"amp.tab.diffPanel.acceptAll",key:"ctrl+enter",mac:"cmd+enter",when:"activeWebviewPanelId == 'ampTabDiff'"},{command:"amp.tab.diffPanel.instruct",key:"ctrl+i",mac:"cmd+i",when:"activeWebviewPanelId == 'ampTabDiff'"},{command:"amp.agent.openReview",key:"ctrl+;",mac:"cmd+;"},{command:"-extension.vim_tab",key:"tab",when:"editorTextFocus && vim.active && vim.mode != 'Insert' && !inlineEditIsVisible && !inDebugRepl"},{command:"-vscode-neovim.send",key:"tab",when:"neovim.init && (editorTextFocus && neovim.mode != insert && editorLangId not in neovim.editorLangIdExclusions || neovim.recording)"},{command:"amp.tab.accept",key:"tab",when:"editorTextFocus && amp.activated && amp.tab.active && !amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.showDiff",key:"shift+tab",when:"editorTextFocus && amp.activated && config.amp.tab.experimental.review && (amp.tab.active || inlineSuggestionVisible) && !amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.dismiss",key:"escape",when:"editorTextFocus && amp.activated && amp.tab.active && !amp.nextCursorSuggested && !suggestWidgetVisible && !amp.editorHasMultipleLineSelection"},{command:"amp.nextCursor.accept",key:"tab",when:"editorTextFocus && amp.activated && amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.nextCursor.discard",key:"escape",when:"editorTextFocus && amp.activated && amp.nextCursorSuggested && !suggestWidgetVisible && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.autoAcceptChain",key:"alt+shift+tab",when:"editorTextFocus && amp.activated && (amp.tab.active || amp.nextCursorSuggested) && !amp.editorHasMultipleLineSelection"},{command:"amp.autoImport.accept",key:"tab",when:"editorTextFocus && amp.activated && config.amp.tab.enabled && amp.autoImportSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.autoImport.discard",key:"escape",when:"editorTextFocus && amp.activated && config.amp.tab.enabled && amp.autoImportSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.commandPalette.show",key:"ctrl+shift+a",mac:"cmd+shift+a",when:"amp.activated"}],configuration:{type:"object",title:"Amp",properties:{"amp.url":{type:"string",examples:["https://ampcode.com/"],description:"URL to the Amp server, usually https://ampcode.com/",scope:"application"},"amp.notifications.enabled":{type:"boolean",default:!0,description:"Play notification sound when done or blocked",scope:"window"},"amp.mcpServers":{type:"object",description:"Model Context Protocol servers that expose tools",additionalProperties:{type:"object",oneOf:[{properties:{command:{type:"string"},args:{type:"array",items:{type:"string"}},env:{type:"object",additionalProperties:{type:"string"}}},required:["command"]},{properties:{url:{type:"string"},headers:{type:"object",description:"HTTP headers to send with requests to the MCP server",additionalProperties:{type:"string"}}},required:["url"]}]}},"amp.mcpTrustedServers":{type:"array",markdownDescription:"MCP server trust decisions. **Security Note:** This setting is only read from user settings, never workspace settings, to prevent malicious repositories from auto-approving MCP servers.",scope:"application",items:{type:"object",properties:{serverName:{type:"string",description:"MCP server name"},specHash:{type:"string",description:"Hash of the server configuration"},allow:{type:"boolean",description:"Whether this server is approved"}},required:["serverName","specHash","allow"]}},"amp.workspaces":{type:"array",markdownDescription:"Workspace-level configuration. This setting is only read from user settings, never workspace settings.",scope:"application",items:{type:"object",properties:{path:{type:"string",description:"Absolute path to the workspace"},allowAllMcpServers:{type:"boolean",description:"Whether to automatically trust all MCP servers in this workspace"}},required:["path"]}},"amp.mcpPermissions":{type:"array",description:"Permissions for Model Context Protocol (MCP) servers. Controls which MCP servers can be used.",items:{type:"object",properties:{matches:{$ref:"https://static.ampcode.com/schemas/permissions.schema.json#/$defs/permissionMatchCondition"},action:{type:"string",enum:["allow","reject"],description:"Whether to allow or reject MCP servers matching the condition"}},required:["matches","action"],additionalProperties:!1},default:[],scope:"application"},"amp.permissions":{$ref:"https://static.ampcode.com/schemas/permissions.schema.json",description:"Entries checked in sequence to configure tool permissions",default:[]},"amp.experimental.promptAutocompleteMode":{type:"string",enum:["disabled","word-based","tab"],enumDescriptions:["Disabled - no prompt autocomplete","Offline word completion from workspace and thread context","AI-powered suggestions via Amp Tab"],default:"disabled",markdownDescription:"**Experimental:** Prompt autocomplete suggestions while typing.",scope:"application"},"amp.experimental.tools":{type:"array",description:"Enable experimental tools by name. Available tools: chat_llm",items:{type:"string"},default:[],scope:"application"},"amp.tools.disable":{type:"array",markdownDescription:'Disable specific tools by name. Glob patterns using * are supported\n\nExamples:\n- Disable edit_file: `["builtin:edit_file"]`\n- Disable all playwright tab tools: `["mcp__playwright__browser_tab*"]`',items:{type:"string"},default:[]},"amp.dangerouslyAllowAll":{type:"boolean",description:"If true, never ask for confirmation when running commands",scope:"window",default:!1},"amp.guardedFiles.allowlist":{type:"array",description:"Glob patterns for files that should bypass guarded file protection. Files matching these patterns can be modified without user confirmation.",items:{type:"string"},default:[],scope:"window"},"amp.anthropic.thinking.enabled":{type:"boolean",default:!0,description:"Enable Claude's extended thinking capabilities",scope:"application"},"amp.tools.inactivityTimeout":{type:"number",default:300,minimum:1,maximum:3600,description:"How many seconds of no output to wait before canceling bash commands.",scope:"workspace"},"amp.tools.stopTimeout":{type:"number",default:300,description:"How many seconds to wait before canceling a running tool.",scope:"application"},"amp.terminal.commands.nodeSpawn.loadProfile":{type:"string",enum:["always","never","daily"],default:"always",description:"Before running commands (including MCP servers), whether to load environment variables from the user's profile (.bashrc, .zshrc, .envrc) as visible from the workspace root directory.",scope:"application"},"amp.todos.enabled":{type:"boolean",default:!0,description:"Enable TODOs tracking for managing tasks",scope:"application"},"amp.guidanceFiles.specs":{type:"boolean",default:!1,description:"[Experimental] Read `*.spec.md` files adjacent to `AGENT.md` files that are read",scope:"window"},"amp.security.audit.logMcpConnections":{type:"boolean",default:!1,description:"Enable telemetry logging for remote MCP server connections (for security auditing)",scope:"application"},"amp.hooks":{type:"array",scope:"window",description:"[Experimental] Hooks are event handlers that can react to specific conditions.",items:{type:"object",properties:{compatibilityDate:{type:"string",const:"2025-05-13",default:"2025-05-13",description:"The version of the hook schema that this value was written to conform to"},id:{type:"string",description:"A unique identifier for the hook",examples:["run-vitest-with-env-vars"]},description:{type:"string",description:"A description of the hook"},on:{oneOf:[{type:"object",properties:{event:{type:"string",const:"tool:pre-execute",default:"tool:pre-execute",description:"Trigger when a tool is about to be executed"},tool:{oneOf:[{type:"string",description:"Tool name to match (e.g., 'edit_file')"},{type:"array",items:{type:"string"},description:"Tool names to match"}],description:"Trigger for the given tool name(s)"},"input.contains":{oneOf:[{type:"string",description:"String pattern to match in the tool input"},{type:"array",items:{type:"string"},description:"String patterns to match in the tool input"}],description:"Trigger only when the tool input contains the given literal string or strings"}},required:["event","tool","input.contains"]},{type:"object",properties:{event:{type:"string",const:"tool:post-execute",default:"tool:post-execute",description:"Trigger after a tool has been executed"},tool:{oneOf:[{type:"string",description:"Tool name to match (e.g., 'edit_file')"},{type:"array",items:{type:"string"},description:"Tool names to match"}],description:"Trigger for the given tool name(s)"}},required:["event","tool"]}]},action:{oneOf:[{type:"object",properties:{type:{type:"string",const:"send-user-message",default:"send-user-message",description:"Send a user message to interrupt the agent and cancel the tool call in the `tool:pre-execute` trigger before it starts to run"},message:{type:"string",description:"The text of the message to send"}},required:["type","message"]},{type:"object",properties:{type:{type:"string",const:"redact-tool-input",default:"redact-tool-input",description:"Redact the tool input after execution. Only allowed with `tool:post-execute` event."},redactedInput:{type:"object",description:"The replacement input data to use instead of the original tool input (must be an object)"}},required:["type","redactedInput"]}]},if:{type:"boolean",description:"A condition that determines whether the hook should be executed",default:!0}},required:["compatibilityDate","id","on","action"]},default:[]},"amp.tab.enabled":{type:"boolean",default:!1,description:"Enable Amp Tab",scope:"application"},"amp.tab.verboseLogs":{type:"boolean",default:!1,description:"Enable verbose logging for Amp Tab",scope:"application"},"amp.debugLogs":{type:"boolean",default:!1,description:"Enable debug logging in the Amp output channel",scope:"application"},"amp.tab.disabledLanguages":{type:"array",items:{type:"string"},default:[],examples:["markdown","python"],description:"List of language IDs for which Amp Tab is disabled",scope:"application"},"amp.tab.disableOnComment":{type:"boolean",default:!1,description:"Disable Amp Tab completions on comment lines",scope:"application"},"amp.tab.autoImport.enabled":{type:"boolean",default:!0,description:"Enable auto import in Amp Tab",scope:"application"},"amp.tab.dismissCommandIds":{type:"array",items:{type:"string"},default:["extension.vim_escape","vim.escape","vscode-neovim.escape","vscode-neovim.escapeKey"],description:"Command IDs to run when Escape is pressed to dismiss an Amp Tab suggestion",scope:"application"},"amp.tab.experimental.showHotStreakProgress":{type:"boolean",default:!1,description:"Experimental: Show hot streak progress in image-rendered suggestions",scope:"window"},"amp.tab.experimental.autoAccept.delayMs":{type:"number",default:0,description:"Experimental: Delay in milliseconds before auto-accepting Amp Tab suggestions",scope:"application"},"amp.tab.experimental.unobtrusiveDiffs":{type:"boolean",default:!1,description:"Experimental: Enable unobtrusive diffs mode for Amp Tab suggestions. When enabled, suggestions are shown as image overlays to avoid layout shifts and visual interference with existing code.",scope:"application"},"amp.tab.experimental.review":{type:"boolean",default:!1,description:"Experimental: Enable review mode for Amp Tab. When enabled, adds the ability to review suggestion changes with Shift+Tab shortcut and review panel.",scope:"window"},"amp.tab.diagnosticTracking":{type:"string",enum:["disabled","same_file","multi_file"],default:"multi_file",description:"Enable diagnostic tracking for Amp Tab suggestions. 'disabled' = no tracking, 'same_file' = track diagnostics within the same file, 'multi_file' = track diagnostics across multiple files.",scope:"application"},"amp.tab.hoverDiagnosticSuggestions":{type:"boolean",default:!1,description:"Show suggestions when hovering over diagnostics.",scope:"application"},"amp.tab.experimental.displayMode":{type:"string",enum:["eager","subtle"],default:"eager",description:"Experimental: Control how Amp Tab suggestions are displayed. 'eager' = show diff immediately, 'subtle' = show 'Tab to Jump' first, then show diff after user interaction.",scope:"application"},"amp.tab.experimental.disableClientFilters":{type:"array",items:{type:"string",enum:["recentlyRejectedCodeToRewrite","recentEdits","rewriteAreaOverlap","bigModification","incompatibleWithSelectedCompletionContextItem","recentlyRejectedDiff","whiteSpaceOnlyChange","formattingOnlyChange"]},default:[],description:"Experimental: Disable specific client-side filters to observe unfiltered model behavior.",scope:"application"},"amp.ui.zoomLevel":{type:"number",default:1,description:"Zoom level for the Amp UI",scope:"application"},"amp.experimental.reviewTool":{type:"boolean",default:!1,description:"Experimental: Enable the code review tool.",scope:"application"},"amp.experimental.gitblame":{type:"boolean",default:!1,description:"Experimental: Show git blame authors when editing code.",scope:"application"},"amp.git.commit.coauthor.enabled":{type:"boolean",default:!0,description:"Enable adding Amp as co-author in git commits",scope:"window"},"amp.git.commit.ampThread.enabled":{type:"boolean",default:!0,description:"Enable adding Amp-Thread trailer in git commits",scope:"window"},"amp.gpt5":{type:"boolean",default:!1,description:"[DEPRECATED] GPT-5 is no longer available as the main model. It's now the oracle. See https://ampcode.com/news/gpt-5-oracle",scope:"window",deprecationMessage:"GPT-5 is no longer available as the main model. It's now the oracle. See https://ampcode.com/news/gpt-5-oracle"}}},icons:{"amp-agent-file":{description:"Amp agent file",default:{fontPath:"resources/amp-icons.woff",fontCharacter:"\\0041"}}}},capabilities:{untrustedWorkspaces:{supported:"limited",description:"Amp only uses MCP servers from trusted workspaces because they execute code.",restrictedConfigurations:["amp.mcpServers","amp.mcpPermissions","amp.url"]},virtualWorkspaces:{supported:!1,description:"Amp is not supported in virtual workspaces like GitHub.dev because Amp requires local file system access and terminal capabilities."}},dependencies:{"@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.57.2","@opentelemetry/core":"^1.30.1","@opentelemetry/exporter-logs-otlp-http":"^0.57.2","@opentelemetry/exporter-metrics-otlp-http":"^0.57.2","@opentelemetry/exporter-trace-otlp-http":"^0.57.2","@opentelemetry/resources":"^1.30.1","@opentelemetry/sdk-logs":"^0.57.2","@opentelemetry/sdk-metrics":"^1.30.1","@opentelemetry/sdk-node":"^0.57.2","@opentelemetry/sdk-trace-base":"^1.30.1","@opentelemetry/sdk-trace-node":"^1.30.1","@opentelemetry/semantic-conventions":"^1.34.0","@sourcegraph/amp-core":"workspace:*","@sourcegraph/amp-uri":"workspace:*","@sourcegraph/observable":"workspace:*","canvaskit-wasm":"^0.40.0","detect-indent":"^7.0.1","fast-json-stable-stringify":"^2.1.0","fast-myers-diff":"^3.2.0","fast-xml-parser":"^5.2.3",isbinaryfile:"^5.0.5",lodash:"^4.17.21","lru-cache":"^11.1.0","node-fetch":"^3.3.2",shiki:"3.8.1",systeminformation:"^5.27.7",uuid:"^11.1.0","vscode-languageserver-textdocument":"^1.0.12","wink-nlp-utils":"^2.1.0",ws:"^8.18.3"},devDependencies:{"@sourcegraph/amp-web":"workspace:*","@types/jest-image-snapshot":"^6.4.0","@types/lodash":"^4.17.15","@types/node":"catalog:","@types/uuid":"^10.0.0","@types/vscode":"^1.79.0","@types/ws":"^8.18.1","@vscode/test-electron":"^2.4.1","@vscode/test-web":"*","@vscode/vsce":"^3.2.2","cross-env":"^7.0.3","crypto-browserify":"^3.12.1","jest-image-snapshot":"^6.5.0","os-browserify":"^0.3.0","path-browserify":"^1.0.1","rollup-plugin-polyfill-node":"^0.13.0",tsx:"^4.19.4","vite-plugin-static-copy":"^3.0.0"}}});function cV6(J){return typeof J==="number"&&Number.isInteger(J)&&J>=1&&J<=3600}function Xn1(J){let Q=J.settings["tools.inactivityTimeout"],Z=J.settings["tools.stopTimeout"],X=Q;if(X===void 0&&Z!==void 0)X=Z;if(X===void 0)X=Rc.contributes.configuration.properties["amp.tools.inactivityTimeout"].default;if(!cV6(X))return null;return X*1000}function Yn1(J){let Q=J.settings["tools.stopTimeout"],Z=Rc.contributes.configuration.properties["amp.tools.stopTimeout"].default;return(Q??Z)*1000}var WN9;var TX1=B1(()=>{Zn1();WN9=Rc.contributes.configuration.properties});function Oc(J,Q){return new e1((Z)=>{let X=setTimeout(Y,Q);function Y(){Z.error(Error(`Tool execution timed out after ${Q/1000} seconds`))}function K(){if(X)clearTimeout(X);X=setTimeout(Y,Q)}let G=J.subscribe({next:(q)=>{K(),Z.next(q)},error:(q)=>{if(X)clearTimeout(X),X=null;Z.error(q)},complete:()=>{if(X)clearTimeout(X),X=null;Z.complete()}});return()=>{if(X)clearTimeout(X),X=null;G.unsubscribe()}})}var CX1=B1(()=>{C0()});function I7(J,Q){let Z={name:Q.name,description:Q.description,inputSchema:Q.inputSchema,source:Q.source,meta:Q.meta,customizedForModel:!1},X=Q.modelCustomizations;if(X){for(let Y of X)if(Y.modelSelector.test(J))Z={...Z,name:Y.name??Z.name,description:Y.description??Z.description,inputSchema:Y.inputSchema??Z.inputSchema,customizedForModel:!0}}return Z}function xJ(J){return["done","error","rejected-by-user","cancelled"].includes(J.status)}function qn1(J){return["done","error","cancelled"].includes(J.status)}function IO(J){let Q=[],Z=new b8;function X(K,G){let q=Q.filter((z)=>z.spec.name===K);if(q.length===0&&K==="Glob")q=Q.filter((z)=>z.spec.name==="glob");for(let z of q)if(lS(z.spec,G).enabled)return z;return}function Y(K,G,q){if(!K)throw Error("spec is required");let z={spec:K,fn:Promise.resolve(G),preprocessArgs:q};return Q.push(z),Z.next(),{dispose:()=>{let U=Q.indexOf(z);if(U!==-1)Q.splice(U,1),Z.next()}}}return{registerTool({spec:K,fn:G,preprocessArgs:q}){if(!G)return lV6;return Y(K,G,q)},tools:b9(J.configService.config,Z.pipe(v2(void 0))).pipe(k0(([K])=>{return Q.map((G)=>({spec:G.spec,...lS(G.spec,K)})).sort((G,q)=>G.spec.name.localeCompare(q.spec.name))})),invokeTool(K,G,q){let z=performance.now(),U=()=>iV6.record(performance.now()-z,{toolName:K});if(K===vX1&&G.args&&"invalid_tool_name"in G.args&&typeof G.args.invalid_tool_name==="string"){$c.add(1,{toolName:K,error:"invalid"});let F=SX1(G.args.invalid_tool_name);return new e1((H)=>{H.error(Error(F))})}let W=X(K,q.config);if(!W){let F=Q.filter((V)=>V.spec.name===K);if(F.length===0)return $c.add(1,{toolName:K,error:"not_found"}),new e1((V)=>{V.error(Error(`tool ${JSON.stringify(K)} not found`))});let H=F[0],B=lS(H.spec,q.config);$c.add(1,{toolName:K,error:"disabled"});let M=B.enabled?"unknown":B.disabledReason;return new e1((V)=>{V.error(Error(`tool ${JSON.stringify(K)} is disabled: ${M}`))})}return $c.add(1,{toolName:K}),d6(()=>W.fn).pipe(q8((F)=>{let H=F(G,q);if(W.spec.meta?.disableTimeout)return H;return Oc(H,Yn1(q.config))}),YG(()=>U()))},preprocessArgs(K,G,q){let z=X(K,q.config);if(!z||!z.preprocessArgs)return;let U=z.preprocessArgs;try{return U(G,q)}catch(W){u.error("preprocessArgs",{id:K,args:G,error:String(W)});return}},dispose(){}}}function jc(J,Q){for(let Z of Q){if(Z==="")continue;if(Z.length===1){if(Z==="*")return!0;if(Z===J)return!0;continue}if(J===Z)return!0;if(Z.includes("*")||Z.includes("?")||Z.includes("[")||Z.includes("{"))try{if(Gn1.default(Z,{dot:!0})(J))return!0}catch(X){continue}}return!1}function lS(J,Q){let Z=Q.settings?.["tools.disable"]??[];if(jc(J.name,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"mcp"in J.source){let X=Un1(J.name);if(X&&J.source.mcp===X.server&&jc(X.tool,Z))return{enabled:!1,disabledReason:"settings"}}if(J.source==="builtin"&&jc(`builtin:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"toolbox"in J.source&&jc(`toolbox:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(J.name===QJ||J.name===$B){if(Q.settings?.["todos.enabled"])return{enabled:!0};return{enabled:!1,disabledReason:"feature-flag"}}return{enabled:!0}}function SX1(J){return`Invalid tool name ${JSON.stringify(J)}. Tool names must match the pattern ${iS.toString()}. Try again with a valid tool name.`}function Un1(J){let[,Q,Z]=J.split(/mcp__([^ ]+)__([^ ]+)/);if(Q&&Z)return{server:Q,tool:Z};return}function kX1(J){if(J.status==="in-progress"||J.status==="done"||J.status==="cancelled"||J.status==="error")return J.progress;return}function bJ(J,Q,Z=!0){let X=new Set(Q.map((K)=>K.spec.name));function Y(K){if(X.has(K))return!0;if(K==="Glob"&&X.has("glob"))return!0;if(Z&&Un1(K))return!0;return!1}return{registerTool(K){throw Error("Tools should not be registered in a filtered tool service")},invokeTool(K,G,q){if(!Y(K))return new e1((z)=>{z.error(Error(`tool ${JSON.stringify(K)} not allowed in filtered service`))});return J.invokeTool(K,G,q)},preprocessArgs(K,G,q){if(!Y(K))return;return J.preprocessArgs?.(K,G,q)},tools:J.tools.pipe(k0((K)=>K.filter((G)=>Y(G.spec.name)))),dispose(){}}}var Kn1,Gn1,lV6,vX1="invalid_tool",iS,zn1,$c,iV6;var c2=B1(()=>{C0();G0();TX1();CX1();N8();Kn1=C6(xd(),1),Gn1=C6(mN(),1);lV6={dispose(){}};iS=/^[a-zA-Z0-9_]{1,64}$/,zn1=Kn1.metrics.getMeter("tool_service"),$c=zn1.createCounter("tool_service.invocation_count",{description:"Number of tool invocations"}),iV6=zn1.createHistogram("tool_service.invocation_latency",{description:"Latency of tool invocations",unit:"ms"})});var Mn1=a((Bn1)=>{Object.defineProperty(Bn1,"__esModule",{value:!0});Bn1.calcSlices=Bn1.applyPatch=Bn1.calcPatch=Bn1.lcs=Bn1.diff=Bn1.diff_core=void 0;function nV6(J,Q){let{b:Z,eq:X,stack_base:Y}=J,{i:K,N:G,j:q,M:z,Z:U,stack_top:W}=J;for(;;)switch(Q){case 0:{J:while(G>0&&z>0){Z.fill(0,0,2*U);let F=G-z,H=G+z,B=H&1,M=K+G-1,V=q+z-1,N=(H+B)/2,L;Q:for(let A=0;A<=N;A++){let w=2*Math.max(0,A-z)-A,R=A-2*Math.max(0,A-G);for(let O=w;O<=R;O+=2){let j=Z[O-1-U*Math.floor((O-1)/U)],$=Z[O+1-U*Math.floor((O+1)/U)],E=O===-A||O!==A&&j<$?$:j+1,I=E-O,T=E,S=I;while(T<G&&S<z&&X(K+T,q+S))T++,S++;if(Z[O-U*Math.floor(O/U)]=T,B===1&&(L=F-O)>=1-A&&L<A&&T+Z[U+L-U*Math.floor(L/U)]>=G)if(A>1||T!==E){Y[W++]=K+T,Y[W++]=G-T,Y[W++]=q+S,Y[W++]=z-S,G=E,z=I,U=2*(Math.min(G,z)+1);continue J}else break Q}for(let O=w;O<=R;O+=2){let j=Z[U+O-1-U*Math.floor((O-1)/U)],$=Z[U+O+1-U*Math.floor((O+1)/U)],E=O===-A||O!==A&&j<$?$:j+1,I=E-O,T=E,S=I;while(T<G&&S<z&&X(M-T,V-S))T++,S++;if(Z[U+O-U*Math.floor(O/U)]=T,B===0&&(L=F-O)>=-A&&L<=A&&T+Z[L-U*Math.floor(L/U)]>=G)if(A>0||T!==E){Y[W++]=K+G-E,Y[W++]=E,Y[W++]=q+z-I,Y[W++]=I,G=G-T,z=z-S,U=2*(Math.min(G,z)+1);continue J}else break Q}}if(G===z)continue;if(z>G)K+=G,q+=G,z-=G,G=0;else K+=z,q+=z,G-=z,z=0;break}if(G+z!==0)if(J.pxe===K||J.pye===q)J.pxe=K+G,J.pye=q+z;else{let F=J.pxs;if(J.oxs=J.pxs,J.oxe=J.pxe,J.oys=J.pys,J.oye=J.pye,J.pxs=K,J.pxe=K+G,J.pys=q,J.pye=q+z,F>=0)return J.i=K,J.N=G,J.j=q,J.M=z,J.Z=U,J.stack_top=W,1}}case 1:{if(W===0)return 2;z=Y[--W],q=Y[--W],G=Y[--W],K=Y[--W],U=2*(Math.min(G,z)+1),Q=0}}}class Wn1{constructor(J){this.state=J,this.c=0,this.result={value:null,done:!1}}[Symbol.iterator](){return this}next(){let{state:J,result:Q}=this;if(this.c>1)return Q.done=!0,Q.value=void 0,Q;let Z=nV6(J,this.c);if(this.c=Z,Z===1)return Q.value=[J.oxs,J.oxe,J.oys,J.oye],Q;if(J.pxs>=0)return Q.value=[J.pxs,J.pxe,J.pys,J.pye],Q;return Q.done=!0,Q.value=void 0,Q}}function Fn1(J,Q,Z,X,Y){let K=(Math.min(Q,X)+1)*2,G=Q+X,q=new(G<256?Uint8Array:G<65536?Uint16Array:Uint32Array)(2*K);return new Wn1({i:J,N:Q,j:Z,M:X,Z:K,b:q,eq:Y,pxs:-1,pxe:-1,pys:-1,pye:-1,oxs:-1,oxe:-1,oys:-1,oye:-1,stack_top:0,stack_base:[]})}Bn1.diff_core=Fn1;function Ec(J,Q,Z){let[X,Y,K]=[0,J.length,Q.length];if(typeof Z==="function"){while(X<Y&&X<K&&Z(X,X))X++;if(X===Y&&X===K)return[][Symbol.iterator]();while(Z(--Y,--K)&&Y>X&&K>X);}else{while(X<Y&&X<K&&J[X]===Q[X])X++;if(X===Y&&X===K)return[][Symbol.iterator]();while(J[--Y]===Q[--K]&&Y>X&&K>X);Z=(G,q)=>J[G]===Q[q]}return Fn1(X,Y+1-X,X,K+1-X,Z)}Bn1.diff=Ec;class Hn1{constructor(J,Q){this.diff=J,this.N=Q,this.i=0,this.j=0}[Symbol.iterator](){return this}next(){let J=this.diff.next();if(J.done){let{i:q,j:z,N:U}=this;if(q<U)J.done=!1,J.value=[q,z,U-q],this.i=U;return J}let Q=J.value,Z=Q[0],X=Q[1],Y=Q[3],{i:K,j:G}=this;if(K!==Z)Q.length--,Q[0]=K,Q[1]=G,Q[2]=Z-K;return this.i=X,this.j=Y,J}}function aV6(J,Q,Z){return new Hn1(Ec(J,Q,Z),J.length)}Bn1.lcs=aV6;function*rV6(J,Q,Z){let X=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let Y of Ec(J,Q,Z))Y[2]=X.call(Q,Y[2],Y[3]),yield Y}Bn1.calcPatch=rV6;function*sV6(J,Q){let Z=0,X=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[Y,K,G]of Q){if(Z<Y)yield X.call(J,Z,Y);if(G.length>0)yield G;Z=K}if(Z<J.length)yield X.call(J,Z)}Bn1.applyPatch=sV6;function*oV6(J,Q,Z){let X=0,Y=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[K,G,q,z]of Ec(J,Q,Z)){if(X<K)yield[0,Y.call(J,X,K)];if(K<G)yield[-1,Y.call(J,K,G)];if(q<z)yield[1,Y.call(Q,q,z)];X=G}if(X<J.length)yield[0,J.slice(X)]}Bn1.calcSlices=oV6});function Ic(J,Q){if(J===void 0||Q===void 0||J===Q)return{added:0,deleted:0,changed:0};let Z={added:0,deleted:0,changed:0};for(let[X,Y,K,G]of Vn1.diff(J.split(`
3
+ `)[0];if(!X?.startsWith("#!"))return{interpreter:null,isValid:!1};let Y=X.slice(2).trim();if(!Y)return{interpreter:null,isValid:!1};let K=Y.split(/\s+/).filter((G)=>G.length>0);if(K[0]?.endsWith("/env")&&K.length>1)return{interpreter:K.slice(1),isValid:!0};return{interpreter:K,isValid:!0}}finally{await Q.close()}}catch{return{interpreter:null,isValid:!1}}}function Sl1(J,Q){let Z=(J&73)!==0;if(process.platform==="win32"){let X=fN.extname(Q).toLowerCase();return Z||[".exe",".bat",".cmd",".ps1"].includes(X)}return Z}function vl1(J){return fN.extname(J).toLowerCase()===".md"}function kl1(J){let Q=J.replace(/\\/g,"/"),Z=fN.basename(Q);return fN.basename(Z,fN.extname(Z))}function _l1(J){return/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(J)&&J.length>0}var xl1=()=>{};var hl1={};R6(hl1,{CommandDiscovery:()=>fl1});import*as yl1 from"node:fs";import{promises as ud}from"node:fs";import{homedir as bl1}from"node:os";import*as RX from"node:path";function rZ1(J,Q,Z){return Promise.race([J,new Promise((X,Y)=>setTimeout(()=>Y(Error(`${Z} timed out after ${Q}ms`)),Q))])}class fl1{config;workspaceRoots;watchFactory;debounceMs;changes=new b8;watchers=new Map;debounceTimer;disposed=!1;constructor(J,Q,Z={}){this.config=J,this.workspaceRoots=Q,this.watchFactory=Z.watchFactory??AD6,this.debounceMs=Z.debounceMs??200}get commandChanges(){return this.changes}async discoverCommands(){if(this.disposed)return[];try{let[J,Q]=await Promise.all([this.discoverWorkspaceCommands(),this.discoverGlobalCommands()]),Z=new Map;for(let Y of Q)Z.set(Y.name,Y);for(let Y of J)Z.set(Y.name,Y);let X=Array.from(Z.values());if(u.debug("Discovered commands",{count:X.length,workspace:J.length,global:Q.length}),this.config.enableWatching)await this.setupWatching();return X}catch(J){return u.error("Failed to discover commands",{error:J}),[]}}async discoverWorkspaceCommands(){let J=[];for(let Q of this.workspaceRoots)for(let Z of this.config.workspacePaths){let X=b0.joinPath(Q,Z),Y=await this.discoverCommandsInDirectory(X,"workspace");J.push(...Y)}return J}async discoverGlobalCommands(){let J=[];for(let Q of this.config.globalPaths){let Z=this.resolveGlobalPath(Q),X=w0.file(Z),Y=await this.discoverCommandsInDirectory(X,"global");J.push(...Y)}return J}async discoverCommandsInDirectory(J,Q){try{let Z=J.fsPath;try{await rZ1(ud.access(Z),aZ1,"directory access")}catch{return[]}let Y=(await rZ1(ud.readdir(Z,{withFileTypes:!0}),aZ1,"directory read")).filter((G)=>G.isFile()),K=[];for(let G of Y){let q=RX.join(Z,G.name),z=await this.createCommand(q);if(z)K.push(z)}return u.debug(`Discovered ${K.length} commands in ${Q} directory`,{directory:Z,commands:K.map((G)=>G.name)}),K}catch(Z){return u.warn(`Failed to discover commands in directory: ${J.fsPath}`,{error:Z}),[]}}ignoreCommandName(J){return J.startsWith(".")||J==="README.md"}async createCommand(J){try{let Q=await ud.stat(J),Z=RX.basename(J);if(this.ignoreCommandName(Z))return null;let X=kl1(Z);if(!_l1(X))return u.warn(`Invalid command name: ${X}`,{filePath:J}),null;if(vl1(Z))return this.createMarkdownCommand(J,Q,X);else return this.createExecutableCommand(J,Q,X)}catch(Q){return u.warn(`Failed to process file: ${J}`,{error:Q}),null}}async createMarkdownCommand(J,Q,Z){return{kind:"markdown",name:Z,filePath:J,sourceDirectory:RX.dirname(J),lastModified:Q.mtimeMs,available:!0,unavailableReason:void 0}}async createExecutableCommand(J,Q,Z){let X=RX.basename(J),Y=Sl1(Q.mode,X),K=await Cl1(J),G=RX.extname(X);if(!Y&&!K.isValid&&!this.isNativeBinary(G))return u.debug(`Skipping non-executable file without shebang: ${J}`),null;let q=Y&&(K.isValid||this.isNativeBinary(G)),z=this.getExecutableUnavailableReason(Y,K.isValid,G);return{kind:"executable",name:Z,filePath:J,sourceDirectory:RX.dirname(J),lastModified:Q.mtimeMs,isExecutable:Y,interpreter:K.interpreter,extension:G,available:q,unavailableReason:z}}isNativeBinary(J){if(process.platform==="win32")return[".exe",".bat",".cmd",".ps1"].includes(J.toLowerCase());return J===""}getExecutableUnavailableReason(J,Q,Z){let X=this.isNativeBinary(Z);if(!J)return"File is not executable (missing execute permissions)";if(!Q&&!X)return"Missing shebang and not a recognized binary type";return}resolveGlobalPath(J){if(J.startsWith("~/"))return RX.join(bl1(),J.slice(2));if(J.startsWith("~/.config/amp/")){let Q=AB||RX.join(bl1(),".config");return RX.join(Q,J.slice(10))}return J}async setupWatching(){if(this.disposed)return;this.stopWatching();let J=new Set;for(let Q of this.workspaceRoots)for(let Z of this.config.workspacePaths){let X=b0.joinPath(Q,Z);J.add(X.fsPath)}for(let Q of this.config.globalPaths){let Z=this.resolveGlobalPath(Q);J.add(Z)}for(let Q of J)await this.watchDirectory(Q)}async watchDirectory(J){try{await rZ1(ud.access(J),aZ1,"watcher access check");try{let Q=this.watchFactory(J,(Z,X)=>{u.debug("Command directory change detected",{directory:J,eventType:Z,filename:X}),this.scheduleRefresh()});Q.on("error",(Z)=>{u.debug("transient file watcher error",{error:Z}),this.scheduleRefresh()}),this.watchers.set(J,Q),u.debug("Started watching command directory",{directory:J})}catch(Q){u.warn("Failed to setup file watcher",{directory:J,error:Q})}}catch(Q){u.debug("Skipping watch for non-existent directory",{directory:J})}}scheduleRefresh(){if(this.disposed)return;if(this.debounceTimer)clearTimeout(this.debounceTimer);this.debounceTimer=setTimeout(async()=>{try{let[J,Q]=await Promise.all([this.discoverWorkspaceCommands(),this.discoverGlobalCommands()]),Z=new Map;for(let Y of Q)Z.set(Y.name,Y);for(let Y of J)Z.set(Y.name,Y);let X=Array.from(Z.values());u.debug("Refreshed commands during file watch",{count:X.length,workspace:J.length,global:Q.length}),this.changes.next(X)}catch(J){u.warn("Failed to refresh commands during file watch",{error:J})}},this.debounceMs)}stopWatching(){try{for(let[J,Q]of this.watchers)try{Q.close(),u.debug("Stopped watching command directory",{directory:J})}catch(Z){u.warn("Failed to close watcher",{directory:J,error:Z})}this.watchers.clear()}finally{if(this.debounceTimer)clearTimeout(this.debounceTimer),this.debounceTimer=void 0}}dispose(){this.disposed=!0;try{this.stopWatching()}catch(J){u.warn("Error during command discovery cleanup",{error:J})}}}var aZ1=5000,AD6=(J,Q)=>yl1.watch(J,Q);var gl1=B1(()=>{b6();C0();QO();G0();xl1()});import{homedir as pd}from"node:os";import hN from"node:path";var ul1,RD6,pl1,OD6,dd,jD6,ZO,wB,sZ1;var DW=B1(()=>{QO();ul1=hN.join(pd(),".local/share"),RD6=process.platform==="win32"||process.platform==="darwin"?ul1:LB??ul1,pl1=hN.join(pd(),".config"),OD6=process.platform==="win32"||process.platform==="darwin"?pl1:AB??pl1,dd=hN.join(RD6,"amp"),jD6=hN.join(OD6,"amp"),ZO=hN.join(jD6,"tools"),wB=hN.join(pd(),".cache","amp"),sZ1=hN.join(pd(),".cache","amp","http-debug-logs")});function wQ(J,Q,Z=Q+"s"){return J===1?Q:Z}var rl1="run_terminal_command",sl1="read_file",e5="Task",ol1="chat_llm",C5="finder",RB="fast_finder",sq="xai_finder",oq="kimiK2_finder",OB="gossip_finder",jB="sonoma_finder",gN="get_diagnostics",i4="Bash",JJ="oracle",wS="mermaid",$B="todo_read",QJ="todo_write",tq="read_web_page",tl1="run_javascript",HZ="create_file",EB="glob",el1="Glob",cd="undo_edit",ld="read_mcp_resource",G9="Read",OX="edit_file",id="format_file",IB="web_search",k4="Grep",RS="Check",eq="librarian",nd="read_github",ad="search_github",rd="commit_search",sd="list_directory_github",od="list_repositories",td="glob_github",ed="diff",Ji1;var N8=B1(()=>{Ji1=["Task","chat_llm","finder","fast_finder","xai_finder","kimiK2_finder","gossip_finder","sonoma_finder","get_diagnostics","Bash","oracle","mermaid","todo_read","todo_write","read_web_page","run_javascript","create_file","glob","Glob","undo_edit","Read","edit_file","format_file","web_search","Grep","search_documents","get_document","Check","code_review","librarian"]});var OS=a((eM9,Zi1)=>{var Qi1={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},yD6={...Qi1,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},fD6={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Zi1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:fD6,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(J){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${J.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(J){return J===!0?yD6:Qi1}}});var jS=a((pD6)=>{var{REGEX_BACKSLASH:hD6,REGEX_REMOVE_BACKSLASH:gD6,REGEX_SPECIAL_CHARS:mD6,REGEX_SPECIAL_CHARS_GLOBAL:uD6}=OS();pD6.isObject=(J)=>J!==null&&typeof J==="object"&&!Array.isArray(J);pD6.hasRegexChars=(J)=>mD6.test(J);pD6.isRegexChar=(J)=>J.length===1&&pD6.hasRegexChars(J);pD6.escapeRegex=(J)=>J.replace(uD6,"\\$1");pD6.toPosixSlashes=(J)=>J.replace(hD6,"/");pD6.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let J=navigator.platform.toLowerCase();return J==="win32"||J==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};pD6.removeBackslashes=(J)=>{return J.replace(gD6,(Q)=>{return Q==="\\"?"":Q})};pD6.escapeLast=(J,Q,Z)=>{let X=J.lastIndexOf(Q,Z);if(X===-1)return J;if(J[X-1]==="\\")return pD6.escapeLast(J,Q,X-1);return`${J.slice(0,X)}\\${J.slice(X)}`};pD6.removePrefix=(J,Q={})=>{let Z=J;if(Z.startsWith("./"))Z=Z.slice(2),Q.prefix="./";return Z};pD6.wrapOutput=(J,Q={},Z={})=>{let X=Z.contains?"":"^",Y=Z.contains?"":"$",K=`${X}(?:${J})${Y}`;if(Q.negated===!0)K=`(?:^(?!${K}).*$)`;return K};pD6.basename=(J,{windows:Q}={})=>{let Z=J.split(Q?/[\\/]/:"/"),X=Z[Z.length-1];if(X==="")return Z[Z.length-2];return X}});var Hi1=a((QV9,Fi1)=>{var Ki1=jS(),{CHAR_ASTERISK:tZ1,CHAR_AT:tD6,CHAR_BACKWARD_SLASH:$S,CHAR_COMMA:eD6,CHAR_DOT:eZ1,CHAR_EXCLAMATION_MARK:JX1,CHAR_FORWARD_SLASH:Wi1,CHAR_LEFT_CURLY_BRACE:QX1,CHAR_LEFT_PARENTHESES:ZX1,CHAR_LEFT_SQUARE_BRACKET:JM6,CHAR_PLUS:QM6,CHAR_QUESTION_MARK:Gi1,CHAR_RIGHT_CURLY_BRACE:ZM6,CHAR_RIGHT_PARENTHESES:qi1,CHAR_RIGHT_SQUARE_BRACKET:XM6}=OS(),zi1=(J)=>{return J===Wi1||J===$S},Ui1=(J)=>{if(J.isPrefix!==!0)J.depth=J.isGlobstar?1/0:1},YM6=(J,Q)=>{let Z=Q||{},X=J.length-1,Y=Z.parts===!0||Z.scanToEnd===!0,K=[],G=[],q=[],z=J,U=-1,W=0,F=0,H=!1,B=!1,M=!1,V=!1,N=!1,L=!1,A=!1,w=!1,R=!1,O=!1,j=0,$,E,I={value:"",depth:0,isGlob:!1},T=()=>U>=X,S=()=>z.charCodeAt(U+1),x=()=>{return $=E,z.charCodeAt(++U)};while(U<X){E=x();let g;if(E===$S){if(A=I.backslashes=!0,E=x(),E===QX1)L=!0;continue}if(L===!0||E===QX1){j++;while(T()!==!0&&(E=x())){if(E===$S){A=I.backslashes=!0,x();continue}if(E===QX1){j++;continue}if(L!==!0&&E===eZ1&&(E=x())===eZ1){if(H=I.isBrace=!0,M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(L!==!0&&E===eD6){if(H=I.isBrace=!0,M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===ZM6){if(j--,j===0){L=!1,H=I.isBrace=!0,O=!0;break}}}if(Y===!0)continue;break}if(E===Wi1){if(K.push(U),G.push(I),I={value:"",depth:0,isGlob:!1},O===!0)continue;if($===eZ1&&U===W+1){W+=2;continue}F=U+1;continue}if(Z.noext!==!0){if((E===QM6||E===tD6||E===tZ1||E===Gi1||E===JX1)===!0&&S()===ZX1){if(M=I.isGlob=!0,V=I.isExtglob=!0,O=!0,E===JX1&&U===W)R=!0;if(Y===!0){while(T()!==!0&&(E=x())){if(E===$S){A=I.backslashes=!0,E=x();continue}if(E===qi1){M=I.isGlob=!0,O=!0;break}}continue}break}}if(E===tZ1){if($===tZ1)N=I.isGlobstar=!0;if(M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===Gi1){if(M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===JM6){while(T()!==!0&&(g=x())){if(g===$S){A=I.backslashes=!0,x();continue}if(g===XM6){B=I.isBracket=!0,M=I.isGlob=!0,O=!0;break}}if(Y===!0)continue;break}if(Z.nonegate!==!0&&E===JX1&&U===W){w=I.negated=!0,W++;continue}if(Z.noparen!==!0&&E===ZX1){if(M=I.isGlob=!0,Y===!0){while(T()!==!0&&(E=x())){if(E===ZX1){A=I.backslashes=!0,E=x();continue}if(E===qi1){O=!0;break}}continue}break}if(M===!0){if(O=!0,Y===!0)continue;break}}if(Z.noext===!0)V=!1,M=!1;let h=z,v="",_="";if(W>0)v=z.slice(0,W),z=z.slice(W),F-=W;if(h&&M===!0&&F>0)h=z.slice(0,F),_=z.slice(F);else if(M===!0)h="",_=z;else h=z;if(h&&h!==""&&h!=="/"&&h!==z){if(zi1(h.charCodeAt(h.length-1)))h=h.slice(0,-1)}if(Z.unescape===!0){if(_)_=Ki1.removeBackslashes(_);if(h&&A===!0)h=Ki1.removeBackslashes(h)}let b={prefix:v,input:J,start:W,base:h,glob:_,isBrace:H,isBracket:B,isGlob:M,isExtglob:V,isGlobstar:N,negated:w,negatedExtglob:R};if(Z.tokens===!0){if(b.maxDepth=0,!zi1(E))G.push(I);b.tokens=G}if(Z.parts===!0||Z.tokens===!0){let g;for(let k=0;k<K.length;k++){let y=g?g+1:W,f=K[k],m=J.slice(y,f);if(Z.tokens){if(k===0&&W!==0)G[k].isPrefix=!0,G[k].value=v;else G[k].value=m;Ui1(G[k]),b.maxDepth+=G[k].depth}if(k!==0||m!=="")q.push(m);g=f}if(g&&g+1<J.length){let k=J.slice(g+1);if(q.push(k),Z.tokens)G[G.length-1].value=k,Ui1(G[G.length-1]),b.maxDepth+=G[G.length-1].depth}b.slashes=K,b.parts=q}return b};Fi1.exports=YM6});var Mi1=a((ZV9,Di1)=>{var Jc=OS(),Jz=jS(),{MAX_LENGTH:Qc,POSIX_REGEX_SOURCE:KM6,REGEX_NON_SPECIAL_CHARS:GM6,REGEX_SPECIAL_CHARS_BACKREF:qM6,REPLACEMENTS:Bi1}=Jc,zM6=(J,Q)=>{if(typeof Q.expandRange==="function")return Q.expandRange(...J,Q);J.sort();let Z=`[${J.join("-")}]`;try{new RegExp(Z)}catch(X){return J.map((Y)=>Jz.escapeRegex(Y)).join("..")}return Z},YO=(J,Q)=>{return`Missing ${J}: "${Q}" - use "\\\\${Q}" to match literal characters`},XX1=(J,Q)=>{if(typeof J!=="string")throw TypeError("Expected a string");J=Bi1[J]||J;let Z={...Q},X=typeof Z.maxLength==="number"?Math.min(Qc,Z.maxLength):Qc,Y=J.length;if(Y>X)throw SyntaxError(`Input length: ${Y}, exceeds maximum allowed length: ${X}`);let K={type:"bos",value:"",output:Z.prepend||""},G=[K],q=Z.capture?"":"?:",z=Jc.globChars(Z.windows),U=Jc.extglobChars(z),{DOT_LITERAL:W,PLUS_LITERAL:F,SLASH_LITERAL:H,ONE_CHAR:B,DOTS_SLASH:M,NO_DOT:V,NO_DOT_SLASH:N,NO_DOTS_SLASH:L,QMARK:A,QMARK_NO_DOT:w,STAR:R,START_ANCHOR:O}=z,j=(F1)=>{return`(${q}(?:(?!${O}${F1.dot?M:W}).)*?)`},$=Z.dot?"":V,E=Z.dot?A:w,I=Z.bash===!0?j(Z):R;if(Z.capture)I=`(${I})`;if(typeof Z.noext==="boolean")Z.noextglob=Z.noext;let T={input:J,index:-1,start:0,dot:Z.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:G};J=Jz.removePrefix(J,T),Y=J.length;let S=[],x=[],h=[],v=K,_,b=()=>T.index===Y-1,g=T.peek=(F1=1)=>J[T.index+F1],k=T.advance=()=>J[++T.index]||"",y=()=>J.slice(T.index+1),f=(F1="",l=0)=>{T.consumed+=F1,T.index+=l},m=(F1)=>{T.output+=F1.output!=null?F1.output:F1.value,f(F1.value)},n=()=>{let F1=1;while(g()==="!"&&(g(2)!=="("||g(3)==="?"))k(),T.start++,F1++;if(F1%2===0)return!1;return T.negated=!0,T.start++,!0},p=(F1)=>{T[F1]++,h.push(F1)},e=(F1)=>{T[F1]--,h.pop()},G1=(F1)=>{if(v.type==="globstar"){let l=T.braces>0&&(F1.type==="comma"||F1.type==="brace"),d=F1.extglob===!0||S.length&&(F1.type==="pipe"||F1.type==="paren");if(F1.type!=="slash"&&F1.type!=="paren"&&!l&&!d)T.output=T.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=I,T.output+=v.output}if(S.length&&F1.type!=="paren")S[S.length-1].inner+=F1.value;if(F1.value||F1.output)m(F1);if(v&&v.type==="text"&&F1.type==="text"){v.output=(v.output||v.value)+F1.value,v.value+=F1.value;return}F1.prev=v,G.push(F1),v=F1},U1=(F1,l)=>{let d={...U[l],conditions:1,inner:""};d.prev=v,d.parens=T.parens,d.output=T.output;let i=(Z.capture?"(":"")+d.open;p("parens"),G1({type:F1,value:l,output:T.output?"":B}),G1({type:"paren",extglob:!0,value:k(),output:i}),S.push(d)},Z1=(F1)=>{let l=F1.close+(Z.capture?")":""),d;if(F1.type==="negate"){let i=I;if(F1.inner&&F1.inner.length>1&&F1.inner.includes("/"))i=j(Z);if(i!==I||b()||/^\)+$/.test(y()))l=F1.close=`)$))${i}`;if(F1.inner.includes("*")&&(d=y())&&/^\.[^\\/.]+$/.test(d)){let r=XX1(d,{...Q,fastpaths:!1}).output;l=F1.close=`)${r})${i})`}if(F1.prev.type==="bos")T.negatedExtglob=!0}G1({type:"paren",extglob:!0,value:_,output:l}),e("parens")};if(Z.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(J)){let F1=!1,l=J.replace(qM6,(d,i,r,o,Y1,J1)=>{if(o==="\\")return F1=!0,d;if(o==="?"){if(i)return i+o+(Y1?A.repeat(Y1.length):"");if(J1===0)return E+(Y1?A.repeat(Y1.length):"");return A.repeat(r.length)}if(o===".")return W.repeat(r.length);if(o==="*"){if(i)return i+o+(Y1?I:"");return I}return i?d:`\\${d}`});if(F1===!0)if(Z.unescape===!0)l=l.replace(/\\/g,"");else l=l.replace(/\\+/g,(d)=>{return d.length%2===0?"\\\\":d?"\\":""});if(l===J&&Z.contains===!0)return T.output=J,T;return T.output=Jz.wrapOutput(l,T,Q),T}while(!b()){if(_=k(),_==="\x00")continue;if(_==="\\"){let d=g();if(d==="/"&&Z.bash!==!0)continue;if(d==="."||d===";")continue;if(!d){_+="\\",G1({type:"text",value:_});continue}let i=/^\\+/.exec(y()),r=0;if(i&&i[0].length>2){if(r=i[0].length,T.index+=r,r%2!==0)_+="\\"}if(Z.unescape===!0)_=k();else _+=k();if(T.brackets===0){G1({type:"text",value:_});continue}}if(T.brackets>0&&(_!=="]"||v.value==="["||v.value==="[^")){if(Z.posix!==!1&&_===":"){let d=v.value.slice(1);if(d.includes("[")){if(v.posix=!0,d.includes(":")){let i=v.value.lastIndexOf("["),r=v.value.slice(0,i),o=v.value.slice(i+2),Y1=KM6[o];if(Y1){if(v.value=r+Y1,T.backtrack=!0,k(),!K.output&&G.indexOf(v)===1)K.output=B;continue}}}}if(_==="["&&g()!==":"||_==="-"&&g()==="]")_=`\\${_}`;if(_==="]"&&(v.value==="["||v.value==="[^"))_=`\\${_}`;if(Z.posix===!0&&_==="!"&&v.value==="[")_="^";v.value+=_,m({value:_});continue}if(T.quotes===1&&_!=='"'){_=Jz.escapeRegex(_),v.value+=_,m({value:_});continue}if(_==='"'){if(T.quotes=T.quotes===1?0:1,Z.keepQuotes===!0)G1({type:"text",value:_});continue}if(_==="("){p("parens"),G1({type:"paren",value:_});continue}if(_===")"){if(T.parens===0&&Z.strictBrackets===!0)throw SyntaxError(YO("opening","("));let d=S[S.length-1];if(d&&T.parens===d.parens+1){Z1(S.pop());continue}G1({type:"paren",value:_,output:T.parens?")":"\\)"}),e("parens");continue}if(_==="["){if(Z.nobracket===!0||!y().includes("]")){if(Z.nobracket!==!0&&Z.strictBrackets===!0)throw SyntaxError(YO("closing","]"));_=`\\${_}`}else p("brackets");G1({type:"bracket",value:_});continue}if(_==="]"){if(Z.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){G1({type:"text",value:_,output:`\\${_}`});continue}if(T.brackets===0){if(Z.strictBrackets===!0)throw SyntaxError(YO("opening","["));G1({type:"text",value:_,output:`\\${_}`});continue}e("brackets");let d=v.value.slice(1);if(v.posix!==!0&&d[0]==="^"&&!d.includes("/"))_=`/${_}`;if(v.value+=_,m({value:_}),Z.literalBrackets===!1||Jz.hasRegexChars(d))continue;let i=Jz.escapeRegex(v.value);if(T.output=T.output.slice(0,-v.value.length),Z.literalBrackets===!0){T.output+=i,v.value=i;continue}v.value=`(${q}${i}|${v.value})`,T.output+=v.value;continue}if(_==="{"&&Z.nobrace!==!0){p("braces");let d={type:"brace",value:_,output:"(",outputIndex:T.output.length,tokensIndex:T.tokens.length};x.push(d),G1(d);continue}if(_==="}"){let d=x[x.length-1];if(Z.nobrace===!0||!d){G1({type:"text",value:_,output:_});continue}let i=")";if(d.dots===!0){let r=G.slice(),o=[];for(let Y1=r.length-1;Y1>=0;Y1--){if(G.pop(),r[Y1].type==="brace")break;if(r[Y1].type!=="dots")o.unshift(r[Y1].value)}i=zM6(o,Z),T.backtrack=!0}if(d.comma!==!0&&d.dots!==!0){let r=T.output.slice(0,d.outputIndex),o=T.tokens.slice(d.tokensIndex);d.value=d.output="\\{",_=i="\\}",T.output=r;for(let Y1 of o)T.output+=Y1.output||Y1.value}G1({type:"brace",value:_,output:i}),e("braces"),x.pop();continue}if(_==="|"){if(S.length>0)S[S.length-1].conditions++;G1({type:"text",value:_});continue}if(_===","){let d=_,i=x[x.length-1];if(i&&h[h.length-1]==="braces")i.comma=!0,d="|";G1({type:"comma",value:_,output:d});continue}if(_==="/"){if(v.type==="dot"&&T.index===T.start+1){T.start=T.index+1,T.consumed="",T.output="",G.pop(),v=K;continue}G1({type:"slash",value:_,output:H});continue}if(_==="."){if(T.braces>0&&v.type==="dot"){if(v.value===".")v.output=W;let d=x[x.length-1];v.type="dots",v.output+=_,v.value+=_,d.dots=!0;continue}if(T.braces+T.parens===0&&v.type!=="bos"&&v.type!=="slash"){G1({type:"text",value:_,output:W});continue}G1({type:"dot",value:_,output:W});continue}if(_==="?"){if(!(v&&v.value==="(")&&Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){U1("qmark",_);continue}if(v&&v.type==="paren"){let i=g(),r=_;if(v.value==="("&&!/[!=<:]/.test(i)||i==="<"&&!/<([!=]|\w+>)/.test(y()))r=`\\${_}`;G1({type:"text",value:_,output:r});continue}if(Z.dot!==!0&&(v.type==="slash"||v.type==="bos")){G1({type:"qmark",value:_,output:w});continue}G1({type:"qmark",value:_,output:A});continue}if(_==="!"){if(Z.noextglob!==!0&&g()==="("){if(g(2)!=="?"||!/[!=<:]/.test(g(3))){U1("negate",_);continue}}if(Z.nonegate!==!0&&T.index===0){n();continue}}if(_==="+"){if(Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){U1("plus",_);continue}if(v&&v.value==="("||Z.regex===!1){G1({type:"plus",value:_,output:F});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||T.parens>0){G1({type:"plus",value:_});continue}G1({type:"plus",value:F});continue}if(_==="@"){if(Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){G1({type:"at",extglob:!0,value:_,output:""});continue}G1({type:"text",value:_});continue}if(_!=="*"){if(_==="$"||_==="^")_=`\\${_}`;let d=GM6.exec(y());if(d)_+=d[0],T.index+=d[0].length;G1({type:"text",value:_});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=_,v.output=I,T.backtrack=!0,T.globstar=!0,f(_);continue}let F1=y();if(Z.noextglob!==!0&&/^\([^?]/.test(F1)){U1("star",_);continue}if(v.type==="star"){if(Z.noglobstar===!0){f(_);continue}let d=v.prev,i=d.prev,r=d.type==="slash"||d.type==="bos",o=i&&(i.type==="star"||i.type==="globstar");if(Z.bash===!0&&(!r||F1[0]&&F1[0]!=="/")){G1({type:"star",value:_,output:""});continue}let Y1=T.braces>0&&(d.type==="comma"||d.type==="brace"),J1=S.length&&(d.type==="pipe"||d.type==="paren");if(!r&&d.type!=="paren"&&!Y1&&!J1){G1({type:"star",value:_,output:""});continue}while(F1.slice(0,3)==="/**"){let H1=J[T.index+4];if(H1&&H1!=="/")break;F1=F1.slice(3),f("/**",3)}if(d.type==="bos"&&b()){v.type="globstar",v.value+=_,v.output=j(Z),T.output=v.output,T.globstar=!0,f(_);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&!o&&b()){T.output=T.output.slice(0,-(d.output+v.output).length),d.output=`(?:${d.output}`,v.type="globstar",v.output=j(Z)+(Z.strictSlashes?")":"|$)"),v.value+=_,T.globstar=!0,T.output+=d.output+v.output,f(_);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&F1[0]==="/"){let H1=F1[1]!==void 0?"|$":"";T.output=T.output.slice(0,-(d.output+v.output).length),d.output=`(?:${d.output}`,v.type="globstar",v.output=`${j(Z)}${H}|${H}${H1})`,v.value+=_,T.output+=d.output+v.output,T.globstar=!0,f(_+k()),G1({type:"slash",value:"/",output:""});continue}if(d.type==="bos"&&F1[0]==="/"){v.type="globstar",v.value+=_,v.output=`(?:^|${H}|${j(Z)}${H})`,T.output=v.output,T.globstar=!0,f(_+k()),G1({type:"slash",value:"/",output:""});continue}T.output=T.output.slice(0,-v.output.length),v.type="globstar",v.output=j(Z),v.value+=_,T.output+=v.output,T.globstar=!0,f(_);continue}let l={type:"star",value:_,output:I};if(Z.bash===!0){if(l.output=".*?",v.type==="bos"||v.type==="slash")l.output=$+l.output;G1(l);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&Z.regex===!0){l.output=_,G1(l);continue}if(T.index===T.start||v.type==="slash"||v.type==="dot"){if(v.type==="dot")T.output+=N,v.output+=N;else if(Z.dot===!0)T.output+=L,v.output+=L;else T.output+=$,v.output+=$;if(g()!=="*")T.output+=B,v.output+=B}G1(l)}while(T.brackets>0){if(Z.strictBrackets===!0)throw SyntaxError(YO("closing","]"));T.output=Jz.escapeLast(T.output,"["),e("brackets")}while(T.parens>0){if(Z.strictBrackets===!0)throw SyntaxError(YO("closing",")"));T.output=Jz.escapeLast(T.output,"("),e("parens")}while(T.braces>0){if(Z.strictBrackets===!0)throw SyntaxError(YO("closing","}"));T.output=Jz.escapeLast(T.output,"{"),e("braces")}if(Z.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket"))G1({type:"maybe_slash",value:"",output:`${H}?`});if(T.backtrack===!0){T.output="";for(let F1 of T.tokens)if(T.output+=F1.output!=null?F1.output:F1.value,F1.suffix)T.output+=F1.suffix}return T};XX1.fastpaths=(J,Q)=>{let Z={...Q},X=typeof Z.maxLength==="number"?Math.min(Qc,Z.maxLength):Qc,Y=J.length;if(Y>X)throw SyntaxError(`Input length: ${Y}, exceeds maximum allowed length: ${X}`);J=Bi1[J]||J;let{DOT_LITERAL:K,SLASH_LITERAL:G,ONE_CHAR:q,DOTS_SLASH:z,NO_DOT:U,NO_DOTS:W,NO_DOTS_SLASH:F,STAR:H,START_ANCHOR:B}=Jc.globChars(Z.windows),M=Z.dot?W:U,V=Z.dot?F:U,N=Z.capture?"":"?:",L={negated:!1,prefix:""},A=Z.bash===!0?".*?":H;if(Z.capture)A=`(${A})`;let w=($)=>{if($.noglobstar===!0)return A;return`(${N}(?:(?!${B}${$.dot?z:K}).)*?)`},R=($)=>{switch($){case"*":return`${M}${q}${A}`;case".*":return`${K}${q}${A}`;case"*.*":return`${M}${A}${K}${q}${A}`;case"*/*":return`${M}${A}${G}${q}${V}${A}`;case"**":return M+w(Z);case"**/*":return`(?:${M}${w(Z)}${G})?${V}${q}${A}`;case"**/*.*":return`(?:${M}${w(Z)}${G})?${V}${A}${K}${q}${A}`;case"**/.*":return`(?:${M}${w(Z)}${G})?${K}${q}${A}`;default:{let E=/^(.*?)\.(\w+)$/.exec($);if(!E)return;let I=R(E[1]);if(!I)return;return I+K+E[2]}}},O=Jz.removePrefix(J,L),j=R(O);if(j&&Z.strictSlashes!==!0)j+=`${G}?`;return j};Di1.exports=XX1});var ES=a((XV9,Ni1)=>{var UM6=Hi1(),YX1=Mi1(),Vi1=jS(),WM6=OS(),FM6=(J)=>J&&typeof J==="object"&&!Array.isArray(J),W7=(J,Q,Z=!1)=>{if(Array.isArray(J)){let W=J.map((H)=>W7(H,Q,Z));return(H)=>{for(let B of W){let M=B(H);if(M)return M}return!1}}let X=FM6(J)&&J.tokens&&J.input;if(J===""||typeof J!=="string"&&!X)throw TypeError("Expected pattern to be a non-empty string");let Y=Q||{},K=Y.windows,G=X?W7.compileRe(J,Q):W7.makeRe(J,Q,!1,!0),q=G.state;delete G.state;let z=()=>!1;if(Y.ignore){let W={...Q,ignore:null,onMatch:null,onResult:null};z=W7(Y.ignore,W,Z)}let U=(W,F=!1)=>{let{isMatch:H,match:B,output:M}=W7.test(W,G,Q,{glob:J,posix:K}),V={glob:J,state:q,regex:G,posix:K,input:W,output:M,match:B,isMatch:H};if(typeof Y.onResult==="function")Y.onResult(V);if(H===!1)return V.isMatch=!1,F?V:!1;if(z(W)){if(typeof Y.onIgnore==="function")Y.onIgnore(V);return V.isMatch=!1,F?V:!1}if(typeof Y.onMatch==="function")Y.onMatch(V);return F?V:!0};if(Z)U.state=q;return U};W7.test=(J,Q,Z,{glob:X,posix:Y}={})=>{if(typeof J!=="string")throw TypeError("Expected input to be a string");if(J==="")return{isMatch:!1,output:""};let K=Z||{},G=K.format||(Y?Vi1.toPosixSlashes:null),q=J===X,z=q&&G?G(J):J;if(q===!1)z=G?G(J):J,q=z===X;if(q===!1||K.capture===!0)if(K.matchBase===!0||K.basename===!0)q=W7.matchBase(J,Q,Z,Y);else q=Q.exec(z);return{isMatch:Boolean(q),match:q,output:z}};W7.matchBase=(J,Q,Z)=>{return(Q instanceof RegExp?Q:W7.makeRe(Q,Z)).test(Vi1.basename(J))};W7.isMatch=(J,Q,Z)=>W7(Q,Z)(J);W7.parse=(J,Q)=>{if(Array.isArray(J))return J.map((Z)=>W7.parse(Z,Q));return YX1(J,{...Q,fastpaths:!1})};W7.scan=(J,Q)=>UM6(J,Q);W7.compileRe=(J,Q,Z=!1,X=!1)=>{if(Z===!0)return J.output;let Y=Q||{},K=Y.contains?"":"^",G=Y.contains?"":"$",q=`${K}(?:${J.output})${G}`;if(J&&J.negated===!0)q=`^(?!${q}).*$`;let z=W7.toRegex(q,Q);if(X===!0)z.state=J;return z};W7.makeRe=(J,Q={},Z=!1,X=!1)=>{if(!J||typeof J!=="string")throw TypeError("Expected a non-empty string");let Y={negated:!1,fastpaths:!0};if(Q.fastpaths!==!1&&(J[0]==="."||J[0]==="*"))Y.output=YX1.fastpaths(J,Q);if(!Y.output)Y=YX1(J,Q);return W7.compileRe(Y,Q,Z,X)};W7.toRegex=(J,Q)=>{try{let Z=Q||{};return new RegExp(J,Z.flags||(Z.nocase?"i":""))}catch(Z){if(Q&&Q.debug===!0)throw Z;return/$^/}};W7.constants=WM6;Ni1.exports=W7});var mN=a((YV9,wi1)=>{var Li1=ES(),HM6=jS();function Ai1(J,Q,Z=!1){if(Q&&(Q.windows===null||Q.windows===void 0))Q={...Q,windows:HM6.isWindows()};return Li1(J,Q,Z)}Object.assign(Ai1,Li1);wi1.exports=Ai1});function Zc(J){if(!J)return null;let Z=Yc(J)?.toolAllowlist;if(!Z)return null;let X=Object.entries(IS).find(([K,G])=>G.includes(J))?.[0],Y=ji1.filter((K)=>K!==X).map((K)=>`!${K}`);if(X&&X!=="finder")Y.push("!finder");return[...Z,...Y]}function Xc(J,Q){let Z=!1;for(let X of Q){if(X==="")continue;if(X.startsWith("!")){let Y=X.slice(1);if(Ri1(J,Y))return!1;continue}if(Ri1(J,X))Z=!0}return Z}function Ri1(J,Q){if(Q==="")return!1;if(Q.length===1){if(Q==="*")return!0;return!1}if(J===Q)return!0;if(Q.includes("*")||Q.includes("?")||Q.includes("[")||Q.includes("{"))try{return Oi1.default(Q,{dot:!0})(J)}catch(Z){return!1}return!1}var Oi1;var KX1=B1(()=>{W2();Oi1=C6(mN(),1)});function y8(J){let Q=d2[J];return`${Q.provider}/${Q.name}`}function jX(J){let[Q,Z]=J.split("/");for(let X of Object.values(d2))if(X.provider===Q&&X.name===Z)return X;switch(Q){case"anthropic":return d2.CLAUDE_SONNET_4_5;case"openai":return d2.GPT_5;case"xai":return d2.GROK_CODE_FAST_1;case"cerebras":return d2.QWEN_3_CODER_480B;case"moonshotai":return d2.KIMI_K2_INSTRUCT;case"openrouter":return d2.SONOMA_SKY_ALPHA;case"supernova":return d2.CODE_SUPERNOVA;case"groq":return d2.GPT_OSS_120B;default:throw Error(`Unknown provider: ${Q}`)}}function KO(J){let[,Q]=J.split("/");return Q||J}function Qz(J){let Q=jX(J);return Q.contextWindow-Q.maxOutputTokens}function EY(J){let Q=J?.["internal.visibleModes"]??[];return Object.values(uN).filter((Z)=>{if(Q.includes(`!${Z.key}`))return!1;let Y="visible"in Z?Z.visible:!1,K=Q.includes(Z.key);return Y||K}).map((Z)=>({mode:Z.key,description:"description"in Z?Z.description:void 0})).sort((Z,X)=>Z.mode.localeCompare(X.mode))}function Yc(J){return Object.values(uN).find((Q)=>Q.key===J)}function $i1(J){return Yc(J)?.primaryModel??y8("CLAUDE_SONNET_4_5")}function Kc(J){let Q=Yc(J);if(!Q)return!1;return jX(Q.primaryModel).capabilities?.vision??!1}function qO(J,Q){return Q.find((Z)=>Z.mode===J)?.description}function Gc(J,Q){let X=(Q.findIndex((K)=>K.mode===J)+1)%Q.length;return Q[X]?.mode??"smart"}var k2,d2,uN,GO,IS,ji1;var W2=B1(()=>{k2={ANTHROPIC:"anthropic",OPENAI:"openai",XAI:"xai",CEREBRAS:"cerebras",GROQ:"groq",MOONSHOT:"moonshotai",OPENROUTER:"openrouter",VERTEXAI:"vertexai",SUPERNOVA:"supernova"},d2={CLAUDE_SONNET_4:{provider:k2.ANTHROPIC,name:"claude-sonnet-4-20250514",displayName:"Claude Sonnet 4",contextWindow:1e6,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_SONNET_4_5:{provider:k2.ANTHROPIC,name:"claude-sonnet-4-5-20250929",displayName:"Claude Sonnet 4.5",contextWindow:1e6,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4:{provider:k2.ANTHROPIC,name:"claude-opus-4-20250514",displayName:"Claude Opus 4",contextWindow:200000,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4_1:{provider:k2.ANTHROPIC,name:"claude-opus-4-1-20250805",displayName:"Claude Opus 4.1",contextWindow:200000,maxOutputTokens:32000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_HAIKU_4_5:{provider:k2.ANTHROPIC,name:"claude-haiku-4-5-20251001",displayName:"Claude Haiku 4.5",contextWindow:200000,maxOutputTokens:64000,capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_3_5_HAIKU:{provider:k2.ANTHROPIC,name:"claude-3-5-haiku-20241022",displayName:"Claude 3.5 Haiku",contextWindow:200000,maxOutputTokens:8000,capabilities:{reasoning:!0,vision:!0,tools:!0},freeTierEligible:!0},CLAUDE_3_5_SONNET:{provider:k2.ANTHROPIC,name:"claude-3-5-sonnet-20241022",displayName:"Claude 3.5 Sonnet",contextWindow:200000,maxOutputTokens:8000,capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5:{provider:k2.OPENAI,name:"gpt-5",displayName:"GPT-5",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_CODEX:{provider:k2.OPENAI,name:"gpt-5-codex",displayName:"GPT-5 Codex",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,tools:!0}},GPT_5_MINI:{provider:k2.OPENAI,name:"gpt-5-mini",displayName:"GPT-5 Mini",contextWindow:400000,maxOutputTokens:128000,pricing:{input:0.25,output:2,cached:0.025},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_NANO:{provider:k2.OPENAI,name:"gpt-5-nano",displayName:"GPT-5 Nano",contextWindow:400000,maxOutputTokens:128000,pricing:{input:0.05,output:0.4,cached:0.005},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_4_1:{provider:k2.OPENAI,name:"gpt-4.1",displayName:"GPT-4.1",contextWindow:1047576,maxOutputTokens:32768,pricing:{input:2,output:8,cached:0.5},capabilities:{vision:!0,tools:!0}},GPT_4O:{provider:k2.OPENAI,name:"gpt-4o",displayName:"GPT-4o",contextWindow:128000,maxOutputTokens:16384,pricing:{input:2.5,output:10,cached:1.25},capabilities:{vision:!0,tools:!0}},O3:{provider:k2.OPENAI,name:"o3",displayName:"o3",contextWindow:200000,maxOutputTokens:1e5,pricing:{input:2,output:8,cached:0.5},capabilities:{reasoning:!0,tools:!0}},O3_MINI:{provider:k2.OPENAI,name:"o3-mini",displayName:"o3-mini",contextWindow:200000,maxOutputTokens:1e5,pricing:{input:1.1,output:4.4,cached:0.55},capabilities:{reasoning:!0,tools:!0}},GPT_OSS_120B:{provider:k2.OPENAI,name:"openai/gpt-oss-120b",displayName:"GPT OSS 120B",contextWindow:128000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0}},GROK_CODE_FAST_1:{provider:k2.XAI,name:"grok-code-fast-1",displayName:"Grok Code Fast 1",contextWindow:256000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0},freeTierEligible:!0},GROK_CODE:{provider:k2.XAI,name:"grok-code",displayName:"Grok Code",contextWindow:256000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0},freeTierEligible:!0},GEMINI_2_5_PRO:{provider:k2.VERTEXAI,name:"gemini-2.5-pro",displayName:"Gemini 2.5 Pro",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH:{provider:k2.VERTEXAI,name:"gemini-2.5-flash",displayName:"Gemini 2.5 Flash",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_PREVIEW_09_2025:{provider:k2.VERTEXAI,name:"gemini-2.5-flash-preview-09-2025",displayName:"Gemini 2.5 Flash (Preview)",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0},freeTierEligible:!0},GEMINI_2_5_FLASH_LITE:{provider:k2.VERTEXAI,name:"gemini-2.5-flash-lite",displayName:"Gemini 2.5 Flash Lite",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_LITE_PREVIEW_09_2025:{provider:k2.VERTEXAI,name:"gemini-2.5-flash-lite-preview-09-2025",displayName:"Gemini 2.5 Flash Lite (Preview)",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0},freeTierEligible:!0},QWEN_3_CODER_480B:{provider:k2.CEREBRAS,name:"qwen-3-coder-480b",displayName:"Qwen 3 Coder 480B",contextWindow:128000,maxOutputTokens:32000,capabilities:{tools:!0}},KIMI_K2_INSTRUCT:{provider:k2.MOONSHOT,name:"kimi-k2-instruct-0905",displayName:"Kimi K2 Instruct",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0}},SONOMA_SKY_ALPHA:{provider:k2.OPENROUTER,name:"sonoma-sky-alpha",displayName:"Sonoma Sky Alpha",contextWindow:256000,maxOutputTokens:32000,capabilities:{tools:!0}},CODE_SUPERNOVA:{provider:k2.SUPERNOVA,name:"code-supernova",displayName:"Code Supernova",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0},freeTierEligible:!0}};uN={SMART:{key:"smart",displayName:"Smart",description:"Smarter, but slower",primaryModel:y8("CLAUDE_SONNET_4_5"),visible:!0},FREE:{key:"free",displayName:"Free",description:"Amp Free",primaryModel:y8("GROK_CODE_FAST_1"),visible:!0,toolAllowlist:["*","!oracle","!librarian","!Task"]},FREE_NEXT:{key:"free-next",displayName:"Free (Next)",description:"Preview of Amp Free configuration in testing",primaryModel:y8("GEMINI_2_5_FLASH_PREVIEW_09_2025"),toolAllowlist:["*","!oracle","!librarian","!Task"]},GRONK_FAST_MAIN:{key:"gronk-fast:main",displayName:"Gronk Fast Main",primaryModel:y8("GROK_CODE_FAST_1")},GRONK_FAST_SEARCH:{key:"gronk-fast:search",displayName:"Gronk Fast Search",primaryModel:y8("CLAUDE_SONNET_4_5"),searchModel:y8("GROK_CODE_FAST_1")},GRONK_FAST_MAIN_SEARCH:{key:"gronk-fast:main+search",displayName:"Gronk Fast Main+Search",primaryModel:y8("GROK_CODE_FAST_1"),searchModel:y8("GROK_CODE_FAST_1")},BOLT_SEARCH:{key:"bolt:search",displayName:"Bolt Search",primaryModel:y8("CLAUDE_SONNET_4_5"),searchModel:y8("QWEN_3_CODER_480B")},BOLT_MAIN:{key:"bolt:main",displayName:"Bolt Main",primaryModel:y8("QWEN_3_CODER_480B")},BOLT_MAIN_SEARCH:{key:"bolt:main+search",displayName:"Bolt Main+Search",primaryModel:y8("QWEN_3_CODER_480B"),searchModel:y8("QWEN_3_CODER_480B")},GEPPETTO_MAIN:{key:"geppetto:main",displayName:"Geppetto Main",primaryModel:y8("GPT_5")},GEPPETTO_PRO_MAIN:{key:"geppetto-pro:main",displayName:"Geppetto Pro Main",primaryModel:y8("GPT_5")},PINOCCHIO_MAIN:{key:"pinocchio:main",displayName:"Pinocchio Main",primaryModel:y8("GPT_5_CODEX")},CLAUDIUS_MAIN:{key:"claudius:main",displayName:"Claudius Main",primaryModel:y8("CLAUDE_OPUS_4")},OPUS_4_1:{key:"opus4.1",displayName:"Opus 4.1",primaryModel:y8("CLAUDE_OPUS_4_1")},HYDROGEN_MAIN:{key:"hydrogen:main",displayName:"Hydrogen Main",primaryModel:y8("CODE_SUPERNOVA")},KASHMIR_MAIN:{key:"kashmir:main",displayName:"Kashmir Main",primaryModel:y8("KIMI_K2_INSTRUCT")},KASHMIR_SEARCH:{key:"kashmir:search",displayName:"Kashmir Search",primaryModel:y8("CLAUDE_SONNET_4_5"),searchModel:y8("KIMI_K2_INSTRUCT")},KASHMIR_MAIN_SEARCH:{key:"kashmir:main+search",displayName:"Kashmir Main+Search",primaryModel:y8("KIMI_K2_INSTRUCT"),searchModel:y8("KIMI_K2_INSTRUCT")},GOSSIP_MAIN:{key:"gossip:main",displayName:"Gossip Main",primaryModel:y8("GPT_OSS_120B")},GOSSIP_SEARCH:{key:"gossip:search",displayName:"Gossip Search",primaryModel:y8("CLAUDE_SONNET_4_5"),searchModel:y8("GPT_OSS_120B")},GOSSIP_MAIN_SEARCH:{key:"gossip:main+search",displayName:"Gossip Main+Search",primaryModel:y8("GPT_OSS_120B"),searchModel:y8("GPT_OSS_120B")},SONOMOON_MAIN:{key:"sonomoon:main",displayName:"Sonomoon Main",primaryModel:y8("SONOMA_SKY_ALPHA")},SONOMOON_SEARCH:{key:"sonomoon:search",displayName:"Sonomoon Search",primaryModel:y8("CLAUDE_SONNET_4_5"),searchModel:y8("SONOMA_SKY_ALPHA")},SONOMOON_MAIN_SEARCH:{key:"sonomoon:main+search",displayName:"Sonomoon Main+Search",primaryModel:y8("SONOMA_SKY_ALPHA"),searchModel:y8("SONOMA_SKY_ALPHA")}},GO=Object.values(uN).map((J)=>J.key),IS={xai_finder:["free","gronk-fast:search","gronk-fast:main+search"],fast_finder:["bolt:search","bolt:main+search"],kimiK2_finder:["kashmir:search","kashmir:main+search"],gossip_finder:["gossip:search","gossip:main+search"],sonoma_finder:["sonomoon:search","sonomoon:main+search"]},ji1=Object.keys(IS)});function GX1(J){return BM6.includes(J)}function Pi1(J){let Q=J["internal.oracleModel"]?.trim();if(Q&&Q.length>0)return Q;return d2.GPT_5.name}function Ti1(J){let Q=J["internal.model"]?.trim();if(!Q||Q.length===0)return null;let Z=Q.indexOf(":");if(Z===-1)return null;let X=Q.slice(0,Z).trim(),Y=Q.slice(Z+1).trim();if(!X||!Y)return null;return`${X}/${Y}`}var BM6,Ei1,Ii1;var zO=B1(()=>{W2();BM6=["guardedFiles.allowlist","mcpPermissions","tools.disable","permissions"];Ei1=["mcpServers","mcpPermissions","url"],Ii1=["apiKey","buildkite-access-token","github-access-token","gitlab-access-token","gitlab-instance-url"]});function PB(J){let Q=typeof J==="string"?J:J.toString();return Q===DZ||Q===DZ.slice(0,-1)}function UO(J){return PB(J)?DZ:J}var VM6,DZ,NM6,MV9;var TB=B1(()=>{VM6=new URL("https://ampcode.com/"),DZ=VM6.toString(),NM6=new URL("https://api.anthropic.com/"),MV9=NM6.toString()});var O9,qX1,e0,Zz=(J)=>{switch(typeof J){case"undefined":return e0.undefined;case"string":return e0.string;case"number":return Number.isNaN(J)?e0.nan:e0.number;case"boolean":return e0.boolean;case"function":return e0.function;case"bigint":return e0.bigint;case"symbol":return e0.symbol;case"object":if(Array.isArray(J))return e0.array;if(J===null)return e0.null;if(J.then&&typeof J.then==="function"&&J.catch&&typeof J.catch==="function")return e0.promise;if(typeof Map<"u"&&J instanceof Map)return e0.map;if(typeof Set<"u"&&J instanceof Set)return e0.set;if(typeof Date<"u"&&J instanceof Date)return e0.date;return e0.object;default:return e0.unknown}};var TS=B1(()=>{(function(J){J.assertEqual=(Y)=>{};function Q(Y){}J.assertIs=Q;function Z(Y){throw Error()}J.assertNever=Z,J.arrayToEnum=(Y)=>{let K={};for(let G of Y)K[G]=G;return K},J.getValidEnumValues=(Y)=>{let K=J.objectKeys(Y).filter((q)=>typeof Y[Y[q]]!=="number"),G={};for(let q of K)G[q]=Y[q];return J.objectValues(G)},J.objectValues=(Y)=>{return J.objectKeys(Y).map(function(K){return Y[K]})},J.objectKeys=typeof Object.keys==="function"?(Y)=>Object.keys(Y):(Y)=>{let K=[];for(let G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))K.push(G);return K},J.find=(Y,K)=>{for(let G of Y)if(K(G))return G;return},J.isInteger=typeof Number.isInteger==="function"?(Y)=>Number.isInteger(Y):(Y)=>typeof Y==="number"&&Number.isFinite(Y)&&Math.floor(Y)===Y;function X(Y,K=" | "){return Y.map((G)=>typeof G==="string"?`'${G}'`:G).join(K)}J.joinValues=X,J.jsonStringifyReplacer=(Y,K)=>{if(typeof K==="bigint")return K.toString();return K}})(O9||(O9={}));(function(J){J.mergeShapes=(Q,Z)=>{return{...Q,...Z}}})(qX1||(qX1={}));e0=O9.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var f0,LM6=(J)=>{return JSON.stringify(J,null,2).replace(/"([^"]+)":/g,"$1:")},MZ;var zc=B1(()=>{TS();f0=O9.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);MZ=class MZ extends Error{get errors(){return this.issues}constructor(J){super();this.issues=[],this.addIssue=(Z)=>{this.issues=[...this.issues,Z]},this.addIssues=(Z=[])=>{this.issues=[...this.issues,...Z]};let Q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,Q);else this.__proto__=Q;this.name="ZodError",this.issues=J}format(J){let Q=J||function(Y){return Y.message},Z={_errors:[]},X=(Y)=>{for(let K of Y.issues)if(K.code==="invalid_union")K.unionErrors.map(X);else if(K.code==="invalid_return_type")X(K.returnTypeError);else if(K.code==="invalid_arguments")X(K.argumentsError);else if(K.path.length===0)Z._errors.push(Q(K));else{let G=Z,q=0;while(q<K.path.length){let z=K.path[q];if(q!==K.path.length-1)G[z]=G[z]||{_errors:[]};else G[z]=G[z]||{_errors:[]},G[z]._errors.push(Q(K));G=G[z],q++}}};return X(this),Z}static assert(J){if(!(J instanceof MZ))throw Error(`Not a ZodError: ${J}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,O9.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(J=(Q)=>Q.message){let Q={},Z=[];for(let X of this.issues)if(X.path.length>0){let Y=X.path[0];Q[Y]=Q[Y]||[],Q[Y].push(J(X))}else Z.push(J(X));return{formErrors:Z,fieldErrors:Q}}get formErrors(){return this.flatten()}};MZ.create=(J)=>{return new MZ(J)}});var AM6=(J,Q)=>{let Z;switch(J.code){case f0.invalid_type:if(J.received===e0.undefined)Z="Required";else Z=`Expected ${J.expected}, received ${J.received}`;break;case f0.invalid_literal:Z=`Invalid literal value, expected ${JSON.stringify(J.expected,O9.jsonStringifyReplacer)}`;break;case f0.unrecognized_keys:Z=`Unrecognized key(s) in object: ${O9.joinValues(J.keys,", ")}`;break;case f0.invalid_union:Z="Invalid input";break;case f0.invalid_union_discriminator:Z=`Invalid discriminator value. Expected ${O9.joinValues(J.options)}`;break;case f0.invalid_enum_value:Z=`Invalid enum value. Expected ${O9.joinValues(J.options)}, received '${J.received}'`;break;case f0.invalid_arguments:Z="Invalid function arguments";break;case f0.invalid_return_type:Z="Invalid function return type";break;case f0.invalid_date:Z="Invalid date";break;case f0.invalid_string:if(typeof J.validation==="object")if("includes"in J.validation){if(Z=`Invalid input: must include "${J.validation.includes}"`,typeof J.validation.position==="number")Z=`${Z} at one or more positions greater than or equal to ${J.validation.position}`}else if("startsWith"in J.validation)Z=`Invalid input: must start with "${J.validation.startsWith}"`;else if("endsWith"in J.validation)Z=`Invalid input: must end with "${J.validation.endsWith}"`;else O9.assertNever(J.validation);else if(J.validation!=="regex")Z=`Invalid ${J.validation}`;else Z="Invalid";break;case f0.too_small:if(J.type==="array")Z=`Array must contain ${J.exact?"exactly":J.inclusive?"at least":"more than"} ${J.minimum} element(s)`;else if(J.type==="string")Z=`String must contain ${J.exact?"exactly":J.inclusive?"at least":"over"} ${J.minimum} character(s)`;else if(J.type==="number")Z=`Number must be ${J.exact?"exactly equal to ":J.inclusive?"greater than or equal to ":"greater than "}${J.minimum}`;else if(J.type==="bigint")Z=`Number must be ${J.exact?"exactly equal to ":J.inclusive?"greater than or equal to ":"greater than "}${J.minimum}`;else if(J.type==="date")Z=`Date must be ${J.exact?"exactly equal to ":J.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(J.minimum))}`;else Z="Invalid input";break;case f0.too_big:if(J.type==="array")Z=`Array must contain ${J.exact?"exactly":J.inclusive?"at most":"less than"} ${J.maximum} element(s)`;else if(J.type==="string")Z=`String must contain ${J.exact?"exactly":J.inclusive?"at most":"under"} ${J.maximum} character(s)`;else if(J.type==="number")Z=`Number must be ${J.exact?"exactly":J.inclusive?"less than or equal to":"less than"} ${J.maximum}`;else if(J.type==="bigint")Z=`BigInt must be ${J.exact?"exactly":J.inclusive?"less than or equal to":"less than"} ${J.maximum}`;else if(J.type==="date")Z=`Date must be ${J.exact?"exactly":J.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(J.maximum))}`;else Z="Invalid input";break;case f0.custom:Z="Invalid input";break;case f0.invalid_intersection_types:Z="Intersection results could not be merged";break;case f0.not_multiple_of:Z=`Number must be a multiple of ${J.multipleOf}`;break;case f0.not_finite:Z="Number must be finite";break;default:Z=Q.defaultError,O9.assertNever(J)}return{message:Z}},MW;var zX1=B1(()=>{zc();TS();MW=AM6});function wM6(J){Ci1=J}function WO(){return Ci1}var Ci1;var Uc=B1(()=>{zX1();Ci1=MW});function W6(J,Q){let Z=WO(),X=CS({issueData:Q,data:J.data,path:J.path,errorMaps:[J.common.contextualErrorMap,J.schemaErrorMap,Z,Z===MW?void 0:MW].filter((Y)=>!!Y)});J.common.issues.push(X)}class ZJ{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(J,Q){let Z=[];for(let X of Q){if(X.status==="aborted")return M8;if(X.status==="dirty")J.dirty();Z.push(X.value)}return{status:J.value,value:Z}}static async mergeObjectAsync(J,Q){let Z=[];for(let X of Q){let Y=await X.key,K=await X.value;Z.push({key:Y,value:K})}return ZJ.mergeObjectSync(J,Z)}static mergeObjectSync(J,Q){let Z={};for(let X of Q){let{key:Y,value:K}=X;if(Y.status==="aborted")return M8;if(K.status==="aborted")return M8;if(Y.status==="dirty")J.dirty();if(K.status==="dirty")J.dirty();if(Y.value!=="__proto__"&&(typeof K.value<"u"||X.alwaysSet))Z[Y.value]=K.value}return{status:J.value,value:Z}}}var CS=(J)=>{let{data:Q,path:Z,errorMaps:X,issueData:Y}=J,K=[...Z,...Y.path||[]],G={...Y,path:K};if(Y.message!==void 0)return{...Y,path:K,message:Y.message};let q="",z=X.filter((U)=>!!U).slice().reverse();for(let U of z)q=U(G,{data:Q,defaultError:q}).message;return{...Y,path:K,message:q}},RM6,M8,pN=(J)=>({status:"dirty",value:J}),kJ=(J)=>({status:"valid",value:J}),Wc=(J)=>J.status==="aborted",Fc=(J)=>J.status==="dirty",CB=(J)=>J.status==="valid",FO=(J)=>typeof Promise<"u"&&J instanceof Promise;var UX1=B1(()=>{Uc();zX1();RM6=[];M8=Object.freeze({status:"aborted"})});var Si1=()=>{};var _6;var vi1=B1(()=>{(function(J){J.errToObj=(Q)=>typeof Q==="string"?{message:Q}:Q||{},J.toString=(Q)=>typeof Q==="string"?Q:Q?.message})(_6||(_6={}))});class WG{constructor(J,Q,Z,X){this._cachedPath=[],this.parent=J,this.data=Q,this._path=Z,this._key=X}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function i8(J){if(!J)return{};let{errorMap:Q,invalid_type_error:Z,required_error:X,description:Y}=J;if(Q&&(Z||X))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(Q)return{errorMap:Q,description:Y};return{errorMap:(G,q)=>{let{message:z}=J;if(G.code==="invalid_enum_value")return{message:z??q.defaultError};if(typeof q.data>"u")return{message:z??X??q.defaultError};if(G.code!=="invalid_type")return{message:q.defaultError};return{message:z??Z??q.defaultError}},description:Y}}class q9{get description(){return this._def.description}_getType(J){return Zz(J.data)}_getOrReturnCtx(J,Q){return Q||{common:J.parent.common,data:J.data,parsedType:Zz(J.data),schemaErrorMap:this._def.errorMap,path:J.path,parent:J.parent}}_processInputParams(J){return{status:new ZJ,ctx:{common:J.parent.common,data:J.data,parsedType:Zz(J.data),schemaErrorMap:this._def.errorMap,path:J.path,parent:J.parent}}}_parseSync(J){let Q=this._parse(J);if(FO(Q))throw Error("Synchronous parse encountered promise.");return Q}_parseAsync(J){let Q=this._parse(J);return Promise.resolve(Q)}parse(J,Q){let Z=this.safeParse(J,Q);if(Z.success)return Z.data;throw Z.error}safeParse(J,Q){let Z={common:{issues:[],async:Q?.async??!1,contextualErrorMap:Q?.errorMap},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:Zz(J)},X=this._parseSync({data:J,path:Z.path,parent:Z});return ki1(Z,X)}"~validate"(J){let Q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:Zz(J)};if(!this["~standard"].async)try{let Z=this._parseSync({data:J,path:[],parent:Q});return CB(Z)?{value:Z.value}:{issues:Q.common.issues}}catch(Z){if(Z?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;Q.common={issues:[],async:!0}}return this._parseAsync({data:J,path:[],parent:Q}).then((Z)=>CB(Z)?{value:Z.value}:{issues:Q.common.issues})}async parseAsync(J,Q){let Z=await this.safeParseAsync(J,Q);if(Z.success)return Z.data;throw Z.error}async safeParseAsync(J,Q){let Z={common:{issues:[],contextualErrorMap:Q?.errorMap,async:!0},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:Zz(J)},X=this._parse({data:J,path:Z.path,parent:Z}),Y=await(FO(X)?X:Promise.resolve(X));return ki1(Z,Y)}refine(J,Q){let Z=(X)=>{if(typeof Q==="string"||typeof Q>"u")return{message:Q};else if(typeof Q==="function")return Q(X);else return Q};return this._refinement((X,Y)=>{let K=J(X),G=()=>Y.addIssue({code:f0.custom,...Z(X)});if(typeof Promise<"u"&&K instanceof Promise)return K.then((q)=>{if(!q)return G(),!1;else return!0});if(!K)return G(),!1;else return!0})}refinement(J,Q){return this._refinement((Z,X)=>{if(!J(Z))return X.addIssue(typeof Q==="function"?Q(Z,X):Q),!1;else return!0})}_refinement(J){return new FG({schema:this,typeName:w8.ZodEffects,effect:{type:"refinement",refinement:J}})}superRefine(J){return this._refinement(J)}constructor(J){this.spa=this.safeParseAsync,this._def=J,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(Q)=>this["~validate"](Q)}}optional(){return UG.create(this,this._def)}nullable(){return NW.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zG.create(this)}promise(){return iN.create(this,this._def)}or(J){return NO.create([this,J],this._def)}and(J){return LO.create(this,J,this._def)}transform(J){return new FG({...i8(this._def),schema:this,typeName:w8.ZodEffects,effect:{type:"transform",transform:J}})}default(J){let Q=typeof J==="function"?J:()=>J;return new OO({...i8(this._def),innerType:this,defaultValue:Q,typeName:w8.ZodDefault})}brand(){return new Bc({typeName:w8.ZodBranded,type:this,...i8(this._def)})}catch(J){let Q=typeof J==="function"?J:()=>J;return new jO({...i8(this._def),innerType:this,catchValue:Q,typeName:w8.ZodCatch})}describe(J){return new this.constructor({...this._def,description:J})}pipe(J){return bS.create(this,J)}readonly(){return $O.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function bi1(J){let Q="[0-5]\\d";if(J.precision)Q=`${Q}\\.\\d{${J.precision}}`;else if(J.precision==null)Q=`${Q}(\\.\\d+)?`;let Z=J.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${Q})${Z}`}function hM6(J){return new RegExp(`^${bi1(J)}$`)}function yi1(J){let Q=`${xi1}T${bi1(J)}`,Z=[];if(Z.push(J.local?"Z?":"Z"),J.offset)Z.push("([+-]\\d{2}:?\\d{2})");return Q=`${Q}(${Z.join("|")})`,new RegExp(`^${Q}$`)}function gM6(J,Q){if((Q==="v4"||!Q)&&vM6.test(J))return!0;if((Q==="v6"||!Q)&&_M6.test(J))return!0;return!1}function mM6(J,Q){if(!PM6.test(J))return!1;try{let[Z]=J.split(".");if(!Z)return!1;let X=Z.replace(/-/g,"+").replace(/_/g,"/").padEnd(Z.length+(4-Z.length%4)%4,"="),Y=JSON.parse(atob(X));if(typeof Y!=="object"||Y===null)return!1;if("typ"in Y&&Y?.typ!=="JWT")return!1;if(!Y.alg)return!1;if(Q&&Y.alg!==Q)return!1;return!0}catch{return!1}}function uM6(J,Q){if((Q==="v4"||!Q)&&kM6.test(J))return!0;if((Q==="v6"||!Q)&&xM6.test(J))return!0;return!1}function pM6(J,Q){let Z=(J.toString().split(".")[1]||"").length,X=(Q.toString().split(".")[1]||"").length,Y=Z>X?Z:X,K=Number.parseInt(J.toFixed(Y).replace(".","")),G=Number.parseInt(Q.toFixed(Y).replace(".",""));return K%G/10**Y}function HO(J){if(J instanceof _4){let Q={};for(let Z in J.shape){let X=J.shape[Z];Q[Z]=UG.create(HO(X))}return new _4({...J._def,shape:()=>Q})}else if(J instanceof zG)return new zG({...J._def,type:HO(J.element)});else if(J instanceof UG)return UG.create(HO(J.unwrap()));else if(J instanceof NW)return NW.create(HO(J.unwrap()));else if(J instanceof Yz)return Yz.create(J.items.map((Q)=>HO(Q)));else return J}function FX1(J,Q){let Z=Zz(J),X=Zz(Q);if(J===Q)return{valid:!0,data:J};else if(Z===e0.object&&X===e0.object){let Y=O9.objectKeys(Q),K=O9.objectKeys(J).filter((q)=>Y.indexOf(q)!==-1),G={...J,...Q};for(let q of K){let z=FX1(J[q],Q[q]);if(!z.valid)return{valid:!1};G[q]=z.data}return{valid:!0,data:G}}else if(Z===e0.array&&X===e0.array){if(J.length!==Q.length)return{valid:!1};let Y=[];for(let K=0;K<J.length;K++){let G=J[K],q=Q[K],z=FX1(G,q);if(!z.valid)return{valid:!1};Y.push(z.data)}return{valid:!0,data:Y}}else if(Z===e0.date&&X===e0.date&&+J===+Q)return{valid:!0,data:J};else return{valid:!1}}function fi1(J,Q){return new _B({values:J,typeName:w8.ZodEnum,...i8(Q)})}function _i1(J,Q){let Z=typeof J==="function"?J(Q):typeof J==="string"?{message:J}:J;return typeof Z==="string"?{message:Z}:Z}function hi1(J,Q={},Z){if(J)return cN.create().superRefine((X,Y)=>{let K=J(X);if(K instanceof Promise)return K.then((G)=>{if(!G){let q=_i1(Q,X),z=q.fatal??Z??!0;Y.addIssue({code:"custom",...q,fatal:z})}});if(!K){let G=_i1(Q,X),q=G.fatal??Z??!0;Y.addIssue({code:"custom",...G,fatal:q})}return});return cN.create()}var ki1=(J,Q)=>{if(CB(Q))return{success:!0,data:Q.value};else{if(!J.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let Z=new MZ(J.common.issues);return this._error=Z,this._error}}}},OM6,jM6,$M6,EM6,IM6,PM6,TM6,CM6,SM6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",WX1,vM6,kM6,_M6,xM6,bM6,yM6,xi1="((\\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])))",fM6,qG,vB,kB,DO,dN,SS,MO,VO,cN,SB,Xz,vS,zG,_4,NO,VW=(J)=>{if(J instanceof AO)return VW(J.schema);else if(J instanceof FG)return VW(J.innerType());else if(J instanceof wO)return[J.value];else if(J instanceof _B)return J.options;else if(J instanceof RO)return O9.objectValues(J.enum);else if(J instanceof OO)return VW(J._def.innerType);else if(J instanceof MO)return[void 0];else if(J instanceof VO)return[null];else if(J instanceof UG)return[void 0,...VW(J.unwrap())];else if(J instanceof NW)return[null,...VW(J.unwrap())];else if(J instanceof Bc)return VW(J.unwrap());else if(J instanceof $O)return VW(J.unwrap());else if(J instanceof jO)return VW(J._def.innerType);else return[]},Hc,LO,Yz,kS,_S,lN,BO,AO,wO,_B,RO,iN,FG,UG,NW,OO,jO,xS,dM6,Bc,bS,$O,cM6,w8,lM6=(J,Q={message:`Input not instance of ${J.name}`})=>hi1((Z)=>Z instanceof J,Q),gi1,mi1,iM6,nM6,ui1,aM6,rM6,sM6,oM6,tM6,eM6,JV6,QV6,ZV6,XV6,YV6,KV6,GV6,qV6,zV6,UV6,WV6,FV6,HV6,BV6,DV6,MV6,VV6,NV6,LV6,AV6,wV6,RV6,OV6,jV6=()=>gi1().optional(),$V6=()=>mi1().optional(),EV6=()=>ui1().optional(),IV6,PV6;var pi1=B1(()=>{zc();Uc();vi1();UX1();TS();OM6=/^c[^\s-]{8,}$/i,jM6=/^[0-9a-z]+$/,$M6=/^[0-9A-HJKMNP-TV-Z]{26}$/i,EM6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,IM6=/^[a-z0-9_-]{21}$/i,PM6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,TM6=/^[-+]?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)?)??$/,CM6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vM6=/^(?:(?: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])$/,kM6=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,_M6=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,xM6=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bM6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yM6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fM6=new RegExp(`^${xi1}$`);qG=class qG extends q9{_parse(J){if(this._def.coerce)J.data=String(J.data);if(this._getType(J)!==e0.string){let Y=this._getOrReturnCtx(J);return W6(Y,{code:f0.invalid_type,expected:e0.string,received:Y.parsedType}),M8}let Z=new ZJ,X=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(J.data.length<Y.value)X=this._getOrReturnCtx(J,X),W6(X,{code:f0.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),Z.dirty()}else if(Y.kind==="max"){if(J.data.length>Y.value)X=this._getOrReturnCtx(J,X),W6(X,{code:f0.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),Z.dirty()}else if(Y.kind==="length"){let K=J.data.length>Y.value,G=J.data.length<Y.value;if(K||G){if(X=this._getOrReturnCtx(J,X),K)W6(X,{code:f0.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});else if(G)W6(X,{code:f0.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});Z.dirty()}}else if(Y.kind==="email"){if(!CM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"email",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="emoji"){if(!WX1)WX1=new RegExp(SM6,"u");if(!WX1.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"emoji",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="uuid"){if(!EM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"uuid",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="nanoid"){if(!IM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"nanoid",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cuid"){if(!OM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"cuid",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cuid2"){if(!jM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"cuid2",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="ulid"){if(!$M6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"ulid",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="url")try{new URL(J.data)}catch{X=this._getOrReturnCtx(J,X),W6(X,{validation:"url",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="regex"){if(Y.regex.lastIndex=0,!Y.regex.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"regex",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="trim")J.data=J.data.trim();else if(Y.kind==="includes"){if(!J.data.includes(Y.value,Y.position))X=this._getOrReturnCtx(J,X),W6(X,{code:f0.invalid_string,validation:{includes:Y.value,position:Y.position},message:Y.message}),Z.dirty()}else if(Y.kind==="toLowerCase")J.data=J.data.toLowerCase();else if(Y.kind==="toUpperCase")J.data=J.data.toUpperCase();else if(Y.kind==="startsWith"){if(!J.data.startsWith(Y.value))X=this._getOrReturnCtx(J,X),W6(X,{code:f0.invalid_string,validation:{startsWith:Y.value},message:Y.message}),Z.dirty()}else if(Y.kind==="endsWith"){if(!J.data.endsWith(Y.value))X=this._getOrReturnCtx(J,X),W6(X,{code:f0.invalid_string,validation:{endsWith:Y.value},message:Y.message}),Z.dirty()}else if(Y.kind==="datetime"){if(!yi1(Y).test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{code:f0.invalid_string,validation:"datetime",message:Y.message}),Z.dirty()}else if(Y.kind==="date"){if(!fM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{code:f0.invalid_string,validation:"date",message:Y.message}),Z.dirty()}else if(Y.kind==="time"){if(!hM6(Y).test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{code:f0.invalid_string,validation:"time",message:Y.message}),Z.dirty()}else if(Y.kind==="duration"){if(!TM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"duration",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="ip"){if(!gM6(J.data,Y.version))X=this._getOrReturnCtx(J,X),W6(X,{validation:"ip",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="jwt"){if(!mM6(J.data,Y.alg))X=this._getOrReturnCtx(J,X),W6(X,{validation:"jwt",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cidr"){if(!uM6(J.data,Y.version))X=this._getOrReturnCtx(J,X),W6(X,{validation:"cidr",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="base64"){if(!bM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"base64",code:f0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="base64url"){if(!yM6.test(J.data))X=this._getOrReturnCtx(J,X),W6(X,{validation:"base64url",code:f0.invalid_string,message:Y.message}),Z.dirty()}else O9.assertNever(Y);return{status:Z.value,value:J.data}}_regex(J,Q,Z){return this.refinement((X)=>J.test(X),{validation:Q,code:f0.invalid_string,..._6.errToObj(Z)})}_addCheck(J){return new qG({...this._def,checks:[...this._def.checks,J]})}email(J){return this._addCheck({kind:"email",..._6.errToObj(J)})}url(J){return this._addCheck({kind:"url",..._6.errToObj(J)})}emoji(J){return this._addCheck({kind:"emoji",..._6.errToObj(J)})}uuid(J){return this._addCheck({kind:"uuid",..._6.errToObj(J)})}nanoid(J){return this._addCheck({kind:"nanoid",..._6.errToObj(J)})}cuid(J){return this._addCheck({kind:"cuid",..._6.errToObj(J)})}cuid2(J){return this._addCheck({kind:"cuid2",..._6.errToObj(J)})}ulid(J){return this._addCheck({kind:"ulid",..._6.errToObj(J)})}base64(J){return this._addCheck({kind:"base64",..._6.errToObj(J)})}base64url(J){return this._addCheck({kind:"base64url",..._6.errToObj(J)})}jwt(J){return this._addCheck({kind:"jwt",..._6.errToObj(J)})}ip(J){return this._addCheck({kind:"ip",..._6.errToObj(J)})}cidr(J){return this._addCheck({kind:"cidr",..._6.errToObj(J)})}datetime(J){if(typeof J==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:J});return this._addCheck({kind:"datetime",precision:typeof J?.precision>"u"?null:J?.precision,offset:J?.offset??!1,local:J?.local??!1,..._6.errToObj(J?.message)})}date(J){return this._addCheck({kind:"date",message:J})}time(J){if(typeof J==="string")return this._addCheck({kind:"time",precision:null,message:J});return this._addCheck({kind:"time",precision:typeof J?.precision>"u"?null:J?.precision,..._6.errToObj(J?.message)})}duration(J){return this._addCheck({kind:"duration",..._6.errToObj(J)})}regex(J,Q){return this._addCheck({kind:"regex",regex:J,..._6.errToObj(Q)})}includes(J,Q){return this._addCheck({kind:"includes",value:J,position:Q?.position,..._6.errToObj(Q?.message)})}startsWith(J,Q){return this._addCheck({kind:"startsWith",value:J,..._6.errToObj(Q)})}endsWith(J,Q){return this._addCheck({kind:"endsWith",value:J,..._6.errToObj(Q)})}min(J,Q){return this._addCheck({kind:"min",value:J,..._6.errToObj(Q)})}max(J,Q){return this._addCheck({kind:"max",value:J,..._6.errToObj(Q)})}length(J,Q){return this._addCheck({kind:"length",value:J,..._6.errToObj(Q)})}nonempty(J){return this.min(1,_6.errToObj(J))}trim(){return new qG({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new qG({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new qG({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((J)=>J.kind==="datetime")}get isDate(){return!!this._def.checks.find((J)=>J.kind==="date")}get isTime(){return!!this._def.checks.find((J)=>J.kind==="time")}get isDuration(){return!!this._def.checks.find((J)=>J.kind==="duration")}get isEmail(){return!!this._def.checks.find((J)=>J.kind==="email")}get isURL(){return!!this._def.checks.find((J)=>J.kind==="url")}get isEmoji(){return!!this._def.checks.find((J)=>J.kind==="emoji")}get isUUID(){return!!this._def.checks.find((J)=>J.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((J)=>J.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((J)=>J.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((J)=>J.kind==="cuid2")}get isULID(){return!!this._def.checks.find((J)=>J.kind==="ulid")}get isIP(){return!!this._def.checks.find((J)=>J.kind==="ip")}get isCIDR(){return!!this._def.checks.find((J)=>J.kind==="cidr")}get isBase64(){return!!this._def.checks.find((J)=>J.kind==="base64")}get isBase64url(){return!!this._def.checks.find((J)=>J.kind==="base64url")}get minLength(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J}get maxLength(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J}};qG.create=(J)=>{return new qG({checks:[],typeName:w8.ZodString,coerce:J?.coerce??!1,...i8(J)})};vB=class vB extends q9{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(J){if(this._def.coerce)J.data=Number(J.data);if(this._getType(J)!==e0.number){let Y=this._getOrReturnCtx(J);return W6(Y,{code:f0.invalid_type,expected:e0.number,received:Y.parsedType}),M8}let Z=void 0,X=new ZJ;for(let Y of this._def.checks)if(Y.kind==="int"){if(!O9.isInteger(J.data))Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.invalid_type,expected:"integer",received:"float",message:Y.message}),X.dirty()}else if(Y.kind==="min"){if(Y.inclusive?J.data<Y.value:J.data<=Y.value)Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.too_small,minimum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),X.dirty()}else if(Y.kind==="max"){if(Y.inclusive?J.data>Y.value:J.data>=Y.value)Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),X.dirty()}else if(Y.kind==="multipleOf"){if(pM6(J.data,Y.value)!==0)Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.not_multiple_of,multipleOf:Y.value,message:Y.message}),X.dirty()}else if(Y.kind==="finite"){if(!Number.isFinite(J.data))Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.not_finite,message:Y.message}),X.dirty()}else O9.assertNever(Y);return{status:X.value,value:J.data}}gte(J,Q){return this.setLimit("min",J,!0,_6.toString(Q))}gt(J,Q){return this.setLimit("min",J,!1,_6.toString(Q))}lte(J,Q){return this.setLimit("max",J,!0,_6.toString(Q))}lt(J,Q){return this.setLimit("max",J,!1,_6.toString(Q))}setLimit(J,Q,Z,X){return new vB({...this._def,checks:[...this._def.checks,{kind:J,value:Q,inclusive:Z,message:_6.toString(X)}]})}_addCheck(J){return new vB({...this._def,checks:[...this._def.checks,J]})}int(J){return this._addCheck({kind:"int",message:_6.toString(J)})}positive(J){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_6.toString(J)})}negative(J){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_6.toString(J)})}nonpositive(J){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_6.toString(J)})}nonnegative(J){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_6.toString(J)})}multipleOf(J,Q){return this._addCheck({kind:"multipleOf",value:J,message:_6.toString(Q)})}finite(J){return this._addCheck({kind:"finite",message:_6.toString(J)})}safe(J){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_6.toString(J)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_6.toString(J)})}get minValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J}get maxValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J}get isInt(){return!!this._def.checks.find((J)=>J.kind==="int"||J.kind==="multipleOf"&&O9.isInteger(J.value))}get isFinite(){let J=null,Q=null;for(let Z of this._def.checks)if(Z.kind==="finite"||Z.kind==="int"||Z.kind==="multipleOf")return!0;else if(Z.kind==="min"){if(Q===null||Z.value>Q)Q=Z.value}else if(Z.kind==="max"){if(J===null||Z.value<J)J=Z.value}return Number.isFinite(Q)&&Number.isFinite(J)}};vB.create=(J)=>{return new vB({checks:[],typeName:w8.ZodNumber,coerce:J?.coerce||!1,...i8(J)})};kB=class kB extends q9{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(J){if(this._def.coerce)try{J.data=BigInt(J.data)}catch{return this._getInvalidInput(J)}if(this._getType(J)!==e0.bigint)return this._getInvalidInput(J);let Z=void 0,X=new ZJ;for(let Y of this._def.checks)if(Y.kind==="min"){if(Y.inclusive?J.data<Y.value:J.data<=Y.value)Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.too_small,type:"bigint",minimum:Y.value,inclusive:Y.inclusive,message:Y.message}),X.dirty()}else if(Y.kind==="max"){if(Y.inclusive?J.data>Y.value:J.data>=Y.value)Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.too_big,type:"bigint",maximum:Y.value,inclusive:Y.inclusive,message:Y.message}),X.dirty()}else if(Y.kind==="multipleOf"){if(J.data%Y.value!==BigInt(0))Z=this._getOrReturnCtx(J,Z),W6(Z,{code:f0.not_multiple_of,multipleOf:Y.value,message:Y.message}),X.dirty()}else O9.assertNever(Y);return{status:X.value,value:J.data}}_getInvalidInput(J){let Q=this._getOrReturnCtx(J);return W6(Q,{code:f0.invalid_type,expected:e0.bigint,received:Q.parsedType}),M8}gte(J,Q){return this.setLimit("min",J,!0,_6.toString(Q))}gt(J,Q){return this.setLimit("min",J,!1,_6.toString(Q))}lte(J,Q){return this.setLimit("max",J,!0,_6.toString(Q))}lt(J,Q){return this.setLimit("max",J,!1,_6.toString(Q))}setLimit(J,Q,Z,X){return new kB({...this._def,checks:[...this._def.checks,{kind:J,value:Q,inclusive:Z,message:_6.toString(X)}]})}_addCheck(J){return new kB({...this._def,checks:[...this._def.checks,J]})}positive(J){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_6.toString(J)})}negative(J){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_6.toString(J)})}nonpositive(J){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_6.toString(J)})}nonnegative(J){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_6.toString(J)})}multipleOf(J,Q){return this._addCheck({kind:"multipleOf",value:J,message:_6.toString(Q)})}get minValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J}get maxValue(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J}};kB.create=(J)=>{return new kB({checks:[],typeName:w8.ZodBigInt,coerce:J?.coerce??!1,...i8(J)})};DO=class DO extends q9{_parse(J){if(this._def.coerce)J.data=Boolean(J.data);if(this._getType(J)!==e0.boolean){let Z=this._getOrReturnCtx(J);return W6(Z,{code:f0.invalid_type,expected:e0.boolean,received:Z.parsedType}),M8}return kJ(J.data)}};DO.create=(J)=>{return new DO({typeName:w8.ZodBoolean,coerce:J?.coerce||!1,...i8(J)})};dN=class dN extends q9{_parse(J){if(this._def.coerce)J.data=new Date(J.data);if(this._getType(J)!==e0.date){let Y=this._getOrReturnCtx(J);return W6(Y,{code:f0.invalid_type,expected:e0.date,received:Y.parsedType}),M8}if(Number.isNaN(J.data.getTime())){let Y=this._getOrReturnCtx(J);return W6(Y,{code:f0.invalid_date}),M8}let Z=new ZJ,X=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(J.data.getTime()<Y.value)X=this._getOrReturnCtx(J,X),W6(X,{code:f0.too_small,message:Y.message,inclusive:!0,exact:!1,minimum:Y.value,type:"date"}),Z.dirty()}else if(Y.kind==="max"){if(J.data.getTime()>Y.value)X=this._getOrReturnCtx(J,X),W6(X,{code:f0.too_big,message:Y.message,inclusive:!0,exact:!1,maximum:Y.value,type:"date"}),Z.dirty()}else O9.assertNever(Y);return{status:Z.value,value:new Date(J.data.getTime())}}_addCheck(J){return new dN({...this._def,checks:[...this._def.checks,J]})}min(J,Q){return this._addCheck({kind:"min",value:J.getTime(),message:_6.toString(Q)})}max(J,Q){return this._addCheck({kind:"max",value:J.getTime(),message:_6.toString(Q)})}get minDate(){let J=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}return J!=null?new Date(J):null}get maxDate(){let J=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(J===null||Q.value<J)J=Q.value}return J!=null?new Date(J):null}};dN.create=(J)=>{return new dN({checks:[],coerce:J?.coerce||!1,typeName:w8.ZodDate,...i8(J)})};SS=class SS extends q9{_parse(J){if(this._getType(J)!==e0.symbol){let Z=this._getOrReturnCtx(J);return W6(Z,{code:f0.invalid_type,expected:e0.symbol,received:Z.parsedType}),M8}return kJ(J.data)}};SS.create=(J)=>{return new SS({typeName:w8.ZodSymbol,...i8(J)})};MO=class MO extends q9{_parse(J){if(this._getType(J)!==e0.undefined){let Z=this._getOrReturnCtx(J);return W6(Z,{code:f0.invalid_type,expected:e0.undefined,received:Z.parsedType}),M8}return kJ(J.data)}};MO.create=(J)=>{return new MO({typeName:w8.ZodUndefined,...i8(J)})};VO=class VO extends q9{_parse(J){if(this._getType(J)!==e0.null){let Z=this._getOrReturnCtx(J);return W6(Z,{code:f0.invalid_type,expected:e0.null,received:Z.parsedType}),M8}return kJ(J.data)}};VO.create=(J)=>{return new VO({typeName:w8.ZodNull,...i8(J)})};cN=class cN extends q9{constructor(){super(...arguments);this._any=!0}_parse(J){return kJ(J.data)}};cN.create=(J)=>{return new cN({typeName:w8.ZodAny,...i8(J)})};SB=class SB extends q9{constructor(){super(...arguments);this._unknown=!0}_parse(J){return kJ(J.data)}};SB.create=(J)=>{return new SB({typeName:w8.ZodUnknown,...i8(J)})};Xz=class Xz extends q9{_parse(J){let Q=this._getOrReturnCtx(J);return W6(Q,{code:f0.invalid_type,expected:e0.never,received:Q.parsedType}),M8}};Xz.create=(J)=>{return new Xz({typeName:w8.ZodNever,...i8(J)})};vS=class vS extends q9{_parse(J){if(this._getType(J)!==e0.undefined){let Z=this._getOrReturnCtx(J);return W6(Z,{code:f0.invalid_type,expected:e0.void,received:Z.parsedType}),M8}return kJ(J.data)}};vS.create=(J)=>{return new vS({typeName:w8.ZodVoid,...i8(J)})};zG=class zG extends q9{_parse(J){let{ctx:Q,status:Z}=this._processInputParams(J),X=this._def;if(Q.parsedType!==e0.array)return W6(Q,{code:f0.invalid_type,expected:e0.array,received:Q.parsedType}),M8;if(X.exactLength!==null){let K=Q.data.length>X.exactLength.value,G=Q.data.length<X.exactLength.value;if(K||G)W6(Q,{code:K?f0.too_big:f0.too_small,minimum:G?X.exactLength.value:void 0,maximum:K?X.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:X.exactLength.message}),Z.dirty()}if(X.minLength!==null){if(Q.data.length<X.minLength.value)W6(Q,{code:f0.too_small,minimum:X.minLength.value,type:"array",inclusive:!0,exact:!1,message:X.minLength.message}),Z.dirty()}if(X.maxLength!==null){if(Q.data.length>X.maxLength.value)W6(Q,{code:f0.too_big,maximum:X.maxLength.value,type:"array",inclusive:!0,exact:!1,message:X.maxLength.message}),Z.dirty()}if(Q.common.async)return Promise.all([...Q.data].map((K,G)=>{return X.type._parseAsync(new WG(Q,K,Q.path,G))})).then((K)=>{return ZJ.mergeArray(Z,K)});let Y=[...Q.data].map((K,G)=>{return X.type._parseSync(new WG(Q,K,Q.path,G))});return ZJ.mergeArray(Z,Y)}get element(){return this._def.type}min(J,Q){return new zG({...this._def,minLength:{value:J,message:_6.toString(Q)}})}max(J,Q){return new zG({...this._def,maxLength:{value:J,message:_6.toString(Q)}})}length(J,Q){return new zG({...this._def,exactLength:{value:J,message:_6.toString(Q)}})}nonempty(J){return this.min(1,J)}};zG.create=(J,Q)=>{return new zG({type:J,minLength:null,maxLength:null,exactLength:null,typeName:w8.ZodArray,...i8(Q)})};_4=class _4 extends q9{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let J=this._def.shape(),Q=O9.objectKeys(J);return this._cached={shape:J,keys:Q},this._cached}_parse(J){if(this._getType(J)!==e0.object){let z=this._getOrReturnCtx(J);return W6(z,{code:f0.invalid_type,expected:e0.object,received:z.parsedType}),M8}let{status:Z,ctx:X}=this._processInputParams(J),{shape:Y,keys:K}=this._getCached(),G=[];if(!(this._def.catchall instanceof Xz&&this._def.unknownKeys==="strip")){for(let z in X.data)if(!K.includes(z))G.push(z)}let q=[];for(let z of K){let U=Y[z],W=X.data[z];q.push({key:{status:"valid",value:z},value:U._parse(new WG(X,W,X.path,z)),alwaysSet:z in X.data})}if(this._def.catchall instanceof Xz){let z=this._def.unknownKeys;if(z==="passthrough")for(let U of G)q.push({key:{status:"valid",value:U},value:{status:"valid",value:X.data[U]}});else if(z==="strict"){if(G.length>0)W6(X,{code:f0.unrecognized_keys,keys:G}),Z.dirty()}else if(z==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let z=this._def.catchall;for(let U of G){let W=X.data[U];q.push({key:{status:"valid",value:U},value:z._parse(new WG(X,W,X.path,U)),alwaysSet:U in X.data})}}if(X.common.async)return Promise.resolve().then(async()=>{let z=[];for(let U of q){let W=await U.key,F=await U.value;z.push({key:W,value:F,alwaysSet:U.alwaysSet})}return z}).then((z)=>{return ZJ.mergeObjectSync(Z,z)});else return ZJ.mergeObjectSync(Z,q)}get shape(){return this._def.shape()}strict(J){return _6.errToObj,new _4({...this._def,unknownKeys:"strict",...J!==void 0?{errorMap:(Q,Z)=>{let X=this._def.errorMap?.(Q,Z).message??Z.defaultError;if(Q.code==="unrecognized_keys")return{message:_6.errToObj(J).message??X};return{message:X}}}:{}})}strip(){return new _4({...this._def,unknownKeys:"strip"})}passthrough(){return new _4({...this._def,unknownKeys:"passthrough"})}extend(J){return new _4({...this._def,shape:()=>({...this._def.shape(),...J})})}merge(J){return new _4({unknownKeys:J._def.unknownKeys,catchall:J._def.catchall,shape:()=>({...this._def.shape(),...J._def.shape()}),typeName:w8.ZodObject})}setKey(J,Q){return this.augment({[J]:Q})}catchall(J){return new _4({...this._def,catchall:J})}pick(J){let Q={};for(let Z of O9.objectKeys(J))if(J[Z]&&this.shape[Z])Q[Z]=this.shape[Z];return new _4({...this._def,shape:()=>Q})}omit(J){let Q={};for(let Z of O9.objectKeys(this.shape))if(!J[Z])Q[Z]=this.shape[Z];return new _4({...this._def,shape:()=>Q})}deepPartial(){return HO(this)}partial(J){let Q={};for(let Z of O9.objectKeys(this.shape)){let X=this.shape[Z];if(J&&!J[Z])Q[Z]=X;else Q[Z]=X.optional()}return new _4({...this._def,shape:()=>Q})}required(J){let Q={};for(let Z of O9.objectKeys(this.shape))if(J&&!J[Z])Q[Z]=this.shape[Z];else{let Y=this.shape[Z];while(Y instanceof UG)Y=Y._def.innerType;Q[Z]=Y}return new _4({...this._def,shape:()=>Q})}keyof(){return fi1(O9.objectKeys(this.shape))}};_4.create=(J,Q)=>{return new _4({shape:()=>J,unknownKeys:"strip",catchall:Xz.create(),typeName:w8.ZodObject,...i8(Q)})};_4.strictCreate=(J,Q)=>{return new _4({shape:()=>J,unknownKeys:"strict",catchall:Xz.create(),typeName:w8.ZodObject,...i8(Q)})};_4.lazycreate=(J,Q)=>{return new _4({shape:J,unknownKeys:"strip",catchall:Xz.create(),typeName:w8.ZodObject,...i8(Q)})};NO=class NO extends q9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=this._def.options;function X(Y){for(let G of Y)if(G.result.status==="valid")return G.result;for(let G of Y)if(G.result.status==="dirty")return Q.common.issues.push(...G.ctx.common.issues),G.result;let K=Y.map((G)=>new MZ(G.ctx.common.issues));return W6(Q,{code:f0.invalid_union,unionErrors:K}),M8}if(Q.common.async)return Promise.all(Z.map(async(Y)=>{let K={...Q,common:{...Q.common,issues:[]},parent:null};return{result:await Y._parseAsync({data:Q.data,path:Q.path,parent:K}),ctx:K}})).then(X);else{let Y=void 0,K=[];for(let q of Z){let z={...Q,common:{...Q.common,issues:[]},parent:null},U=q._parseSync({data:Q.data,path:Q.path,parent:z});if(U.status==="valid")return U;else if(U.status==="dirty"&&!Y)Y={result:U,ctx:z};if(z.common.issues.length)K.push(z.common.issues)}if(Y)return Q.common.issues.push(...Y.ctx.common.issues),Y.result;let G=K.map((q)=>new MZ(q));return W6(Q,{code:f0.invalid_union,unionErrors:G}),M8}}get options(){return this._def.options}};NO.create=(J,Q)=>{return new NO({options:J,typeName:w8.ZodUnion,...i8(Q)})};Hc=class Hc extends q9{_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==e0.object)return W6(Q,{code:f0.invalid_type,expected:e0.object,received:Q.parsedType}),M8;let Z=this.discriminator,X=Q.data[Z],Y=this.optionsMap.get(X);if(!Y)return W6(Q,{code:f0.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Z]}),M8;if(Q.common.async)return Y._parseAsync({data:Q.data,path:Q.path,parent:Q});else return Y._parseSync({data:Q.data,path:Q.path,parent:Q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(J,Q,Z){let X=new Map;for(let Y of Q){let K=VW(Y.shape[J]);if(!K.length)throw Error(`A discriminator value for key \`${J}\` could not be extracted from all schema options`);for(let G of K){if(X.has(G))throw Error(`Discriminator property ${String(J)} has duplicate value ${String(G)}`);X.set(G,Y)}}return new Hc({typeName:w8.ZodDiscriminatedUnion,discriminator:J,options:Q,optionsMap:X,...i8(Z)})}};LO=class LO extends q9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J),X=(Y,K)=>{if(Wc(Y)||Wc(K))return M8;let G=FX1(Y.value,K.value);if(!G.valid)return W6(Z,{code:f0.invalid_intersection_types}),M8;if(Fc(Y)||Fc(K))Q.dirty();return{status:Q.value,value:G.data}};if(Z.common.async)return Promise.all([this._def.left._parseAsync({data:Z.data,path:Z.path,parent:Z}),this._def.right._parseAsync({data:Z.data,path:Z.path,parent:Z})]).then(([Y,K])=>X(Y,K));else return X(this._def.left._parseSync({data:Z.data,path:Z.path,parent:Z}),this._def.right._parseSync({data:Z.data,path:Z.path,parent:Z}))}};LO.create=(J,Q,Z)=>{return new LO({left:J,right:Q,typeName:w8.ZodIntersection,...i8(Z)})};Yz=class Yz extends q9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==e0.array)return W6(Z,{code:f0.invalid_type,expected:e0.array,received:Z.parsedType}),M8;if(Z.data.length<this._def.items.length)return W6(Z,{code:f0.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),M8;if(!this._def.rest&&Z.data.length>this._def.items.length)W6(Z,{code:f0.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q.dirty();let Y=[...Z.data].map((K,G)=>{let q=this._def.items[G]||this._def.rest;if(!q)return null;return q._parse(new WG(Z,K,Z.path,G))}).filter((K)=>!!K);if(Z.common.async)return Promise.all(Y).then((K)=>{return ZJ.mergeArray(Q,K)});else return ZJ.mergeArray(Q,Y)}get items(){return this._def.items}rest(J){return new Yz({...this._def,rest:J})}};Yz.create=(J,Q)=>{if(!Array.isArray(J))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yz({items:J,typeName:w8.ZodTuple,rest:null,...i8(Q)})};kS=class kS extends q9{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==e0.object)return W6(Z,{code:f0.invalid_type,expected:e0.object,received:Z.parsedType}),M8;let X=[],Y=this._def.keyType,K=this._def.valueType;for(let G in Z.data)X.push({key:Y._parse(new WG(Z,G,Z.path,G)),value:K._parse(new WG(Z,Z.data[G],Z.path,G)),alwaysSet:G in Z.data});if(Z.common.async)return ZJ.mergeObjectAsync(Q,X);else return ZJ.mergeObjectSync(Q,X)}get element(){return this._def.valueType}static create(J,Q,Z){if(Q instanceof q9)return new kS({keyType:J,valueType:Q,typeName:w8.ZodRecord,...i8(Z)});return new kS({keyType:qG.create(),valueType:J,typeName:w8.ZodRecord,...i8(Q)})}};_S=class _S extends q9{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==e0.map)return W6(Z,{code:f0.invalid_type,expected:e0.map,received:Z.parsedType}),M8;let X=this._def.keyType,Y=this._def.valueType,K=[...Z.data.entries()].map(([G,q],z)=>{return{key:X._parse(new WG(Z,G,Z.path,[z,"key"])),value:Y._parse(new WG(Z,q,Z.path,[z,"value"]))}});if(Z.common.async){let G=new Map;return Promise.resolve().then(async()=>{for(let q of K){let z=await q.key,U=await q.value;if(z.status==="aborted"||U.status==="aborted")return M8;if(z.status==="dirty"||U.status==="dirty")Q.dirty();G.set(z.value,U.value)}return{status:Q.value,value:G}})}else{let G=new Map;for(let q of K){let{key:z,value:U}=q;if(z.status==="aborted"||U.status==="aborted")return M8;if(z.status==="dirty"||U.status==="dirty")Q.dirty();G.set(z.value,U.value)}return{status:Q.value,value:G}}}};_S.create=(J,Q,Z)=>{return new _S({valueType:Q,keyType:J,typeName:w8.ZodMap,...i8(Z)})};lN=class lN extends q9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==e0.set)return W6(Z,{code:f0.invalid_type,expected:e0.set,received:Z.parsedType}),M8;let X=this._def;if(X.minSize!==null){if(Z.data.size<X.minSize.value)W6(Z,{code:f0.too_small,minimum:X.minSize.value,type:"set",inclusive:!0,exact:!1,message:X.minSize.message}),Q.dirty()}if(X.maxSize!==null){if(Z.data.size>X.maxSize.value)W6(Z,{code:f0.too_big,maximum:X.maxSize.value,type:"set",inclusive:!0,exact:!1,message:X.maxSize.message}),Q.dirty()}let Y=this._def.valueType;function K(q){let z=new Set;for(let U of q){if(U.status==="aborted")return M8;if(U.status==="dirty")Q.dirty();z.add(U.value)}return{status:Q.value,value:z}}let G=[...Z.data.values()].map((q,z)=>Y._parse(new WG(Z,q,Z.path,z)));if(Z.common.async)return Promise.all(G).then((q)=>K(q));else return K(G)}min(J,Q){return new lN({...this._def,minSize:{value:J,message:_6.toString(Q)}})}max(J,Q){return new lN({...this._def,maxSize:{value:J,message:_6.toString(Q)}})}size(J,Q){return this.min(J,Q).max(J,Q)}nonempty(J){return this.min(1,J)}};lN.create=(J,Q)=>{return new lN({valueType:J,minSize:null,maxSize:null,typeName:w8.ZodSet,...i8(Q)})};BO=class BO extends q9{constructor(){super(...arguments);this.validate=this.implement}_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==e0.function)return W6(Q,{code:f0.invalid_type,expected:e0.function,received:Q.parsedType}),M8;function Z(G,q){return CS({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,WO(),MW].filter((z)=>!!z),issueData:{code:f0.invalid_arguments,argumentsError:q}})}function X(G,q){return CS({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,WO(),MW].filter((z)=>!!z),issueData:{code:f0.invalid_return_type,returnTypeError:q}})}let Y={errorMap:Q.common.contextualErrorMap},K=Q.data;if(this._def.returns instanceof iN){let G=this;return kJ(async function(...q){let z=new MZ([]),U=await G._def.args.parseAsync(q,Y).catch((H)=>{throw z.addIssue(Z(q,H)),z}),W=await Reflect.apply(K,this,U);return await G._def.returns._def.type.parseAsync(W,Y).catch((H)=>{throw z.addIssue(X(W,H)),z})})}else{let G=this;return kJ(function(...q){let z=G._def.args.safeParse(q,Y);if(!z.success)throw new MZ([Z(q,z.error)]);let U=Reflect.apply(K,this,z.data),W=G._def.returns.safeParse(U,Y);if(!W.success)throw new MZ([X(U,W.error)]);return W.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...J){return new BO({...this._def,args:Yz.create(J).rest(SB.create())})}returns(J){return new BO({...this._def,returns:J})}implement(J){return this.parse(J)}strictImplement(J){return this.parse(J)}static create(J,Q,Z){return new BO({args:J?J:Yz.create([]).rest(SB.create()),returns:Q||SB.create(),typeName:w8.ZodFunction,...i8(Z)})}};AO=class AO extends q9{get schema(){return this._def.getter()}_parse(J){let{ctx:Q}=this._processInputParams(J);return this._def.getter()._parse({data:Q.data,path:Q.path,parent:Q})}};AO.create=(J,Q)=>{return new AO({getter:J,typeName:w8.ZodLazy,...i8(Q)})};wO=class wO extends q9{_parse(J){if(J.data!==this._def.value){let Q=this._getOrReturnCtx(J);return W6(Q,{received:Q.data,code:f0.invalid_literal,expected:this._def.value}),M8}return{status:"valid",value:J.data}}get value(){return this._def.value}};wO.create=(J,Q)=>{return new wO({value:J,typeName:w8.ZodLiteral,...i8(Q)})};_B=class _B extends q9{_parse(J){if(typeof J.data!=="string"){let Q=this._getOrReturnCtx(J),Z=this._def.values;return W6(Q,{expected:O9.joinValues(Z),received:Q.parsedType,code:f0.invalid_type}),M8}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(J.data)){let Q=this._getOrReturnCtx(J),Z=this._def.values;return W6(Q,{received:Q.data,code:f0.invalid_enum_value,options:Z}),M8}return kJ(J.data)}get options(){return this._def.values}get enum(){let J={};for(let Q of this._def.values)J[Q]=Q;return J}get Values(){let J={};for(let Q of this._def.values)J[Q]=Q;return J}get Enum(){let J={};for(let Q of this._def.values)J[Q]=Q;return J}extract(J,Q=this._def){return _B.create(J,{...this._def,...Q})}exclude(J,Q=this._def){return _B.create(this.options.filter((Z)=>!J.includes(Z)),{...this._def,...Q})}};_B.create=fi1;RO=class RO extends q9{_parse(J){let Q=O9.getValidEnumValues(this._def.values),Z=this._getOrReturnCtx(J);if(Z.parsedType!==e0.string&&Z.parsedType!==e0.number){let X=O9.objectValues(Q);return W6(Z,{expected:O9.joinValues(X),received:Z.parsedType,code:f0.invalid_type}),M8}if(!this._cache)this._cache=new Set(O9.getValidEnumValues(this._def.values));if(!this._cache.has(J.data)){let X=O9.objectValues(Q);return W6(Z,{received:Z.data,code:f0.invalid_enum_value,options:X}),M8}return kJ(J.data)}get enum(){return this._def.values}};RO.create=(J,Q)=>{return new RO({values:J,typeName:w8.ZodNativeEnum,...i8(Q)})};iN=class iN extends q9{unwrap(){return this._def.type}_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==e0.promise&&Q.common.async===!1)return W6(Q,{code:f0.invalid_type,expected:e0.promise,received:Q.parsedType}),M8;let Z=Q.parsedType===e0.promise?Q.data:Promise.resolve(Q.data);return kJ(Z.then((X)=>{return this._def.type.parseAsync(X,{path:Q.path,errorMap:Q.common.contextualErrorMap})}))}};iN.create=(J,Q)=>{return new iN({type:J,typeName:w8.ZodPromise,...i8(Q)})};FG=class FG extends q9{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w8.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J),X=this._def.effect||null,Y={addIssue:(K)=>{if(W6(Z,K),K.fatal)Q.abort();else Q.dirty()},get path(){return Z.path}};if(Y.addIssue=Y.addIssue.bind(Y),X.type==="preprocess"){let K=X.transform(Z.data,Y);if(Z.common.async)return Promise.resolve(K).then(async(G)=>{if(Q.value==="aborted")return M8;let q=await this._def.schema._parseAsync({data:G,path:Z.path,parent:Z});if(q.status==="aborted")return M8;if(q.status==="dirty")return pN(q.value);if(Q.value==="dirty")return pN(q.value);return q});else{if(Q.value==="aborted")return M8;let G=this._def.schema._parseSync({data:K,path:Z.path,parent:Z});if(G.status==="aborted")return M8;if(G.status==="dirty")return pN(G.value);if(Q.value==="dirty")return pN(G.value);return G}}if(X.type==="refinement"){let K=(G)=>{let q=X.refinement(G,Y);if(Z.common.async)return Promise.resolve(q);if(q instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return G};if(Z.common.async===!1){let G=this._def.schema._parseSync({data:Z.data,path:Z.path,parent:Z});if(G.status==="aborted")return M8;if(G.status==="dirty")Q.dirty();return K(G.value),{status:Q.value,value:G.value}}else return this._def.schema._parseAsync({data:Z.data,path:Z.path,parent:Z}).then((G)=>{if(G.status==="aborted")return M8;if(G.status==="dirty")Q.dirty();return K(G.value).then(()=>{return{status:Q.value,value:G.value}})})}if(X.type==="transform")if(Z.common.async===!1){let K=this._def.schema._parseSync({data:Z.data,path:Z.path,parent:Z});if(!CB(K))return M8;let G=X.transform(K.value,Y);if(G instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:Q.value,value:G}}else return this._def.schema._parseAsync({data:Z.data,path:Z.path,parent:Z}).then((K)=>{if(!CB(K))return M8;return Promise.resolve(X.transform(K.value,Y)).then((G)=>({status:Q.value,value:G}))});O9.assertNever(X)}};FG.create=(J,Q,Z)=>{return new FG({schema:J,typeName:w8.ZodEffects,effect:Q,...i8(Z)})};FG.createWithPreprocess=(J,Q,Z)=>{return new FG({schema:Q,effect:{type:"preprocess",transform:J},typeName:w8.ZodEffects,...i8(Z)})};UG=class UG extends q9{_parse(J){if(this._getType(J)===e0.undefined)return kJ(void 0);return this._def.innerType._parse(J)}unwrap(){return this._def.innerType}};UG.create=(J,Q)=>{return new UG({innerType:J,typeName:w8.ZodOptional,...i8(Q)})};NW=class NW extends q9{_parse(J){if(this._getType(J)===e0.null)return kJ(null);return this._def.innerType._parse(J)}unwrap(){return this._def.innerType}};NW.create=(J,Q)=>{return new NW({innerType:J,typeName:w8.ZodNullable,...i8(Q)})};OO=class OO extends q9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=Q.data;if(Q.parsedType===e0.undefined)Z=this._def.defaultValue();return this._def.innerType._parse({data:Z,path:Q.path,parent:Q})}removeDefault(){return this._def.innerType}};OO.create=(J,Q)=>{return new OO({innerType:J,typeName:w8.ZodDefault,defaultValue:typeof Q.default==="function"?Q.default:()=>Q.default,...i8(Q)})};jO=class jO extends q9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z={...Q,common:{...Q.common,issues:[]}},X=this._def.innerType._parse({data:Z.data,path:Z.path,parent:{...Z}});if(FO(X))return X.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new MZ(Z.common.issues)},input:Z.data})}});else return{status:"valid",value:X.status==="valid"?X.value:this._def.catchValue({get error(){return new MZ(Z.common.issues)},input:Z.data})}}removeCatch(){return this._def.innerType}};jO.create=(J,Q)=>{return new jO({innerType:J,typeName:w8.ZodCatch,catchValue:typeof Q.catch==="function"?Q.catch:()=>Q.catch,...i8(Q)})};xS=class xS extends q9{_parse(J){if(this._getType(J)!==e0.nan){let Z=this._getOrReturnCtx(J);return W6(Z,{code:f0.invalid_type,expected:e0.nan,received:Z.parsedType}),M8}return{status:"valid",value:J.data}}};xS.create=(J)=>{return new xS({typeName:w8.ZodNaN,...i8(J)})};dM6=Symbol("zod_brand");Bc=class Bc extends q9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=Q.data;return this._def.type._parse({data:Z,path:Q.path,parent:Q})}unwrap(){return this._def.type}};bS=class bS extends q9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.common.async)return(async()=>{let Y=await this._def.in._parseAsync({data:Z.data,path:Z.path,parent:Z});if(Y.status==="aborted")return M8;if(Y.status==="dirty")return Q.dirty(),pN(Y.value);else return this._def.out._parseAsync({data:Y.value,path:Z.path,parent:Z})})();else{let X=this._def.in._parseSync({data:Z.data,path:Z.path,parent:Z});if(X.status==="aborted")return M8;if(X.status==="dirty")return Q.dirty(),{status:"dirty",value:X.value};else return this._def.out._parseSync({data:X.value,path:Z.path,parent:Z})}}static create(J,Q){return new bS({in:J,out:Q,typeName:w8.ZodPipeline})}};$O=class $O extends q9{_parse(J){let Q=this._def.innerType._parse(J),Z=(X)=>{if(CB(X))X.value=Object.freeze(X.value);return X};return FO(Q)?Q.then((X)=>Z(X)):Z(Q)}unwrap(){return this._def.innerType}};$O.create=(J,Q)=>{return new $O({innerType:J,typeName:w8.ZodReadonly,...i8(Q)})};cM6={object:_4.lazycreate};(function(J){J.ZodString="ZodString",J.ZodNumber="ZodNumber",J.ZodNaN="ZodNaN",J.ZodBigInt="ZodBigInt",J.ZodBoolean="ZodBoolean",J.ZodDate="ZodDate",J.ZodSymbol="ZodSymbol",J.ZodUndefined="ZodUndefined",J.ZodNull="ZodNull",J.ZodAny="ZodAny",J.ZodUnknown="ZodUnknown",J.ZodNever="ZodNever",J.ZodVoid="ZodVoid",J.ZodArray="ZodArray",J.ZodObject="ZodObject",J.ZodUnion="ZodUnion",J.ZodDiscriminatedUnion="ZodDiscriminatedUnion",J.ZodIntersection="ZodIntersection",J.ZodTuple="ZodTuple",J.ZodRecord="ZodRecord",J.ZodMap="ZodMap",J.ZodSet="ZodSet",J.ZodFunction="ZodFunction",J.ZodLazy="ZodLazy",J.ZodLiteral="ZodLiteral",J.ZodEnum="ZodEnum",J.ZodEffects="ZodEffects",J.ZodNativeEnum="ZodNativeEnum",J.ZodOptional="ZodOptional",J.ZodNullable="ZodNullable",J.ZodDefault="ZodDefault",J.ZodCatch="ZodCatch",J.ZodPromise="ZodPromise",J.ZodBranded="ZodBranded",J.ZodPipeline="ZodPipeline",J.ZodReadonly="ZodReadonly"})(w8||(w8={}));gi1=qG.create,mi1=vB.create,iM6=xS.create,nM6=kB.create,ui1=DO.create,aM6=dN.create,rM6=SS.create,sM6=MO.create,oM6=VO.create,tM6=cN.create,eM6=SB.create,JV6=Xz.create,QV6=vS.create,ZV6=zG.create,XV6=_4.create,YV6=_4.strictCreate,KV6=NO.create,GV6=Hc.create,qV6=LO.create,zV6=Yz.create,UV6=kS.create,WV6=_S.create,FV6=lN.create,HV6=BO.create,BV6=AO.create,DV6=wO.create,MV6=_B.create,VV6=RO.create,NV6=iN.create,LV6=FG.create,AV6=UG.create,wV6=NW.create,RV6=FG.createWithPreprocess,OV6=bS.create,IV6={string:(J)=>qG.create({...J,coerce:!0}),number:(J)=>vB.create({...J,coerce:!0}),boolean:(J)=>DO.create({...J,coerce:!0}),bigint:(J)=>kB.create({...J,coerce:!0}),date:(J)=>dN.create({...J,coerce:!0})},PV6=M8});var Q1={};R6(Q1,{void:()=>QV6,util:()=>O9,unknown:()=>eM6,union:()=>KV6,undefined:()=>sM6,tuple:()=>zV6,transformer:()=>LV6,symbol:()=>rM6,string:()=>gi1,strictObject:()=>YV6,setErrorMap:()=>wM6,set:()=>FV6,record:()=>UV6,quotelessJson:()=>LM6,promise:()=>NV6,preprocess:()=>RV6,pipeline:()=>OV6,ostring:()=>jV6,optional:()=>AV6,onumber:()=>$V6,oboolean:()=>EV6,objectUtil:()=>qX1,object:()=>XV6,number:()=>mi1,nullable:()=>wV6,null:()=>oM6,never:()=>JV6,nativeEnum:()=>VV6,nan:()=>iM6,map:()=>WV6,makeIssue:()=>CS,literal:()=>DV6,lazy:()=>BV6,late:()=>cM6,isValid:()=>CB,isDirty:()=>Fc,isAsync:()=>FO,isAborted:()=>Wc,intersection:()=>qV6,instanceof:()=>lM6,getParsedType:()=>Zz,getErrorMap:()=>WO,function:()=>HV6,enum:()=>MV6,effect:()=>LV6,discriminatedUnion:()=>GV6,defaultErrorMap:()=>MW,datetimeRegex:()=>yi1,date:()=>aM6,custom:()=>hi1,coerce:()=>IV6,boolean:()=>ui1,bigint:()=>nM6,array:()=>ZV6,any:()=>tM6,addIssueToContext:()=>W6,ZodVoid:()=>vS,ZodUnknown:()=>SB,ZodUnion:()=>NO,ZodUndefined:()=>MO,ZodType:()=>q9,ZodTuple:()=>Yz,ZodTransformer:()=>FG,ZodSymbol:()=>SS,ZodString:()=>qG,ZodSet:()=>lN,ZodSchema:()=>q9,ZodRecord:()=>kS,ZodReadonly:()=>$O,ZodPromise:()=>iN,ZodPipeline:()=>bS,ZodParsedType:()=>e0,ZodOptional:()=>UG,ZodObject:()=>_4,ZodNumber:()=>vB,ZodNullable:()=>NW,ZodNull:()=>VO,ZodNever:()=>Xz,ZodNativeEnum:()=>RO,ZodNaN:()=>xS,ZodMap:()=>_S,ZodLiteral:()=>wO,ZodLazy:()=>AO,ZodIssueCode:()=>f0,ZodIntersection:()=>LO,ZodFunction:()=>BO,ZodFirstPartyTypeKind:()=>w8,ZodError:()=>MZ,ZodEnum:()=>_B,ZodEffects:()=>FG,ZodDiscriminatedUnion:()=>Hc,ZodDefault:()=>OO,ZodDate:()=>dN,ZodCatch:()=>jO,ZodBranded:()=>Bc,ZodBoolean:()=>DO,ZodBigInt:()=>kB,ZodArray:()=>zG,ZodAny:()=>cN,Schema:()=>q9,ParseStatus:()=>ZJ,OK:()=>kJ,NEVER:()=>PV6,INVALID:()=>M8,EMPTY_PATH:()=>RM6,DIRTY:()=>pN,BRAND:()=>dM6});var HX1=B1(()=>{Uc();UX1();Si1();TS();pi1();zc()});var LW=B1(()=>{HX1();HX1()});function CV6(J){return di1.safeParse(J)}function xB(J){return TV6.safeParse(J)}function EO(J){if(!J||!Array.isArray(J))return[];let Q=[];for(let[Z,X]of J.entries()){let Y=CV6(X);if(Y.success)Q.push(Y.data);else{let K=typeof X==="object"&&X!==null&&"tool"in X?String(X.tool):`entry at index ${Z}`;u.warn(`Permission entry for tool "${K}" is invalid: ${Y.error.errors.map((G)=>`${G.path.join(".")}: ${G.message}`).join(", ")}`)}}return Q}var BX1,di1,TV6;var nN=B1(()=>{LW();G0();BX1=Q1.lazy(()=>Q1.union([Q1.string().describe('Pattern match where "*" matches any number of any characters'),Q1.array(BX1).min(1).describe("OR match of each entry"),Q1.boolean().describe("A literal boolean match"),Q1.number().describe("A literal number match"),Q1.null().describe("A literal null match"),Q1.undefined().describe("A literal undefined match"),Q1.record(Q1.string(),BX1).describe("Matching individual keys of an object")])),di1=Q1.object({tool:Q1.string().min(1).describe("The name of the tool to which this entry applies"),matches:Q1.record(Q1.string(),BX1).optional().describe("Maps tool inputs to conditions"),action:Q1.enum(["allow","reject","ask","delegate"]).describe("How Amp should proceed in case of a match"),context:Q1.enum(["thread","subagent"]).optional().describe("Only apply this entry in this context"),to:Q1.string().min(1).optional().describe('Command to delegate to when action is "delegate"')}).superRefine((J,Q)=>{if(J.action==="delegate"&&!J.to)Q.addIssue({code:Q1.ZodIssueCode.custom,message:'delegate action requires "to" field',path:["to"]});if(J.action!=="delegate"&&J.to)Q.addIssue({code:Q1.ZodIssueCode.custom,message:'"to" field only allowed with delegate action',path:["to"]})}),TV6=Q1.array(di1).describe("Entries checked in sequence to configure tool permissions")});function VZ(J,Q){let Z=SV6(J,Q);return typeof Z==="string"?Z:Z.toString()}function SV6(J,Q,Z=!0){if(!Q)Q=vV6();let{workspaceFolders:X,isWindows:Y,homeDir:K}=Q,G=typeof J==="string"?w0.parse(J):w0.from(J);if(X)for(let q of X){let z=D8(q);if(b0.hasPrefix(G,z)){let U=z.path.endsWith("/")?z.path.slice(0,-1):z.path,F=Z&&X&&X.length>=2?PN(z.path)+(Y?"\\":"/"):"";return DX1(F+G.path.slice(U.length+1),Y,G.scheme)}}if(G?.scheme==="file"){if(K){let q=D8(K);if(b0.hasPrefix(G,q)){let z=q.path.endsWith("/")?q.path.slice(0,-1):q.path,U=G.path.slice(z.length+1);return DX1("~"+(Y?"\\":"/")+U,Y,G.scheme)}}return DX1(G.fsPath,Y,G.scheme)}return G}function DX1(J,Q,Z){return Q&&Z==="file"?J.replaceAll("/","\\"):J}function Mc(J){let Q=Dc;return Dc=J,Q}function vV6(){if(Dc)return Dc;throw Error("must call setDisplayPathEnvInfo before calling displayPath() and related functions")}var Dc=null;var bB=B1(()=>{b6();iR();Id()});function _J(J,...Q){throw Error(`[Immer] minified error nr: ${J}. Full error at: https://bit.ly/3cXEKWf`)}function sN(J){return!!J&&!!J[$X]}function yB(J){if(!J)return!1;return ai1(J)||Array.isArray(J)||!!J[yS]||!!J.constructor?.[yS]||uS(J)||pS(J)}function ai1(J){if(!J||typeof J!=="object")return!1;let Q=rN(J);if(Q===null)return!0;let Z=Object.hasOwnProperty.call(Q,"constructor")&&Q.constructor;if(Z===Object)return!0;return typeof Z=="function"&&Function.toString.call(Z)===kV6}function fS(J,Q){if(oN(J)===0)Reflect.ownKeys(J).forEach((Z)=>{Q(Z,J[Z],J)});else J.forEach((Z,X)=>Q(X,Z,J))}function oN(J){let Q=J[$X];return Q?Q.type_:Array.isArray(J)?1:uS(J)?2:pS(J)?3:0}function hS(J,Q){return oN(J)===2?J.has(Q):Object.prototype.hasOwnProperty.call(J,Q)}function MX1(J,Q){return oN(J)===2?J.get(Q):J[Q]}function ri1(J,Q,Z){let X=oN(J);if(X===2)J.set(Q,Z);else if(X===3)J.add(Z);else J[Q]=Z}function _V6(J,Q){if(J===Q)return J!==0||1/J===1/Q;else return J!==J&&Q!==Q}function uS(J){return J instanceof Map}function pS(J){return J instanceof Set}function aN(J){return J.copy_||J.base_}function LX1(J,Q){if(uS(J))return new Map(J);if(pS(J))return new Set(J);if(Array.isArray(J))return Array.prototype.slice.call(J);let Z=ai1(J);if(Q===!0||Q==="class_only"&&!Z){let X=Object.getOwnPropertyDescriptors(J);delete X[$X];let Y=Reflect.ownKeys(X);for(let K=0;K<Y.length;K++){let G=Y[K],q=X[G];if(q.writable===!1)q.writable=!0,q.configurable=!0;if(q.get||q.set)X[G]={configurable:!0,writable:!0,enumerable:q.enumerable,value:J[G]}}return Object.create(rN(J),X)}else{let X=rN(J);if(X!==null&&Z)return{...J};let Y=Object.create(X);return Object.assign(Y,J)}}function RQ(J,Q=!1){if(Lc(J)||sN(J)||!yB(J))return J;if(oN(J)>1)J.set=J.add=J.clear=J.delete=xV6;if(Object.freeze(J),Q)Object.entries(J).forEach(([Z,X])=>RQ(X,!0));return J}function xV6(){_J(2)}function Lc(J){return Object.isFrozen(J)}function tN(J){let Q=AX1[J];if(!Q)_J(0,J);return Q}function bV6(J,Q){if(!AX1[J])AX1[J]=Q}function si1(){return gS}function yV6(J,Q){return{drafts_:[],parent_:J,immer_:Q,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ci1(J,Q){if(Q)tN("Patches"),J.patches_=[],J.inversePatches_=[],J.patchListener_=Q}function wX1(J){RX1(J),J.drafts_.forEach(fV6),J.drafts_=null}function RX1(J){if(J===gS)gS=J.parent_}function li1(J){return gS=yV6(gS,J)}function fV6(J){let Q=J[$X];if(Q.type_===0||Q.type_===1)Q.revoke_();else Q.revoked_=!0}function ii1(J,Q){Q.unfinalizedDrafts_=Q.drafts_.length;let Z=Q.drafts_[0];if(J!==void 0&&J!==Z){if(Z[$X].modified_)wX1(Q),_J(4);if(yB(J)){if(J=Vc(Q,J),!Q.parent_)Nc(Q,J)}if(Q.patches_)tN("Patches").generateReplacementPatches_(Z[$X].base_,J,Q.patches_,Q.inversePatches_)}else J=Vc(Q,Z,[]);if(wX1(Q),Q.patches_)Q.patchListener_(Q.patches_,Q.inversePatches_);return J!==$X1?J:void 0}function Vc(J,Q,Z){if(Lc(Q))return Q;let X=Q[$X];if(!X)return fS(Q,(Y,K)=>ni1(J,X,Q,Y,K,Z)),Q;if(X.scope_!==J)return Q;if(!X.modified_)return Nc(J,X.base_,!0),X.base_;if(!X.finalized_){X.finalized_=!0,X.scope_.unfinalizedDrafts_--;let Y=X.copy_,K=Y,G=!1;if(X.type_===3)K=new Set(Y),Y.clear(),G=!0;if(fS(K,(q,z)=>ni1(J,X,Y,q,z,Z,G)),Nc(J,Y,!1),Z&&J.patches_)tN("Patches").generatePatches_(X,Z,J.patches_,J.inversePatches_)}return X.copy_}function ni1(J,Q,Z,X,Y,K,G){if(sN(Y)){let q=K&&Q&&Q.type_!==3&&!hS(Q.assigned_,X)?K.concat(X):void 0,z=Vc(J,Y,q);if(ri1(Z,X,z),sN(z))J.canAutoFreeze_=!1;else return}else if(G)Z.add(Y);if(yB(Y)&&!Lc(Y)){if(!J.immer_.autoFreeze_&&J.unfinalizedDrafts_<1)return;if(Vc(J,Y),(!Q||!Q.scope_.parent_)&&typeof X!=="symbol"&&Object.prototype.propertyIsEnumerable.call(Z,X))Nc(J,Y)}}function Nc(J,Q,Z=!1){if(!J.parent_&&J.immer_.autoFreeze_&&J.canAutoFreeze_)RQ(Q,Z)}function hV6(J,Q){let Z=Array.isArray(J),X={type_:Z?1:0,scope_:Q?Q.scope_:si1(),modified_:!1,finalized_:!1,assigned_:{},parent_:Q,base_:J,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=X,K=EX1;if(Z)Y=[X],K=mS;let{revoke:G,proxy:q}=Proxy.revocable(Y,K);return X.draft_=q,X.revoke_=G,q}function VX1(J,Q){let Z=J[$X];return(Z?aN(Z):J)[Q]}function gV6(J,Q,Z){let X=oi1(Q,Z);return X?"value"in X?X.value:X.get?.call(J.draft_):void 0}function oi1(J,Q){if(!(Q in J))return;let Z=rN(J);while(Z){let X=Object.getOwnPropertyDescriptor(Z,Q);if(X)return X;Z=rN(Z)}return}function OX1(J){if(!J.modified_){if(J.modified_=!0,J.parent_)OX1(J.parent_)}}function NX1(J){if(!J.copy_)J.copy_=LX1(J.base_,J.scope_.immer_.useStrictShallowCopy_)}function jX1(J,Q){let Z=uS(J)?tN("MapSet").proxyMap_(J,Q):pS(J)?tN("MapSet").proxySet_(J,Q):hV6(J,Q);return(Q?Q.scope_:si1()).drafts_.push(Z),Z}function uV6(J){if(!sN(J))_J(10,J);return ti1(J)}function ti1(J){if(!yB(J)||Lc(J))return J;let Q=J[$X],Z;if(Q){if(!Q.modified_)return Q.base_;Q.finalized_=!0,Z=LX1(J,Q.scope_.immer_.useStrictShallowCopy_)}else Z=LX1(J,!0);if(fS(Z,(X,Y)=>{ri1(Z,X,ti1(Y))}),Q)Q.finalized_=!1;return Z}function Ac(){let Q="replace",Z="add",X="remove";function Y(H,B,M,V){switch(H.type_){case 0:case 2:return G(H,B,M,V);case 1:return K(H,B,M,V);case 3:return q(H,B,M,V)}}function K(H,B,M,V){let{base_:N,assigned_:L}=H,A=H.copy_;if(A.length<N.length)[N,A]=[A,N],[M,V]=[V,M];for(let w=0;w<N.length;w++)if(L[w]&&A[w]!==N[w]){let R=B.concat([w]);M.push({op:Q,path:R,value:F(A[w])}),V.push({op:Q,path:R,value:F(N[w])})}for(let w=N.length;w<A.length;w++){let R=B.concat([w]);M.push({op:Z,path:R,value:F(A[w])})}for(let w=A.length-1;N.length<=w;--w){let R=B.concat([w]);V.push({op:X,path:R})}}function G(H,B,M,V){let{base_:N,copy_:L}=H;fS(H.assigned_,(A,w)=>{let R=MX1(N,A),O=MX1(L,A),j=!w?X:hS(N,A)?Q:Z;if(R===O&&j===Q)return;let $=B.concat(A);M.push(j===X?{op:j,path:$}:{op:j,path:$,value:O}),V.push(j===Z?{op:X,path:$}:j===X?{op:Z,path:$,value:F(R)}:{op:Q,path:$,value:F(R)})})}function q(H,B,M,V){let{base_:N,copy_:L}=H,A=0;N.forEach((w)=>{if(!L.has(w)){let R=B.concat([A]);M.push({op:X,path:R,value:w}),V.unshift({op:Z,path:R,value:w})}A++}),A=0,L.forEach((w)=>{if(!N.has(w)){let R=B.concat([A]);M.push({op:Z,path:R,value:w}),V.unshift({op:X,path:R,value:w})}A++})}function z(H,B,M,V){M.push({op:Q,path:[],value:B===$X1?void 0:B}),V.push({op:Q,path:[],value:H})}function U(H,B){return B.forEach((M)=>{let{path:V,op:N}=M,L=H;for(let O=0;O<V.length-1;O++){let j=oN(L),$=V[O];if(typeof $!=="string"&&typeof $!=="number")$=""+$;if((j===0||j===1)&&($==="__proto__"||$==="constructor"))_J(19);if(typeof L==="function"&&$==="prototype")_J(19);if(L=MX1(L,$),typeof L!=="object")_J(18,V.join("/"))}let A=oN(L),w=W(M.value),R=V[V.length-1];switch(N){case Q:switch(A){case 2:return L.set(R,w);case 3:_J(16);default:return L[R]=w}case Z:switch(A){case 1:return R==="-"?L.push(w):L.splice(R,0,w);case 2:return L.set(R,w);case 3:return L.add(w);default:return L[R]=w}case X:switch(A){case 1:return L.splice(R,1);case 2:return L.delete(R);case 3:return L.delete(M.value);default:return delete L[R]}default:_J(17,N)}}),H}function W(H){if(!yB(H))return H;if(Array.isArray(H))return H.map(W);if(uS(H))return new Map(Array.from(H.entries()).map(([M,V])=>[M,W(V)]));if(pS(H))return new Set(Array.from(H).map(W));let B=Object.create(rN(H));for(let M in H)B[M]=W(H[M]);if(hS(H,yS))B[yS]=H[yS];return B}function F(H){if(sN(H))return W(H);else return H}bV6("Patches",{applyPatches_:U,generatePatches_:Y,generateReplacementPatches_:z})}function t8(J){return J}var $X1,yS,$X,rN,kV6,AX1,gS,EX1,mS,mV6=class{constructor(J){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(Q,Z,X)=>{if(typeof Q==="function"&&typeof Z!=="function"){let K=Z;Z=Q;let G=this;return function(z=K,...U){return G.produce(z,(W)=>Z.call(this,W,...U))}}if(typeof Z!=="function")_J(6);if(X!==void 0&&typeof X!=="function")_J(7);let Y;if(yB(Q)){let K=li1(this),G=jX1(Q,void 0),q=!0;try{Y=Z(G),q=!1}finally{if(q)wX1(K);else RX1(K)}return ci1(K,X),ii1(Y,K)}else if(!Q||typeof Q!=="object"){if(Y=Z(Q),Y===void 0)Y=Q;if(Y===$X1)Y=void 0;if(this.autoFreeze_)RQ(Y,!0);if(X){let K=[],G=[];tN("Patches").generateReplacementPatches_(Q,Y,K,G),X(K,G)}return Y}else _J(1,Q)},this.produceWithPatches=(Q,Z)=>{if(typeof Q==="function")return(G,...q)=>this.produceWithPatches(G,(z)=>Q(z,...q));let X,Y;return[this.produce(Q,Z,(G,q)=>{X=G,Y=q}),X,Y]},typeof J?.autoFreeze==="boolean")this.setAutoFreeze(J.autoFreeze);if(typeof J?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy(J.useStrictShallowCopy)}createDraft(J){if(!yB(J))_J(8);if(sN(J))J=uV6(J);let Q=li1(this),Z=jX1(J,void 0);return Z[$X].isManual_=!0,RX1(Q),Z}finishDraft(J,Q){let Z=J&&J[$X];if(!Z||!Z.isManual_)_J(9);let{scope_:X}=Z;return ci1(X,Q),ii1(void 0,X)}setAutoFreeze(J){this.autoFreeze_=J}setUseStrictShallowCopy(J){this.useStrictShallowCopy_=J}applyPatches(J,Q){let Z;for(Z=Q.length-1;Z>=0;Z--){let Y=Q[Z];if(Y.path.length===0&&Y.op==="replace"){J=Y.value;break}}if(Z>-1)Q=Q.slice(Z+1);let X=tN("Patches").applyPatches_;if(sN(J))return X(J,Q);return this.produce(J,(Y)=>X(Y,Q))}},EX,wc,dS,tV9,eV9,ei1,JN9,QN9;var OQ=B1(()=>{$X1=Symbol.for("immer-nothing"),yS=Symbol.for("immer-draftable"),$X=Symbol.for("immer-state");rN=Object.getPrototypeOf;kV6=Object.prototype.constructor.toString();AX1={};EX1={get(J,Q){if(Q===$X)return J;let Z=aN(J);if(!hS(Z,Q))return gV6(J,Z,Q);let X=Z[Q];if(J.finalized_||!yB(X))return X;if(X===VX1(J.base_,Q))return NX1(J),J.copy_[Q]=jX1(X,J);return X},has(J,Q){return Q in aN(J)},ownKeys(J){return Reflect.ownKeys(aN(J))},set(J,Q,Z){let X=oi1(aN(J),Q);if(X?.set)return X.set.call(J.draft_,Z),!0;if(!J.modified_){let Y=VX1(aN(J),Q),K=Y?.[$X];if(K&&K.base_===Z)return J.copy_[Q]=Z,J.assigned_[Q]=!1,!0;if(_V6(Z,Y)&&(Z!==void 0||hS(J.base_,Q)))return!0;NX1(J),OX1(J)}if(J.copy_[Q]===Z&&(Z!==void 0||(Q in J.copy_))||Number.isNaN(Z)&&Number.isNaN(J.copy_[Q]))return!0;return J.copy_[Q]=Z,J.assigned_[Q]=!0,!0},deleteProperty(J,Q){if(VX1(J.base_,Q)!==void 0||Q in J.base_)J.assigned_[Q]=!1,NX1(J),OX1(J);else delete J.assigned_[Q];if(J.copy_)delete J.copy_[Q];return!0},getOwnPropertyDescriptor(J,Q){let Z=aN(J),X=Reflect.getOwnPropertyDescriptor(Z,Q);if(!X)return X;return{writable:!0,configurable:J.type_!==1||Q!=="length",enumerable:X.enumerable,value:Z[Q]}},defineProperty(){_J(11)},getPrototypeOf(J){return rN(J.base_)},setPrototypeOf(){_J(12)}},mS={};fS(EX1,(J,Q)=>{mS[J]=function(){return arguments[0]=arguments[0][0],Q.apply(this,arguments)}});mS.deleteProperty=function(J,Q){return mS.set.call(this,J,Q,void 0)};mS.set=function(J,Q,Z){return EX1.set.call(this,J[0],Q,Z,J[0])};EX=new mV6,wc=EX.produce,dS=EX.produceWithPatches.bind(EX),tV9=EX.setAutoFreeze.bind(EX),eV9=EX.setUseStrictShallowCopy.bind(EX),ei1=EX.applyPatches.bind(EX),JN9=EX.createDraft.bind(EX),QN9=EX.finishDraft.bind(EX)});function IX1({onlyFirst:J=!1}={}){let Z=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(Z,J?void 0:"g")}function cS(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(pV6,"")}var pV6;var PX1=B1(()=>{pV6=IX1()});var Qn1=a((qN9,Jn1)=>{Jn1.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var Rc;var Zn1=B1(()=>{Rc={name:"amp",description:"The frontier coding agent, with a highly capable `smart` mode and a fast `free` mode. ",private:!0,displayName:"Amp (Research Preview)",version:"0.0.0-dev",publisher:"sourcegraph",license:"Apache-2.0",categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["sourcegraph","amp","amp code","ampcode","ai","assistant","llm","Claude","Claude Sonnet 4.5","GPT-5","agent","free","Claude Sonnet"],icon:"./resources/amp-icon.png",scripts:{dev:"pnpm run -s dev:desktop","dev:insiders":"pnpm run -s dev:desktop:insiders","start:dev:desktop":"node scripts/start-dev.js","start:dev:desktop:insiders":"node scripts/start-dev.js --insiders","start:dev:web":"vscode-test-web --extensionDevelopmentPath=. --browserOption=--disable-web-security --verbose --open-devtools --verbose --printServerLog","start:dev:debugger":"pnpm run -s build:dev:desktop && pnpm run -s ./src/autoedit/webview dev","dev:desktop":"pnpm run -s build:dev:desktop && pnpm run start:dev:desktop","dev:desktop:insiders":"pnpm run -s build:dev:desktop && pnpm run start:dev:desktop:insiders","build:dev:desktop":"vite build",build:"pnpm run -s _build:extension && concurrently -n 'debugger,web,review' 'pnpm run -s _build:debugger' 'pnpm run -s _build:web' 'pnpm run -s _build:tab:review'","build:production":"pnpm run -s _build:extension:production && concurrently -n 'debugger,web,review' 'pnpm run -s _build:debugger:production' 'pnpm run -s _build:web:production' 'pnpm run -s _build:tab:review:production'","_build:extension":"vite build","_build:extension:production":"cross-env NODE_ENV=production vite build","_build:web":"pnpm -C ../web run build && cp -R ../web/build dist/web-build","_build:web:production":"pnpm -C ../web run build:production && cp -R ../web/build dist/web-build","_build:debugger":"pnpm -C ./src/autoedit/webview run build && cp -R ./src/autoedit/webview/build dist/autoedit","_build:debugger:production":"cross-env NODE_ENV=production pnpm -C ./src/autoedit/webview run build && cp -R ./src/autoedit/webview/build dist/autoedit","_build:tab:review":"pnpm -C ./src/autoedit/review-panel-webview run build && mkdir -p dist/autoedit && cp -R ./src/autoedit/review-panel-webview/build dist/autoedit/review-panel","_build:tab:review:production":"cross-env NODE_ENV=production pnpm -C ./src/autoedit/review-panel-webview run build && mkdir -p dist/autoedit && cp -R ./src/autoedit/review-panel-webview/build dist/autoedit/review-panel","build:icon-font":"npx -y svgtofont --sources ./icon-font/svg --output ./icon-font/build && cp ./icon-font/build/amp-icons.woff ./resources","dev:forks":"pnpm dev:vsix && cursor --install-extension dist/amp-dev.vsix --force && windsurf --install-extension dist/amp-dev.vsix --force","dev:vsix":"vite build && pnpm run -s _build:web && pnpm run -s _build:debugger && pnpm run -s _build:tab:review && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code --install-extension dist/amp-dev.vsix --force","dev:insiders:vsix":"vite build && pnpm run -s _build:web && pnpm run -s _build:debugger && pnpm run -s _build:tab:review && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code-insiders --install-extension dist/amp-dev.vsix --force",test:"vitest run","test:dev":"vitest"},homepage:"https://ampcode.com",repository:{type:"git",url:"https://github.com/sourcegraph/amp",directory:"vscode"},author:{name:"The Amp Team at Sourcegraph",email:"amp-devs@sourcegraph.com"},engines:{vscode:"^1.79.0",node:">=22.0.0"},main:"./dist/extension.js",activationEvents:["onStartupFinished"],extensionDependencies:["vscode.git"],contributes:{languages:[{id:"jsonc",filenamePatterns:["**/Library/Application Support/ampcode/managed-settings.json","**/etc/ampcode/managed-settings.json","**/ProgramData/ampcode/managed-settings.json"]}],viewsContainers:{activitybar:[{id:"sourcegraph-amp",title:"Amp",icon:"./resources/amp-mark.svg"}]},views:{"sourcegraph-amp":[{type:"webview",id:"amp.sidebarView",name:"Amp",icon:"./resources/amp-mark.svg",visibility:"visible"}]},commands:[{command:"amp.agent.newThread",title:"New Thread",category:"Amp",icon:"$(add)"},{command:"amp.agent.newWindow",title:"New Agent Window",category:"Amp",icon:"$(browser)",enablement:"amp.activated"},{command:"amp.agent.toggleVisibility",title:"Toggle Agent",category:"Amp"},{command:"amp.agent.openReview",title:"Open Amp Review",category:"Amp",icon:"$(compare-changes)",enablement:"amp.activated"},{command:"amp.agent.focusPromptEditor",title:"Focus Prompt Editor",category:"Amp"},{command:"amp.agent.addSelectionToPromptEditor",title:"Add Selection to Prompt",category:"Amp",enablement:"editorHasSelection"},{command:"amp.agent.switchAgentMode",title:"Switch Agent Mode for Current Thread",category:"Amp",enablement:"amp.hasMultipleVisibleModes"},{command:"amp.agent.setPromptFromRecentActions",title:"Create Prompt from Recent Actions",category:"Amp"},{command:"amp.agent.findInThread",title:"Find in Thread",category:"Amp",enablement:"amp.agent.active"},{command:"amp.agent.collapseAllInThread",title:"Collapse All Blocks in Thread",category:"Amp"},{command:"amp.agent.expandAllInThread",title:"Expand All Blocks in Thread",category:"Amp"},{command:"amp.agent.expandToggleInThread",title:"Toggle Expand All Blocks in Thread",category:"Amp"},{command:"amp.agent.toggleThreadSwitcher",title:"Switch to Thread...",category:"Amp",enablement:"amp.agent.active"},{command:"amp.agent.toggleCostDisplay",title:"Toggle Cost Display",category:"Amp"},{command:"amp.agent.navigateThreadPrevious",title:"Navigate to Previous Thread",category:"Amp",enablement:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.navigateThreadNext",title:"Navigate to Next Thread",category:"Amp",enablement:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.openThreadJSON",title:"Open Thread JSON",category:"Amp",enablement:"amp.isDevelopmentMode"},{command:"amp.testThreadSummary",title:"Test Thread Summary",category:"Amp",enablement:"amp.isDevelopmentMode"},{command:"amp.tab.quickPickMenu",title:"Show Tab Menu",category:"Amp",icon:"$(debug)",enablement:"amp.activated"},{command:"amp.tab.showDebugPanel",title:"Show Tab Debug Panel",category:"Amp",icon:"$(debug)",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.showDiff",title:"Tab: Show Diff",category:"Amp",icon:"$(diff)",enablement:"amp.activated && config.amp.tab.enabled && config.amp.tab.experimental.review"},{command:"amp.tab.diffPanel.acceptAll",title:"Tab Review: Accept All Changes",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled && config.amp.tab.experimental.review"},{command:"amp.tab.diffPanel.instruct",title:"Tab Review: Open Instruct Mode",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled && config.amp.tab.experimental.review"},{command:"amp.tab.manualTrigger",title:"Tab Manual Trigger",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.enable",title:"Enable Tab",category:"Amp",enablement:"amp.activated && !config.amp.tab.enabled"},{command:"amp.tab.disable",title:"Disable Tab",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.toggleForCurrentDocument",title:"Toggle Tab for Current Document",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.debugInfo",title:"Open Tab Debug Info",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.autoAcceptChain",title:"Accept Suggestion Chain",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.mcp.restartServers",title:"Restart MCP Servers",category:"Amp"},{command:"amp.agent.editUserPermissions",title:"Edit User Permissions",category:"Amp"},{command:"amp.agent.editWorkspacePermissions",title:"Edit Workspace Permissions",category:"Amp"},{command:"amp.commandPalette.show",title:"Show Amp Command Palette",category:"Amp",icon:"$(list-flat)"}],menus:{"editor/context":[{command:"amp.agent.addSelectionToPromptEditor",when:"editorHasSelection",group:"amp@1"}]},keybindings:[{command:"amp.agent.newThread",key:"ctrl+l",mac:"cmd+l",when:"amp.primaryShortcuts"},{command:"amp.agent.newThread",key:"ctrl+alt+j",mac:"cmd+alt+j",when:"!amp.primaryShortcuts"},{command:"amp.agent.newWindow",key:"ctrl+shift+l",mac:"cmd+shift+l"},{command:"amp.agent.toggleVisibility",key:"ctrl+i",mac:"cmd+i",when:"amp.primaryShortcuts"},{command:"amp.agent.toggleVisibility",key:"ctrl+alt+u",mac:"cmd+alt+u",when:"!amp.primaryShortcuts"},{command:"amp.agent.findInThread",key:"ctrl+f",mac:"cmd+f",when:"amp.agent.active"},{command:"amp.agent.toggleThreadSwitcher",key:"ctrl+k",mac:"cmd+k",when:"amp.agent.active"},{command:"amp.agent.toggleCostDisplay",key:"ctrl+d",mac:"cmd+d",when:"amp.agent.active && amp.isSourcegraphTeammate || isWeb"},{command:"amp.agent.navigateThreadPrevious",key:"ctrl+shift+[",mac:"cmd+shift+[",when:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.navigateThreadNext",key:"ctrl+shift+]",mac:"cmd+shift+]",when:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.savePermissions",key:"ctrl+s",mac:"cmd+s",enablement:"editorTextFocus && resourcePath =~ /[\\\\/]amp[\\\\/]permissions-.*\\.sh$/i",when:"editorTextFocus && resourcePath =~ /[\\\\/]amp[\\\\/]permissions-.*\\.sh$/i"},{command:"amp.tab.diffPanel.acceptAll",key:"ctrl+enter",mac:"cmd+enter",when:"activeWebviewPanelId == 'ampTabDiff'"},{command:"amp.tab.diffPanel.instruct",key:"ctrl+i",mac:"cmd+i",when:"activeWebviewPanelId == 'ampTabDiff'"},{command:"amp.agent.openReview",key:"ctrl+;",mac:"cmd+;"},{command:"-extension.vim_tab",key:"tab",when:"editorTextFocus && vim.active && vim.mode != 'Insert' && !inlineEditIsVisible && !inDebugRepl"},{command:"-vscode-neovim.send",key:"tab",when:"neovim.init && (editorTextFocus && neovim.mode != insert && editorLangId not in neovim.editorLangIdExclusions || neovim.recording)"},{command:"amp.tab.accept",key:"tab",when:"editorTextFocus && amp.activated && amp.tab.active && !amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.showDiff",key:"shift+tab",when:"editorTextFocus && amp.activated && config.amp.tab.experimental.review && (amp.tab.active || inlineSuggestionVisible) && !amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.dismiss",key:"escape",when:"editorTextFocus && amp.activated && amp.tab.active && !amp.nextCursorSuggested && !suggestWidgetVisible && !amp.editorHasMultipleLineSelection"},{command:"amp.nextCursor.accept",key:"tab",when:"editorTextFocus && amp.activated && amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.nextCursor.discard",key:"escape",when:"editorTextFocus && amp.activated && amp.nextCursorSuggested && !suggestWidgetVisible && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.autoAcceptChain",key:"alt+shift+tab",when:"editorTextFocus && amp.activated && (amp.tab.active || amp.nextCursorSuggested) && !amp.editorHasMultipleLineSelection"},{command:"amp.autoImport.accept",key:"tab",when:"editorTextFocus && amp.activated && config.amp.tab.enabled && amp.autoImportSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.autoImport.discard",key:"escape",when:"editorTextFocus && amp.activated && config.amp.tab.enabled && amp.autoImportSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.commandPalette.show",key:"ctrl+shift+a",mac:"cmd+shift+a",when:"amp.activated"}],configuration:{type:"object",title:"Amp",properties:{"amp.url":{type:"string",examples:["https://ampcode.com/"],description:"URL to the Amp server, usually https://ampcode.com/",scope:"application"},"amp.notifications.enabled":{type:"boolean",default:!0,description:"Play notification sound when done or blocked",scope:"window"},"amp.mcpServers":{type:"object",description:"Model Context Protocol servers that expose tools",additionalProperties:{type:"object",oneOf:[{properties:{command:{type:"string"},args:{type:"array",items:{type:"string"}},env:{type:"object",additionalProperties:{type:"string"}}},required:["command"]},{properties:{url:{type:"string"},headers:{type:"object",description:"HTTP headers to send with requests to the MCP server",additionalProperties:{type:"string"}}},required:["url"]}]}},"amp.mcpTrustedServers":{type:"array",markdownDescription:"MCP server trust decisions. **Security Note:** This setting is only read from user settings, never workspace settings, to prevent malicious repositories from auto-approving MCP servers.",scope:"application",items:{type:"object",properties:{serverName:{type:"string",description:"MCP server name"},specHash:{type:"string",description:"Hash of the server configuration"},allow:{type:"boolean",description:"Whether this server is approved"}},required:["serverName","specHash","allow"]}},"amp.workspaces":{type:"array",markdownDescription:"Workspace-level configuration. This setting is only read from user settings, never workspace settings.",scope:"application",items:{type:"object",properties:{path:{type:"string",description:"Absolute path to the workspace"},allowAllMcpServers:{type:"boolean",description:"Whether to automatically trust all MCP servers in this workspace"}},required:["path"]}},"amp.mcpPermissions":{type:"array",description:"Permissions for Model Context Protocol (MCP) servers. Controls which MCP servers can be used.",items:{type:"object",properties:{matches:{$ref:"https://static.ampcode.com/schemas/permissions.schema.json#/$defs/permissionMatchCondition"},action:{type:"string",enum:["allow","reject"],description:"Whether to allow or reject MCP servers matching the condition"}},required:["matches","action"],additionalProperties:!1},default:[],scope:"application"},"amp.permissions":{$ref:"https://static.ampcode.com/schemas/permissions.schema.json",description:"Entries checked in sequence to configure tool permissions",default:[]},"amp.experimental.promptAutocompleteMode":{type:"string",enum:["disabled","word-based","tab"],enumDescriptions:["Disabled - no prompt autocomplete","Offline word completion from workspace and thread context","AI-powered suggestions via Amp Tab"],default:"disabled",markdownDescription:"**Experimental:** Prompt autocomplete suggestions while typing.",scope:"application"},"amp.experimental.tools":{type:"array",description:"Enable experimental tools by name. Available tools: chat_llm",items:{type:"string"},default:[],scope:"application"},"amp.tools.disable":{type:"array",markdownDescription:'Disable specific tools by name. Glob patterns using * are supported\n\nExamples:\n- Disable edit_file: `["builtin:edit_file"]`\n- Disable all playwright tab tools: `["mcp__playwright__browser_tab*"]`',items:{type:"string"},default:[]},"amp.dangerouslyAllowAll":{type:"boolean",description:"If true, never ask for confirmation when running commands",scope:"window",default:!1},"amp.guardedFiles.allowlist":{type:"array",description:"Glob patterns for files that should bypass guarded file protection. Files matching these patterns can be modified without user confirmation.",items:{type:"string"},default:[],scope:"window"},"amp.anthropic.thinking.enabled":{type:"boolean",default:!0,description:"Enable Claude's extended thinking capabilities",scope:"application"},"amp.tools.inactivityTimeout":{type:"number",default:300,minimum:1,maximum:3600,description:"How many seconds of no output to wait before canceling bash commands.",scope:"workspace"},"amp.tools.stopTimeout":{type:"number",default:300,description:"How many seconds to wait before canceling a running tool.",scope:"application"},"amp.terminal.commands.nodeSpawn.loadProfile":{type:"string",enum:["always","never","daily"],default:"always",description:"Before running commands (including MCP servers), whether to load environment variables from the user's profile (.bashrc, .zshrc, .envrc) as visible from the workspace root directory.",scope:"application"},"amp.todos.enabled":{type:"boolean",default:!0,description:"Enable TODOs tracking for managing tasks",scope:"application"},"amp.guidanceFiles.specs":{type:"boolean",default:!1,description:"[Experimental] Read `*.spec.md` files adjacent to `AGENT.md` files that are read",scope:"window"},"amp.security.audit.logMcpConnections":{type:"boolean",default:!1,description:"Enable telemetry logging for remote MCP server connections (for security auditing)",scope:"application"},"amp.hooks":{type:"array",scope:"window",description:"[Experimental] Hooks are event handlers that can react to specific conditions.",items:{type:"object",properties:{compatibilityDate:{type:"string",const:"2025-05-13",default:"2025-05-13",description:"The version of the hook schema that this value was written to conform to"},id:{type:"string",description:"A unique identifier for the hook",examples:["run-vitest-with-env-vars"]},description:{type:"string",description:"A description of the hook"},on:{oneOf:[{type:"object",properties:{event:{type:"string",const:"tool:pre-execute",default:"tool:pre-execute",description:"Trigger when a tool is about to be executed"},tool:{oneOf:[{type:"string",description:"Tool name to match (e.g., 'edit_file')"},{type:"array",items:{type:"string"},description:"Tool names to match"}],description:"Trigger for the given tool name(s)"},"input.contains":{oneOf:[{type:"string",description:"String pattern to match in the tool input"},{type:"array",items:{type:"string"},description:"String patterns to match in the tool input"}],description:"Trigger only when the tool input contains the given literal string or strings"}},required:["event","tool","input.contains"]},{type:"object",properties:{event:{type:"string",const:"tool:post-execute",default:"tool:post-execute",description:"Trigger after a tool has been executed"},tool:{oneOf:[{type:"string",description:"Tool name to match (e.g., 'edit_file')"},{type:"array",items:{type:"string"},description:"Tool names to match"}],description:"Trigger for the given tool name(s)"}},required:["event","tool"]}]},action:{oneOf:[{type:"object",properties:{type:{type:"string",const:"send-user-message",default:"send-user-message",description:"Send a user message to interrupt the agent and cancel the tool call in the `tool:pre-execute` trigger before it starts to run"},message:{type:"string",description:"The text of the message to send"}},required:["type","message"]},{type:"object",properties:{type:{type:"string",const:"redact-tool-input",default:"redact-tool-input",description:"Redact the tool input after execution. Only allowed with `tool:post-execute` event."},redactedInput:{type:"object",description:"The replacement input data to use instead of the original tool input (must be an object)"}},required:["type","redactedInput"]}]},if:{type:"boolean",description:"A condition that determines whether the hook should be executed",default:!0}},required:["compatibilityDate","id","on","action"]},default:[]},"amp.tab.enabled":{type:"boolean",default:!1,description:"Enable Amp Tab",scope:"application"},"amp.tab.verboseLogs":{type:"boolean",default:!1,description:"Enable verbose logging for Amp Tab",scope:"application"},"amp.debugLogs":{type:"boolean",default:!1,description:"Enable debug logging in the Amp output channel",scope:"application"},"amp.tab.disabledLanguages":{type:"array",items:{type:"string"},default:[],examples:["markdown","python"],description:"List of language IDs for which Amp Tab is disabled",scope:"application"},"amp.tab.disableOnComment":{type:"boolean",default:!1,description:"Disable Amp Tab completions on comment lines",scope:"application"},"amp.tab.autoImport.enabled":{type:"boolean",default:!0,description:"Enable auto import in Amp Tab",scope:"application"},"amp.tab.dismissCommandIds":{type:"array",items:{type:"string"},default:["extension.vim_escape","vim.escape","vscode-neovim.escape","vscode-neovim.escapeKey"],description:"Command IDs to run when Escape is pressed to dismiss an Amp Tab suggestion",scope:"application"},"amp.tab.experimental.showHotStreakProgress":{type:"boolean",default:!1,description:"Experimental: Show hot streak progress in image-rendered suggestions",scope:"window"},"amp.tab.experimental.autoAccept.delayMs":{type:"number",default:0,description:"Experimental: Delay in milliseconds before auto-accepting Amp Tab suggestions",scope:"application"},"amp.tab.experimental.unobtrusiveDiffs":{type:"boolean",default:!1,description:"Experimental: Enable unobtrusive diffs mode for Amp Tab suggestions. When enabled, suggestions are shown as image overlays to avoid layout shifts and visual interference with existing code.",scope:"application"},"amp.tab.experimental.review":{type:"boolean",default:!1,description:"Experimental: Enable review mode for Amp Tab. When enabled, adds the ability to review suggestion changes with Shift+Tab shortcut and review panel.",scope:"window"},"amp.tab.diagnosticTracking":{type:"string",enum:["disabled","same_file","multi_file"],default:"multi_file",description:"Enable diagnostic tracking for Amp Tab suggestions. 'disabled' = no tracking, 'same_file' = track diagnostics within the same file, 'multi_file' = track diagnostics across multiple files.",scope:"application"},"amp.tab.hoverDiagnosticSuggestions":{type:"boolean",default:!1,description:"Show suggestions when hovering over diagnostics.",scope:"application"},"amp.tab.experimental.displayMode":{type:"string",enum:["eager","subtle"],default:"eager",description:"Experimental: Control how Amp Tab suggestions are displayed. 'eager' = show diff immediately, 'subtle' = show 'Tab to Jump' first, then show diff after user interaction.",scope:"application"},"amp.tab.experimental.disableClientFilters":{type:"array",items:{type:"string",enum:["recentlyRejectedCodeToRewrite","recentEdits","rewriteAreaOverlap","bigModification","incompatibleWithSelectedCompletionContextItem","recentlyRejectedDiff","whiteSpaceOnlyChange","formattingOnlyChange"]},default:[],description:"Experimental: Disable specific client-side filters to observe unfiltered model behavior.",scope:"application"},"amp.ui.zoomLevel":{type:"number",default:1,description:"Zoom level for the Amp UI",scope:"application"},"amp.experimental.reviewTool":{type:"boolean",default:!1,description:"Experimental: Enable the code review tool.",scope:"application"},"amp.experimental.gitblame":{type:"boolean",default:!1,description:"Experimental: Show git blame authors when editing code.",scope:"application"},"amp.git.commit.coauthor.enabled":{type:"boolean",default:!0,description:"Enable adding Amp as co-author in git commits",scope:"window"},"amp.git.commit.ampThread.enabled":{type:"boolean",default:!0,description:"Enable adding Amp-Thread trailer in git commits",scope:"window"},"amp.gpt5":{type:"boolean",default:!1,description:"[DEPRECATED] GPT-5 is no longer available as the main model. It's now the oracle. See https://ampcode.com/news/gpt-5-oracle",scope:"window",deprecationMessage:"GPT-5 is no longer available as the main model. It's now the oracle. See https://ampcode.com/news/gpt-5-oracle"}}},icons:{"amp-agent-file":{description:"Amp agent file",default:{fontPath:"resources/amp-icons.woff",fontCharacter:"\\0041"}}}},capabilities:{untrustedWorkspaces:{supported:"limited",description:"Amp only uses MCP servers from trusted workspaces because they execute code.",restrictedConfigurations:["amp.mcpServers","amp.mcpPermissions","amp.url"]},virtualWorkspaces:{supported:!1,description:"Amp is not supported in virtual workspaces like GitHub.dev because Amp requires local file system access and terminal capabilities."}},dependencies:{"@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.57.2","@opentelemetry/core":"^1.30.1","@opentelemetry/exporter-logs-otlp-http":"^0.57.2","@opentelemetry/exporter-metrics-otlp-http":"^0.57.2","@opentelemetry/exporter-trace-otlp-http":"^0.57.2","@opentelemetry/resources":"^1.30.1","@opentelemetry/sdk-logs":"^0.57.2","@opentelemetry/sdk-metrics":"^1.30.1","@opentelemetry/sdk-node":"^0.57.2","@opentelemetry/sdk-trace-base":"^1.30.1","@opentelemetry/sdk-trace-node":"^1.30.1","@opentelemetry/semantic-conventions":"^1.34.0","@sourcegraph/amp-core":"workspace:*","@sourcegraph/amp-uri":"workspace:*","@sourcegraph/observable":"workspace:*","canvaskit-wasm":"^0.40.0","detect-indent":"^7.0.1","fast-json-stable-stringify":"^2.1.0","fast-myers-diff":"^3.2.0","fast-xml-parser":"^5.2.3",isbinaryfile:"^5.0.5",lodash:"^4.17.21","lru-cache":"^11.1.0","node-fetch":"^3.3.2",shiki:"3.8.1",systeminformation:"^5.27.7",uuid:"^11.1.0","vscode-languageserver-textdocument":"^1.0.12","wink-nlp-utils":"^2.1.0",ws:"^8.18.3"},devDependencies:{"@sourcegraph/amp-web":"workspace:*","@types/jest-image-snapshot":"^6.4.0","@types/lodash":"^4.17.15","@types/node":"catalog:","@types/uuid":"^10.0.0","@types/vscode":"^1.79.0","@types/ws":"^8.18.1","@vscode/test-electron":"^2.4.1","@vscode/test-web":"*","@vscode/vsce":"^3.2.2","cross-env":"^7.0.3","crypto-browserify":"^3.12.1","jest-image-snapshot":"^6.5.0","os-browserify":"^0.3.0","path-browserify":"^1.0.1","rollup-plugin-polyfill-node":"^0.13.0",tsx:"^4.19.4","vite-plugin-static-copy":"^3.0.0"}}});function cV6(J){return typeof J==="number"&&Number.isInteger(J)&&J>=1&&J<=3600}function Xn1(J){let Q=J.settings["tools.inactivityTimeout"],Z=J.settings["tools.stopTimeout"],X=Q;if(X===void 0&&Z!==void 0)X=Z;if(X===void 0)X=Rc.contributes.configuration.properties["amp.tools.inactivityTimeout"].default;if(!cV6(X))return null;return X*1000}function Yn1(J){let Q=J.settings["tools.stopTimeout"],Z=Rc.contributes.configuration.properties["amp.tools.stopTimeout"].default;return(Q??Z)*1000}var WN9;var TX1=B1(()=>{Zn1();WN9=Rc.contributes.configuration.properties});function Oc(J,Q){return new e1((Z)=>{let X=setTimeout(Y,Q);function Y(){Z.error(Error(`Tool execution timed out after ${Q/1000} seconds`))}function K(){if(X)clearTimeout(X);X=setTimeout(Y,Q)}let G=J.subscribe({next:(q)=>{K(),Z.next(q)},error:(q)=>{if(X)clearTimeout(X),X=null;Z.error(q)},complete:()=>{if(X)clearTimeout(X),X=null;Z.complete()}});return()=>{if(X)clearTimeout(X),X=null;G.unsubscribe()}})}var CX1=B1(()=>{C0()});function I7(J,Q){let Z={name:Q.name,description:Q.description,inputSchema:Q.inputSchema,source:Q.source,meta:Q.meta,customizedForModel:!1},X=Q.modelCustomizations;if(X){for(let Y of X)if(Y.modelSelector.test(J))Z={...Z,name:Y.name??Z.name,description:Y.description??Z.description,inputSchema:Y.inputSchema??Z.inputSchema,customizedForModel:!0}}return Z}function xJ(J){return["done","error","rejected-by-user","cancelled"].includes(J.status)}function qn1(J){return["done","error","cancelled"].includes(J.status)}function IO(J){let Q=[],Z=new b8;function X(K,G){let q=Q.filter((z)=>z.spec.name===K);if(q.length===0&&K==="Glob")q=Q.filter((z)=>z.spec.name==="glob");for(let z of q)if(lS(z.spec,G).enabled)return z;return}function Y(K,G,q){if(!K)throw Error("spec is required");let z={spec:K,fn:Promise.resolve(G),preprocessArgs:q};return Q.push(z),Z.next(),{dispose:()=>{let U=Q.indexOf(z);if(U!==-1)Q.splice(U,1),Z.next()}}}return{registerTool({spec:K,fn:G,preprocessArgs:q}){if(!G)return lV6;return Y(K,G,q)},tools:b9(J.configService.config,Z.pipe(v2(void 0))).pipe(k0(([K])=>{return Q.map((G)=>({spec:G.spec,...lS(G.spec,K)})).sort((G,q)=>G.spec.name.localeCompare(q.spec.name))})),invokeTool(K,G,q){let z=performance.now(),U=()=>iV6.record(performance.now()-z,{toolName:K});if(K===vX1&&G.args&&"invalid_tool_name"in G.args&&typeof G.args.invalid_tool_name==="string"){$c.add(1,{toolName:K,error:"invalid"});let F=SX1(G.args.invalid_tool_name);return new e1((H)=>{H.error(Error(F))})}let W=X(K,q.config);if(!W){let F=Q.filter((V)=>V.spec.name===K);if(F.length===0)return $c.add(1,{toolName:K,error:"not_found"}),new e1((V)=>{V.error(Error(`tool ${JSON.stringify(K)} not found`))});let H=F[0],B=lS(H.spec,q.config);$c.add(1,{toolName:K,error:"disabled"});let M=B.enabled?"unknown":B.disabledReason;return new e1((V)=>{V.error(Error(`tool ${JSON.stringify(K)} is disabled: ${M}`))})}return $c.add(1,{toolName:K}),d6(()=>W.fn).pipe(q8((F)=>{let H=F(G,q);if(W.spec.meta?.disableTimeout)return H;return Oc(H,Yn1(q.config))}),YG(()=>U()))},preprocessArgs(K,G,q){let z=X(K,q.config);if(!z||!z.preprocessArgs)return;let U=z.preprocessArgs;try{return U(G,q)}catch(W){u.error("preprocessArgs",{id:K,args:G,error:String(W)});return}},dispose(){}}}function jc(J,Q){for(let Z of Q){if(Z==="")continue;if(Z.length===1){if(Z==="*")return!0;if(Z===J)return!0;continue}if(J===Z)return!0;if(Z.includes("*")||Z.includes("?")||Z.includes("[")||Z.includes("{"))try{if(Gn1.default(Z,{dot:!0})(J))return!0}catch(X){continue}}return!1}function lS(J,Q){let Z=Q.settings?.["tools.disable"]??[];if(jc(J.name,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"mcp"in J.source){let X=Un1(J.name);if(X&&J.source.mcp===X.server&&jc(X.tool,Z))return{enabled:!1,disabledReason:"settings"}}if(J.source==="builtin"&&jc(`builtin:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"toolbox"in J.source&&jc(`toolbox:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(J.name===QJ||J.name===$B){if(Q.settings?.["todos.enabled"])return{enabled:!0};return{enabled:!1,disabledReason:"feature-flag"}}return{enabled:!0}}function SX1(J){return`Invalid tool name ${JSON.stringify(J)}. Tool names must match the pattern ${iS.toString()}. Try again with a valid tool name.`}function Un1(J){let[,Q,Z]=J.split(/mcp__([^ ]+)__([^ ]+)/);if(Q&&Z)return{server:Q,tool:Z};return}function kX1(J){if(J.status==="in-progress"||J.status==="done"||J.status==="cancelled"||J.status==="error")return J.progress;return}function bJ(J,Q,Z=!0){let X=new Set(Q.map((K)=>K.spec.name));function Y(K){if(X.has(K))return!0;if(K==="Glob"&&X.has("glob"))return!0;if(Z&&Un1(K))return!0;return!1}return{registerTool(K){throw Error("Tools should not be registered in a filtered tool service")},invokeTool(K,G,q){if(!Y(K))return new e1((z)=>{z.error(Error(`tool ${JSON.stringify(K)} not allowed in filtered service`))});return J.invokeTool(K,G,q)},preprocessArgs(K,G,q){if(!Y(K))return;return J.preprocessArgs?.(K,G,q)},tools:J.tools.pipe(k0((K)=>K.filter((G)=>Y(G.spec.name)))),dispose(){}}}var Kn1,Gn1,lV6,vX1="invalid_tool",iS,zn1,$c,iV6;var c2=B1(()=>{C0();G0();TX1();CX1();N8();Kn1=C6(xd(),1),Gn1=C6(mN(),1);lV6={dispose(){}};iS=/^[a-zA-Z0-9_]{1,64}$/,zn1=Kn1.metrics.getMeter("tool_service"),$c=zn1.createCounter("tool_service.invocation_count",{description:"Number of tool invocations"}),iV6=zn1.createHistogram("tool_service.invocation_latency",{description:"Latency of tool invocations",unit:"ms"})});var Mn1=a((Bn1)=>{Object.defineProperty(Bn1,"__esModule",{value:!0});Bn1.calcSlices=Bn1.applyPatch=Bn1.calcPatch=Bn1.lcs=Bn1.diff=Bn1.diff_core=void 0;function nV6(J,Q){let{b:Z,eq:X,stack_base:Y}=J,{i:K,N:G,j:q,M:z,Z:U,stack_top:W}=J;for(;;)switch(Q){case 0:{J:while(G>0&&z>0){Z.fill(0,0,2*U);let F=G-z,H=G+z,B=H&1,M=K+G-1,V=q+z-1,N=(H+B)/2,L;Q:for(let A=0;A<=N;A++){let w=2*Math.max(0,A-z)-A,R=A-2*Math.max(0,A-G);for(let O=w;O<=R;O+=2){let j=Z[O-1-U*Math.floor((O-1)/U)],$=Z[O+1-U*Math.floor((O+1)/U)],E=O===-A||O!==A&&j<$?$:j+1,I=E-O,T=E,S=I;while(T<G&&S<z&&X(K+T,q+S))T++,S++;if(Z[O-U*Math.floor(O/U)]=T,B===1&&(L=F-O)>=1-A&&L<A&&T+Z[U+L-U*Math.floor(L/U)]>=G)if(A>1||T!==E){Y[W++]=K+T,Y[W++]=G-T,Y[W++]=q+S,Y[W++]=z-S,G=E,z=I,U=2*(Math.min(G,z)+1);continue J}else break Q}for(let O=w;O<=R;O+=2){let j=Z[U+O-1-U*Math.floor((O-1)/U)],$=Z[U+O+1-U*Math.floor((O+1)/U)],E=O===-A||O!==A&&j<$?$:j+1,I=E-O,T=E,S=I;while(T<G&&S<z&&X(M-T,V-S))T++,S++;if(Z[U+O-U*Math.floor(O/U)]=T,B===0&&(L=F-O)>=-A&&L<=A&&T+Z[L-U*Math.floor(L/U)]>=G)if(A>0||T!==E){Y[W++]=K+G-E,Y[W++]=E,Y[W++]=q+z-I,Y[W++]=I,G=G-T,z=z-S,U=2*(Math.min(G,z)+1);continue J}else break Q}}if(G===z)continue;if(z>G)K+=G,q+=G,z-=G,G=0;else K+=z,q+=z,G-=z,z=0;break}if(G+z!==0)if(J.pxe===K||J.pye===q)J.pxe=K+G,J.pye=q+z;else{let F=J.pxs;if(J.oxs=J.pxs,J.oxe=J.pxe,J.oys=J.pys,J.oye=J.pye,J.pxs=K,J.pxe=K+G,J.pys=q,J.pye=q+z,F>=0)return J.i=K,J.N=G,J.j=q,J.M=z,J.Z=U,J.stack_top=W,1}}case 1:{if(W===0)return 2;z=Y[--W],q=Y[--W],G=Y[--W],K=Y[--W],U=2*(Math.min(G,z)+1),Q=0}}}class Wn1{constructor(J){this.state=J,this.c=0,this.result={value:null,done:!1}}[Symbol.iterator](){return this}next(){let{state:J,result:Q}=this;if(this.c>1)return Q.done=!0,Q.value=void 0,Q;let Z=nV6(J,this.c);if(this.c=Z,Z===1)return Q.value=[J.oxs,J.oxe,J.oys,J.oye],Q;if(J.pxs>=0)return Q.value=[J.pxs,J.pxe,J.pys,J.pye],Q;return Q.done=!0,Q.value=void 0,Q}}function Fn1(J,Q,Z,X,Y){let K=(Math.min(Q,X)+1)*2,G=Q+X,q=new(G<256?Uint8Array:G<65536?Uint16Array:Uint32Array)(2*K);return new Wn1({i:J,N:Q,j:Z,M:X,Z:K,b:q,eq:Y,pxs:-1,pxe:-1,pys:-1,pye:-1,oxs:-1,oxe:-1,oys:-1,oye:-1,stack_top:0,stack_base:[]})}Bn1.diff_core=Fn1;function Ec(J,Q,Z){let[X,Y,K]=[0,J.length,Q.length];if(typeof Z==="function"){while(X<Y&&X<K&&Z(X,X))X++;if(X===Y&&X===K)return[][Symbol.iterator]();while(Z(--Y,--K)&&Y>X&&K>X);}else{while(X<Y&&X<K&&J[X]===Q[X])X++;if(X===Y&&X===K)return[][Symbol.iterator]();while(J[--Y]===Q[--K]&&Y>X&&K>X);Z=(G,q)=>J[G]===Q[q]}return Fn1(X,Y+1-X,X,K+1-X,Z)}Bn1.diff=Ec;class Hn1{constructor(J,Q){this.diff=J,this.N=Q,this.i=0,this.j=0}[Symbol.iterator](){return this}next(){let J=this.diff.next();if(J.done){let{i:q,j:z,N:U}=this;if(q<U)J.done=!1,J.value=[q,z,U-q],this.i=U;return J}let Q=J.value,Z=Q[0],X=Q[1],Y=Q[3],{i:K,j:G}=this;if(K!==Z)Q.length--,Q[0]=K,Q[1]=G,Q[2]=Z-K;return this.i=X,this.j=Y,J}}function aV6(J,Q,Z){return new Hn1(Ec(J,Q,Z),J.length)}Bn1.lcs=aV6;function*rV6(J,Q,Z){let X=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let Y of Ec(J,Q,Z))Y[2]=X.call(Q,Y[2],Y[3]),yield Y}Bn1.calcPatch=rV6;function*sV6(J,Q){let Z=0,X=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[Y,K,G]of Q){if(Z<Y)yield X.call(J,Z,Y);if(G.length>0)yield G;Z=K}if(Z<J.length)yield X.call(J,Z)}Bn1.applyPatch=sV6;function*oV6(J,Q,Z){let X=0,Y=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[K,G,q,z]of Ec(J,Q,Z)){if(X<K)yield[0,Y.call(J,X,K)];if(K<G)yield[-1,Y.call(J,K,G)];if(q<z)yield[1,Y.call(Q,q,z)];X=G}if(X<J.length)yield[0,J.slice(X)]}Bn1.calcSlices=oV6});function Ic(J,Q){if(J===void 0||Q===void 0||J===Q)return{added:0,deleted:0,changed:0};let Z={added:0,deleted:0,changed:0};for(let[X,Y,K,G]of Vn1.diff(J.split(`
4
4
  `),Q.split(`
5
5
  `)))Z.deleted+=Y-X,Z.added+=G-K,Z.changed+=Math.min(Y-X,G-K);return Z}function Nn1(J){return{added:J?.split(`
6
6
  `).length??0,deleted:0,changed:0}}function _X1(J){if(!J)return{totalFiles:0,createdFiles:0,totalAdded:0,totalRemoved:0,totalModified:0,revertedFiles:0,allReverted:!1};let Q=J.files.length,Z=J.files.filter((z)=>z.created).length,X=J.files.filter((z)=>z.reverted).length,Y=X===Q&&Q>0,K=0,G=0,q=0;for(let z of J.files){if(z.reverted)continue;K+=z.diffStat.added,G+=z.diffStat.removed,q+=z.diffStat.modified}return{totalFiles:Q,createdFiles:Z,totalAdded:K,totalRemoved:G,totalModified:q,revertedFiles:X,allReverted:Y}}var Vn1;var Pc=B1(()=>{Vn1=C6(Mn1(),1)});function Kz(){return`T-${crypto.randomUUID()}`}function AW(J){if(!J.startsWith("T-"))return!1;let Q=J.slice(2);return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(Q)}function PO(){return`toolu_${crypto.randomUUID()}`}function Ln1(J){return J.startsWith("toolu_")||J.startsWith("call_")}function An1(J){for(let Q=J.messages.length-1;Q>=0;Q--){let Z=J.messages[Q];if(Z?.role==="info"){let X=Z.content[0];if(X?.type==="summary"&&X?.summary.type==="message")return}if(Z?.role==="assistant"&&Z.usage)return Z.usage}return J["~debug"]?.lastInferenceUsage}function IX(J,Q){for(let Z of J.messages){if(Z.role!=="assistant")continue;for(let X of Z.content)if(X.type==="tool_use"&&X.id===Q)return X}return}function TO(J,Q){for(let[Z,X]of J.messages.entries()){if(X.role!=="assistant")continue;for(let[Y,K]of X.content.entries())if(K.type==="tool_use"&&K.id===Q)return{message:X,messageIndex:Z,block:K,blockIndex:Y}}return null}function eN(J,Q){for(let Z of J.messages){if(Z.role!=="user")continue;for(let X of Z.content)if(X.type==="tool_result"&&X.toolUseID===Q)return X}return}function jQ(J){return J.messages.filter((Q)=>Q.role==="user").flatMap((Q)=>Q.content).filter((Q)=>Q.type==="tool_result").reduce((Q,Z)=>{return Q.set(Z.toolUseID,Z),Q},new Map)}function xX1(J){if(J&&typeof J==="object"&&"threadID"in J){let Q=J.threadID;if(typeof Q==="string"&&AW(Q))return Q}return}function bX1(J){let Q=[],Z=new Map;for(let X of J)if(X.role==="assistant"){for(let Y of X.content)if(Y.type==="tool_use"&&Y.name===e5)Z.set(Y.id,Y)}else if(X.role==="user"){for(let Y of X.content)if(Y.type==="tool_result"){let K=Z.get(Y.toolUseID);if(K){let G=Y.run,q=(G.status==="in-progress"||G.status==="cancelled"||G.status==="done"||G.status==="error")&&G.progress?xX1(G.progress):void 0;if(q)Q.push({toolUseID:Y.toolUseID,threadID:q,toolUse:K,toolResult:Y})}}}return Q}function wn1(J){if(!J)return!1;if(J.role==="assistant")return J.state?.type==="cancelled";if(J.role==="user")return J.content.some((Q)=>Q.type==="tool_result"&&Q.run.status==="cancelled");return!1}function Rn1(J){if(!J)return!1;if(J.role==="user")return J.content.some((Q)=>Q.type==="tool_result"&&Q.run.status==="rejected-by-user");return!1}function yX1(J){if(!J)return!1;return J.role==="info"}function XN6(J){return J.replace(/u([0-9A-Fa-f]{4})(\s)/gi,(Q,Z,X)=>{try{return String.fromCodePoint(parseInt(Z,16))+X}catch{return`u${Z}${X}`}})}function Tc(J){for(let Q=J.messages.length-1;Q>=0;Q--){let Z=J.messages[Q];if(Z?.role==="info"){if(Z.content.some((Y)=>Y.type==="summary"&&Y.summary.type==="message"))break}if(Z?.role!=="assistant"||!Z.state||Z.state.type!=="complete"||Z.state.stopReason!=="tool_use")continue;for(let X of Z.content)if(X.type==="tool_use"&&X.name===QJ&&X.input){let Y=X.input.todos;if(Array.isArray(Y))return Y;let K=X.input.content;if(typeof K==="string")return XN6(K)}}return}function s7(J){return J.map((Q)=>Q.type==="text"?Q.text:null).filter((Q)=>Q!==null).join(`
@@ -5906,11 +5906,11 @@ Actual: ${Y}`)}async function e79(J,Q,Z){let{execSync:X}=await import("node:ch
5906
5906
  ${B}`;if(Y==="pnpm"&&B.includes("Unable to find the global bin directory"))M+=`
5907
5907
 
5908
5908
  Hint: Try running "pnpm setup" to configure pnpm global directory, or use npm instead:
5909
- npm install -g @sourcegraph/amp`;q(Error(M))}},error:(H)=>{if(!W)W=!0,q(Error(`Failed to spawn ${Y}: ${H.message}`))},complete:()=>{if(!W)W=!0,G()}})})}G0();G0();async function y51(J){try{let Z=new AbortController,X=setTimeout(()=>Z.abort(),5000),Y=await fetch("https://registry.npmjs.org/@sourcegraph/amp",{signal:Z.signal});if(clearTimeout(X),!Y.ok)return{hasUpdate:!1,currentVersion:J,source:"npm"};let K=await Y.json(),G=K["dist-tags"]?.latest;if(!G)return{hasUpdate:!1,currentVersion:J,source:"npm"};let q=Y59(J,G),z=q<0,U,W;if(K.time){let F=K.time[J],H=K.time[G],B=Date.now();if(F)U=Math.floor((B-new Date(F).getTime())/3600000);if(H)W=Math.floor((B-new Date(H).getTime())/3600000)}return u.info("NPM version comparison",{currentVersion:J,latestVersion:G,compareResult:q,hasUpdate:z,currentVersionAge:U,latestVersionAge:W}),{hasUpdate:z,latestVersion:G,currentVersion:J,currentVersionAge:U,latestVersionAge:W,source:"npm"}}catch(Z){return u.debug("Error checking npm version",{error:Z}),{hasUpdate:!1,currentVersion:J,source:"npm"}}}function Y59(J,Q){let Z=(G)=>{let[q,z]=G.split("-");return{parts:q?.split(".").map(Number)||[],label:z}},X=Z(J),Y=Z(Q),K=Math.max(X.parts.length,Y.parts.length);for(let G=0;G<K;G++){let q=X.parts[G]||0,z=Y.parts[G]||0;if(q<z)return-1;if(q>z)return 1}if(X.label===Y.label)return 0;if(!X.label&&Y.label)return 1;if(X.label&&!Y.label)return-1;if(X.label&&Y.label)return X.label<Y.label?-1:1;return 0}C0();function Zf1(J,Q){let Z=new b8,X=Z.pipe(M9({shouldCountRefs:!1}));return setImmediate(async()=>{let Y=new rq().scoped("update"),K=X.subscribe({next:(G)=>{Y.debug("emit new state",G)}});try{let G=process.env.AMP_TEST_UPDATE_STATUS;if(G){Y.debug("using fake update status for testing",{status:G}),await E_(500),Z.next(G);return}if(process.env.AMP_SKIP_UPDATE_CHECK==="1"){Y.debug("checking disabled via AMP_SKIP_UPDATE_CHECK environment variable");return}let q=await Q.get("updates.mode");if(q==="disabled"){Y.debug("checking disabled");return}Y.debug("checking",{currentVersion:J,mode:q});let z=await y51(J);if(!(z.latestVersion&&z.hasUpdate)){Y.debug("no update available");return}let U=await b51();if(!q)q=U==="pnpm"?"warn":"auto",Y.debug("no configured update mode; selected default based on package manager",{packageManager:U,mode:q});if(q==="warn"){Z.next("update-available");return}if(!U){Y.debug("auto-update not supported, falling back to warn mode"),Z.next("update-available");return}try{await Zp(z.latestVersion,U);let W=await eV(z.latestVersion),F={from:z.currentVersion,to:z.latestVersion,...W};if(W.status==="same")Y.info("success",F),Z.next("updated");else Y.warn("success with warning",F),Z.next("updated-with-warning")}catch(W){Z.next("update-error")}}catch(G){Y.debug("check failed",{error:G})}finally{await E_(5000),Z.next("hidden"),K.unsubscribe(),Z.complete()}}),{state:X}}import{stderr as JW}from"node:process";function iZ6(J){let Q=new Bu().name("install").description("Install required tools like ripgrep to $AMP_HOME/bin").option("--force","Force reinstallation even if already installed").option("--verbose","Show installation progress and results").action(async(X)=>{await ey1(X.force||!1,X.verbose||!1,"0.0.1761436902-g59a6f7"),process.exit()});J.addCommand(Q,{hidden:!0});let Z=new Bu("update").summary("Update Amp CLI").description("Update Amp CLI to the latest version. You can specify a particular version to install, or leave blank to get the latest stable release.").option("--version <version>","Update to a specific version").allowUnknownOption(!1).action(async(X)=>{await K59(X.version)});J.addCommand(Z)}async function K59(J){if(process.env.AMP_SKIP_UPDATE_CHECK==="1")JW.write(z8.yellow(`Note: AMP_SKIP_UPDATE_CHECK=1 is set, which disables automatic update checking. Manual updates will still work.
5909
+ npm install -g @sourcegraph/amp`;q(Error(M))}},error:(H)=>{if(!W)W=!0,q(Error(`Failed to spawn ${Y}: ${H.message}`))},complete:()=>{if(!W)W=!0,G()}})})}G0();G0();async function y51(J){try{let Z=new AbortController,X=setTimeout(()=>Z.abort(),5000),Y=await fetch("https://registry.npmjs.org/@sourcegraph/amp",{signal:Z.signal});if(clearTimeout(X),!Y.ok)return{hasUpdate:!1,currentVersion:J,source:"npm"};let K=await Y.json(),G=K["dist-tags"]?.latest;if(!G)return{hasUpdate:!1,currentVersion:J,source:"npm"};let q=Y59(J,G),z=q<0,U,W;if(K.time){let F=K.time[J],H=K.time[G],B=Date.now();if(F)U=Math.floor((B-new Date(F).getTime())/3600000);if(H)W=Math.floor((B-new Date(H).getTime())/3600000)}return u.info("NPM version comparison",{currentVersion:J,latestVersion:G,compareResult:q,hasUpdate:z,currentVersionAge:U,latestVersionAge:W}),{hasUpdate:z,latestVersion:G,currentVersion:J,currentVersionAge:U,latestVersionAge:W,source:"npm"}}catch(Z){return u.debug("Error checking npm version",{error:Z}),{hasUpdate:!1,currentVersion:J,source:"npm"}}}function Y59(J,Q){let Z=(G)=>{let[q,z]=G.split("-");return{parts:q?.split(".").map(Number)||[],label:z}},X=Z(J),Y=Z(Q),K=Math.max(X.parts.length,Y.parts.length);for(let G=0;G<K;G++){let q=X.parts[G]||0,z=Y.parts[G]||0;if(q<z)return-1;if(q>z)return 1}if(X.label===Y.label)return 0;if(!X.label&&Y.label)return 1;if(X.label&&!Y.label)return-1;if(X.label&&Y.label)return X.label<Y.label?-1:1;return 0}C0();function Zf1(J,Q){let Z=new b8,X=Z.pipe(M9({shouldCountRefs:!1}));return setImmediate(async()=>{let Y=new rq().scoped("update"),K=X.subscribe({next:(G)=>{Y.debug("emit new state",G)}});try{let G=process.env.AMP_TEST_UPDATE_STATUS;if(G){Y.debug("using fake update status for testing",{status:G}),await E_(500),Z.next(G);return}if(process.env.AMP_SKIP_UPDATE_CHECK==="1"){Y.debug("checking disabled via AMP_SKIP_UPDATE_CHECK environment variable");return}let q=await Q.get("updates.mode");if(q==="disabled"){Y.debug("checking disabled");return}Y.debug("checking",{currentVersion:J,mode:q});let z=await y51(J);if(!(z.latestVersion&&z.hasUpdate)){Y.debug("no update available");return}let U=await b51();if(!q)q=U==="pnpm"?"warn":"auto",Y.debug("no configured update mode; selected default based on package manager",{packageManager:U,mode:q});if(q==="warn"){Z.next("update-available");return}if(!U){Y.debug("auto-update not supported, falling back to warn mode"),Z.next("update-available");return}try{await Zp(z.latestVersion,U);let W=await eV(z.latestVersion),F={from:z.currentVersion,to:z.latestVersion,...W};if(W.status==="same")Y.info("success",F),Z.next("updated");else Y.warn("success with warning",F),Z.next("updated-with-warning")}catch(W){Z.next("update-error")}}catch(G){Y.debug("check failed",{error:G})}finally{await E_(5000),Z.next("hidden"),K.unsubscribe(),Z.complete()}}),{state:X}}import{stderr as JW}from"node:process";function iZ6(J){let Q=new Bu().name("install").description("Install required tools like ripgrep to $AMP_HOME/bin").option("--force","Force reinstallation even if already installed").option("--verbose","Show installation progress and results").action(async(X)=>{await ey1(X.force||!1,X.verbose||!1,"0.0.1761458743-ge8ce60"),process.exit()});J.addCommand(Q,{hidden:!0});let Z=new Bu("update").summary("Update Amp CLI").description("Update Amp CLI to the latest version. You can specify a particular version to install, or leave blank to get the latest stable release.").option("--version <version>","Update to a specific version").allowUnknownOption(!1).action(async(X)=>{await K59(X.version)});J.addCommand(Z)}async function K59(J){if(process.env.AMP_SKIP_UPDATE_CHECK==="1")JW.write(z8.yellow(`Note: AMP_SKIP_UPDATE_CHECK=1 is set, which disables automatic update checking. Manual updates will still work.
5910
5910
 
5911
5911
  `));try{if(!J){JW.write(z8.blue(`Checking for updates...
5912
- `));let{hasUpdate:Z,latestVersion:X}=await y51("0.0.1761436902-g59a6f7");if(!Z){JW.write(z8.green(`✓ Amp CLI is already up to date.
5913
- `));let Y=await eV("0.0.1761436902-g59a6f7");if(Y.warning)JW.write(`
5912
+ `));let{hasUpdate:Z,latestVersion:X}=await y51("0.0.1761458743-ge8ce60");if(!Z){JW.write(z8.green(`✓ Amp CLI is already up to date.
5913
+ `));let Y=await eV("0.0.1761458743-ge8ce60");if(Y.warning)JW.write(`
5914
5914
  `+z8.yellow(Y.warning)+`
5915
5915
  `);process.exit(0)}if(!X)JW.write(z8.yellow("[WARN] could not find latest version")),process.exit(0);J=X}JW.write(z8.blue(`Updating to version ${J}...
5916
5916
  `)),await Zp(J,void 0,(Z)=>{JW.write(z8.dim(`Running: ${Z}
@@ -6282,7 +6282,7 @@ See https://ampcode.com/manual#toolboxes`);return Q[0]||ZO}function vX6(J,Q){let
6282
6282
  `);J.command("use").argument("<tool-name>","The tool to invoke").summary("Invoke a tool with arguments or JSON input from stdin").description(Z).option("--only <field>","Extract only the specified field from the result").allowUnknownOption(!0).allowExcessArguments(!0).action(async function(X,Y,K){let G=K.optsWithGlobals(),q=await Q(K,G),z=0;await q.mcpService.initialized;let U=K.args.slice(1),W;if(CX6()){let F=[];for await(let H of process.stdin)F.push(H);W=Buffer.concat(F).toString("utf-8").trim()}await PX6({toolName:X,rawArgs:U,stdinInput:W,only:Y.only,threadDeps:q,stdout:process.stdout,stderr:process.stderr,exit:(F)=>{z=F}}),await q.asyncDispose(),q.cleanupTerminal(),process.exit(z)})}import{randomBytes as PH9}from"node:crypto";import{homedir as TH9}from"node:os";import Md from"node:path";C0();G0();var kX6=120000,_X6=180000;function Uf1(J,Q=Date.now()){return Q-J<_X6}function Wf1(J,Q,Z=()=>!0,X){let Y=null,K=[],G=5;return hd(kX6).pipe(v2(void 0),q8(()=>d6(async(q)=>{if(!Z())return u.debug("[Ads] Skipping ad fetch (user inactive or ad already fetched)"),Y;let z=await X?.getContext();u.debug("[Ads] Fetching ad from server",{hasContext:!!z});let U=await J.getCurrentAd({context:z,excludeAdIds:K},{config:Q,signal:q});if(!U.ok)throw u.error("[Ads] Failed to fetch ad",{error:U.error.message}),Error(U.error.message);if(U.result){if(Y=U.result,K.length>=G)K.shift();K.push(Y.id),u.debug("[Ads] Received ad from server",{adTitle:Y.title,matchType:Y.matchType,matchedPatterns:Y.matchedPatterns,candidateAdPoolCount:Y.candidateAdPoolCount,recentlyShownCount:K.length})}else u.debug("[Ads] No ad available from server");return Y})),J8((q,z)=>q?.id===z?.id))}G0();lj();W2();JD();M2();$L();N8();b6();function xX6(J){let Q=J.trim();if(Q==="quit"||Q==="exit")return"/quit";return J}function bX6(J,Q,Z){if(J.agentMode)return J.agentMode;if(Q?.agentMode){let X=Q.agentMode;if(X==="free"){if(Z?.canUseAmpFree??!1)return"free";return"smart"}return X}return"smart"}G0();JD();import kJ9 from"node:fs";import yX6 from"node:path";function fX6(J){let Q=J.trim().replace(/^["']|["']$/g,"");if(Q=Q.replace(/\\(.)/g,"$1"),!/\.(png|jpe?g|gif|webp)$/i.test(Q))return null;if(!yX6.isAbsolute(Q))return null;return u.debug("Extracted image path",{original:J,extracted:Q}),Q}function hX6(J){try{let Q=yX6.extname(J).toLowerCase(),Z=M10(Q);if(!Z)return u.warn("Unsupported image file extension",{ext:Q}),null;try{let X=kJ9.readFileSync(J);return _J9(X,Z)}catch(X){u.error(`Failed to read image file ${J}:`,X)}}catch(Q){u.error("Error handling image file path",{imagePath:J,error:Q})}return null}function _J9(J,Q){if(J.length>_W)return u.warn(`Image file too large: ${J.length} bytes (max: ${_W})`),null;return{type:"image",source:{type:"base64",data:J.toString("base64"),mediaType:Q}}}import{execSync as PK9}from"node:child_process";Fj();G0();import{spawn as xJ9}from"node:child_process";import{promises as bJ9}from"node:fs";function gX6(J){return J.kind==="executable"}function mX6(J){return J.kind==="markdown"}var JB=50000,uX6=300000;async function Gp(J,Q,Z,X={}){let{timeoutMs:Y=uX6,signal:K}=X;try{let G=await Z.getCommand(J);if(!G)return{success:!1,output:"",error:`Command '${J}' not found`};if(!await Z.isCommandAvailable(J))return{success:!1,output:"",error:`Command '${J}' is not available for execution`};if(u.debug("Executing command",{commandName:J,filePath:G.filePath,args:Q}),mX6(G))return await yJ9(G,Q);else if(gX6(G))return await fJ9(G,Q,Y,K);else return{success:!1,output:"",error:"Unsupported command type"}}catch(G){return u.error("Failed to execute command",{commandName:J,error:G}),{success:!1,output:"",error:G instanceof Error?G.message:"Unknown error occurred"}}}async function yJ9(J,Q){try{if(Q.length>0)return{success:!1,output:"",error:"Markdown commands do not accept arguments"};let Z=await bJ9.readFile(J.filePath,"utf8");return{success:!0,output:(Z.length>JB?Z.slice(0,JB)+`
6283
6283
  ... (output truncated at ${JB} characters)`:Z).trim(),exitCode:0}}catch(Z){return{success:!1,output:"",error:Z instanceof Error?Z.message:"Failed to read markdown file"}}}async function fJ9(J,Q,Z=uX6,X){return new Promise((Y)=>{let[K,G]=hJ9(J,Q);u.debug("Spawning command",{spawnCommand:K,spawnArgs:G.slice(0,10),filePath:J.filePath,timeoutMs:Z});let q=z10(X),z=!1,U=setTimeout(()=>{z=!0,q.abort(),u.warn("Command execution timed out",{commandName:J.name,timeoutMs:Z})},Z),W=xJ9(K,G,{stdio:["pipe","pipe","pipe"],signal:q.signal,detached:!0}),F=[],H=[],B=0;W.stdout?.on("data",(M)=>{let V=M.toString();if(B+=V.length,B<=JB)F.push(V);else{let N=JB-(B-V.length);if(N>0)F.push(V.slice(0,N))}}),W.stderr?.on("data",(M)=>{let V=M.toString();if(B+=V.length,B<=JB)H.push(V);else{let N=JB-(B-V.length);if(N>0)H.push(V.slice(0,N))}}),W.on("close",(M)=>{if(clearTimeout(U),z){Y({success:!1,output:F.join(""),error:`Command timed out after ${Z}ms`,exitCode:void 0});return}if(q.signal.aborted){Y({success:!1,output:F.join(""),error:"The command was aborted",exitCode:M??void 0});return}let V=M===0||M===1,N=F.join(""),L=H.join(""),A=N;if(!V&&!N.trim()&&L.trim())A=L;else if(L.trim())A+=N?`
6284
6284
  ${L}`:L;if(B>JB)A+=`
6285
- ... (output truncated at ${JB} characters)`;Y({success:V,output:A.trim(),error:!V?L.trim()||"Command failed":void 0,exitCode:M??void 0})}),W.on("error",(M)=>{clearTimeout(U);let V=M.message;if(z)V=`Command timed out after ${Z}ms`;else if(M.message.includes("operation was aborted")||M.name==="AbortError")V="The command was aborted";Y({success:!1,output:F.join(""),error:V})})})}function hJ9(J,Q){let{filePath:Z,interpreter:X,extension:Y}=J;if(process.platform==="win32")return mJ9(Z,X?[...X]:null,Y,Q);else return gJ9(Z,X?[...X]:null,Y,Q)}function gJ9(J,Q,Z,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];else return[J,X]}function mJ9(J,Q,Z,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];switch(Z.toLowerCase()){case".bat":case".cmd":return["cmd.exe",["/c",J,...X]];case".ps1":return["powershell.exe",["-ExecutionPolicy","Bypass","-File",J,...X]];case".exe":return[J,X];default:return[J,X]}}G0();lj();W2();bB();fX();Oz();b6();C0();var d51={};R6(d51,{scrollUp:()=>GQ9,scrollDown:()=>qQ9,link:()=>BQ9,image:()=>DQ9,iTerm:()=>MQ9,exitAlternativeScreen:()=>FQ9,eraseUp:()=>KQ9,eraseStartLine:()=>XQ9,eraseScreen:()=>Ff1,eraseLines:()=>QQ9,eraseLine:()=>lX6,eraseEndLine:()=>ZQ9,eraseDown:()=>YQ9,enterAlternativeScreen:()=>WQ9,cursorUp:()=>dX6,cursorTo:()=>dJ9,cursorShow:()=>JQ9,cursorSavePosition:()=>aJ9,cursorRestorePosition:()=>rJ9,cursorPrevLine:()=>tJ9,cursorNextLine:()=>oJ9,cursorMove:()=>cJ9,cursorLeft:()=>cX6,cursorHide:()=>eJ9,cursorGetPosition:()=>sJ9,cursorForward:()=>iJ9,cursorDown:()=>lJ9,cursorBackward:()=>nJ9,clearTerminal:()=>UQ9,clearScreen:()=>zQ9,beep:()=>HQ9});import Hf1 from"node:process";var p51=globalThis.window?.document!==void 0,gw2=globalThis.process?.versions?.node!==void 0,mw2=globalThis.process?.versions?.bun!==void 0,uw2=globalThis.Deno?.version?.deno!==void 0,pw2=globalThis.process?.versions?.electron!==void 0,dw2=globalThis.navigator?.userAgent?.includes("jsdom")===!0,cw2=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,lw2=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,iw2=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,nw2=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,qp=globalThis.navigator?.userAgentData?.platform,aw2=qp==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",rw2=qp==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",sw2=qp==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",ow2=qp==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),tw2=qp==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var j2="\x1B[",Up="\x1B]",IC="\x07",zp=";",pX6=!p51&&Hf1.env.TERM_PROGRAM==="Apple_Terminal",uJ9=!p51&&Hf1.platform==="win32",pJ9=p51?()=>{throw Error("`process.cwd()` only works in Node.js, not the browser.")}:Hf1.cwd,dJ9=(J,Q)=>{if(typeof J!=="number")throw TypeError("The `x` argument is required");if(typeof Q!=="number")return j2+(J+1)+"G";return j2+(Q+1)+zp+(J+1)+"H"},cJ9=(J,Q)=>{if(typeof J!=="number")throw TypeError("The `x` argument is required");let Z="";if(J<0)Z+=j2+-J+"D";else if(J>0)Z+=j2+J+"C";if(Q<0)Z+=j2+-Q+"A";else if(Q>0)Z+=j2+Q+"B";return Z},dX6=(J=1)=>j2+J+"A",lJ9=(J=1)=>j2+J+"B",iJ9=(J=1)=>j2+J+"C",nJ9=(J=1)=>j2+J+"D",cX6=j2+"G",aJ9=pX6?"\x1B7":j2+"s",rJ9=pX6?"\x1B8":j2+"u",sJ9=j2+"6n",oJ9=j2+"E",tJ9=j2+"F",eJ9=j2+"?25l",JQ9=j2+"?25h",QQ9=(J)=>{let Q="";for(let Z=0;Z<J;Z++)Q+=lX6+(Z<J-1?dX6():"");if(J)Q+=cX6;return Q},ZQ9=j2+"K",XQ9=j2+"1K",lX6=j2+"2K",YQ9=j2+"J",KQ9=j2+"1J",Ff1=j2+"2J",GQ9=j2+"S",qQ9=j2+"T",zQ9="\x1Bc",UQ9=uJ9?`${Ff1}${j2}0f`:`${Ff1}${j2}3J${j2}H`,WQ9=j2+"?1049h",FQ9=j2+"?1049l",HQ9=IC,BQ9=(J,Q)=>[Up,"8",zp,zp,Q,IC,J,Up,"8",zp,zp,IC].join(""),DQ9=(J,Q={})=>{let Z=`${Up}1337;File=inline=1`;if(Q.width)Z+=`;width=${Q.width}`;if(Q.height)Z+=`;height=${Q.height}`;if(Q.preserveAspectRatio===!1)Z+=";preserveAspectRatio=0";return Z+":"+Buffer.from(J).toString("base64")+IC},MQ9={setCwd:(J=pJ9())=>`${Up}50;CurrentDir=${J}${IC}`,annotation(J,Q={}){let Z=`${Up}1337;`,X=Q.x!==void 0,Y=Q.y!==void 0;if((X||Y)&&!(X&&Y&&Q.length!==void 0))throw Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");if(J=J.replaceAll("|",""),Z+=Q.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",Q.length>0)Z+=(X?[J,Q.length,Q.x,Q.y]:[Q.length,J]).join("|");else Z+=J;return Z+IC}};var c51=C6(tX6(),1);function ZN(J,Q,{target:Z="stdout",...X}={}){if(!c51.default[Z]){if(X.fallback===!1)return J;return typeof X.fallback==="function"?X.fallback(J,Q):`${J} (​${Q}​)`}return d51.link(J,Q)}ZN.isSupported=c51.default.stdout;ZN.stderr=(J,Q,Z={})=>ZN(J,Q,{target:"stderr",...Z});ZN.stderr.isSupported=c51.default.stderr;G0();fX();class Wp{enabled;configService;commandCounts=new Map;timer=null;bufferTimeMs=1e4;constructor(J,Q){this.enabled=J;this.configService=Q;this.startTimer()}startTimer(){this.timer=setInterval(()=>{this.flushEvents()},this.bufferTimeMs)}async flushEvents(){if(this.commandCounts.size===0||!await this.enabled())return;let J=Array.from(this.commandCounts.entries()).map(([Q,Z])=>({feature:"cli.command",action:Q,source:{client:"cli",clientVersion:"0.0.1761436902-g59a6f7"},parameters:{metadata:{count:Z}},timestamp:Date.now()*1000}));this.commandCounts.clear();try{let Q=JSON.stringify(J);await Ea(Q,this.configService)}catch(Q){u.error("Failed to export command telemetry events",Q)}}async submit(J){if(!await this.enabled()||this.timer===null)return;let Q=this.commandCounts.get(J)||0;this.commandCounts.set(J,Q+1)}async dispose(){if(await this.flushEvents(),this.timer!==null)clearInterval(this.timer),this.timer=null}}import{execFile as i51}from"node:child_process";import{platform as Nf1}from"node:os";import{promisify as AQ9}from"node:util";var l51=AQ9(i51),wQ9=(J)=>`\x1B]52;c;${J}\x1B\\`,RQ9="\x1B]52;c;?\x1B\\",OQ9="\x1B]52;p;?\x1B\\";class eX6{capabilities=null;pendingReadPromise=null;readResolve=null;readTimeout=null;setCapabilities(J){this.capabilities=J}isOsc52Supported(){return this.capabilities?.osc52??!1}async commandExists(J){try{return await l51("which",[J]),!0}catch{return!1}}async writeToPbcopy(J){try{let Q=i51("pbcopy");return Q.stdin?.write(J),Q.stdin?.end(),await new Promise((Z,X)=>{Q.on("close",(Y)=>{if(Y===0)Z();else X(Error(`pbcopy exited with code ${Y}`))})}),!0}catch{return!1}}async writeToWlCopy(J){try{let Q=i51("wl-copy");return Q.stdin?.write(J),Q.stdin?.end(),await new Promise((Z,X)=>{Q.on("close",(Y)=>{if(Y===0)Z();else X(Error(`wl-copy exited with code ${Y}`))})}),!0}catch{return!1}}async writeToXclip(J){try{let Q=i51("xclip",["-selection","clipboard"]);return Q.stdin?.write(J),Q.stdin?.end(),await new Promise((Z,X)=>{Q.on("close",(Y)=>{if(Y===0)Z();else X(Error(`xclip exited with code ${Y}`))})}),!0}catch{return!1}}async readFromOSC52WithQuery(J){if(!this.isOsc52Supported())return null;if(this.pendingReadPromise)return this.pendingReadPromise;this.pendingReadPromise=new Promise((Z)=>{this.readResolve=Z,this.readTimeout=setTimeout(()=>{this.readResolve=null,this.pendingReadPromise=null,Z(null)},2000),process.stdout.write(J)});let Q=await this.pendingReadPromise;return this.pendingReadPromise=null,Q}async readFromOSC52(){return this.readFromOSC52WithQuery(RQ9)}handleOSC52Response(J){if(this.readResolve&&this.readTimeout){clearTimeout(this.readTimeout),this.readTimeout=null;try{let Q=Buffer.from(J,"base64").toString("utf8");this.readResolve(Q)}catch{this.readResolve(null)}this.readResolve=null,this.pendingReadPromise=null}}async readFromPbpaste(){try{let{stdout:J}=await l51("pbpaste");return J}catch{return null}}async readFromWlPaste(J){try{let Q=["--no-newline"];if(J==="primary")Q.push("--primary");let{stdout:Z}=await l51("wl-paste",Q);return Z}catch{return null}}async readFromXclip(J){try{let{stdout:Q}=await l51("xclip",["-selection",J,"-o"]);return Q}catch{return null}}async readFromOSC52Primary(){return this.readFromOSC52WithQuery(OQ9)}async readText(){if(this.isOsc52Supported()){let Q=await this.readFromOSC52();if(Q!==null)return Q}if(Nf1()==="darwin"){let Q=await this.readFromPbpaste();if(Q!==null)return Q}else{if(await this.commandExists("wl-paste")){let Q=await this.readFromWlPaste("clipboard");if(Q!==null)return Q}if(await this.commandExists("xclip")){let Q=await this.readFromXclip("clipboard");if(Q!==null)return Q}}return null}async readPrimarySelection(){if(Nf1()==="darwin")return this.readText();if(this.isOsc52Supported()){let Q=await this.readFromOSC52Primary();if(Q!==null)return Q}if(await this.commandExists("wl-paste")){let Q=await this.readFromWlPaste("primary");if(Q!==null)return Q}if(await this.commandExists("xclip")){let Q=await this.readFromXclip("primary");if(Q!==null)return Q}return null}async writeText(J){if(this.isOsc52Supported()){let Z=Buffer.from(J).toString("base64"),X=wQ9(Z);process.stdout.write(X);return}if(Nf1()==="darwin"){if(await this.writeToPbcopy(J))return}else{if(await this.commandExists("wl-copy")&&await this.writeToWlCopy(J))return;if(await this.commandExists("xclip")&&await this.writeToXclip(J))return}}}var NY=new eX6;G0();class e9{message;name;constructor(J){this.message=J;this.name="InformationMessage"}}function n51(J){if(J instanceof e9)return{title:"Info",description:J.message,type:"info"};return u.warn("Unknown error type encountered",{name:J.name,message:J.message,stack:J.stack}),{title:"Error",description:J.message||"An unexpected error occurred.",type:"error"}}var UN=null,TK9={connect:{name:"connect",description:"Connect CLI to web interface for current thread access",execute:async(J,Q)=>{try{if(UN)return Error("Already connected. Use /disconnect first to reconnect.");let{connectedClientsService:Z}=J;await Z.start({clientId:J.clientId,currentThreadID:J.worker.thread.id});let Y=Z.getCurrentStatus().clientID||"unknown",{connectBackground:K}=await Promise.resolve().then(() => (V51(),Ty1)),G=await K({worker:J.worker},J.configService,{clientId:J.clientId,onUserDisconnect:()=>{UN=null,Z.sendStatus({connected:!1,enabled:!1,errorMessage:"Disconnected by user via web interface"})}});UN=G,G.promise.then(()=>{Z.sendStatus({connected:!0,errorMessage:void 0})}).catch((M)=>{UN=null,Z.sendStatus({connected:!1,errorMessage:M.message})});let z=(await J.configService.getLatest()).settings.url,U=J.worker.thread.id,W=new URL(`/threads/${U}`,z).toString(),F=new URL("/clients",z).toString(),H="";try{H=await(await Promise.resolve().then(() => C6(Rp(),1))).toString(W,{type:"utf8",margin:2,color:{dark:"#000000",light:"#FFFFFF"}})}catch(M){u.error("Failed to generate QR code:",M)}if((process.stdout.rows||24)>=30&&H&&J.onShowQRCodeOverlay)J.onShowQRCodeOverlay({url:F,qrCode:H});else return new e9(`Continue at ${F}`)}catch(Z){return J.connectedClientsService.sendStatus({connected:!1,errorMessage:Z.message}),Error(`Failed to start connection: ${Z.message}`)}}},disconnect:{name:"disconnect",description:"Disconnect from web interface",execute:async(J,Q)=>{if(!UN)return new e9("Not connected to Amp web interface");try{UN.disconnect();let Z=UN.clientID;return UN=null,J.connectedClientsService.sendStatus({connected:!1,enabled:!1,errorMessage:void 0}),new e9(`Disconnected from Amp web interface
6285
+ ... (output truncated at ${JB} characters)`;Y({success:V,output:A.trim(),error:!V?L.trim()||"Command failed":void 0,exitCode:M??void 0})}),W.on("error",(M)=>{clearTimeout(U);let V=M.message;if(z)V=`Command timed out after ${Z}ms`;else if(M.message.includes("operation was aborted")||M.name==="AbortError")V="The command was aborted";Y({success:!1,output:F.join(""),error:V})})})}function hJ9(J,Q){let{filePath:Z,interpreter:X,extension:Y}=J;if(process.platform==="win32")return mJ9(Z,X?[...X]:null,Y,Q);else return gJ9(Z,X?[...X]:null,Y,Q)}function gJ9(J,Q,Z,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];else return[J,X]}function mJ9(J,Q,Z,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];switch(Z.toLowerCase()){case".bat":case".cmd":return["cmd.exe",["/c",J,...X]];case".ps1":return["powershell.exe",["-ExecutionPolicy","Bypass","-File",J,...X]];case".exe":return[J,X];default:return[J,X]}}G0();lj();W2();bB();fX();Oz();b6();C0();var d51={};R6(d51,{scrollUp:()=>GQ9,scrollDown:()=>qQ9,link:()=>BQ9,image:()=>DQ9,iTerm:()=>MQ9,exitAlternativeScreen:()=>FQ9,eraseUp:()=>KQ9,eraseStartLine:()=>XQ9,eraseScreen:()=>Ff1,eraseLines:()=>QQ9,eraseLine:()=>lX6,eraseEndLine:()=>ZQ9,eraseDown:()=>YQ9,enterAlternativeScreen:()=>WQ9,cursorUp:()=>dX6,cursorTo:()=>dJ9,cursorShow:()=>JQ9,cursorSavePosition:()=>aJ9,cursorRestorePosition:()=>rJ9,cursorPrevLine:()=>tJ9,cursorNextLine:()=>oJ9,cursorMove:()=>cJ9,cursorLeft:()=>cX6,cursorHide:()=>eJ9,cursorGetPosition:()=>sJ9,cursorForward:()=>iJ9,cursorDown:()=>lJ9,cursorBackward:()=>nJ9,clearTerminal:()=>UQ9,clearScreen:()=>zQ9,beep:()=>HQ9});import Hf1 from"node:process";var p51=globalThis.window?.document!==void 0,gw2=globalThis.process?.versions?.node!==void 0,mw2=globalThis.process?.versions?.bun!==void 0,uw2=globalThis.Deno?.version?.deno!==void 0,pw2=globalThis.process?.versions?.electron!==void 0,dw2=globalThis.navigator?.userAgent?.includes("jsdom")===!0,cw2=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,lw2=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,iw2=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,nw2=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,qp=globalThis.navigator?.userAgentData?.platform,aw2=qp==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",rw2=qp==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",sw2=qp==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",ow2=qp==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),tw2=qp==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var j2="\x1B[",Up="\x1B]",IC="\x07",zp=";",pX6=!p51&&Hf1.env.TERM_PROGRAM==="Apple_Terminal",uJ9=!p51&&Hf1.platform==="win32",pJ9=p51?()=>{throw Error("`process.cwd()` only works in Node.js, not the browser.")}:Hf1.cwd,dJ9=(J,Q)=>{if(typeof J!=="number")throw TypeError("The `x` argument is required");if(typeof Q!=="number")return j2+(J+1)+"G";return j2+(Q+1)+zp+(J+1)+"H"},cJ9=(J,Q)=>{if(typeof J!=="number")throw TypeError("The `x` argument is required");let Z="";if(J<0)Z+=j2+-J+"D";else if(J>0)Z+=j2+J+"C";if(Q<0)Z+=j2+-Q+"A";else if(Q>0)Z+=j2+Q+"B";return Z},dX6=(J=1)=>j2+J+"A",lJ9=(J=1)=>j2+J+"B",iJ9=(J=1)=>j2+J+"C",nJ9=(J=1)=>j2+J+"D",cX6=j2+"G",aJ9=pX6?"\x1B7":j2+"s",rJ9=pX6?"\x1B8":j2+"u",sJ9=j2+"6n",oJ9=j2+"E",tJ9=j2+"F",eJ9=j2+"?25l",JQ9=j2+"?25h",QQ9=(J)=>{let Q="";for(let Z=0;Z<J;Z++)Q+=lX6+(Z<J-1?dX6():"");if(J)Q+=cX6;return Q},ZQ9=j2+"K",XQ9=j2+"1K",lX6=j2+"2K",YQ9=j2+"J",KQ9=j2+"1J",Ff1=j2+"2J",GQ9=j2+"S",qQ9=j2+"T",zQ9="\x1Bc",UQ9=uJ9?`${Ff1}${j2}0f`:`${Ff1}${j2}3J${j2}H`,WQ9=j2+"?1049h",FQ9=j2+"?1049l",HQ9=IC,BQ9=(J,Q)=>[Up,"8",zp,zp,Q,IC,J,Up,"8",zp,zp,IC].join(""),DQ9=(J,Q={})=>{let Z=`${Up}1337;File=inline=1`;if(Q.width)Z+=`;width=${Q.width}`;if(Q.height)Z+=`;height=${Q.height}`;if(Q.preserveAspectRatio===!1)Z+=";preserveAspectRatio=0";return Z+":"+Buffer.from(J).toString("base64")+IC},MQ9={setCwd:(J=pJ9())=>`${Up}50;CurrentDir=${J}${IC}`,annotation(J,Q={}){let Z=`${Up}1337;`,X=Q.x!==void 0,Y=Q.y!==void 0;if((X||Y)&&!(X&&Y&&Q.length!==void 0))throw Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");if(J=J.replaceAll("|",""),Z+=Q.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",Q.length>0)Z+=(X?[J,Q.length,Q.x,Q.y]:[Q.length,J]).join("|");else Z+=J;return Z+IC}};var c51=C6(tX6(),1);function ZN(J,Q,{target:Z="stdout",...X}={}){if(!c51.default[Z]){if(X.fallback===!1)return J;return typeof X.fallback==="function"?X.fallback(J,Q):`${J} (​${Q}​)`}return d51.link(J,Q)}ZN.isSupported=c51.default.stdout;ZN.stderr=(J,Q,Z={})=>ZN(J,Q,{target:"stderr",...Z});ZN.stderr.isSupported=c51.default.stderr;G0();fX();class Wp{enabled;configService;commandCounts=new Map;timer=null;bufferTimeMs=1e4;constructor(J,Q){this.enabled=J;this.configService=Q;this.startTimer()}startTimer(){this.timer=setInterval(()=>{this.flushEvents()},this.bufferTimeMs)}async flushEvents(){if(this.commandCounts.size===0||!await this.enabled())return;let J=Array.from(this.commandCounts.entries()).map(([Q,Z])=>({feature:"cli.command",action:Q,source:{client:"cli",clientVersion:"0.0.1761458743-ge8ce60"},parameters:{metadata:{count:Z}},timestamp:Date.now()*1000}));this.commandCounts.clear();try{let Q=JSON.stringify(J);await Ea(Q,this.configService)}catch(Q){u.error("Failed to export command telemetry events",Q)}}async submit(J){if(!await this.enabled()||this.timer===null)return;let Q=this.commandCounts.get(J)||0;this.commandCounts.set(J,Q+1)}async dispose(){if(await this.flushEvents(),this.timer!==null)clearInterval(this.timer),this.timer=null}}import{execFile as i51}from"node:child_process";import{platform as Nf1}from"node:os";import{promisify as AQ9}from"node:util";var l51=AQ9(i51),wQ9=(J)=>`\x1B]52;c;${J}\x1B\\`,RQ9="\x1B]52;c;?\x1B\\",OQ9="\x1B]52;p;?\x1B\\";class eX6{capabilities=null;pendingReadPromise=null;readResolve=null;readTimeout=null;setCapabilities(J){this.capabilities=J}isOsc52Supported(){return this.capabilities?.osc52??!1}async commandExists(J){try{return await l51("which",[J]),!0}catch{return!1}}async writeToPbcopy(J){try{let Q=i51("pbcopy");return Q.stdin?.write(J),Q.stdin?.end(),await new Promise((Z,X)=>{Q.on("close",(Y)=>{if(Y===0)Z();else X(Error(`pbcopy exited with code ${Y}`))})}),!0}catch{return!1}}async writeToWlCopy(J){try{let Q=i51("wl-copy");return Q.stdin?.write(J),Q.stdin?.end(),await new Promise((Z,X)=>{Q.on("close",(Y)=>{if(Y===0)Z();else X(Error(`wl-copy exited with code ${Y}`))})}),!0}catch{return!1}}async writeToXclip(J){try{let Q=i51("xclip",["-selection","clipboard"]);return Q.stdin?.write(J),Q.stdin?.end(),await new Promise((Z,X)=>{Q.on("close",(Y)=>{if(Y===0)Z();else X(Error(`xclip exited with code ${Y}`))})}),!0}catch{return!1}}async readFromOSC52WithQuery(J){if(!this.isOsc52Supported())return null;if(this.pendingReadPromise)return this.pendingReadPromise;this.pendingReadPromise=new Promise((Z)=>{this.readResolve=Z,this.readTimeout=setTimeout(()=>{this.readResolve=null,this.pendingReadPromise=null,Z(null)},2000),process.stdout.write(J)});let Q=await this.pendingReadPromise;return this.pendingReadPromise=null,Q}async readFromOSC52(){return this.readFromOSC52WithQuery(RQ9)}handleOSC52Response(J){if(this.readResolve&&this.readTimeout){clearTimeout(this.readTimeout),this.readTimeout=null;try{let Q=Buffer.from(J,"base64").toString("utf8");this.readResolve(Q)}catch{this.readResolve(null)}this.readResolve=null,this.pendingReadPromise=null}}async readFromPbpaste(){try{let{stdout:J}=await l51("pbpaste");return J}catch{return null}}async readFromWlPaste(J){try{let Q=["--no-newline"];if(J==="primary")Q.push("--primary");let{stdout:Z}=await l51("wl-paste",Q);return Z}catch{return null}}async readFromXclip(J){try{let{stdout:Q}=await l51("xclip",["-selection",J,"-o"]);return Q}catch{return null}}async readFromOSC52Primary(){return this.readFromOSC52WithQuery(OQ9)}async readText(){if(this.isOsc52Supported()){let Q=await this.readFromOSC52();if(Q!==null)return Q}if(Nf1()==="darwin"){let Q=await this.readFromPbpaste();if(Q!==null)return Q}else{if(await this.commandExists("wl-paste")){let Q=await this.readFromWlPaste("clipboard");if(Q!==null)return Q}if(await this.commandExists("xclip")){let Q=await this.readFromXclip("clipboard");if(Q!==null)return Q}}return null}async readPrimarySelection(){if(Nf1()==="darwin")return this.readText();if(this.isOsc52Supported()){let Q=await this.readFromOSC52Primary();if(Q!==null)return Q}if(await this.commandExists("wl-paste")){let Q=await this.readFromWlPaste("primary");if(Q!==null)return Q}if(await this.commandExists("xclip")){let Q=await this.readFromXclip("primary");if(Q!==null)return Q}return null}async writeText(J){if(this.isOsc52Supported()){let Z=Buffer.from(J).toString("base64"),X=wQ9(Z);process.stdout.write(X);return}if(Nf1()==="darwin"){if(await this.writeToPbcopy(J))return}else{if(await this.commandExists("wl-copy")&&await this.writeToWlCopy(J))return;if(await this.commandExists("xclip")&&await this.writeToXclip(J))return}}}var NY=new eX6;G0();class e9{message;name;constructor(J){this.message=J;this.name="InformationMessage"}}function n51(J){if(J instanceof e9)return{title:"Info",description:J.message,type:"info"};return u.warn("Unknown error type encountered",{name:J.name,message:J.message,stack:J.stack}),{title:"Error",description:J.message||"An unexpected error occurred.",type:"error"}}var UN=null,TK9={connect:{name:"connect",description:"Connect CLI to web interface for current thread access",execute:async(J,Q)=>{try{if(UN)return Error("Already connected. Use /disconnect first to reconnect.");let{connectedClientsService:Z}=J;await Z.start({clientId:J.clientId,currentThreadID:J.worker.thread.id});let Y=Z.getCurrentStatus().clientID||"unknown",{connectBackground:K}=await Promise.resolve().then(() => (V51(),Ty1)),G=await K({worker:J.worker},J.configService,{clientId:J.clientId,onUserDisconnect:()=>{UN=null,Z.sendStatus({connected:!1,enabled:!1,errorMessage:"Disconnected by user via web interface"})}});UN=G,G.promise.then(()=>{Z.sendStatus({connected:!0,errorMessage:void 0})}).catch((M)=>{UN=null,Z.sendStatus({connected:!1,errorMessage:M.message})});let z=(await J.configService.getLatest()).settings.url,U=J.worker.thread.id,W=new URL(`/threads/${U}`,z).toString(),F=new URL("/clients",z).toString(),H="";try{H=await(await Promise.resolve().then(() => C6(Rp(),1))).toString(W,{type:"utf8",margin:2,color:{dark:"#000000",light:"#FFFFFF"}})}catch(M){u.error("Failed to generate QR code:",M)}if((process.stdout.rows||24)>=30&&H&&J.onShowQRCodeOverlay)J.onShowQRCodeOverlay({url:F,qrCode:H});else return new e9(`Continue at ${F}`)}catch(Z){return J.connectedClientsService.sendStatus({connected:!1,errorMessage:Z.message}),Error(`Failed to start connection: ${Z.message}`)}}},disconnect:{name:"disconnect",description:"Disconnect from web interface",execute:async(J,Q)=>{if(!UN)return new e9("Not connected to Amp web interface");try{UN.disconnect();let Z=UN.clientID;return UN=null,J.connectedClientsService.sendStatus({connected:!1,enabled:!1,errorMessage:void 0}),new e9(`Disconnected from Amp web interface
6286
6286
  Client ID: ${Z}
6287
6287
  Server will clean up automatically within 60 seconds`)}catch(Z){return Error(`Failed to disconnect: ${Z.message}`)}}}};class Fh1{configService;commands;customRegistry;latestCustom=[];telemetrySubmitter;constructor(J=AS(),Q){this.configService=Q;this.customRegistry=J,this._initBaseCommands(!1),this.customRegistry.commands.subscribe((Z)=>this.latestCustom=Z),this.telemetrySubmitter=new Wp(async()=>{try{return(await this.configService.getLatest()).settings["experimental.cli.commandTelemetry.enabled"]===!0}catch{return!1}},this.configService),this.configService.config.pipe(k0((Z)=>EY(Z.settings)),J8()).subscribe((Z)=>{this._initBaseCommands(Z.length>1)})}_initBaseCommands(J){if(this.commands={...CK9},process.env.AMP_CONNECT==="1")Object.assign(this.commands,TK9);if(J)Object.assign(this.commands,SK9)}async execute(J,Q,Z=[],X){this.telemetrySubmitter.submit(J).catch((q)=>{u.debug("Failed to submit command telemetry",q)});let Y=this.commands[J];if(Y)return Y.execute(Q,Z);let K=this.latestCustom.find((q)=>q.name===J),G=await Gp(J,Z,this.customRegistry,{signal:X});if(G.success)if(K?.kind==="markdown"){Q.editorDispatch({type:"set-input",input:G.output});return}else{Q.submitMessage(G.output);return}return Error(G.error??`Command '${J}' failed`)}query(J,Q,Z){let X=Object.values(this.commands).filter((K)=>{if(!Q||!K.isVisible)return!0;return K.isVisible(Q,Z)}),Y=this.latestCustom.filter((K)=>K.available).map((K)=>({name:K.name,description:"Custom command",requiresArgs:K.kind==="executable",execute:(G,q)=>this.execute(K.name,G,q??[])}));return[...X,...Y]}async cleanup(){await this.telemetrySubmitter.dispose()}get(J){let Q=this.commands[J];if(Q)return Q;let Z=this.latestCustom.find((X)=>X.name===J);return{name:J,description:"Custom command",requiresArgs:Z?.kind==="executable",execute:(X,Y)=>this.execute(J,X,Y??[])}}getCustomCommand(J){return this.latestCustom.find((Q)=>Q.name===J)}}var CK9={"generate-agent-file":{name:"generate-agent-file",description:`Generate an ${_5} file in the current workspace`,execute:async(J,Q)=>{let Z=await J.configService.getLatest(),X=kQ(Z.settings),K=J.getInMemoryAgentModeOverride()??X;J.worker.handle({type:"user:message",message:{content:[{type:"text",text:Pa}],agentMode:K}});return}},editor:{name:"editor",description:"Open $EDITOR to write a prompt",launchesWindow:!0,execute:async(J,Q)=>{return J.openInEditor("")}},help:{name:"help",description:"Show help and hotkeys",execute:async(J,Q)=>{J.openHelp();return}},permissions:{name:"permissions",description:"Edit permission rules in $EDITOR, or `/permissions off|on` to toggle for this session",launchesWindow:!0,execute:async(J,Q)=>{if(Q&&Q.length>0){let Y=Q[0]?.trim().toLowerCase();switch(Y){case"on":try{return BZ("dangerouslyAllowAll",!1),new e9("Amp is now following permissions rules for this session")}catch(K){return u.error("Failed to set dangerously allow all setting",K),Error("Failed to enable permissions for this session")}case"off":try{return BZ("dangerouslyAllowAll",!0),new e9("Permissions disabled for this session - you will NOT be asked for confirmation before Amp runs a command.")}catch(K){return u.error("Failed to set dangerously allow all setting",K),Error("Failed to disable permissions for this session")}case"edit":break;default:return Error(`Invalid option: ${Y}. Use: on, off, or edit (or no argument for edit)`)}}let Z=await QW();if(Z===null)return Error("No editor found, please set $EDITOR to edit permissions");let X="";try{let Y={stdin:process.stdin,stdout:process.stdout,stderr:{write:(K)=>{return X=K.toString(),!0}},exit:(K)=>{if(K!==0)throw u.error("editPermissions exited with status",K),Error(X)},settingsFile:J.settingsFilePath,resolveEditor:QW};await $C(Y);return}catch(Y){u.error("failed to open permissions editor:",Y);let K=Y instanceof Error?`: ${Y.message}`:"";return Error(`Failed to open ${Z}${K}`)}finally{process.stdout.write("\x1B[?25l")}}},new:{name:"new",description:"Start a new thread",execute:async(J,Q)=>{try{await J.startNewThread();return}catch(Z){return u.error("Failed to start new thread",Z),Error("Failed to start new thread")}},isVisible:(J)=>J.messages.length!==0},handoff:{name:"handoff",description:"Draft a new thread with relevant context from current thread: /handoff <your goal>",requiresArgs:!0,execute:async()=>{return},isVisible:(J)=>J.messages.length!==0},continue:{name:"continue",description:"Continue an existing thread",requiresArgs:!1,requiresPicker:!0,execute:async(J,Q)=>{try{if(Q&&Q.length>0){let Z=Q[0]?.trim();if(!Z)return Error("Invalid thread ID provided");return await J.switchToThread(Z),new e9(`Switched to existing thread: ${Z}`)}await J.pickAndContinueThread();return}catch(Z){return u.error("Failed to continue thread",Z),Error("Failed to continue thread")}}},queue:{name:"queue",description:"Queue a message to send when inference completes. If no inference running, sends immediately.",requiresArgs:!0,execute:async(J,Q)=>{if(!Q||Q.length===0)return Error("Queue command requires a message argument. Usage: /queue <message>");let X=[{type:"text",text:Q.join(" ").trim()}],Y=J.takeImageAttachments?.()??[];if(Y.length>0)X.push(...Y);J.worker.handle({type:"user:message-queue:enqueue",message:{content:X}})}},dequeue:{name:"dequeue",description:"Dequeue all messages and restore them to the prompt editor",execute:async(J,Q)=>{let Z=J.thread.queuedMessages??[];if(Z.length===0)return;let Y=Z.map((K)=>{return K.queuedMessage.content.filter((q)=>q.type==="text").map((q)=>q.text).join("").trim()}).filter(Boolean).join(`
6288
6288
  `).trim();await J.worker.handle({type:"user:message-queue:discard"}),J.editorDispatch({type:"set-input",input:Y})},isVisible:(J)=>(J.queuedMessages?.length??0)>0},share:{name:"share",description:"Set thread visibility - `/share private|workspace|group|public`",execute:async(J,Q)=>{let{thread:Z,threadSyncService:X,ampURL:Y}=J;if(!Q||Q.length===0)return Error("Please specify a visibility option: private, workspace, group, or public");let K=nW(new URL(Y),Z.id).toString(),q=`Thread URL: ${ZN(K,K,{fallback:()=>K})}`,z=Q[0]?.trim().toLowerCase(),U;switch(z){case"private":U={visibility:"private",sharedGroupIDs:[]};break;case"workspace":U={visibility:"thread_workspace_shared"};break;case"group":U={visibility:"private",sharedGroupIDs:[],shareWithAllCreatorGroups:!0};break;case"public":U={visibility:"public"};break;default:return Error(`Invalid visibility option: ${z}. Use: private, workspace, group, or public`)}try{return await X.updateThreadMeta(Z.id,U),new e9(`${q}
@@ -6497,7 +6497,7 @@ https://www.jetbrains.com/help/idea/managing-plugins.html#install_plugin_from_di
6497
6497
  `),J.stdout.write(`Thread: ${H}
6498
6498
  `),J.stdout.write(`Continue this thread with: amp threads continue ${W}
6499
6499
  `)}}function Jp1(J){return J==="smart"?E1.rgb(3,197,97):J==="free"?E1.rgb(0,184,255):SH9(J)}function SH9(J){let Q=0;for(let Y=0;Y<J.length;Y++){let K=J.charCodeAt(Y);Q=(Q<<5)-Q+K,Q=Q&Q}let Z=[9,10,11,12,13,14,15,208,209,210,211,212,213,214,215],X=Math.abs(Q)%Z.length;return E1.index(Z[X])}Sh1();if(process.env.AMP_PWD)try{process.chdir(process.env.AMP_PWD),delete process.env.AMP_PWD}catch(J){QG.write(`Failed to change directory to ${process.env.AMP_PWD}: ${J}
6500
- `)}var Zp1=Qp1.join(Tl1||Qp1.join(process.env.HOME||process.cwd(),".local","state"),"amp","last-thread-id");function bH9(J){process.emitWarning=function(Q,Z,X,Y){let K=typeof Q==="string"?Q:Q.message||String(Q),G=Z||"Warning",q=!1;J.warn(K,{name:G,code:X})}}function cq(J,Q){if(J.getOptionValueSourceWithGlobals("dangerouslyAllowAll")==="cli")BZ("dangerouslyAllowAll",Q.dangerouslyAllowAll);if(J.getOptionValueSourceWithGlobals("tryGpt5")==="cli")throw new c9("The --try-gpt5 flag has been removed.",1,`GPT-5 is now available as the oracle. Read why: ${z8.blue("https://ampcode.com/news/gpt-5-oracle")}`);if(J.getOptionValueSourceWithGlobals("agentMode")==="cli")BZ("experimental.agentMode",Q.agentMode)}async function Yp1(J){try{await kH9(Qp1.dirname(Zp1),{recursive:!0}),await _H9(Zp1,J,"utf-8")}catch(Q){u.debug("Failed to save last thread ID",Q)}}async function yH9(){try{return(await OF6(Zp1,"utf-8")).trim()}catch(J){return null}}function fH9(J,Q){return{...J,async get(Z){if(Z==="mcpServers"){let X=await J.get(Z);return PS("mcpServers",{global:X,workspace:Q})}return J.get(Z)},async keys(){let Z=await J.keys();if(!Z.includes("mcpServers"))Z.push("mcpServers");return Z},[Symbol.dispose](){J[Symbol.dispose]()}}}var AF6=[{name:"notifications",long:"notifications",type:"flag",description:(J)=>`${J?"Enable":"Disable"} sound notifications (enabled by default when not in execute mode)`},{name:"color",long:"color",type:"flag",description:(J)=>`${J?"Enable":"Disable"} color output (enabled by default if stdout and stderr are sent to a TTY)`,deprecated:!0},{name:"settingsFile",long:"settings-file",type:"option",default:process.env.AMP_SETTINGS_FILE??DX,description:`Custom settings file path (overrides the default location ${DX})`},{name:"logLevel",long:"log-level",type:"option",description:`Set log level (${Object.keys(u).join(", ")})`},{name:"logFile",long:"log-file",type:"option",description:`Set log file location (overrides the default location ${Ly1})`},{name:"format",long:"format",type:"option",description:"output using the standard or new-ui. Options: `ui`, `new-ui`",choices:["ui","jsonl","new-ui"],hidden:!0,deprecated:!0},{name:"dangerouslyAllowAll",long:"dangerously-allow-all",type:"switch",default:!1,description:"Disable all command confirmation prompts (agent will execute all commands without asking)"},{name:"jetbrains",long:"jetbrains",type:"flag",default:nK(),description:(J)=>J?"Enable JetBrains integration. When enabled, Amp automatically includes your open JetBrains file and text selection with every message.":"Disable JetBrains integration."},{name:"ide",long:"ide",type:"flag",default:!0,description:(J)=>J?"Enable IDE connection (default). When enabled, Amp automatically includes your open IDE's file and text selection with every message.":"Disable IDE connection."},{name:"interactive",long:"interactive",type:"flag",description:(J)=>J?"Enable interactive mode. This will enable the interactive UI.":"Disable interactive mode. This will disable the interactive UI.",hidden:!0,deprecated:!0},{name:"mcpConfig",long:"mcp-config",type:"option",description:"JSON configuration or file path for MCP servers to merge with existing settings"},{name:"tryGpt5",long:"try-gpt5",type:"switch",default:!1,description:"[DEPRECATED] Try GPT-5 as the primary agent model (see https://ampcode.com/news/gpt-5-oracle)",deprecated:!0},{name:"agentMode",long:"agent-mode",type:"option",description:"Set the experimental agent mode configuration",hidden:!0,choices:GO}],wF6=(J)=>("deprecated"in J)&&J.deprecated===!0,hH9=(J)=>("hidden"in J)&&J.hidden===!0,gH9=(J)=>("default"in J),mH9=(J)=>("default"in J)?J.default:void 0;function uH9(J,Q){let Z=Q.args[0],X=Q.commands.map((K)=>K.name());if(Z&&!Z.includes(" ")&&Z.length<30&&!/[./\\]/.test(Z)){let K=X.filter((q)=>Z.includes(q)||q.includes(Z)),G="Run amp --help for a list of available commands.";if(K.length>0)G=`Did you mean: ${K.join(", ")}? Or run amp --help for all commands.`;throw new c9(iK.unknownCommand(Z),1,G)}}var jF6=null;function Y64(){return jF6}function fQ1(J){return{...J,getThreadEnvironment:W51,vfs:b40({os:J.fileSystem},J.configService.config),fileChangeTrackerStorage:new f_(J.fileSystem),generateThreadTitle:Ds,deleteThread:(Q)=>J.threadHistoryService.delete(Q)}}var Kp1=w0.file(xH9.homedir()),$F6=process.env.XDG_CONFIG_HOME?w0.file(process.env.XDG_CONFIG_HOME):b0.joinPath(Kp1,".config");async function lq(J,Q){vn1("0.0.1761436902-g59a6f7");let Z=gX1({storage:J.settings,secretStorage:J.secrets,workspaceRoots:e1.of([w0.file(process.cwd())]),defaultAmpURL:J.ampURL,homeDir:Kp1,userConfigDir:$F6}),{initializeCLITelemetry:X}=await Promise.resolve().then(() => (bQ1(),xQ1));X(Z);let Y=await Z.getLatest();u.debug("Global configuration initialized",{settingsKeys:Object.keys(Y.settings)});let K=da(IO({configService:Z})),G=F40({configService:Z,toolService:K}),q=VO0(K,k9,w11).catch((O)=>{u.warn("Toolbox registration failed, continuing anyway:",O)}),z=G.initialized.catch((O)=>{u.warn("MCP service initialization failed, continuing anyway:",O)});if(J.executeMode)await Promise.all([z,q]);if(Q.jetbrains)CO("JetBrains");else if(Q.ide&&SZ6())CO("VS Code");else if(Q.ide&&vZ6())CO("Neovim");if(J.executeMode)kn1(!0);O26(K,{configService:Z});let U,W=T7.status.pipe(k0((O)=>Boolean(O.connected&&O.authenticated)),J8()).subscribe((O)=>{if(O){if(!U)U=K.registerTool(us)}else U?.dispose(),U=void 0}),F;if(!J.executeMode)F=new E51(process.cwd(),{},!0);else F=new class extends E51{async start(){}async query(){return[]}getStats(){return{state:"unstarted",stats:[]}}dispose(){}};if(!await J.secrets.get("apiKey",J.ampURL)){if(e2.write(`No API key found. Starting login flow...
6500
+ `)}var Zp1=Qp1.join(Tl1||Qp1.join(process.env.HOME||process.cwd(),".local","state"),"amp","last-thread-id");function bH9(J){process.emitWarning=function(Q,Z,X,Y){let K=typeof Q==="string"?Q:Q.message||String(Q),G=Z||"Warning",q=!1;J.warn(K,{name:G,code:X})}}function cq(J,Q){if(J.getOptionValueSourceWithGlobals("dangerouslyAllowAll")==="cli")BZ("dangerouslyAllowAll",Q.dangerouslyAllowAll);if(J.getOptionValueSourceWithGlobals("tryGpt5")==="cli")throw new c9("The --try-gpt5 flag has been removed.",1,`GPT-5 is now available as the oracle. Read why: ${z8.blue("https://ampcode.com/news/gpt-5-oracle")}`);if(J.getOptionValueSourceWithGlobals("agentMode")==="cli")BZ("experimental.agentMode",Q.agentMode)}async function Yp1(J){try{await kH9(Qp1.dirname(Zp1),{recursive:!0}),await _H9(Zp1,J,"utf-8")}catch(Q){u.debug("Failed to save last thread ID",Q)}}async function yH9(){try{return(await OF6(Zp1,"utf-8")).trim()}catch(J){return null}}function fH9(J,Q){return{...J,async get(Z){if(Z==="mcpServers"){let X=await J.get(Z);return PS("mcpServers",{global:X,workspace:Q})}return J.get(Z)},async keys(){let Z=await J.keys();if(!Z.includes("mcpServers"))Z.push("mcpServers");return Z},[Symbol.dispose](){J[Symbol.dispose]()}}}var AF6=[{name:"notifications",long:"notifications",type:"flag",description:(J)=>`${J?"Enable":"Disable"} sound notifications (enabled by default when not in execute mode)`},{name:"color",long:"color",type:"flag",description:(J)=>`${J?"Enable":"Disable"} color output (enabled by default if stdout and stderr are sent to a TTY)`,deprecated:!0},{name:"settingsFile",long:"settings-file",type:"option",default:process.env.AMP_SETTINGS_FILE??DX,description:`Custom settings file path (overrides the default location ${DX})`},{name:"logLevel",long:"log-level",type:"option",description:`Set log level (${Object.keys(u).join(", ")})`},{name:"logFile",long:"log-file",type:"option",description:`Set log file location (overrides the default location ${Ly1})`},{name:"format",long:"format",type:"option",description:"output using the standard or new-ui. Options: `ui`, `new-ui`",choices:["ui","jsonl","new-ui"],hidden:!0,deprecated:!0},{name:"dangerouslyAllowAll",long:"dangerously-allow-all",type:"switch",default:!1,description:"Disable all command confirmation prompts (agent will execute all commands without asking)"},{name:"jetbrains",long:"jetbrains",type:"flag",default:nK(),description:(J)=>J?"Enable JetBrains integration. When enabled, Amp automatically includes your open JetBrains file and text selection with every message.":"Disable JetBrains integration."},{name:"ide",long:"ide",type:"flag",default:!0,description:(J)=>J?"Enable IDE connection (default). When enabled, Amp automatically includes your open IDE's file and text selection with every message.":"Disable IDE connection."},{name:"interactive",long:"interactive",type:"flag",description:(J)=>J?"Enable interactive mode. This will enable the interactive UI.":"Disable interactive mode. This will disable the interactive UI.",hidden:!0,deprecated:!0},{name:"mcpConfig",long:"mcp-config",type:"option",description:"JSON configuration or file path for MCP servers to merge with existing settings"},{name:"tryGpt5",long:"try-gpt5",type:"switch",default:!1,description:"[DEPRECATED] Try GPT-5 as the primary agent model (see https://ampcode.com/news/gpt-5-oracle)",deprecated:!0},{name:"agentMode",long:"agent-mode",type:"option",description:"Set the experimental agent mode configuration",hidden:!0,choices:GO}],wF6=(J)=>("deprecated"in J)&&J.deprecated===!0,hH9=(J)=>("hidden"in J)&&J.hidden===!0,gH9=(J)=>("default"in J),mH9=(J)=>("default"in J)?J.default:void 0;function uH9(J,Q){let Z=Q.args[0],X=Q.commands.map((K)=>K.name());if(Z&&!Z.includes(" ")&&Z.length<30&&!/[./\\]/.test(Z)){let K=X.filter((q)=>Z.includes(q)||q.includes(Z)),G="Run amp --help for a list of available commands.";if(K.length>0)G=`Did you mean: ${K.join(", ")}? Or run amp --help for all commands.`;throw new c9(iK.unknownCommand(Z),1,G)}}var jF6=null;function Y64(){return jF6}function fQ1(J){return{...J,getThreadEnvironment:W51,vfs:b40({os:J.fileSystem},J.configService.config),fileChangeTrackerStorage:new f_(J.fileSystem),generateThreadTitle:Ds,deleteThread:(Q)=>J.threadHistoryService.delete(Q)}}var Kp1=w0.file(xH9.homedir()),$F6=process.env.XDG_CONFIG_HOME?w0.file(process.env.XDG_CONFIG_HOME):b0.joinPath(Kp1,".config");async function lq(J,Q){vn1("0.0.1761458743-ge8ce60");let Z=gX1({storage:J.settings,secretStorage:J.secrets,workspaceRoots:e1.of([w0.file(process.cwd())]),defaultAmpURL:J.ampURL,homeDir:Kp1,userConfigDir:$F6}),{initializeCLITelemetry:X}=await Promise.resolve().then(() => (bQ1(),xQ1));X(Z);let Y=await Z.getLatest();u.debug("Global configuration initialized",{settingsKeys:Object.keys(Y.settings)});let K=da(IO({configService:Z})),G=F40({configService:Z,toolService:K}),q=VO0(K,k9,w11).catch((O)=>{u.warn("Toolbox registration failed, continuing anyway:",O)}),z=G.initialized.catch((O)=>{u.warn("MCP service initialization failed, continuing anyway:",O)});if(J.executeMode)await Promise.all([z,q]);if(Q.jetbrains)CO("JetBrains");else if(Q.ide&&SZ6())CO("VS Code");else if(Q.ide&&vZ6())CO("Neovim");if(J.executeMode)kn1(!0);O26(K,{configService:Z});let U,W=T7.status.pipe(k0((O)=>Boolean(O.connected&&O.authenticated)),J8()).subscribe((O)=>{if(O){if(!U)U=K.registerTool(us)}else U?.dispose(),U=void 0}),F;if(!J.executeMode)F=new E51(process.cwd(),{},!0);else F=new class extends E51{async start(){}async query(){return[]}getStats(){return{state:"unstarted",stats:[]}}dispose(){}};if(!await J.secrets.get("apiKey",J.ampURL)){if(e2.write(`No API key found. Starting login flow...
6501
6501
  `),!await pH9(J))await BR(),process.exit(1)}let H=await m40({isDevelopment:!1}),B=new kV1(H),M=new AB1(H,Z,{lazy:!0}),V=Q.notifications!==void 0?Q.notifications:!J.executeMode,N=$26({playNotificationSound:async(O)=>{if(V){j26(O);let j=Th1(),$=Ch1();if((!j||$)&&Y.settings["notifications.system.enabled"]!==!1){if(O==="idle")process.stdout.write("\x1B]777;notify;Amp;Agent is ready\x1B\\");else if(O==="requires-user-input")process.stdout.write("\x1B]777;notify;Amp;Waiting for approval\x1B\\")}}},windowFocused:()=>Promise.resolve(!1),threadService:B,configService:Z});u.info("Starting Amp background services");let L=lq0({threadService:B,threadHistoryService:M,configService:Z,isExtensionDevelopment:!1}),A;T7.status.subscribe((O)=>{A=O});let R={codebaseContextService:new hZ1({workspaceRoots:[w0.file(process.cwd())],getCurrentFile:()=>{if(!A?.openFile)return;try{return w0.parse(A.openFile)}catch(O){u.warn("Failed to parse current file URI",{uri:A.openFile,error:O});return}},getOpenFiles:()=>{if(!A?.visibleFiles?.length)return[];let O=A.openFile;return A.visibleFiles.filter((j)=>j!==O).map((j)=>{try{return w0.parse(j)}catch($){return u.warn("Failed to parse visible file URI",{uri:j,error:$}),null}}).filter((j)=>j!==null)}}),configService:Z,toolService:K,mcpService:G,threadService:B,threadHistoryService:M,threadSyncService:L,threadStorage:H,secretStorage:J.secrets,settingsStorage:J.settings,fuzzyServer:F,notificationService:N,fileSystem:Q.jetbrains||Q.ide?k40:k9};return{...R,async asyncDispose(){await R.mcpService.dispose(),await R.threadService.asyncDispose(),R.configService.unsubscribe(),R.toolService.dispose(),R.fuzzyServer.dispose(),R.threadSyncService.dispose(),R.settingsStorage[Symbol.dispose](),W.unsubscribe(),U?.dispose()}}}async function pH9(J){if(!J.executeMode){if(!await Kf1("Would you like to log in to Amp? [(y)es, (n)o]: "))return e2.write(`Login cancelled. Run the command again to retry.
6502
6502
  `),!1}return await EF6(J)}async function EF6(J){let Q=vH9(32).toString("hex"),Z=await Yf1(J.ampURL,Q);try{await VY(Z)}catch(Y){u.error("Failed to open browser",{error:Y})}let X=await Yf1(J.ampURL,Q,!1);e2.write(`If your browser did not open automatically, visit:
6503
6503
 
@@ -6507,13 +6507,13 @@ ${z8.blue.bold(X)}
6507
6507
  Login successful! You can now use the Amp CLI.
6508
6508
  `),!0}catch(Y){return u.error("Login failed",{error:Y}),QG.write(`
6509
6509
  Login failed: ${Y instanceof Error?Y.message:String(Y)}
6510
- `),!1}}function dH9(){let J=new Bu().name("amp").description("AI-powered coding assistant").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").configureOutput({writeErr:()=>{}});J.exitOverride((U)=>{if(U.code==="commander.help"||U.code==="commander.version"||U.exitCode===0)VR(),process.exit(0);let W=U.originalError??U;IQ6(W)}),J.option("-V, --version","output the version number",()=>{e2.write(`0.0.1761436902-g59a6f7 (released 2025-10-26T00:06:53.404Z)
6510
+ `),!1}}function dH9(){let J=new Bu().name("amp").description("AI-powered coding assistant").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").configureOutput({writeErr:()=>{}});J.exitOverride((U)=>{if(U.code==="commander.help"||U.code==="commander.version"||U.exitCode===0)VR(),process.exit(0);let W=U.originalError??U;IQ6(W)}),J.option("-V, --version","output the version number",()=>{e2.write(`0.0.1761458743-ge8ce60 (released 2025-10-26T06:10:55.016Z)
6511
6511
  `),process.exit(0)}),J.addHelpText("after",PZ6()),J.configureHelp({formatHelp:TZ6}),J.command("logout").description("Log out by removing stored API key").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await NX(F);await nH9(H)}),J.command("login").description("Log in to Amp").addHelpText("after","If AMP_URL is set during login, it will be persisted to global settings for future CLI invocations, though AMP_URL will continue to take precedence.").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await NX(F);await iH9(H,await iy1(F,H.settings))});let Q=async(U,W,F)=>{gX1({storage:W.settings,secretStorage:W.secrets,workspaceRoots:e1.of([w0.file(process.cwd())]),defaultAmpURL:W.ampURL,homeDir:Kp1,userConfigDir:$F6});let H={...W,executeMode:!1};await Xp1(H,{...U,startWithPicker:!0},F)},Z=J.command("threads").alias("t").alias("thread").summary("Manage threads").description("Thread management commands. When no subcommand is provided, defaults to listing threads.").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await NX(F);await RF6(F,H,W)});Z.command("new").alias("n").summary("Create a new thread").description("Create a new thread and print its ID. The thread will be empty. You can set the visibility using the --visibility option.").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await NX(F);await eH9(F,H,W)}),Z.command("continue [threadId]").alias("c").summary("Continue an existing thread").description("Continue an existing thread by resuming the conversation. By default, shows an interactive picker with the most recently used thread at the top. Use --last to continue the last thread directly without the picker.").option("--last","Continue the last thread directly without showing the picker").option("--pick","Pick a thread interactively from a list (DEPRECATED: picker is now the default)").action(async(U,W,F)=>{let H=F.optsWithGlobals(),B=await NX(H);if(W.pick)QG.write(`${z8.yellow("Warning:")} The --pick flag is deprecated. The picker is now shown by default.
6512
6512
  `);if(W.last||U||B.executeMode)await tH9(H,B,U,F);else await Q(H,B,F)}),Z.command("fork [threadId]").alias("f").summary("Fork an existing thread").description("Create a new thread by forking an existing one. This copies the conversation history up to the current point and creates a new thread where you can explore different directions. If no thread ID is provided, the most recently used thread will be forked.").action(async(U,W,F)=>{let H=F.optsWithGlobals(),B=await NX(H);await oH9(H,B,U,F)}),Z.command("list").alias("l").alias("ls").summary("List all threads").description("List all your threads with their IDs, names, and last modified times.").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await NX(F);await RF6(F,H,W)}),Z.command("share <threadId>").summary("Share a thread").description("Change thread visibility (private, public, workspace, group) or share with Amp support for debugging. Use --visibility to change who can access the thread, or --support to share with the Amp team for troubleshooting.").alias("s").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").option("--support","Share thread with Amp support for debugging").action(async(U,W,F)=>{let H=F.optsWithGlobals(),B=await NX(H);await sH9(H,B,U,F,W.support)}),Z.command("rename <threadId> <newName>").alias("r").summary("Rename a thread").description('Change the title of a thread. Quote names with spaces: amp threads rename T-123 "New thread name"').action(async(U,W,F,H)=>{let B=H.optsWithGlobals(),M=await NX(B);await aH9(B,M,U,W,H)}),Z.command("markdown <threadId>").alias("md").summary("Render thread as markdown").description("Render a thread as markdown. This outputs the entire conversation history in a readable markdown format.").action(async(U,W,F)=>{let H=F.optsWithGlobals(),B=await NX(H);await rH9(H,B,U,F)}),vX6(J,async(U,W)=>{let F=await NX(W);cq(U,W);let H=await lq(F,W);return{context:F,mcpService:H.mcpService,toolService:H.toolService,configService:H.configService,cleanupTerminal:VR,asyncDispose:H.asyncDispose.bind(H)}}),GX6(J),tZ6(J,async(U)=>{let W=await NX(U);return{settings:W.settings,getThreadDeps:async(F)=>{cq(F,U);let H=await lq(W,U);return{mcpService:H.mcpService,asyncDispose:H.asyncDispose.bind(H)}}}}),J.command("connect").description("Connect CLI to web interface for multi-thread management").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await NX(F);cq(W,F);let B=await lq(H,F);try{await Py1(B,B.configService,{})}finally{await B.asyncDispose(),await VR()}});function X(U,W,F){let B=typeof U.description==="string"?U.description:F===void 0?U.description(!0):U.description(F),M=new dV(W,B),V=mH9(U);if(V)M.default(V);if(M.hidden=hH9(U)||wF6(U),"choices"in U)M.choices([...U.choices]);return M}for(let U of AF6)switch(U.type){case"flag":{J.addOption(X(U,`--${U.long}`)),J.addOption(X(U,`--no-${U.long}`,!1));break}case"switch":{J.addOption(X(U,`--${U.long}`,!0));break}default:{J.addOption(X(U,`--${U.long} <value>`));break}}let Y=new dV("-x, --execute [message]","Use execute mode, optionally with user message. In execute mode, agent will execute provided prompt (either as argument, or via stdin). Only last assistant message is printed. Enabled automatically when redirecting stdout.").default(!1);J.addOption(Y);let K=new dV("-r, --remote","When used with -x/--execute, execute in an async agent on the Amp server.").default(!1).hideHelp();J.addOption(K);let G=new dV("--stream-json","When used with --execute, output in Claude Code compatible stream JSON format instead of plain text.").default(!1);J.addOption(G);let q=new dV("--stream-json-input","Read JSON Lines user messages from stdin. Requires both --execute and --stream-json.").default(!1);J.addOption(q);let z=new dV("--stats","When used with --execute, output JSON with both result and token usage data (for /evals).").default(!1).hideHelp(!0);if(J.addOption(z),process.env.AMP_CONNECT==="1"){let U=new dV("--client-id <clientId>","Override the client ID for connect functionality (default: amp-<pid>@<hostname>)");J.addOption(U)}return J.action(async(U,W)=>{let F=U,H=await NX(F);if(Object.keys(F).forEach((B)=>{let M=AF6.find((V)=>V.name===B);if(M&&wF6(M)&&!gH9(M))QG.write(z8.yellow(`Warning: '--${B}' flag is deprecated
6513
6513
  `))}),W.args.length>0)uH9(H,W);await Xp1(H,F,W)}),iZ6(J),J}async function yQ1(J,Q){let{thread:Z,visibility:X}=Q,Y=Z?.id??Kz(),K=fQ1(J);if(Z)await J.threadStorage.set(Y,Z);let G=await WJ.getOrCreateForThread(K,Y);if(X)await J.threadSyncService.updateThreadMeta(Y,h51(X));let q=J.threadService.observe(Y).subscribe(async(z)=>{if(o7(z,"assistant"))await Yp1(Y),q.unsubscribe()});return await G.resume(),G}async function Xp1(J,Q,Z){let X=f51(Q);if(X instanceof Error)JG(X.message);let Y,K=null;if(Q.streamJsonInput)Y="";else if(typeof Q.execute==="string"){Y=Q.execute;let R=(await Gf1()).trimEnd();if(R)K=R}else Y=(await Gf1()).trimEnd();if(Q.remote&&!J.executeMode)throw new c9("The -r/--remote flag currently only works with --execute mode",1,'Use: amp --remote --execute "your message"');if(Q.streamJson&&!J.executeMode)throw new c9("The --stream-json flag requires --execute mode",1,'Use: amp --execute "your message" --stream-json');if(Q.streamJsonInput&&!J.executeMode)throw new c9("The --stream-json-input flag requires --execute mode",1,"Use: amp --execute --stream-json --stream-json-input");if(Q.streamJsonInput&&!Q.streamJson)throw new c9("The --stream-json-input flag requires --stream-json",1,"Use: amp --execute --stream-json --stream-json-input");if((J.executeMode||Q.streamJson)&&Q.agentMode&&Q.agentMode!=="smart")throw new c9(`Execute mode is not permitted with --agent-mode '${Q.agentMode}'`,1);if(Q.stats&&!J.executeMode)throw new c9("The --stats flag requires --execute mode",1,'Use: amp --execute "your message" --stats');if(Q.streamJsonInput&&typeof Q.execute==="string"&&Q.execute.trim()!=="")throw new c9("Do not provide a message argument when using --stream-json-input",1,`Supply messages via stdin JSONL instead: echo '{"type":"user","message":{"role":"user","content":[{"type":"text","text":"your message"}]}}' | amp --execute --stream-json --stream-json-input`);if(J.executeMode&&Y===""&&!Q.streamJsonInput)throw new c9("User message must be provided through stdin or as argument when using execute mode",1,`Either pass a message as an argument: amp --execute "your message"
6514
6514
  Or pipe via stdin: echo "your message" | amp --execute`);cq(Z,Q);let G=await lq(J,Q);jF6=G;let q=fQ1(G),z=async(R)=>{let O=await OF6(R,"utf-8"),j=JSON.parse(O);if(!AW(j.id))throw new c9(iK.invalidThreadId);return yQ1(G,{visibility:X,thread:j})},U=async(R)=>{if(!AW(R))throw new c9(iK.invalidThreadId);let O=await G.threadService.get(R)??void 0;if(u.info(`[fetchAndStartThread] Loaded thread ${R}, agentMode: ${O?.agentMode??"undefined"}`),O?.agentMode)u.info(`[fetchAndStartThread] Setting runtime override for agentMode to: ${O.agentMode}`),BZ("experimental.agentMode",O.agentMode);else u.info("[fetchAndStartThread] No agentMode on thread, not setting override");return yQ1(G,{visibility:X,thread:O})},W=async()=>{try{if(Q.threadId)return U(Q.threadId);else return yQ1(G,{visibility:X})}catch(R){if(R instanceof c9)throw R;throw await N51(R,Q.threadId),Error("handleError should have called process.exit()")}},F=async()=>{return yQ1(G,{visibility:X})};if(Q.format==="jsonl")QG.write(`jsonl format is deprecated. Version "0.0.1752148945-gd8844f" or earlier is required to use jsonl format.
6515
- `),await BR(),process.exit(1);if(J.executeMode&&Q.remote)await qX6(Y,K,G.configService),await G.asyncDispose(),process.exit(0);let H=await W();if(J.executeMode)await gQ6(H,H.threadID,Y,K,G,!!Q.streamJson,!!Q.streamJsonInput,!!Q.stats,J.ampURL),await G.asyncDispose(),process.exit(0);let B=!1,M=!1;if(Q.jetbrains||Q.ide){await nr1();let R=await uB({jetbrainsOnly:Q.jetbrains});if(R.length===0){if(Q.jetbrains)M=!await G.configService.get("jetbrains.skipInstall")}else if(R.length===1){let O=R[0];if(O)T7.selectConfig(O)}else B=!0}let V=Zf1("0.0.1761436902-g59a6f7",G.settingsStorage),N=e1.of([w0.file(process.cwd())]),L=AS(void 0,N);if(Y)H.handle({type:"user:message",message:{content:[{type:"text",text:Y}]}});let A;try{A=await YJ.getUserFreeTierStatus({},{config:G.configService})}catch(R){A={ok:!1,error:R}}u.info("User free tier status:",A);let w=await FX6();u.info("Loaded session state:",w),await LF6({codebaseContextService:G.codebaseContextService,stdout:process.stdout,history:new ky1,fuzzyServer:G.fuzzyServer,settingsStorage:G.settingsStorage,threadService:G.threadService,threadSyncService:G.threadSyncService,threadID:H.threadID,worker:H,workerDeps:q,configService:G.configService,internalAPIClient:YJ,ampURL:J.ampURL,startNewThread:F,pickAndContinueThread:async()=>{u.info("Thread picker requested - not yet implemented in TUI")},switchToThread:U,ideClient:T7,connectedClientsService:new kc,commandRegistry:L,showJetBrainsInstaller:M,showIdePicker:B,startWithPicker:Q.startWithPicker,updateService:V,inspector:Q.inspector,inspectorPort:Q.inspectorPort,jetbrainsMode:Q.jetbrains,clientId:Q.clientId,sessionState:w,freeTierStatus:A.ok?A.result:void 0}),await G.asyncDispose(),process.exit(0)}async function NX(J){if(J.interactive)QG.write(`Warning: --interactive flag is deprecated. Interactive mode is now the default unless --execute is used or output is redirected.
6516
- `);let Q=!!J.execute||!process.stdout.isTTY&&!J.streamJson,Z=process.stdout.isTTY&&process.stderr.isTTY,X=await FZ6({...J,getHook:process.env.AMP_URL?(G,q)=>{if(G==="url")return Promise.resolve(process.env.AMP_URL);return q()}:void 0});if(J.mcpConfig){let G=await eZ6(J.mcpConfig);X=fH9(X,G)}let Y=await X.get("url","global");if(!Y)Y=DZ;if(!PB(Y))u.info("Targeting custom Amp server",{ampURL:Y});if(X=al1(X),await X.get("debug.httpLogging"))ll1();return{executeMode:Q,isTTY:Z,ampURL:Y,settings:X,secrets:zX6(await iy1(J,X))}}function cH9(J){let Q={};for(let Z=0;Z<J.length;Z++){let X=J[Z];if(X?.startsWith("--")){let K=X.slice(2).replace(/-([a-z])/g,(q,z)=>z.toUpperCase()),G=J[Z+1];if(G&&!G.startsWith("--"))Q[K]=G,Z++}}return Q}async function lH9(){let J=cH9(process.argv);if(zQ6({logLevel:J.logLevel||process.env.AMP_LOG_LEVEL,logFile:J.logFile||process.env.AMP_LOG_FILE}),bH9(u),u.info("Starting Amp CLI.",{version:"0.0.1761436902-g59a6f7",buildTimestamp:"2025-10-26T00:06:53.404Z"}),parseInt(process.version.slice(1).split(".")[0]??"")<20)throw new c9(iK.nodeVersion(process.version),1,"Please upgrade your Node.js installation from https://nodejs.org");await dH9().parseAsync(process.argv)}lH9().catch(N51);async function iH9(J,Q){if(process.env.AMP_URL)await J.settings.set("url",process.env.AMP_URL,"global"),e2.write(`Saving custom server URL to settings: ${process.env.AMP_URL}
6515
+ `),await BR(),process.exit(1);if(J.executeMode&&Q.remote)await qX6(Y,K,G.configService),await G.asyncDispose(),process.exit(0);let H=await W();if(J.executeMode)await gQ6(H,H.threadID,Y,K,G,!!Q.streamJson,!!Q.streamJsonInput,!!Q.stats,J.ampURL),await G.asyncDispose(),process.exit(0);let B=!1,M=!1;if(Q.jetbrains||Q.ide){await nr1();let R=await uB({jetbrainsOnly:Q.jetbrains});if(R.length===0){if(Q.jetbrains)M=!await G.configService.get("jetbrains.skipInstall")}else if(R.length===1){let O=R[0];if(O)T7.selectConfig(O)}else B=!0}let V=Zf1("0.0.1761458743-ge8ce60",G.settingsStorage),N=e1.of([w0.file(process.cwd())]),L=AS(void 0,N);if(Y)H.handle({type:"user:message",message:{content:[{type:"text",text:Y}]}});let A;try{A=await YJ.getUserFreeTierStatus({},{config:G.configService})}catch(R){A={ok:!1,error:R}}u.info("User free tier status:",A);let w=await FX6();u.info("Loaded session state:",w),await LF6({codebaseContextService:G.codebaseContextService,stdout:process.stdout,history:new ky1,fuzzyServer:G.fuzzyServer,settingsStorage:G.settingsStorage,threadService:G.threadService,threadSyncService:G.threadSyncService,threadID:H.threadID,worker:H,workerDeps:q,configService:G.configService,internalAPIClient:YJ,ampURL:J.ampURL,startNewThread:F,pickAndContinueThread:async()=>{u.info("Thread picker requested - not yet implemented in TUI")},switchToThread:U,ideClient:T7,connectedClientsService:new kc,commandRegistry:L,showJetBrainsInstaller:M,showIdePicker:B,startWithPicker:Q.startWithPicker,updateService:V,inspector:Q.inspector,inspectorPort:Q.inspectorPort,jetbrainsMode:Q.jetbrains,clientId:Q.clientId,sessionState:w,freeTierStatus:A.ok?A.result:void 0}),await G.asyncDispose(),process.exit(0)}async function NX(J){if(J.interactive)QG.write(`Warning: --interactive flag is deprecated. Interactive mode is now the default unless --execute is used or output is redirected.
6516
+ `);let Q=!!J.execute||!process.stdout.isTTY&&!J.streamJson,Z=process.stdout.isTTY&&process.stderr.isTTY,X=await FZ6({...J,getHook:process.env.AMP_URL?(G,q)=>{if(G==="url")return Promise.resolve(process.env.AMP_URL);return q()}:void 0});if(J.mcpConfig){let G=await eZ6(J.mcpConfig);X=fH9(X,G)}let Y=await X.get("url","global");if(!Y)Y=DZ;if(!PB(Y))u.info("Targeting custom Amp server",{ampURL:Y});if(X=al1(X),await X.get("debug.httpLogging"))ll1();return{executeMode:Q,isTTY:Z,ampURL:Y,settings:X,secrets:zX6(await iy1(J,X))}}function cH9(J){let Q={};for(let Z=0;Z<J.length;Z++){let X=J[Z];if(X?.startsWith("--")){let K=X.slice(2).replace(/-([a-z])/g,(q,z)=>z.toUpperCase()),G=J[Z+1];if(G&&!G.startsWith("--"))Q[K]=G,Z++}}return Q}async function lH9(){let J=cH9(process.argv);if(zQ6({logLevel:J.logLevel||process.env.AMP_LOG_LEVEL,logFile:J.logFile||process.env.AMP_LOG_FILE}),bH9(u),u.info("Starting Amp CLI.",{version:"0.0.1761458743-ge8ce60",buildTimestamp:"2025-10-26T06:10:55.016Z"}),parseInt(process.version.slice(1).split(".")[0]??"")<20)throw new c9(iK.nodeVersion(process.version),1,"Please upgrade your Node.js installation from https://nodejs.org");await dH9().parseAsync(process.argv)}lH9().catch(N51);async function iH9(J,Q){if(process.env.AMP_URL)await J.settings.set("url",process.env.AMP_URL,"global"),e2.write(`Saving custom server URL to settings: ${process.env.AMP_URL}
6517
6517
  `);else if(!PB(J.ampURL))e2.write(`Logging in to ${new URL(J.ampURL).hostname}
6518
6518
  `);let Z=process.env.AMP_API_KEY;if(Z)e2.write(`API key found in environment variable, storing...
6519
6519
  `),await Q.set("apiKey",Z,J.ampURL),e2.write(`API key successfully stored.