@sourcegraph/amp 0.0.1761868901-gb9e977 → 0.0.1761883329-ga93f38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +9 -9
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env -S node --no-warnings
2
2
  import{createRequire as zz6}from"node:module";var Yz6=Object.create;var{getPrototypeOf:Kz6,defineProperty:HQ1,getOwnPropertyNames:Gz6}=Object;var qz6=Object.prototype.hasOwnProperty;var x6=(J,Q,Z)=>{Z=J!=null?Yz6(Kz6(J)):{};let X=Q||!J||!J.__esModule?HQ1(Z,"default",{value:J,enumerable:!0}):Z;for(let Y of Gz6(J))if(!qz6.call(X,Y))HQ1(X,Y,{get:()=>J[Y],enumerable:!0});return X};var t=(J,Q)=>()=>(Q||J((Q={exports:{}}).exports,Q),Q.exports);var C6=(J,Q)=>{for(var Z in Q)HQ1(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 s1=zz6(import.meta.url),Uz6=Symbol.dispose||Symbol.for("Symbol.dispose"),Wz6=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),rm1=(J,Q,Z)=>{if(Q!=null){if(typeof Q!=="object"&&typeof Q!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var X;if(Z)X=Q[Wz6];if(X===void 0)X=Q[Uz6];if(typeof X!=="function")throw TypeError("Object not disposable");J.push([Z,X,Q])}else if(Z)J.push([Z]);return Q},sm1=(J,Q,Z)=>{var X=typeof SuppressedError==="function"?SuppressedError:function(G,q,z,U){return U=Error(z),U.name="SuppressedError",U.error=G,U.suppressed=q,U},Y=(G)=>Q=Z?new X(G,Q,"An error was suppressed during disposal"):(Z=!0,G),K=(G)=>{while(G=J.pop())try{var q=G[1]&&G[1].call(G[2]);if(G[0])return Promise.resolve(q).then(K,(z)=>(Y(z),K()))}catch(z){Y(z)}if(Z)throw Q};return K()};function om1(){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 tm1(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&&!Fz6.test(J.scheme))throw Error("[UriError]: Scheme contains illegal characters.");if(J.path){if(J.authority){if(!Hz6.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(Bz6.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 Dz6(J,Q){if(!J&&!Q)return"file";return J}function Mz6(J,Q){switch(J){case"https":case"http":case"file":if(!Q)Q=rK;else if(Q[0]!==rK)Q=rK+Q;break}return Q}class $0{static isUri(J){if(J instanceof $0)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||m2,this.authority=J.authority||m2,this.path=J.path||m2,this.query=J.query||m2,this.fragment=J.fragment||m2,this.platform=J.platform;else this.scheme=Dz6(J,K),this.authority=Q||m2,this.path=Mz6(this.scheme,Z||m2),this.query=X||m2,this.fragment=Y||m2,this.platform=G,tm1(this,K)}get fsPath(){return Xu1(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=m2;if(Z===void 0)Z=this.authority;else if(Z===null)Z=m2;if(X===void 0)X=this.path;else if(X===null)X=m2;if(Y===void 0)Y=this.query;else if(Y===null)Y=m2;if(K===void 0)K=this.fragment;else if(K===null)K=m2;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 WN(Q,Z,X,Y,K,!1,G)}static parse(J,Q=!1){let Z=Vz6.exec(J);if(!Z)return new WN(m2,m2,m2,m2,m2);return new WN(Z[2]||m2,np(Z[4]||m2),np(Z[5]||m2),np(Z[7]||m2),np(Z[9]||m2),Q)}static file(J,Q=om1()){let Z=m2;if(Q==="windows")J=J.replace(/\\/g,rK);if(J[0]===rK&&J[1]===rK){let X=J.indexOf(rK,2);if(X===-1)Z=J.substring(2),J=rK;else Z=J.substring(2,X),J=J.substring(X)||rK}return new WN("file",Z,J,m2,m2,!1,Q)}static from(J){let Q=new WN(J.scheme,J.authority,J.path,J.query,J.fragment,!0,J.platform);return tm1(Q,!0),Q}toString(J=!1){return BQ1(this,J)}toJSON(){return this}static revive(J){if(!J)return J;if(J instanceof $0)return J;let Q=new WN(J),Z=J;return Q._formatted=Z.external,Q._fsPath=Z._sep===Qu1(Q.platform)?Z.fsPath:null,Q}}function Qu1(J){return J==="windows"?1:void 0}function em1(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=Zu1[K];if(G!==void 0)X+=G;else X+=encodeURIComponent(J.charAt(Y))}}return X!==void 0?X:J}function Nz6(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+=Zu1[X]}else if(Q!==void 0)Q+=J[Z]}return Q!==void 0?Q:J}function Xu1(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 BQ1(J,Q){let Z=!Q?em1:Nz6,X="",{scheme:Y,authority:K,path:G,query:q,fragment:z}=J;if(Y)X+=Y,X+=":";if(K||Y==="file")X+=rK,X+=rK;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?em1(z,!1,!1):z;return X}function Yu1(J){try{return decodeURIComponent(J)}catch{if(J.length>3)return J.substring(0,3)+Yu1(J.substring(3));else return J}}function np(J){if(!J.match(Ju1))return J;return J.replace(Ju1,(Q)=>Yu1(Q))}function JB(J){return J.scheme==="file"}function NX(J){return $0.parse(J)}function P6(J){return J.toString()}function V8(J){if(typeof J==="string"||J instanceof URL)return $0.parse(J.toString());return J}function gC(J){if(!URL.canParse(J))throw Error(`invalid URI string: ${JSON.stringify(J)}`);return J}var Fz6,Hz6,Bz6,m2="",rK="/",Vz6,WN,Zu1,Ju1;var mC=B1(()=>{Fz6=/^\w[\w\d+.-]*$/,Hz6=/^\//,Bz6=/^\/\//;Vz6=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;WN=class WN extends $0{_formatted=null;_fsPath=null;get fsPath(){if(!this._fsPath)this._fsPath=Xu1(this,!1);return this._fsPath}toString(J=!1){if(!J){if(!this._formatted)this._formatted=BQ1(this,!1);return this._formatted}return BQ1(this,!0)}toJSON(){let J={};if(this._fsPath)J.fsPath=this._fsPath,J._sep=Qu1(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}};Zu1={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"};Ju1=/(%[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 FN(J){let Q=J.replace(/\/+$/,"");if(!Q)return"";let Z=Q.lastIndexOf("/");return Z===-1?Q:Q.slice(Z+1)}function xR(...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 Ku1(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 rp(J){let Q=FN(J.replace(/\/+$/,"")),Z=Q.lastIndexOf(".");if(Z===0||Z===-1)return"";return Q.slice(Z)}function VQ(J){if(J=V8(J),J.scheme==="file")return J.path;return J.toString()}var bR=B1(()=>{mC()});function Lz6(J,...Q){return J=V8(J),J.with({path:xR(J.path,...Q)})}function Az6(J,...Q){let Z=J.path,X=!1;if(Z[0]!==sp)Z=sp+Z,X=!0;let Y=Z;for(let K of Q)if(K.startsWith("/"))Y=xR(K);else Y=xR(Y,K);if(Y!=="/"&&Y.endsWith("/"))Y=Y.replace(/\/+$/,"");if(X&&Y[0]===sp&&!J.authority)Y=Y.substring(1);return J.with({path:Y})}function wz6(J){if(J=V8(J),J.path.length===0||J.path===sp)return J;let Q=DQ1(J.path);if(Q.length===1&&Q===".")Q="";return J.with({path:Q})}function Rz6(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 Oz6(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 Ku1(J.path,Q.path,Z,Z)}function jz6(J,Q){let Z=P6(J),X=P6(Q);if(Z.startsWith("file:///")&&X.startsWith("file:///"))return Gu1(Z)===Gu1(X);return Z===X}function Gu1(J){return J.replace(/^file:\/\/\/([A-Za-z]):/,(Q)=>`file:///${Q.toLowerCase()}:`)}var sp="/",b0;var op=B1(()=>{bR();mC();b0={joinPath:Lz6,resolvePath:Az6,dirname:wz6,basename:(J)=>FN(V8(J).path),extname:(J)=>rp(V8(J).path),hasPrefix:Rz6,relativePath:Oz6,equalURIs:jz6}});var Uu1=t((qu1)=>{Object.defineProperty(qu1,"__esModule",{value:!0});qu1._globalThis=void 0;qu1._globalThis=typeof globalThis==="object"?globalThis:global});var Wu1=t((HN)=>{var $z6=HN&&HN.__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]}),Ez6=HN&&HN.__exportStar||function(J,Q){for(var Z in J)if(Z!=="default"&&!Object.prototype.hasOwnProperty.call(Q,Z))$z6(Q,J,Z)};Object.defineProperty(HN,"__esModule",{value:!0});Ez6(Uu1(),HN)});var Fu1=t((BN)=>{var Iz6=BN&&BN.__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]}),Pz6=BN&&BN.__exportStar||function(J,Q){for(var Z in J)if(Z!=="default"&&!Object.prototype.hasOwnProperty.call(Q,Z))Iz6(Q,J,Z)};Object.defineProperty(BN,"__esModule",{value:!0});Pz6(Wu1(),BN)});var MQ1=t((Hu1)=>{Object.defineProperty(Hu1,"__esModule",{value:!0});Hu1.VERSION=void 0;Hu1.VERSION="1.9.0"});var Lu1=t((Vu1)=>{Object.defineProperty(Vu1,"__esModule",{value:!0});Vu1.isCompatible=Vu1._makeCompatibilityCheck=void 0;var Tz6=MQ1(),Du1=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Mu1(J){let Q=new Set([J]),Z=new Set,X=J.match(Du1);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(Du1);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)}}Vu1._makeCompatibilityCheck=Mu1;Vu1.isCompatible=Mu1(Tz6.VERSION)});var DN=t((Au1)=>{Object.defineProperty(Au1,"__esModule",{value:!0});Au1.unregisterGlobal=Au1.getGlobal=Au1.registerGlobal=void 0;var Sz6=Fu1(),yR=MQ1(),vz6=Lu1(),kz6=yR.VERSION.split(".")[0],uC=Symbol.for(`opentelemetry.js.api.${kz6}`),pC=Sz6._globalThis;function _z6(J,Q,Z,X=!1){var Y;let K=pC[uC]=(Y=pC[uC])!==null&&Y!==void 0?Y:{version:yR.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!==yR.VERSION){let G=Error(`@opentelemetry/api: Registration of version v${K.version} for ${J} does not match previously registered API v${yR.VERSION}`);return Z.error(G.stack||G.message),!1}return K[J]=Q,Z.debug(`@opentelemetry/api: Registered a global for ${J} v${yR.VERSION}.`),!0}Au1.registerGlobal=_z6;function xz6(J){var Q,Z;let X=(Q=pC[uC])===null||Q===void 0?void 0:Q.version;if(!X||!(0,vz6.isCompatible)(X))return;return(Z=pC[uC])===null||Z===void 0?void 0:Z[J]}Au1.getGlobal=xz6;function bz6(J,Q){Q.debug(`@opentelemetry/api: Unregistering a global for ${J} v${yR.VERSION}.`);let Z=pC[uC];if(Z)delete Z[J]}Au1.unregisterGlobal=bz6});var $u1=t((Ou1)=>{Object.defineProperty(Ou1,"__esModule",{value:!0});Ou1.DiagComponentLogger=void 0;var hz6=DN();class Ru1{constructor(J){this._namespace=J.namespace||"DiagComponentLogger"}debug(...J){return dC("debug",this._namespace,J)}error(...J){return dC("error",this._namespace,J)}info(...J){return dC("info",this._namespace,J)}warn(...J){return dC("warn",this._namespace,J)}verbose(...J){return dC("verbose",this._namespace,J)}}Ou1.DiagComponentLogger=Ru1;function dC(J,Q,Z){let X=(0,hz6.getGlobal)("diag");if(!X)return;return Z.unshift(Q),X[J](...Z)}});var tp=t((Eu1)=>{Object.defineProperty(Eu1,"__esModule",{value:!0});Eu1.DiagLogLevel=void 0;var gz6;(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"})(gz6=Eu1.DiagLogLevel||(Eu1.DiagLogLevel={}))});var Tu1=t((Iu1)=>{Object.defineProperty(Iu1,"__esModule",{value:!0});Iu1.createLogLevelDiagLogger=void 0;var JW=tp();function mz6(J,Q){if(J<JW.DiagLogLevel.NONE)J=JW.DiagLogLevel.NONE;else if(J>JW.DiagLogLevel.ALL)J=JW.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",JW.DiagLogLevel.ERROR),warn:Z("warn",JW.DiagLogLevel.WARN),info:Z("info",JW.DiagLogLevel.INFO),debug:Z("debug",JW.DiagLogLevel.DEBUG),verbose:Z("verbose",JW.DiagLogLevel.VERBOSE)}}Iu1.createLogLevelDiagLogger=mz6});var MN=t((Su1)=>{Object.defineProperty(Su1,"__esModule",{value:!0});Su1.DiagAPI=void 0;var uz6=$u1(),pz6=Tu1(),Cu1=tp(),ep=DN(),dz6="diag";class NQ1{constructor(){function J(X){return function(...Y){let K=(0,ep.getGlobal)("diag");if(!K)return;return K[X](...Y)}}let Q=this,Z=(X,Y={logLevel:Cu1.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,ep.getGlobal)("diag"),U=(0,pz6.createLogLevelDiagLogger)((G=Y.logLevel)!==null&&G!==void 0?G:Cu1.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,ep.registerGlobal)("diag",U,Q,!0)};Q.setLogger=Z,Q.disable=()=>{(0,ep.unregisterGlobal)(dz6,Q)},Q.createComponentLogger=(X)=>{return new uz6.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 NQ1;return this._instance}}Su1.DiagAPI=NQ1});var xu1=t((ku1)=>{Object.defineProperty(ku1,"__esModule",{value:!0});ku1.BaggageImpl=void 0;class fR{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 fR(this._entries);return Z._entries.set(J,Q),Z}removeEntry(J){let Q=new fR(this._entries);return Q._entries.delete(J),Q}removeEntries(...J){let Q=new fR(this._entries);for(let Z of J)Q._entries.delete(Z);return Q}clear(){return new fR}}ku1.BaggageImpl=fR});var fu1=t((bu1)=>{Object.defineProperty(bu1,"__esModule",{value:!0});bu1.baggageEntryMetadataSymbol=void 0;bu1.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")});var LQ1=t((hu1)=>{Object.defineProperty(hu1,"__esModule",{value:!0});hu1.baggageEntryMetadataFromString=hu1.createBaggage=void 0;var cz6=MN(),lz6=xu1(),iz6=fu1(),az6=cz6.DiagAPI.instance();function nz6(J={}){return new lz6.BaggageImpl(new Map(Object.entries(J)))}hu1.createBaggage=nz6;function rz6(J){if(typeof J!=="string")az6.error(`Cannot create baggage metadata from unknown type: ${typeof J}`),J="";return{__TYPE__:iz6.baggageEntryMetadataSymbol,toString(){return J}}}hu1.baggageEntryMetadataFromString=rz6});var cC=t((mu1)=>{Object.defineProperty(mu1,"__esModule",{value:!0});mu1.ROOT_CONTEXT=mu1.createContextKey=void 0;function oz6(J){return Symbol.for(J)}mu1.createContextKey=oz6;class Jd{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 Jd(Q._currentContext);return Y._currentContext.set(Z,X),Y},Q.deleteValue=(Z)=>{let X=new Jd(Q._currentContext);return X._currentContext.delete(Z),X}}}mu1.ROOT_CONTEXT=new Jd});var lu1=t((du1)=>{Object.defineProperty(du1,"__esModule",{value:!0});du1.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 pu1{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)}}du1.DiagConsoleLogger=pu1});var TQ1=t((iu1)=>{Object.defineProperty(iu1,"__esModule",{value:!0});iu1.createNoopMeter=iu1.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=iu1.NOOP_OBSERVABLE_GAUGE_METRIC=iu1.NOOP_OBSERVABLE_COUNTER_METRIC=iu1.NOOP_UP_DOWN_COUNTER_METRIC=iu1.NOOP_HISTOGRAM_METRIC=iu1.NOOP_GAUGE_METRIC=iu1.NOOP_COUNTER_METRIC=iu1.NOOP_METER=iu1.NoopObservableUpDownCounterMetric=iu1.NoopObservableGaugeMetric=iu1.NoopObservableCounterMetric=iu1.NoopObservableMetric=iu1.NoopHistogramMetric=iu1.NoopGaugeMetric=iu1.NoopUpDownCounterMetric=iu1.NoopCounterMetric=iu1.NoopMetric=iu1.NoopMeter=void 0;class wQ1{constructor(){}createGauge(J,Q){return iu1.NOOP_GAUGE_METRIC}createHistogram(J,Q){return iu1.NOOP_HISTOGRAM_METRIC}createCounter(J,Q){return iu1.NOOP_COUNTER_METRIC}createUpDownCounter(J,Q){return iu1.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(J,Q){return iu1.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(J,Q){return iu1.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(J,Q){return iu1.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(J,Q){}removeBatchObservableCallback(J){}}iu1.NoopMeter=wQ1;class hR{}iu1.NoopMetric=hR;class RQ1 extends hR{add(J,Q){}}iu1.NoopCounterMetric=RQ1;class OQ1 extends hR{add(J,Q){}}iu1.NoopUpDownCounterMetric=OQ1;class jQ1 extends hR{record(J,Q){}}iu1.NoopGaugeMetric=jQ1;class $Q1 extends hR{record(J,Q){}}iu1.NoopHistogramMetric=$Q1;class lC{addCallback(J){}removeCallback(J){}}iu1.NoopObservableMetric=lC;class EQ1 extends lC{}iu1.NoopObservableCounterMetric=EQ1;class IQ1 extends lC{}iu1.NoopObservableGaugeMetric=IQ1;class PQ1 extends lC{}iu1.NoopObservableUpDownCounterMetric=PQ1;iu1.NOOP_METER=new wQ1;iu1.NOOP_COUNTER_METRIC=new RQ1;iu1.NOOP_GAUGE_METRIC=new jQ1;iu1.NOOP_HISTOGRAM_METRIC=new $Q1;iu1.NOOP_UP_DOWN_COUNTER_METRIC=new OQ1;iu1.NOOP_OBSERVABLE_COUNTER_METRIC=new EQ1;iu1.NOOP_OBSERVABLE_GAUGE_METRIC=new IQ1;iu1.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new PQ1;function ez6(){return iu1.NOOP_METER}iu1.createNoopMeter=ez6});var Xp1=t((Zp1)=>{Object.defineProperty(Zp1,"__esModule",{value:!0});Zp1.ValueType=void 0;var WU6;(function(J){J[J.INT=0]="INT",J[J.DOUBLE=1]="DOUBLE"})(WU6=Zp1.ValueType||(Zp1.ValueType={}))});var SQ1=t((Yp1)=>{Object.defineProperty(Yp1,"__esModule",{value:!0});Yp1.defaultTextMapSetter=Yp1.defaultTextMapGetter=void 0;Yp1.defaultTextMapGetter={get(J,Q){if(J==null)return;return J[Q]},keys(J){if(J==null)return[];return Object.keys(J)}};Yp1.defaultTextMapSetter={set(J,Q,Z){if(J==null)return;J[Q]=Z}}});var Up1=t((qp1)=>{Object.defineProperty(qp1,"__esModule",{value:!0});qp1.NoopContextManager=void 0;var HU6=cC();class Gp1{active(){return HU6.ROOT_CONTEXT}with(J,Q,Z,...X){return Q.call(Z,...X)}bind(J,Q){return Q}enable(){return this}disable(){return this}}qp1.NoopContextManager=Gp1});var iC=t((Fp1)=>{Object.defineProperty(Fp1,"__esModule",{value:!0});Fp1.ContextAPI=void 0;var BU6=Up1(),vQ1=DN(),Wp1=MN(),kQ1="context",DU6=new BU6.NoopContextManager;class _Q1{constructor(){}static getInstance(){if(!this._instance)this._instance=new _Q1;return this._instance}setGlobalContextManager(J){return(0,vQ1.registerGlobal)(kQ1,J,Wp1.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,vQ1.getGlobal)(kQ1)||DU6}disable(){this._getContextManager().disable(),(0,vQ1.unregisterGlobal)(kQ1,Wp1.DiagAPI.instance())}}Fp1.ContextAPI=_Q1});var bQ1=t((Bp1)=>{Object.defineProperty(Bp1,"__esModule",{value:!0});Bp1.TraceFlags=void 0;var MU6;(function(J){J[J.NONE=0]="NONE",J[J.SAMPLED=1]="SAMPLED"})(MU6=Bp1.TraceFlags||(Bp1.TraceFlags={}))});var Qd=t((Dp1)=>{Object.defineProperty(Dp1,"__esModule",{value:!0});Dp1.INVALID_SPAN_CONTEXT=Dp1.INVALID_TRACEID=Dp1.INVALID_SPANID=void 0;var VU6=bQ1();Dp1.INVALID_SPANID="0000000000000000";Dp1.INVALID_TRACEID="00000000000000000000000000000000";Dp1.INVALID_SPAN_CONTEXT={traceId:Dp1.INVALID_TRACEID,spanId:Dp1.INVALID_SPANID,traceFlags:VU6.TraceFlags.NONE}});var Zd=t((Ap1)=>{Object.defineProperty(Ap1,"__esModule",{value:!0});Ap1.NonRecordingSpan=void 0;var NU6=Qd();class Lp1{constructor(J=NU6.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){}}Ap1.NonRecordingSpan=Lp1});var hQ1=t((Op1)=>{Object.defineProperty(Op1,"__esModule",{value:!0});Op1.getSpanContext=Op1.setSpanContext=Op1.deleteSpan=Op1.setSpan=Op1.getActiveSpan=Op1.getSpan=void 0;var LU6=cC(),AU6=Zd(),wU6=iC(),yQ1=(0,LU6.createContextKey)("OpenTelemetry Context Key SPAN");function fQ1(J){return J.getValue(yQ1)||void 0}Op1.getSpan=fQ1;function RU6(){return fQ1(wU6.ContextAPI.getInstance().active())}Op1.getActiveSpan=RU6;function Rp1(J,Q){return J.setValue(yQ1,Q)}Op1.setSpan=Rp1;function OU6(J){return J.deleteValue(yQ1)}Op1.deleteSpan=OU6;function jU6(J,Q){return Rp1(J,new AU6.NonRecordingSpan(Q))}Op1.setSpanContext=jU6;function $U6(J){var Q;return(Q=fQ1(J))===null||Q===void 0?void 0:Q.spanContext()}Op1.getSpanContext=$U6});var Xd=t((Pp1)=>{Object.defineProperty(Pp1,"__esModule",{value:!0});Pp1.wrapSpanContext=Pp1.isSpanContextValid=Pp1.isValidSpanId=Pp1.isValidTraceId=void 0;var $p1=Qd(),SU6=Zd(),vU6=/^([0-9a-f]{32})$/i,kU6=/^[0-9a-f]{16}$/i;function Ep1(J){return vU6.test(J)&&J!==$p1.INVALID_TRACEID}Pp1.isValidTraceId=Ep1;function Ip1(J){return kU6.test(J)&&J!==$p1.INVALID_SPANID}Pp1.isValidSpanId=Ip1;function _U6(J){return Ep1(J.traceId)&&Ip1(J.spanId)}Pp1.isSpanContextValid=_U6;function xU6(J){return new SU6.NonRecordingSpan(J)}Pp1.wrapSpanContext=xU6});var uQ1=t((vp1)=>{Object.defineProperty(vp1,"__esModule",{value:!0});vp1.NoopTracer=void 0;var hU6=iC(),Cp1=hQ1(),gQ1=Zd(),gU6=Xd(),mQ1=hU6.ContextAPI.getInstance();class Sp1{startSpan(J,Q,Z=mQ1.active()){if(Boolean(Q===null||Q===void 0?void 0:Q.root))return new gQ1.NonRecordingSpan;let Y=Z&&(0,Cp1.getSpanContext)(Z);if(mU6(Y)&&(0,gU6.isSpanContextValid)(Y))return new gQ1.NonRecordingSpan(Y);else return new gQ1.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:mQ1.active(),z=this.startSpan(J,Y,q),U=(0,Cp1.setSpan)(q,z);return mQ1.with(U,G,void 0,z)}}vp1.NoopTracer=Sp1;function mU6(J){return typeof J==="object"&&typeof J.spanId==="string"&&typeof J.traceId==="string"&&typeof J.traceFlags==="number"}});var pQ1=t((xp1)=>{Object.defineProperty(xp1,"__esModule",{value:!0});xp1.ProxyTracer=void 0;var uU6=uQ1(),pU6=new uU6.NoopTracer;class _p1{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 pU6;return this._delegate=J,this._delegate}}xp1.ProxyTracer=_p1});var gp1=t((fp1)=>{Object.defineProperty(fp1,"__esModule",{value:!0});fp1.NoopTracerProvider=void 0;var dU6=uQ1();class yp1{getTracer(J,Q,Z){return new dU6.NoopTracer}}fp1.NoopTracerProvider=yp1});var dQ1=t((up1)=>{Object.defineProperty(up1,"__esModule",{value:!0});up1.ProxyTracerProvider=void 0;var cU6=pQ1(),lU6=gp1(),iU6=new lU6.NoopTracerProvider;class mp1{getTracer(J,Q,Z){var X;return(X=this.getDelegateTracer(J,Q,Z))!==null&&X!==void 0?X:new cU6.ProxyTracer(this,J,Q,Z)}getDelegate(){var J;return(J=this._delegate)!==null&&J!==void 0?J:iU6}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)}}up1.ProxyTracerProvider=mp1});var cp1=t((dp1)=>{Object.defineProperty(dp1,"__esModule",{value:!0});dp1.SamplingDecision=void 0;var aU6;(function(J){J[J.NOT_RECORD=0]="NOT_RECORD",J[J.RECORD=1]="RECORD",J[J.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(aU6=dp1.SamplingDecision||(dp1.SamplingDecision={}))});var ip1=t((lp1)=>{Object.defineProperty(lp1,"__esModule",{value:!0});lp1.SpanKind=void 0;var nU6;(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"})(nU6=lp1.SpanKind||(lp1.SpanKind={}))});var np1=t((ap1)=>{Object.defineProperty(ap1,"__esModule",{value:!0});ap1.SpanStatusCode=void 0;var rU6;(function(J){J[J.UNSET=0]="UNSET",J[J.OK=1]="OK",J[J.ERROR=2]="ERROR"})(rU6=ap1.SpanStatusCode||(ap1.SpanStatusCode={}))});var op1=t((rp1)=>{Object.defineProperty(rp1,"__esModule",{value:!0});rp1.validateValue=rp1.validateKey=void 0;var aQ1="[_0-9a-z-*/]",sU6=`[a-z]${aQ1}{0,255}`,oU6=`[a-z0-9]${aQ1}{0,240}@[a-z]${aQ1}{0,13}`,tU6=new RegExp(`^(?:${sU6}|${oU6})$`),eU6=/^[ -~]{0,255}[!-~]$/,JW6=/,|=/;function QW6(J){return tU6.test(J)}rp1.validateKey=QW6;function ZW6(J){return eU6.test(J)&&!JW6.test(J)}rp1.validateValue=ZW6});var Yd1=t((Zd1)=>{Object.defineProperty(Zd1,"__esModule",{value:!0});Zd1.TraceStateImpl=void 0;var tp1=op1(),ep1=32,YW6=512,Jd1=",",Qd1="=";class nQ1{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+Qd1+this.get(Q)),J},[]).join(Jd1)}_parse(J){if(J.length>YW6)return;if(this._internalState=J.split(Jd1).reverse().reduce((Q,Z)=>{let X=Z.trim(),Y=X.indexOf(Qd1);if(Y!==-1){let K=X.slice(0,Y),G=X.slice(Y+1,Z.length);if((0,tp1.validateKey)(K)&&(0,tp1.validateValue)(G))Q.set(K,G)}return Q},new Map),this._internalState.size>ep1)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,ep1))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let J=new nQ1;return J._internalState=new Map(this._internalState),J}}Zd1.TraceStateImpl=nQ1});var qd1=t((Kd1)=>{Object.defineProperty(Kd1,"__esModule",{value:!0});Kd1.createTraceState=void 0;var KW6=Yd1();function GW6(J){return new KW6.TraceStateImpl(J)}Kd1.createTraceState=GW6});var Wd1=t((zd1)=>{Object.defineProperty(zd1,"__esModule",{value:!0});zd1.context=void 0;var qW6=iC();zd1.context=qW6.ContextAPI.getInstance()});var Bd1=t((Fd1)=>{Object.defineProperty(Fd1,"__esModule",{value:!0});Fd1.diag=void 0;var zW6=MN();Fd1.diag=zW6.DiagAPI.instance()});var Vd1=t((Dd1)=>{Object.defineProperty(Dd1,"__esModule",{value:!0});Dd1.NOOP_METER_PROVIDER=Dd1.NoopMeterProvider=void 0;var UW6=TQ1();class rQ1{getMeter(J,Q,Z){return UW6.NOOP_METER}}Dd1.NoopMeterProvider=rQ1;Dd1.NOOP_METER_PROVIDER=new rQ1});var wd1=t((Ld1)=>{Object.defineProperty(Ld1,"__esModule",{value:!0});Ld1.MetricsAPI=void 0;var FW6=Vd1(),sQ1=DN(),Nd1=MN(),oQ1="metrics";class tQ1{constructor(){}static getInstance(){if(!this._instance)this._instance=new tQ1;return this._instance}setGlobalMeterProvider(J){return(0,sQ1.registerGlobal)(oQ1,J,Nd1.DiagAPI.instance())}getMeterProvider(){return(0,sQ1.getGlobal)(oQ1)||FW6.NOOP_METER_PROVIDER}getMeter(J,Q,Z){return this.getMeterProvider().getMeter(J,Q,Z)}disable(){(0,sQ1.unregisterGlobal)(oQ1,Nd1.DiagAPI.instance())}}Ld1.MetricsAPI=tQ1});var jd1=t((Rd1)=>{Object.defineProperty(Rd1,"__esModule",{value:!0});Rd1.metrics=void 0;var HW6=wd1();Rd1.metrics=HW6.MetricsAPI.getInstance()});var Pd1=t((Ed1)=>{Object.defineProperty(Ed1,"__esModule",{value:!0});Ed1.NoopTextMapPropagator=void 0;class $d1{inject(J,Q){}extract(J,Q){return J}fields(){return[]}}Ed1.NoopTextMapPropagator=$d1});var vd1=t((Cd1)=>{Object.defineProperty(Cd1,"__esModule",{value:!0});Cd1.deleteBaggage=Cd1.setBaggage=Cd1.getActiveBaggage=Cd1.getBaggage=void 0;var BW6=iC(),DW6=cC(),eQ1=(0,DW6.createContextKey)("OpenTelemetry Baggage Key");function Td1(J){return J.getValue(eQ1)||void 0}Cd1.getBaggage=Td1;function MW6(){return Td1(BW6.ContextAPI.getInstance().active())}Cd1.getActiveBaggage=MW6;function VW6(J,Q){return J.setValue(eQ1,Q)}Cd1.setBaggage=VW6;function NW6(J){return J.deleteValue(eQ1)}Cd1.deleteBaggage=NW6});var yd1=t((xd1)=>{Object.defineProperty(xd1,"__esModule",{value:!0});xd1.PropagationAPI=void 0;var JZ1=DN(),RW6=Pd1(),kd1=SQ1(),Yd=vd1(),OW6=LQ1(),_d1=MN(),QZ1="propagation",jW6=new RW6.NoopTextMapPropagator;class ZZ1{constructor(){this.createBaggage=OW6.createBaggage,this.getBaggage=Yd.getBaggage,this.getActiveBaggage=Yd.getActiveBaggage,this.setBaggage=Yd.setBaggage,this.deleteBaggage=Yd.deleteBaggage}static getInstance(){if(!this._instance)this._instance=new ZZ1;return this._instance}setGlobalPropagator(J){return(0,JZ1.registerGlobal)(QZ1,J,_d1.DiagAPI.instance())}inject(J,Q,Z=kd1.defaultTextMapSetter){return this._getGlobalPropagator().inject(J,Q,Z)}extract(J,Q,Z=kd1.defaultTextMapGetter){return this._getGlobalPropagator().extract(J,Q,Z)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,JZ1.unregisterGlobal)(QZ1,_d1.DiagAPI.instance())}_getGlobalPropagator(){return(0,JZ1.getGlobal)(QZ1)||jW6}}xd1.PropagationAPI=ZZ1});var gd1=t((fd1)=>{Object.defineProperty(fd1,"__esModule",{value:!0});fd1.propagation=void 0;var $W6=yd1();fd1.propagation=$W6.PropagationAPI.getInstance()});var ld1=t((dd1)=>{Object.defineProperty(dd1,"__esModule",{value:!0});dd1.TraceAPI=void 0;var XZ1=DN(),md1=dQ1(),ud1=Xd(),gR=hQ1(),pd1=MN(),YZ1="trace";class KZ1{constructor(){this._proxyTracerProvider=new md1.ProxyTracerProvider,this.wrapSpanContext=ud1.wrapSpanContext,this.isSpanContextValid=ud1.isSpanContextValid,this.deleteSpan=gR.deleteSpan,this.getSpan=gR.getSpan,this.getActiveSpan=gR.getActiveSpan,this.getSpanContext=gR.getSpanContext,this.setSpan=gR.setSpan,this.setSpanContext=gR.setSpanContext}static getInstance(){if(!this._instance)this._instance=new KZ1;return this._instance}setGlobalTracerProvider(J){let Q=(0,XZ1.registerGlobal)(YZ1,this._proxyTracerProvider,pd1.DiagAPI.instance());if(Q)this._proxyTracerProvider.setDelegate(J);return Q}getTracerProvider(){return(0,XZ1.getGlobal)(YZ1)||this._proxyTracerProvider}getTracer(J,Q){return this.getTracerProvider().getTracer(J,Q)}disable(){(0,XZ1.unregisterGlobal)(YZ1,pd1.DiagAPI.instance()),this._proxyTracerProvider=new md1.ProxyTracerProvider}}dd1.TraceAPI=KZ1});var nd1=t((id1)=>{Object.defineProperty(id1,"__esModule",{value:!0});id1.trace=void 0;var EW6=ld1();id1.trace=EW6.TraceAPI.getInstance()});var Kd=t((T2)=>{Object.defineProperty(T2,"__esModule",{value:!0});T2.trace=T2.propagation=T2.metrics=T2.diag=T2.context=T2.INVALID_SPAN_CONTEXT=T2.INVALID_TRACEID=T2.INVALID_SPANID=T2.isValidSpanId=T2.isValidTraceId=T2.isSpanContextValid=T2.createTraceState=T2.TraceFlags=T2.SpanStatusCode=T2.SpanKind=T2.SamplingDecision=T2.ProxyTracerProvider=T2.ProxyTracer=T2.defaultTextMapSetter=T2.defaultTextMapGetter=T2.ValueType=T2.createNoopMeter=T2.DiagLogLevel=T2.DiagConsoleLogger=T2.ROOT_CONTEXT=T2.createContextKey=T2.baggageEntryMetadataFromString=void 0;var IW6=LQ1();Object.defineProperty(T2,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return IW6.baggageEntryMetadataFromString}});var rd1=cC();Object.defineProperty(T2,"createContextKey",{enumerable:!0,get:function(){return rd1.createContextKey}});Object.defineProperty(T2,"ROOT_CONTEXT",{enumerable:!0,get:function(){return rd1.ROOT_CONTEXT}});var PW6=lu1();Object.defineProperty(T2,"DiagConsoleLogger",{enumerable:!0,get:function(){return PW6.DiagConsoleLogger}});var TW6=tp();Object.defineProperty(T2,"DiagLogLevel",{enumerable:!0,get:function(){return TW6.DiagLogLevel}});var CW6=TQ1();Object.defineProperty(T2,"createNoopMeter",{enumerable:!0,get:function(){return CW6.createNoopMeter}});var SW6=Xp1();Object.defineProperty(T2,"ValueType",{enumerable:!0,get:function(){return SW6.ValueType}});var sd1=SQ1();Object.defineProperty(T2,"defaultTextMapGetter",{enumerable:!0,get:function(){return sd1.defaultTextMapGetter}});Object.defineProperty(T2,"defaultTextMapSetter",{enumerable:!0,get:function(){return sd1.defaultTextMapSetter}});var vW6=pQ1();Object.defineProperty(T2,"ProxyTracer",{enumerable:!0,get:function(){return vW6.ProxyTracer}});var kW6=dQ1();Object.defineProperty(T2,"ProxyTracerProvider",{enumerable:!0,get:function(){return kW6.ProxyTracerProvider}});var _W6=cp1();Object.defineProperty(T2,"SamplingDecision",{enumerable:!0,get:function(){return _W6.SamplingDecision}});var xW6=ip1();Object.defineProperty(T2,"SpanKind",{enumerable:!0,get:function(){return xW6.SpanKind}});var bW6=np1();Object.defineProperty(T2,"SpanStatusCode",{enumerable:!0,get:function(){return bW6.SpanStatusCode}});var yW6=bQ1();Object.defineProperty(T2,"TraceFlags",{enumerable:!0,get:function(){return yW6.TraceFlags}});var fW6=qd1();Object.defineProperty(T2,"createTraceState",{enumerable:!0,get:function(){return fW6.createTraceState}});var GZ1=Xd();Object.defineProperty(T2,"isSpanContextValid",{enumerable:!0,get:function(){return GZ1.isSpanContextValid}});Object.defineProperty(T2,"isValidTraceId",{enumerable:!0,get:function(){return GZ1.isValidTraceId}});Object.defineProperty(T2,"isValidSpanId",{enumerable:!0,get:function(){return GZ1.isValidSpanId}});var qZ1=Qd();Object.defineProperty(T2,"INVALID_SPANID",{enumerable:!0,get:function(){return qZ1.INVALID_SPANID}});Object.defineProperty(T2,"INVALID_TRACEID",{enumerable:!0,get:function(){return qZ1.INVALID_TRACEID}});Object.defineProperty(T2,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return qZ1.INVALID_SPAN_CONTEXT}});var od1=Wd1();Object.defineProperty(T2,"context",{enumerable:!0,get:function(){return od1.context}});var td1=Bd1();Object.defineProperty(T2,"diag",{enumerable:!0,get:function(){return td1.diag}});var ed1=jd1();Object.defineProperty(T2,"metrics",{enumerable:!0,get:function(){return ed1.metrics}});var Jc1=gd1();Object.defineProperty(T2,"propagation",{enumerable:!0,get:function(){return Jc1.propagation}});var Qc1=nd1();Object.defineProperty(T2,"trace",{enumerable:!0,get:function(){return Qc1.trace}});T2.default={context:od1.context,diag:td1.diag,metrics:ed1.metrics,propagation:Jc1.propagation,trace:Qc1.trace}});function uW6(){return mW6}function Zc1(J){let Q=VN;return VN=J,Q}class cq{baseLogger;scope;context={};constructor(J=Xc1){this.baseLogger=J}with(J){let Q=new cq(this.baseLogger);return Q.scope=this.scope,Q.context={...this.context,...J},Q}scoped(J){let Q=new cq(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=zZ1.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 zZ1,mW6=!1,pW6,VN,Xc1,u;var G0=B1(()=>{zZ1=x6(Kd(),1);pW6={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(uW6())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=zZ1.trace.getActiveSpan();if(X){let Y=X.spanContext();if(Y.traceId)Z.traceId=Y.traceId,Z.spanId=Y.spanId}console.info(J,Z)}},VN=pW6;Xc1={error:(J,...Q)=>VN.error(J,...Q),warn:(J,...Q)=>VN.warn(J,...Q),info:(J,...Q)=>VN.info(J,...Q),debug:(J,...Q)=>VN.debug(J,...Q),audit:(J,...Q)=>VN.audit(J,...Q)};u=Xc1});function Gd(J){Promise.resolve().then(()=>{try{J()}catch(Q){console.error(Q)}})}function Yc1(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 FZ1(J){J._observer=void 0,J._queue=void 0,J._state="closed"}function cW6(J){let Q=J._queue;if(!Q)return;J._queue=void 0,J._state="ready";for(let Z of Q)if(Kc1(J,Z.type,Z.value),J._state==="closed")break}function Kc1(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(FZ1(J),X&&typeof X.error==="function")X.error(Z);else throw Z;break;case"complete":if(FZ1(J),X&&typeof X.complete==="function")X.complete();break}}catch(Y){console.error("notifySubscription",Y)}if(J._state==="closed")Yc1(J);else if(J._state==="running")J._state="ready"}function WZ1(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}],Gd(()=>cW6(J));return}Kc1(J,Q,Z)}class Gc1{_cleanup;_observer;_queue;_state;constructor(J,Q){this._cleanup=void 0,this._observer=J,this._queue=void 0,this._state="initializing";let Z=new qc1(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")FZ1(this),Yc1(this)}}class qc1{_subscription;constructor(J){this._subscription=J}get closed(){return this._subscription._state==="closed"}next(J){WZ1(this._subscription,"next",J)}error(J){WZ1(this._subscription,"error",J)}complete(){WZ1(this._subscription,"complete")}}function z4(J){if(typeof J==="function")J();else if(J&&typeof J.unsubscribe==="function")J.unsubscribe()}class mR{_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 HZ1(J){return J&&typeof J.subscribe==="function"&&typeof J[Symbol.observable]==="function"}function BZ1(J){if(HZ1(J))return J;return t1.of(J)}var t1;var uR=B1(()=>{if(!Symbol.observable)Symbol.observable=Symbol("observable");t1=class t1{_subscriber;constructor(J){if(!(this instanceof t1))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 Gc1(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:t1;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 t1)return Y;return new Q((K)=>Y.subscribe(K))}let X=J[Symbol.iterator];if(typeof X==="function")return new Q((Y)=>{Gd(()=>{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)=>{Gd(()=>{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:t1)((Z)=>{Gd(()=>{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 I8,U4;var qd=B1(()=>{uR();I8=class I8 extends t1{_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()}};U4=class U4 extends I8{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,aC;var zc1=B1(()=>{uR();qd();DZ1=class DZ1 extends Set{subject=new U4(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 t1.from(this.subject)}dispose(){this.subject.complete()}};aC=class aC extends Map{subject=new U4(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 t1.from(this.subject)}dispose(){this.subject.complete()}}});function zd(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)=>zd(K,Q[G]));let Y=new Set([...Object.keys(J),...Object.keys(Q)]);for(let K of Y)if(!zd(J[K],Q[K]))return!1;return!0}function MZ1(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 QB(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 t1((Q)=>{J.then((Z)=>{Q.next(Z),Q.complete()}).catch((Z)=>{Q.error(Z)})})}function c6(J){return new t1((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 y0(J){return(Q)=>{return new t1((Z)=>{let X=new mR(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()=>z4(K)})}}function Ud(J){return new t1((Q)=>{let Z=0,X=setInterval(()=>{Q.next(Z++)},J);return()=>clearInterval(X)})}function NN(...J){return new t1((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()=>{Wc1(X)}})}function b9(...J){if(J.length===0)return nC;return new t1((Q)=>{let Z=Array(J.length),X=Array(J.length).fill(0),Y=Array(J.length).fill(!1),K=0,G=[],q=new mR(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()=>{Wc1(G)}})}function M9(J){let Z=J?.shouldCountRefs??!0,X=lW6++,Y=(K,...G)=>{};return(K)=>{let G=new I8,q=null,z=!1,U,W=0;return new t1((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)z4(q),q=null;z=!1}}})}}function Wc1(J){for(let Q of J)if(Q)z4(Q)}function pR(J){return(Q)=>{return new t1((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 QW(J){return(Q)=>{return new t1((Z)=>{let X,Y=Q.subscribe({next(K){X=K,Z.next(K)},error(K){Z.error(K)},complete(){Z.complete()}});return()=>{z4(Y),J(X)}})}}function G8(J=zd){return(Q)=>{return new t1((Z)=>{let X=Uc1,Y=new mR(Z),K=Q.subscribe({complete(){Y.complete()},error(G){Y.error(G)},next(G){Y.schedule(async(q)=>{if(X===Uc1||!J(X,G))X=G,q(G)})}});return()=>z4(K)})}}function LN(J){return iW6(typeof J==="function"?{next:J}:J)}function iW6(J){return(Q)=>new t1((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()=>z4(Y)})}function dR(J){return(Q)=>{return new t1((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 Fc1(`Operation timed out after ${J}ms`))},J);return()=>{clearTimeout(K),Y.unsubscribe()}})}}function u2(J){return(Q)=>new t1((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)z4(X)}})}function AN(J){return(Q)=>new t1((Z)=>{let X=0,Y=Q.subscribe({next(K){if(X<J){if(Z.next(K),X++,X===J)Z.complete(),z4(Y)}},error(K){Z.error(K)},complete(){Z.complete()}});return()=>{z4(Y)}})}function Hc1(J){return(Q)=>new t1((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()=>{z4(Y)}})}function q8(J){return(Q)=>{return new t1((Z)=>{let X=0,Y=null,K=!1,G=()=>{if(K&&!Y)Z.complete()},q=Q.subscribe({next(z){if(Y)z4(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(z4(q),Y)z4(Y)}})}}function Bc1(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 sK(J){return(Q)=>new t1((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(z4(G),X!==null)clearTimeout(X)}})}function VZ1(J,Q){if(!Q.leading||!Q.trailing)throw Error("leading and trailing must be true");return(Z)=>new t1((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(z4(z),K!==null)clearTimeout(K)}})}function rC(...J){return new t1((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)z4(X)}})}function oK(J){return(Q)=>new t1((Z)=>{let X=0,Y=!1,K=null,G=Q.subscribe({next(q){try{let z=J(q,X++);if(K)z4(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(z4(G),K)z4(K)}})}function sC({onSubscribe:J,onUnsubscribe:Q}){return(Z)=>new t1((X)=>{J?.();let Y=Z.subscribe(X);return()=>{z4(Y),Q?.()}})}function ZW(J){return(Q)=>t1.from(Q).pipe(q8((Z)=>c6((X)=>J(Z,X))))}function n5(J){return(Q)=>new t1((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(z4(Y),X)z4(X)}})}function I7(J){return(Q)=>{return new t1((Z)=>{let X=Q.subscribe({next(Y){if(J(Y))Z.next(Y)},error(Y){Z.error(Y)},complete(){Z.complete()}});return()=>z4(X)})}}function Dc1(J,Q){return(Z)=>{return new t1((X)=>{let Y,K=0,G=new mR(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()=>z4(q)})}}var nC,LY,uG9,lW6=0,Uc1,Fc1;var NZ1=B1(()=>{uR();qd();nC=new t1((J)=>{J.complete()}),LY=new t1(()=>{});uG9=Symbol("noInitialValue");Uc1={};Fc1=class Fc1 extends Error{constructor(J="Timeout has occurred"){super(J);this.name="TimeoutError"}}});function wN(J,Q){return(Z)=>{return t1.from(Z).pipe(q8((X)=>X===r5?t1.of(r5):J(X).pipe(n5((Y)=>t1.of(Y instanceof Error?Y:Error(Y))),u2(r5))),M9(Q))}}function aW6(){return(J)=>t1.from(J).pipe(I7((Q)=>Q!==r5))}async function oC(J,Q){let Z=await G6(t1.from(J).pipe(aW6()),Q);if(Z instanceof Error)throw Z;return Z}var r5;var Mc1=B1(()=>{uR();NZ1();r5=Symbol.for("@@pendingOperation")});var v0=B1(()=>{zc1();uR();Mc1();NZ1();qd()});var b6=B1(()=>{mC();op();bR()});import nW6 from"os";import Wd from"path";var ZB,RN,XB,YB,Vc1,Yq9,Kq9,rW6,sW6;var cR=B1(()=>{ZB=nW6.homedir(),{env:RN}=process,XB=RN.XDG_DATA_HOME||(ZB?Wd.join(ZB,".local","share"):void 0),YB=RN.XDG_CONFIG_HOME||(ZB?Wd.join(ZB,".config"):void 0),Vc1=RN.XDG_STATE_HOME||(ZB?Wd.join(ZB,".local","state"):void 0),Yq9=RN.XDG_CACHE_HOME||(ZB?Wd.join(ZB,".cache"):void 0),Kq9=RN.XDG_RUNTIME_DIR||void 0,rW6=(RN.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");if(XB)rW6.unshift(XB);sW6=(RN.XDG_CONFIG_DIRS||"/etc/xdg").split(":");if(YB)sW6.unshift(YB)});import{promises as oW6}from"node:fs";import*as ON from"node:path";async function Nc1(J){try{let Q=await oW6.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 Lc1(J,Q){let Z=(J&73)!==0;if(process.platform==="win32"){let X=ON.extname(Q).toLowerCase();return Z||[".exe",".bat",".cmd",".ps1"].includes(X)}return Z}function Ac1(J){return ON.extname(J).toLowerCase()===".md"}function wc1(J){let Q=J.replace(/\\/g,"/"),Z=ON.basename(Q);return ON.basename(Z,ON.extname(Z))}function Rc1(J){return/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(J)&&J.length>0}var Oc1=()=>{};var Ic1={};C6(Ic1,{CommandDiscovery:()=>Ec1});import*as $c1 from"node:fs";import{promises as Fd}from"node:fs";import{homedir as jc1}from"node:os";import*as LX from"node:path";function AZ1(J,Q,Z){return Promise.race([J,new Promise((X,Y)=>setTimeout(()=>Y(Error(`${Z} timed out after ${Q}ms`)),Q))])}class Ec1{config;workspaceRoots;watchFactory;debounceMs;changes=new I8;watchers=new Map;debounceTimer;disposed=!1;constructor(J,Q,Z={}){this.config=J,this.workspaceRoots=Q,this.watchFactory=Z.watchFactory??tW6,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=$0.file(Z),Y=await this.discoverCommandsInDirectory(X,"global");J.push(...Y)}return J}async discoverCommandsInDirectory(J,Q){try{let Z=J.fsPath;try{await AZ1(Fd.access(Z),LZ1,"directory access")}catch{return[]}let Y=(await AZ1(Fd.readdir(Z,{withFileTypes:!0}),LZ1,"directory read")).filter((G)=>G.isFile()),K=[];for(let G of Y){let q=LX.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 Fd.stat(J),Z=LX.basename(J);if(this.ignoreCommandName(Z))return null;let X=wc1(Z);if(!Rc1(X))return u.warn(`Invalid command name: ${X}`,{filePath:J}),null;if(Ac1(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:LX.dirname(J),lastModified:Q.mtimeMs,available:!0,unavailableReason:void 0}}async createExecutableCommand(J,Q,Z){let X=LX.basename(J),Y=Lc1(Q.mode,X),K=await Nc1(J),G=LX.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:LX.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 LX.join(jc1(),J.slice(2));if(J.startsWith("~/.config/amp/")){let Q=YB||LX.join(jc1(),".config");return LX.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 AZ1(Fd.access(J),LZ1,"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 LZ1=5000,tW6=(J,Q)=>$c1.watch(J,Q);var Pc1=B1(()=>{b6();v0();cR();G0();Oc1()});import{homedir as Hd}from"node:os";import jN from"node:path";var Cc1,YF6,Sc1,KF6,Bd,GF6,lR,KB,RZ1;var XW=B1(()=>{cR();Cc1=jN.join(Hd(),".local/share"),YF6=process.platform==="win32"||process.platform==="darwin"?Cc1:XB??Cc1,Sc1=jN.join(Hd(),".config"),KF6=process.platform==="win32"||process.platform==="darwin"?Sc1:YB??Sc1,Bd=jN.join(YF6,"amp"),GF6=jN.join(KF6,"amp"),lR=jN.join(GF6,"tools"),KB=jN.join(Hd(),".cache","amp"),RZ1=jN.join(Hd(),".cache","amp","http-debug-logs")});function wX(J,Q,Z=Q+"s"){return J===1?Q:Z}var rR;var TZ1=B1(()=>{rR={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"},{type:"webview",id:"amp.reviewPanel",name:"Review",icon:"$(compare-changes)",visibility:"visible",when:"config.amp.review.separatePanel"}]},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"},{command:"amp.agent.switchAgentMode",key:"ctrl+shift+m",mac:"cmd+shift+m",when:"amp.activated && amp.hasMultipleVisibleModes"}],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"}},oauth:{type:"object",description:"OAuth 2.0 configuration for MCP server authentication",properties:{clientId:{type:"string",description:"OAuth client ID"},clientSecret:{type:"string",description:"OAuth client secret (optional for public clients)"},authUrl:{type:"string",description:"OAuth authorization endpoint URL"},tokenUrl:{type:"string",description:"OAuth token endpoint URL"},scopes:{type:"array",description:"OAuth scopes to request",items:{type:"string"}},redirectUrl:{type:"string",description:"OAuth redirect URL (defaults to http://localhost:8976/oauth/callback)"}}}},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.promptAutocomplete.verboseLogging":{type:"boolean",default:!1,markdownDescription:"Enable verbose logging for prompt autocomplete.",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.review.separatePanel":{type:"boolean",default:!1,description:"Show the review panel as a separate container that's independently draggable to a different sidebar location.",scope:"window"},"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.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","jsonc-parser":"^3.3.1",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"}}});var dc1="run_terminal_command",Nd="read_file",cc1="write_file",s5="Task",lc1="chat_llm",P5="finder",GB="fast_finder",lq="xai_finder",iq="kimiK2_finder",qB="gossip_finder",zB="sonoma_finder",EN="get_diagnostics",c4="Bash",o5="oracle",YS="mermaid",UB="todo_read",t5="todo_write",aq="read_web_page",Ld="read_thread",ic1="run_javascript",CJ="create_file",WB="glob",ac1="Glob",Ad="undo_edit",wd="read_mcp_resource",J9="Read",NQ="edit_file",Rd="format_file",FB="web_search",v4="Grep",KS="Check",nq="librarian",Od="read_github",jd="search_github",$d="commit_search",Ed="list_directory_github",Id="list_repositories",Pd="glob_github",Td="diff",nc1;var F8=B1(()=>{nc1=["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","delete_file","format_file","web_search","Grep","search_documents","get_document","Check","code_review","librarian","read_thread"]});var GS=t((qz9,sc1)=>{var rc1={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:"/"},$F6={...rc1,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:"\\"},EF6={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"};sc1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:EF6,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?$F6:rc1}}});var qS=t((SF6)=>{var{REGEX_BACKSLASH:IF6,REGEX_REMOVE_BACKSLASH:PF6,REGEX_SPECIAL_CHARS:TF6,REGEX_SPECIAL_CHARS_GLOBAL:CF6}=GS();SF6.isObject=(J)=>J!==null&&typeof J==="object"&&!Array.isArray(J);SF6.hasRegexChars=(J)=>TF6.test(J);SF6.isRegexChar=(J)=>J.length===1&&SF6.hasRegexChars(J);SF6.escapeRegex=(J)=>J.replace(CF6,"\\$1");SF6.toPosixSlashes=(J)=>J.replace(IF6,"/");SF6.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};SF6.removeBackslashes=(J)=>{return J.replace(PF6,(Q)=>{return Q==="\\"?"":Q})};SF6.escapeLast=(J,Q,Z)=>{let X=J.lastIndexOf(Q,Z);if(X===-1)return J;if(J[X-1]==="\\")return SF6.escapeLast(J,Q,X-1);return`${J.slice(0,X)}\\${J.slice(X)}`};SF6.removePrefix=(J,Q={})=>{let Z=J;if(Z.startsWith("./"))Z=Z.slice(2),Q.prefix="./";return Z};SF6.wrapOutput=(J,Q={},Z={})=>{let X=Z.contains?"":"^",Y=Z.contains?"":"$",K=`${X}(?:${J})${Y}`;if(Q.negated===!0)K=`(?:^(?!${K}).*$)`;return K};SF6.basename=(J,{windows:Q}={})=>{let Z=J.split(Q?/[\\/]/:"/"),X=Z[Z.length-1];if(X==="")return Z[Z.length-2];return X}});var Gl1=t((Uz9,Kl1)=>{var ec1=qS(),{CHAR_ASTERISK:CZ1,CHAR_AT:mF6,CHAR_BACKWARD_SLASH:zS,CHAR_COMMA:uF6,CHAR_DOT:SZ1,CHAR_EXCLAMATION_MARK:vZ1,CHAR_FORWARD_SLASH:Yl1,CHAR_LEFT_CURLY_BRACE:kZ1,CHAR_LEFT_PARENTHESES:_Z1,CHAR_LEFT_SQUARE_BRACKET:pF6,CHAR_PLUS:dF6,CHAR_QUESTION_MARK:Jl1,CHAR_RIGHT_CURLY_BRACE:cF6,CHAR_RIGHT_PARENTHESES:Ql1,CHAR_RIGHT_SQUARE_BRACKET:lF6}=GS(),Zl1=(J)=>{return J===Yl1||J===zS},Xl1=(J)=>{if(J.isPrefix!==!0)J.depth=J.isGlobstar?1/0:1},iF6=(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,$=0,j,E,I={value:"",depth:0,isGlob:!1},T=()=>U>=X,S=()=>z.charCodeAt(U+1),x=()=>{return j=E,z.charCodeAt(++U)};while(U<X){E=x();let g;if(E===zS){if(A=I.backslashes=!0,E=x(),E===kZ1)L=!0;continue}if(L===!0||E===kZ1){$++;while(T()!==!0&&(E=x())){if(E===zS){A=I.backslashes=!0,x();continue}if(E===kZ1){$++;continue}if(L!==!0&&E===SZ1&&(E=x())===SZ1){if(H=I.isBrace=!0,M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(L!==!0&&E===uF6){if(H=I.isBrace=!0,M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===cF6){if($--,$===0){L=!1,H=I.isBrace=!0,O=!0;break}}}if(Y===!0)continue;break}if(E===Yl1){if(K.push(U),G.push(I),I={value:"",depth:0,isGlob:!1},O===!0)continue;if(j===SZ1&&U===W+1){W+=2;continue}F=U+1;continue}if(Z.noext!==!0){if((E===dF6||E===mF6||E===CZ1||E===Jl1||E===vZ1)===!0&&S()===_Z1){if(M=I.isGlob=!0,V=I.isExtglob=!0,O=!0,E===vZ1&&U===W)R=!0;if(Y===!0){while(T()!==!0&&(E=x())){if(E===zS){A=I.backslashes=!0,E=x();continue}if(E===Ql1){M=I.isGlob=!0,O=!0;break}}continue}break}}if(E===CZ1){if(j===CZ1)N=I.isGlobstar=!0;if(M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===Jl1){if(M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===pF6){while(T()!==!0&&(g=x())){if(g===zS){A=I.backslashes=!0,x();continue}if(g===lF6){B=I.isBracket=!0,M=I.isGlob=!0,O=!0;break}}if(Y===!0)continue;break}if(Z.nonegate!==!0&&E===vZ1&&U===W){w=I.negated=!0,W++;continue}if(Z.noparen!==!0&&E===_Z1){if(M=I.isGlob=!0,Y===!0){while(T()!==!0&&(E=x())){if(E===_Z1){A=I.backslashes=!0,E=x();continue}if(E===Ql1){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(Zl1(h.charCodeAt(h.length-1)))h=h.slice(0,-1)}if(Z.unescape===!0){if(_)_=ec1.removeBackslashes(_);if(h&&A===!0)h=ec1.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,!Zl1(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 f=g?g+1:W,y=K[k],m=J.slice(f,y);if(Z.tokens){if(k===0&&W!==0)G[k].isPrefix=!0,G[k].value=v;else G[k].value=m;Xl1(G[k]),b.maxDepth+=G[k].depth}if(k!==0||m!=="")q.push(m);g=y}if(g&&g+1<J.length){let k=J.slice(g+1);if(q.push(k),Z.tokens)G[G.length-1].value=k,Xl1(G[G.length-1]),b.maxDepth+=G[G.length-1].depth}b.slashes=K,b.parts=q}return b};Kl1.exports=iF6});var Ul1=t((Wz9,zl1)=>{var Cd=GS(),rq=qS(),{MAX_LENGTH:Sd,POSIX_REGEX_SOURCE:aF6,REGEX_NON_SPECIAL_CHARS:nF6,REGEX_SPECIAL_CHARS_BACKREF:rF6,REPLACEMENTS:ql1}=Cd,sF6=(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)=>rq.escapeRegex(Y)).join("..")}return Z},sR=(J,Q)=>{return`Missing ${J}: "${Q}" - use "\\\\${Q}" to match literal characters`},xZ1=(J,Q)=>{if(typeof J!=="string")throw TypeError("Expected a string");J=ql1[J]||J;let Z={...Q},X=typeof Z.maxLength==="number"?Math.min(Sd,Z.maxLength):Sd,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=Cd.globChars(Z.windows),U=Cd.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,$=(F1)=>{return`(${q}(?:(?!${O}${F1.dot?M:W}).)*?)`},j=Z.dot?"":V,E=Z.dot?A:w,I=Z.bash===!0?$(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=rq.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]||"",f=()=>J.slice(T.index+1),y=(F1="",l=0)=>{T.consumed+=F1,T.index+=l},m=(F1)=>{T.output+=F1.output!=null?F1.output:F1.value,y(F1.value)},a=()=>{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},W1=(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=$(Z);if(i!==I||b()||/^\)+$/.test(f()))l=F1.close=`)$))${i}`;if(F1.inner.includes("*")&&(d=f())&&/^\.[^\\/.]+$/.test(d)){let n=xZ1(d,{...Q,fastpaths:!1}).output;l=F1.close=`)${n})${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(rF6,(d,i,n,s,Y1,J1)=>{if(s==="\\")return F1=!0,d;if(s==="?"){if(i)return i+s+(Y1?A.repeat(Y1.length):"");if(J1===0)return E+(Y1?A.repeat(Y1.length):"");return A.repeat(n.length)}if(s===".")return W.repeat(n.length);if(s==="*"){if(i)return i+s+(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=rq.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(f()),n=0;if(i&&i[0].length>2){if(n=i[0].length,T.index+=n,n%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("["),n=v.value.slice(0,i),s=v.value.slice(i+2),Y1=aF6[s];if(Y1){if(v.value=n+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&&_!=='"'){_=rq.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(sR("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||!f().includes("]")){if(Z.nobracket!==!0&&Z.strictBrackets===!0)throw SyntaxError(sR("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(sR("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||rq.hasRegexChars(d))continue;let i=rq.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 n=G.slice(),s=[];for(let Y1=n.length-1;Y1>=0;Y1--){if(G.pop(),n[Y1].type==="brace")break;if(n[Y1].type!=="dots")s.unshift(n[Y1].value)}i=sF6(s,Z),T.backtrack=!0}if(d.comma!==!0&&d.dots!==!0){let n=T.output.slice(0,d.outputIndex),s=T.tokens.slice(d.tokensIndex);d.value=d.output="\\{",_=i="\\}",T.output=n;for(let Y1 of s)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)!=="?"){W1("qmark",_);continue}if(v&&v.type==="paren"){let i=g(),n=_;if(v.value==="("&&!/[!=<:]/.test(i)||i==="<"&&!/<([!=]|\w+>)/.test(f()))n=`\\${_}`;G1({type:"text",value:_,output:n});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))){W1("negate",_);continue}}if(Z.nonegate!==!0&&T.index===0){a();continue}}if(_==="+"){if(Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){W1("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=nF6.exec(f());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,y(_);continue}let F1=f();if(Z.noextglob!==!0&&/^\([^?]/.test(F1)){W1("star",_);continue}if(v.type==="star"){if(Z.noglobstar===!0){y(_);continue}let d=v.prev,i=d.prev,n=d.type==="slash"||d.type==="bos",s=i&&(i.type==="star"||i.type==="globstar");if(Z.bash===!0&&(!n||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(!n&&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),y("/**",3)}if(d.type==="bos"&&b()){v.type="globstar",v.value+=_,v.output=$(Z),T.output=v.output,T.globstar=!0,y(_);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&!s&&b()){T.output=T.output.slice(0,-(d.output+v.output).length),d.output=`(?:${d.output}`,v.type="globstar",v.output=$(Z)+(Z.strictSlashes?")":"|$)"),v.value+=_,T.globstar=!0,T.output+=d.output+v.output,y(_);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=`${$(Z)}${H}|${H}${H1})`,v.value+=_,T.output+=d.output+v.output,T.globstar=!0,y(_+k()),G1({type:"slash",value:"/",output:""});continue}if(d.type==="bos"&&F1[0]==="/"){v.type="globstar",v.value+=_,v.output=`(?:^|${H}|${$(Z)}${H})`,T.output=v.output,T.globstar=!0,y(_+k()),G1({type:"slash",value:"/",output:""});continue}T.output=T.output.slice(0,-v.output.length),v.type="globstar",v.output=$(Z),v.value+=_,T.output+=v.output,T.globstar=!0,y(_);continue}let l={type:"star",value:_,output:I};if(Z.bash===!0){if(l.output=".*?",v.type==="bos"||v.type==="slash")l.output=j+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+=j,v.output+=j;if(g()!=="*")T.output+=B,v.output+=B}G1(l)}while(T.brackets>0){if(Z.strictBrackets===!0)throw SyntaxError(sR("closing","]"));T.output=rq.escapeLast(T.output,"["),e("brackets")}while(T.parens>0){if(Z.strictBrackets===!0)throw SyntaxError(sR("closing",")"));T.output=rq.escapeLast(T.output,"("),e("parens")}while(T.braces>0){if(Z.strictBrackets===!0)throw SyntaxError(sR("closing","}"));T.output=rq.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};xZ1.fastpaths=(J,Q)=>{let Z={...Q},X=typeof Z.maxLength==="number"?Math.min(Sd,Z.maxLength):Sd,Y=J.length;if(Y>X)throw SyntaxError(`Input length: ${Y}, exceeds maximum allowed length: ${X}`);J=ql1[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}=Cd.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=(j)=>{if(j.noglobstar===!0)return A;return`(${N}(?:(?!${B}${j.dot?z:K}).)*?)`},R=(j)=>{switch(j){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(j);if(!E)return;let I=R(E[1]);if(!I)return;return I+K+E[2]}}},O=rq.removePrefix(J,L),$=R(O);if($&&Z.strictSlashes!==!0)$+=`${G}?`;return $};zl1.exports=xZ1});var US=t((Fz9,Fl1)=>{var oF6=Gl1(),bZ1=Ul1(),Wl1=qS(),tF6=GS(),eF6=(J)=>J&&typeof J==="object"&&!Array.isArray(J),U7=(J,Q,Z=!1)=>{if(Array.isArray(J)){let W=J.map((H)=>U7(H,Q,Z));return(H)=>{for(let B of W){let M=B(H);if(M)return M}return!1}}let X=eF6(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?U7.compileRe(J,Q):U7.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=U7(Y.ignore,W,Z)}let U=(W,F=!1)=>{let{isMatch:H,match:B,output:M}=U7.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};U7.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?Wl1.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=U7.matchBase(J,Q,Z,Y);else q=Q.exec(z);return{isMatch:Boolean(q),match:q,output:z}};U7.matchBase=(J,Q,Z)=>{return(Q instanceof RegExp?Q:U7.makeRe(Q,Z)).test(Wl1.basename(J))};U7.isMatch=(J,Q,Z)=>U7(Q,Z)(J);U7.parse=(J,Q)=>{if(Array.isArray(J))return J.map((Z)=>U7.parse(Z,Q));return bZ1(J,{...Q,fastpaths:!1})};U7.scan=(J,Q)=>oF6(J,Q);U7.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=U7.toRegex(q,Q);if(X===!0)z.state=J;return z};U7.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=bZ1.fastpaths(J,Q);if(!Y.output)Y=bZ1(J,Q);return U7.compileRe(Y,Q,Z,X)};U7.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/$^/}};U7.constants=tF6;Fl1.exports=U7});var IN=t((Hz9,Dl1)=>{var Hl1=US(),JH6=qS();function Bl1(J,Q,Z=!1){if(Q&&(Q.windows===null||Q.windows===void 0))Q={...Q,windows:JH6.isWindows()};return Hl1(J,Q,Z)}Object.assign(Bl1,Hl1);Dl1.exports=Bl1});function vd(J){if(!J)return null;let Z=_d(J)?.toolAllowlist;if(!Z)return null;let X=Object.entries(WS).find(([K,G])=>G.includes(J))?.[0],Y=Nl1.filter((K)=>K!==X).map((K)=>`!${K}`);if(X&&X!=="finder")Y.push("!finder");return[...Z,...Y]}function kd(J,Q){let Z=!1;for(let X of Q){if(X==="")continue;if(X.startsWith("!")){let Y=X.slice(1);if(Ml1(J,Y))return!1;continue}if(Ml1(J,X))Z=!0}return Z}function Ml1(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 Vl1.default(Q,{dot:!0})(J)}catch(Z){return!1}return!1}var Vl1;var yZ1=B1(()=>{O2();Vl1=x6(IN(),1)});function f8(J){let Q=b2[J];return`${Q.provider}/${Q.name}`}function OX(J){let[Q,Z]=J.split("/");for(let X of Object.values(b2))if(X.provider===Q&&X.name===Z)return X;switch(Q){case"anthropic":return b2.CLAUDE_SONNET_4_5;case"openai":return b2.GPT_5;case"xai":return b2.GROK_CODE_FAST_1;case"cerebras":return b2.QWEN_3_CODER_480B;case"moonshotai":return b2.KIMI_K2_INSTRUCT;case"openrouter":return b2.SONOMA_SKY_ALPHA;case"supernova":return b2.CODE_SUPERNOVA;case"groq":return b2.GPT_OSS_120B;case"vertexai":return b2.GEMINI_2_5_FLASH_PREVIEW_09_2025;default:throw Error(`Unknown provider: ${Q}`)}}function oR(J){let[,Q]=J.split("/");return Q||J}function zZ(J){let Q=OX(J);return Q.contextWindow-Q.maxOutputTokens}function YW(J){let Q=J?.["internal.visibleModes"]??[];return Object.values(PN).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 _d(J){return Object.values(PN).find((Q)=>Q.key===J)}function Al1(J){return _d(J)?.primaryModel??f8("CLAUDE_SONNET_4_5")}function xd(J){let Q=_d(J);if(!Q)return!1;return OX(Q.primaryModel).capabilities?.vision??!1}function wl1(J,Q){return Q.find((Z)=>Z.mode===J)?.description}function bd(J,Q){let X=(Q.findIndex((K)=>K.mode===J)+1)%Q.length;return Q[X]?.mode??"smart"}var C2,b2,PN,Ll1,WS,Nl1;var O2=B1(()=>{C2={ANTHROPIC:"anthropic",OPENAI:"openai",XAI:"xai",CEREBRAS:"cerebras",GROQ:"groq",MOONSHOT:"moonshotai",OPENROUTER:"openrouter",VERTEXAI:"vertexai",SUPERNOVA:"supernova"},b2={CLAUDE_SONNET_4:{provider:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.OPENAI,name:"openai/gpt-oss-120b",displayName:"GPT OSS 120B",contextWindow:128000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0}},GROK_CODE_FAST_1:{provider:C2.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:C2.XAI,name:"grok-code",displayName:"Grok Code",contextWindow:256000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0},freeTierEligible:!0},GEMINI_2_5_PRO:{provider:C2.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:C2.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:C2.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:C2.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:C2.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:C2.CEREBRAS,name:"qwen-3-coder-480b",displayName:"Qwen 3 Coder 480B",contextWindow:128000,maxOutputTokens:32000,capabilities:{tools:!0}},KIMI_K2_INSTRUCT:{provider:C2.MOONSHOT,name:"kimi-k2-instruct-0905",displayName:"Kimi K2 Instruct",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0}},SONOMA_SKY_ALPHA:{provider:C2.OPENROUTER,name:"sonoma-sky-alpha",displayName:"Sonoma Sky Alpha",contextWindow:256000,maxOutputTokens:32000,capabilities:{tools:!0}},CODE_SUPERNOVA:{provider:C2.SUPERNOVA,name:"code-supernova",displayName:"Code Supernova",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0},freeTierEligible:!0}};PN={SMART:{key:"smart",displayName:"Smart",description:"Smarter, but slower",primaryModel:f8("CLAUDE_SONNET_4_5"),visible:!0},FREE:{key:"free",displayName:"Free",description:"Amp Free",primaryModel:f8("GROK_CODE_FAST_1"),visible:!0,toolAllowlist:["*","!oracle","!librarian","!Task","!read_thread"]},FREE_NEXT:{key:"free-next",displayName:"Free (Next)",description:"Preview of Amp Free configuration in testing",primaryModel:f8("GEMINI_2_5_FLASH_PREVIEW_09_2025"),toolAllowlist:["*","!oracle","!librarian","!Task"]},GRONK_FAST_MAIN:{key:"gronk-fast:main",displayName:"Gronk Fast Main",primaryModel:f8("GROK_CODE_FAST_1")},GRONK_FAST_SEARCH:{key:"gronk-fast:search",displayName:"Gronk Fast Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("GROK_CODE_FAST_1")},GRONK_FAST_MAIN_SEARCH:{key:"gronk-fast:main+search",displayName:"Gronk Fast Main+Search",primaryModel:f8("GROK_CODE_FAST_1"),searchModel:f8("GROK_CODE_FAST_1")},BOLT_SEARCH:{key:"bolt:search",displayName:"Bolt Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("QWEN_3_CODER_480B")},BOLT_MAIN:{key:"bolt:main",displayName:"Bolt Main",primaryModel:f8("QWEN_3_CODER_480B")},BOLT_MAIN_SEARCH:{key:"bolt:main+search",displayName:"Bolt Main+Search",primaryModel:f8("QWEN_3_CODER_480B"),searchModel:f8("QWEN_3_CODER_480B")},GEPPETTO_MAIN:{key:"geppetto:main",displayName:"Geppetto Main",primaryModel:f8("GPT_5")},GEPPETTO_PRO_MAIN:{key:"geppetto-pro:main",displayName:"Geppetto Pro Main",primaryModel:f8("GPT_5")},PINOCCHIO_MAIN:{key:"pinocchio:main",displayName:"Pinocchio Main",primaryModel:f8("GPT_5_CODEX")},CLAUDIUS_MAIN:{key:"claudius:main",displayName:"Claudius Main",primaryModel:f8("CLAUDE_OPUS_4")},OPUS_4_1:{key:"opus4.1",displayName:"Opus 4.1",primaryModel:f8("CLAUDE_OPUS_4_1")},HYDROGEN_MAIN:{key:"hydrogen:main",displayName:"Hydrogen Main",primaryModel:f8("CODE_SUPERNOVA")},KASHMIR_MAIN:{key:"kashmir:main",displayName:"Kashmir Main",primaryModel:f8("KIMI_K2_INSTRUCT")},KASHMIR_SEARCH:{key:"kashmir:search",displayName:"Kashmir Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("KIMI_K2_INSTRUCT")},KASHMIR_MAIN_SEARCH:{key:"kashmir:main+search",displayName:"Kashmir Main+Search",primaryModel:f8("KIMI_K2_INSTRUCT"),searchModel:f8("KIMI_K2_INSTRUCT")},GOSSIP_MAIN:{key:"gossip:main",displayName:"Gossip Main",primaryModel:f8("GPT_OSS_120B")},GOSSIP_SEARCH:{key:"gossip:search",displayName:"Gossip Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("GPT_OSS_120B")},GOSSIP_MAIN_SEARCH:{key:"gossip:main+search",displayName:"Gossip Main+Search",primaryModel:f8("GPT_OSS_120B"),searchModel:f8("GPT_OSS_120B")},SONOMOON_MAIN:{key:"sonomoon:main",displayName:"Sonomoon Main",primaryModel:f8("SONOMA_SKY_ALPHA")},SONOMOON_SEARCH:{key:"sonomoon:search",displayName:"Sonomoon Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("SONOMA_SKY_ALPHA")},SONOMOON_MAIN_SEARCH:{key:"sonomoon:main+search",displayName:"Sonomoon Main+Search",primaryModel:f8("SONOMA_SKY_ALPHA"),searchModel:f8("SONOMA_SKY_ALPHA")}},Ll1=Object.values(PN).map((J)=>J.key),WS={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"]},Nl1=Object.keys(WS)});function fZ1(J){return QH6.includes(J)}function Ol1(J){let Q=J["internal.oracleModel"]?.trim();if(Q&&Q.length>0)return Q;return b2.GPT_5.name}function jl1(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 QH6,yd,Rl1;var tR=B1(()=>{TZ1();O2();QH6=["guardedFiles.allowlist","mcpPermissions","tools.disable","permissions"];yd=rR.capabilities.untrustedWorkspaces.restrictedConfigurations.map((J)=>J.replace(/^amp\./,"")),Rl1=["apiKey","buildkite-access-token","github-access-token","gitlab-access-token","gitlab-instance-url","mcp-oauth-client-secret","mcp-oauth-token"]});function HB(J){let Q=typeof J==="string"?J:J.toString();return Q===UZ||Q===UZ.slice(0,-1)}function eR(J){return HB(J)?UZ:J}var YH6,UZ,KH6,$z9;var BB=B1(()=>{YH6=new URL("https://ampcode.com/"),UZ=YH6.toString(),KH6=new URL("https://api.anthropic.com/"),$z9=KH6.toString()});var O9,hZ1,J6,sq=(J)=>{switch(typeof J){case"undefined":return J6.undefined;case"string":return J6.string;case"number":return Number.isNaN(J)?J6.nan:J6.number;case"boolean":return J6.boolean;case"function":return J6.function;case"bigint":return J6.bigint;case"symbol":return J6.symbol;case"object":if(Array.isArray(J))return J6.array;if(J===null)return J6.null;if(J.then&&typeof J.then==="function"&&J.catch&&typeof J.catch==="function")return J6.promise;if(typeof Map<"u"&&J instanceof Map)return J6.map;if(typeof Set<"u"&&J instanceof Set)return J6.set;if(typeof Date<"u"&&J instanceof Date)return J6.date;return J6.object;default:return J6.unknown}};var FS=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}}})(hZ1||(hZ1={}));J6=O9.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var h0,GH6=(J)=>{return JSON.stringify(J,null,2).replace(/"([^"]+)":/g,"$1:")},WZ;var gd=B1(()=>{FS();h0=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"]);WZ=class WZ 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 WZ))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()}};WZ.create=(J)=>{return new WZ(J)}});var qH6=(J,Q)=>{let Z;switch(J.code){case h0.invalid_type:if(J.received===J6.undefined)Z="Required";else Z=`Expected ${J.expected}, received ${J.received}`;break;case h0.invalid_literal:Z=`Invalid literal value, expected ${JSON.stringify(J.expected,O9.jsonStringifyReplacer)}`;break;case h0.unrecognized_keys:Z=`Unrecognized key(s) in object: ${O9.joinValues(J.keys,", ")}`;break;case h0.invalid_union:Z="Invalid input";break;case h0.invalid_union_discriminator:Z=`Invalid discriminator value. Expected ${O9.joinValues(J.options)}`;break;case h0.invalid_enum_value:Z=`Invalid enum value. Expected ${O9.joinValues(J.options)}, received '${J.received}'`;break;case h0.invalid_arguments:Z="Invalid function arguments";break;case h0.invalid_return_type:Z="Invalid function return type";break;case h0.invalid_date:Z="Invalid date";break;case h0.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 h0.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 h0.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 h0.custom:Z="Invalid input";break;case h0.invalid_intersection_types:Z="Intersection results could not be merged";break;case h0.not_multiple_of:Z=`Number must be a multiple of ${J.multipleOf}`;break;case h0.not_finite:Z="Number must be finite";break;default:Z=Q.defaultError,O9.assertNever(J)}return{message:Z}},KW;var gZ1=B1(()=>{gd();FS();KW=qH6});function zH6(J){$l1=J}function JO(){return $l1}var $l1;var md=B1(()=>{gZ1();$l1=KW});function F6(J,Q){let Z=JO(),X=HS({issueData:Q,data:J.data,path:J.path,errorMaps:[J.common.contextualErrorMap,J.schemaErrorMap,Z,Z===KW?void 0:KW].filter((Y)=>!!Y)});J.common.issues.push(X)}class e5{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 N8;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 e5.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 N8;if(K.status==="aborted")return N8;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 HS=(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}},UH6,N8,TN=(J)=>({status:"dirty",value:J}),SJ=(J)=>({status:"valid",value:J}),ud=(J)=>J.status==="aborted",pd=(J)=>J.status==="dirty",DB=(J)=>J.status==="valid",QO=(J)=>typeof Promise<"u"&&J instanceof Promise;var mZ1=B1(()=>{md();gZ1();UH6=[];N8=Object.freeze({status:"aborted"})});var El1=()=>{};var y6;var Il1=B1(()=>{(function(J){J.errToObj=(Q)=>typeof Q==="string"?{message:Q}:Q||{},J.toString=(Q)=>typeof Q==="string"?Q:Q?.message})(y6||(y6={}))});class ZG{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 n8(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 z9{get description(){return this._def.description}_getType(J){return sq(J.data)}_getOrReturnCtx(J,Q){return Q||{common:J.parent.common,data:J.data,parsedType:sq(J.data),schemaErrorMap:this._def.errorMap,path:J.path,parent:J.parent}}_processInputParams(J){return{status:new e5,ctx:{common:J.parent.common,data:J.data,parsedType:sq(J.data),schemaErrorMap:this._def.errorMap,path:J.path,parent:J.parent}}}_parseSync(J){let Q=this._parse(J);if(QO(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:sq(J)},X=this._parseSync({data:J,path:Z.path,parent:Z});return Pl1(Z,X)}"~validate"(J){let Q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:sq(J)};if(!this["~standard"].async)try{let Z=this._parseSync({data:J,path:[],parent:Q});return DB(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)=>DB(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:sq(J)},X=this._parse({data:J,path:Z.path,parent:Z}),Y=await(QO(X)?X:Promise.resolve(X));return Pl1(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:h0.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 XG({schema:this,typeName:R8.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 QG.create(this,this._def)}nullable(){return qW.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return JG.create(this)}promise(){return kN.create(this,this._def)}or(J){return qO.create([this,J],this._def)}and(J){return zO.create(this,J,this._def)}transform(J){return new XG({...n8(this._def),schema:this,typeName:R8.ZodEffects,effect:{type:"transform",transform:J}})}default(J){let Q=typeof J==="function"?J:()=>J;return new HO({...n8(this._def),innerType:this,defaultValue:Q,typeName:R8.ZodDefault})}brand(){return new cd({typeName:R8.ZodBranded,type:this,...n8(this._def)})}catch(J){let Q=typeof J==="function"?J:()=>J;return new BO({...n8(this._def),innerType:this,catchValue:Q,typeName:R8.ZodCatch})}describe(J){return new this.constructor({...this._def,description:J})}pipe(J){return LS.create(this,J)}readonly(){return DO.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Sl1(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 IH6(J){return new RegExp(`^${Sl1(J)}$`)}function vl1(J){let Q=`${Cl1}T${Sl1(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 PH6(J,Q){if((Q==="v4"||!Q)&&AH6.test(J))return!0;if((Q==="v6"||!Q)&&RH6.test(J))return!0;return!1}function TH6(J,Q){if(!MH6.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 CH6(J,Q){if((Q==="v4"||!Q)&&wH6.test(J))return!0;if((Q==="v6"||!Q)&&OH6.test(J))return!0;return!1}function SH6(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 ZO(J){if(J instanceof k4){let Q={};for(let Z in J.shape){let X=J.shape[Z];Q[Z]=QG.create(ZO(X))}return new k4({...J._def,shape:()=>Q})}else if(J instanceof JG)return new JG({...J._def,type:ZO(J.element)});else if(J instanceof QG)return QG.create(ZO(J.unwrap()));else if(J instanceof qW)return qW.create(ZO(J.unwrap()));else if(J instanceof tq)return tq.create(J.items.map((Q)=>ZO(Q)));else return J}function pZ1(J,Q){let Z=sq(J),X=sq(Q);if(J===Q)return{valid:!0,data:J};else if(Z===J6.object&&X===J6.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=pZ1(J[q],Q[q]);if(!z.valid)return{valid:!1};G[q]=z.data}return{valid:!0,data:G}}else if(Z===J6.array&&X===J6.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=pZ1(G,q);if(!z.valid)return{valid:!1};Y.push(z.data)}return{valid:!0,data:Y}}else if(Z===J6.date&&X===J6.date&&+J===+Q)return{valid:!0,data:J};else return{valid:!1}}function kl1(J,Q){return new LB({values:J,typeName:R8.ZodEnum,...n8(Q)})}function Tl1(J,Q){let Z=typeof J==="function"?J(Q):typeof J==="string"?{message:J}:J;return typeof Z==="string"?{message:Z}:Z}function _l1(J,Q={},Z){if(J)return SN.create().superRefine((X,Y)=>{let K=J(X);if(K instanceof Promise)return K.then((G)=>{if(!G){let q=Tl1(Q,X),z=q.fatal??Z??!0;Y.addIssue({code:"custom",...q,fatal:z})}});if(!K){let G=Tl1(Q,X),q=G.fatal??Z??!0;Y.addIssue({code:"custom",...G,fatal:q})}return});return SN.create()}var Pl1=(J,Q)=>{if(DB(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 WZ(J.common.issues);return this._error=Z,this._error}}}},WH6,FH6,HH6,BH6,DH6,MH6,VH6,NH6,LH6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uZ1,AH6,wH6,RH6,OH6,jH6,$H6,Cl1="((\\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])))",EH6,eK,VB,NB,YO,CN,BS,KO,GO,SN,MB,oq,DS,JG,k4,qO,GW=(J)=>{if(J instanceof UO)return GW(J.schema);else if(J instanceof XG)return GW(J.innerType());else if(J instanceof WO)return[J.value];else if(J instanceof LB)return J.options;else if(J instanceof FO)return O9.objectValues(J.enum);else if(J instanceof HO)return GW(J._def.innerType);else if(J instanceof KO)return[void 0];else if(J instanceof GO)return[null];else if(J instanceof QG)return[void 0,...GW(J.unwrap())];else if(J instanceof qW)return[null,...GW(J.unwrap())];else if(J instanceof cd)return GW(J.unwrap());else if(J instanceof DO)return GW(J.unwrap());else if(J instanceof BO)return GW(J._def.innerType);else return[]},dd,zO,tq,MS,VS,vN,XO,UO,WO,LB,FO,kN,XG,QG,qW,HO,BO,NS,vH6,cd,LS,DO,kH6,R8,_H6=(J,Q={message:`Input not instance of ${J.name}`})=>_l1((Z)=>Z instanceof J,Q),xl1,bl1,xH6,bH6,yl1,yH6,fH6,hH6,gH6,mH6,uH6,pH6,dH6,cH6,lH6,iH6,aH6,nH6,rH6,sH6,oH6,tH6,eH6,JB6,QB6,ZB6,XB6,YB6,KB6,GB6,qB6,zB6,UB6,WB6,FB6=()=>xl1().optional(),HB6=()=>bl1().optional(),BB6=()=>yl1().optional(),DB6,MB6;var fl1=B1(()=>{gd();md();Il1();mZ1();FS();WH6=/^c[^\s-]{8,}$/i,FH6=/^[0-9a-z]+$/,HH6=/^[0-9A-HJKMNP-TV-Z]{26}$/i,BH6=/^[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,DH6=/^[a-z0-9_-]{21}$/i,MH6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,VH6=/^[-+]?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)?)??$/,NH6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,AH6=/^(?:(?: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])$/,wH6=/^(?:(?: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])$/,RH6=/^(([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]))$/,OH6=/^(([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])$/,jH6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$H6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,EH6=new RegExp(`^${Cl1}$`);eK=class eK extends z9{_parse(J){if(this._def.coerce)J.data=String(J.data);if(this._getType(J)!==J6.string){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_type,expected:J6.string,received:Y.parsedType}),N8}let Z=new e5,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),F6(X,{code:h0.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),F6(X,{code:h0.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)F6(X,{code:h0.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});else if(G)F6(X,{code:h0.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});Z.dirty()}}else if(Y.kind==="email"){if(!NH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"email",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="emoji"){if(!uZ1)uZ1=new RegExp(LH6,"u");if(!uZ1.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"emoji",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="uuid"){if(!BH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"uuid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="nanoid"){if(!DH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"nanoid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cuid"){if(!WH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"cuid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cuid2"){if(!FH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"cuid2",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="ulid"){if(!HH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"ulid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="url")try{new URL(J.data)}catch{X=this._getOrReturnCtx(J,X),F6(X,{validation:"url",code:h0.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),F6(X,{validation:"regex",code:h0.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),F6(X,{code:h0.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),F6(X,{code:h0.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),F6(X,{code:h0.invalid_string,validation:{endsWith:Y.value},message:Y.message}),Z.dirty()}else if(Y.kind==="datetime"){if(!vl1(Y).test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:"datetime",message:Y.message}),Z.dirty()}else if(Y.kind==="date"){if(!EH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:"date",message:Y.message}),Z.dirty()}else if(Y.kind==="time"){if(!IH6(Y).test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:"time",message:Y.message}),Z.dirty()}else if(Y.kind==="duration"){if(!VH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"duration",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="ip"){if(!PH6(J.data,Y.version))X=this._getOrReturnCtx(J,X),F6(X,{validation:"ip",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="jwt"){if(!TH6(J.data,Y.alg))X=this._getOrReturnCtx(J,X),F6(X,{validation:"jwt",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cidr"){if(!CH6(J.data,Y.version))X=this._getOrReturnCtx(J,X),F6(X,{validation:"cidr",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="base64"){if(!jH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"base64",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="base64url"){if(!$H6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"base64url",code:h0.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:h0.invalid_string,...y6.errToObj(Z)})}_addCheck(J){return new eK({...this._def,checks:[...this._def.checks,J]})}email(J){return this._addCheck({kind:"email",...y6.errToObj(J)})}url(J){return this._addCheck({kind:"url",...y6.errToObj(J)})}emoji(J){return this._addCheck({kind:"emoji",...y6.errToObj(J)})}uuid(J){return this._addCheck({kind:"uuid",...y6.errToObj(J)})}nanoid(J){return this._addCheck({kind:"nanoid",...y6.errToObj(J)})}cuid(J){return this._addCheck({kind:"cuid",...y6.errToObj(J)})}cuid2(J){return this._addCheck({kind:"cuid2",...y6.errToObj(J)})}ulid(J){return this._addCheck({kind:"ulid",...y6.errToObj(J)})}base64(J){return this._addCheck({kind:"base64",...y6.errToObj(J)})}base64url(J){return this._addCheck({kind:"base64url",...y6.errToObj(J)})}jwt(J){return this._addCheck({kind:"jwt",...y6.errToObj(J)})}ip(J){return this._addCheck({kind:"ip",...y6.errToObj(J)})}cidr(J){return this._addCheck({kind:"cidr",...y6.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,...y6.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,...y6.errToObj(J?.message)})}duration(J){return this._addCheck({kind:"duration",...y6.errToObj(J)})}regex(J,Q){return this._addCheck({kind:"regex",regex:J,...y6.errToObj(Q)})}includes(J,Q){return this._addCheck({kind:"includes",value:J,position:Q?.position,...y6.errToObj(Q?.message)})}startsWith(J,Q){return this._addCheck({kind:"startsWith",value:J,...y6.errToObj(Q)})}endsWith(J,Q){return this._addCheck({kind:"endsWith",value:J,...y6.errToObj(Q)})}min(J,Q){return this._addCheck({kind:"min",value:J,...y6.errToObj(Q)})}max(J,Q){return this._addCheck({kind:"max",value:J,...y6.errToObj(Q)})}length(J,Q){return this._addCheck({kind:"length",value:J,...y6.errToObj(Q)})}nonempty(J){return this.min(1,y6.errToObj(J))}trim(){return new eK({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new eK({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new eK({...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}};eK.create=(J)=>{return new eK({checks:[],typeName:R8.ZodString,coerce:J?.coerce??!1,...n8(J)})};VB=class VB extends z9{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)!==J6.number){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_type,expected:J6.number,received:Y.parsedType}),N8}let Z=void 0,X=new e5;for(let Y of this._def.checks)if(Y.kind==="int"){if(!O9.isInteger(J.data))Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.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),F6(Z,{code:h0.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),F6(Z,{code:h0.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),X.dirty()}else if(Y.kind==="multipleOf"){if(SH6(J.data,Y.value)!==0)Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.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),F6(Z,{code:h0.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,y6.toString(Q))}gt(J,Q){return this.setLimit("min",J,!1,y6.toString(Q))}lte(J,Q){return this.setLimit("max",J,!0,y6.toString(Q))}lt(J,Q){return this.setLimit("max",J,!1,y6.toString(Q))}setLimit(J,Q,Z,X){return new VB({...this._def,checks:[...this._def.checks,{kind:J,value:Q,inclusive:Z,message:y6.toString(X)}]})}_addCheck(J){return new VB({...this._def,checks:[...this._def.checks,J]})}int(J){return this._addCheck({kind:"int",message:y6.toString(J)})}positive(J){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y6.toString(J)})}negative(J){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y6.toString(J)})}nonpositive(J){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y6.toString(J)})}nonnegative(J){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y6.toString(J)})}multipleOf(J,Q){return this._addCheck({kind:"multipleOf",value:J,message:y6.toString(Q)})}finite(J){return this._addCheck({kind:"finite",message:y6.toString(J)})}safe(J){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y6.toString(J)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y6.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:R8.ZodNumber,coerce:J?.coerce||!1,...n8(J)})};NB=class NB extends z9{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)!==J6.bigint)return this._getInvalidInput(J);let Z=void 0,X=new e5;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),F6(Z,{code:h0.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),F6(Z,{code:h0.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),F6(Z,{code:h0.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 F6(Q,{code:h0.invalid_type,expected:J6.bigint,received:Q.parsedType}),N8}gte(J,Q){return this.setLimit("min",J,!0,y6.toString(Q))}gt(J,Q){return this.setLimit("min",J,!1,y6.toString(Q))}lte(J,Q){return this.setLimit("max",J,!0,y6.toString(Q))}lt(J,Q){return this.setLimit("max",J,!1,y6.toString(Q))}setLimit(J,Q,Z,X){return new NB({...this._def,checks:[...this._def.checks,{kind:J,value:Q,inclusive:Z,message:y6.toString(X)}]})}_addCheck(J){return new NB({...this._def,checks:[...this._def.checks,J]})}positive(J){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y6.toString(J)})}negative(J){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y6.toString(J)})}nonpositive(J){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y6.toString(J)})}nonnegative(J){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y6.toString(J)})}multipleOf(J,Q){return this._addCheck({kind:"multipleOf",value:J,message:y6.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}};NB.create=(J)=>{return new NB({checks:[],typeName:R8.ZodBigInt,coerce:J?.coerce??!1,...n8(J)})};YO=class YO extends z9{_parse(J){if(this._def.coerce)J.data=Boolean(J.data);if(this._getType(J)!==J6.boolean){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.boolean,received:Z.parsedType}),N8}return SJ(J.data)}};YO.create=(J)=>{return new YO({typeName:R8.ZodBoolean,coerce:J?.coerce||!1,...n8(J)})};CN=class CN extends z9{_parse(J){if(this._def.coerce)J.data=new Date(J.data);if(this._getType(J)!==J6.date){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_type,expected:J6.date,received:Y.parsedType}),N8}if(Number.isNaN(J.data.getTime())){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_date}),N8}let Z=new e5,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),F6(X,{code:h0.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),F6(X,{code:h0.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 CN({...this._def,checks:[...this._def.checks,J]})}min(J,Q){return this._addCheck({kind:"min",value:J.getTime(),message:y6.toString(Q)})}max(J,Q){return this._addCheck({kind:"max",value:J.getTime(),message:y6.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}};CN.create=(J)=>{return new CN({checks:[],coerce:J?.coerce||!1,typeName:R8.ZodDate,...n8(J)})};BS=class BS extends z9{_parse(J){if(this._getType(J)!==J6.symbol){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.symbol,received:Z.parsedType}),N8}return SJ(J.data)}};BS.create=(J)=>{return new BS({typeName:R8.ZodSymbol,...n8(J)})};KO=class KO extends z9{_parse(J){if(this._getType(J)!==J6.undefined){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.undefined,received:Z.parsedType}),N8}return SJ(J.data)}};KO.create=(J)=>{return new KO({typeName:R8.ZodUndefined,...n8(J)})};GO=class GO extends z9{_parse(J){if(this._getType(J)!==J6.null){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.null,received:Z.parsedType}),N8}return SJ(J.data)}};GO.create=(J)=>{return new GO({typeName:R8.ZodNull,...n8(J)})};SN=class SN extends z9{constructor(){super(...arguments);this._any=!0}_parse(J){return SJ(J.data)}};SN.create=(J)=>{return new SN({typeName:R8.ZodAny,...n8(J)})};MB=class MB extends z9{constructor(){super(...arguments);this._unknown=!0}_parse(J){return SJ(J.data)}};MB.create=(J)=>{return new MB({typeName:R8.ZodUnknown,...n8(J)})};oq=class oq extends z9{_parse(J){let Q=this._getOrReturnCtx(J);return F6(Q,{code:h0.invalid_type,expected:J6.never,received:Q.parsedType}),N8}};oq.create=(J)=>{return new oq({typeName:R8.ZodNever,...n8(J)})};DS=class DS extends z9{_parse(J){if(this._getType(J)!==J6.undefined){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.void,received:Z.parsedType}),N8}return SJ(J.data)}};DS.create=(J)=>{return new DS({typeName:R8.ZodVoid,...n8(J)})};JG=class JG extends z9{_parse(J){let{ctx:Q,status:Z}=this._processInputParams(J),X=this._def;if(Q.parsedType!==J6.array)return F6(Q,{code:h0.invalid_type,expected:J6.array,received:Q.parsedType}),N8;if(X.exactLength!==null){let K=Q.data.length>X.exactLength.value,G=Q.data.length<X.exactLength.value;if(K||G)F6(Q,{code:K?h0.too_big:h0.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)F6(Q,{code:h0.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)F6(Q,{code:h0.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 ZG(Q,K,Q.path,G))})).then((K)=>{return e5.mergeArray(Z,K)});let Y=[...Q.data].map((K,G)=>{return X.type._parseSync(new ZG(Q,K,Q.path,G))});return e5.mergeArray(Z,Y)}get element(){return this._def.type}min(J,Q){return new JG({...this._def,minLength:{value:J,message:y6.toString(Q)}})}max(J,Q){return new JG({...this._def,maxLength:{value:J,message:y6.toString(Q)}})}length(J,Q){return new JG({...this._def,exactLength:{value:J,message:y6.toString(Q)}})}nonempty(J){return this.min(1,J)}};JG.create=(J,Q)=>{return new JG({type:J,minLength:null,maxLength:null,exactLength:null,typeName:R8.ZodArray,...n8(Q)})};k4=class k4 extends z9{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)!==J6.object){let z=this._getOrReturnCtx(J);return F6(z,{code:h0.invalid_type,expected:J6.object,received:z.parsedType}),N8}let{status:Z,ctx:X}=this._processInputParams(J),{shape:Y,keys:K}=this._getCached(),G=[];if(!(this._def.catchall instanceof oq&&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 ZG(X,W,X.path,z)),alwaysSet:z in X.data})}if(this._def.catchall instanceof oq){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)F6(X,{code:h0.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 ZG(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 e5.mergeObjectSync(Z,z)});else return e5.mergeObjectSync(Z,q)}get shape(){return this._def.shape()}strict(J){return y6.errToObj,new k4({...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:y6.errToObj(J).message??X};return{message:X}}}:{}})}strip(){return new k4({...this._def,unknownKeys:"strip"})}passthrough(){return new k4({...this._def,unknownKeys:"passthrough"})}extend(J){return new k4({...this._def,shape:()=>({...this._def.shape(),...J})})}merge(J){return new k4({unknownKeys:J._def.unknownKeys,catchall:J._def.catchall,shape:()=>({...this._def.shape(),...J._def.shape()}),typeName:R8.ZodObject})}setKey(J,Q){return this.augment({[J]:Q})}catchall(J){return new k4({...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 k4({...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 k4({...this._def,shape:()=>Q})}deepPartial(){return ZO(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 k4({...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 QG)Y=Y._def.innerType;Q[Z]=Y}return new k4({...this._def,shape:()=>Q})}keyof(){return kl1(O9.objectKeys(this.shape))}};k4.create=(J,Q)=>{return new k4({shape:()=>J,unknownKeys:"strip",catchall:oq.create(),typeName:R8.ZodObject,...n8(Q)})};k4.strictCreate=(J,Q)=>{return new k4({shape:()=>J,unknownKeys:"strict",catchall:oq.create(),typeName:R8.ZodObject,...n8(Q)})};k4.lazycreate=(J,Q)=>{return new k4({shape:J,unknownKeys:"strip",catchall:oq.create(),typeName:R8.ZodObject,...n8(Q)})};qO=class qO extends z9{_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 WZ(G.ctx.common.issues));return F6(Q,{code:h0.invalid_union,unionErrors:K}),N8}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 WZ(q));return F6(Q,{code:h0.invalid_union,unionErrors:G}),N8}}get options(){return this._def.options}};qO.create=(J,Q)=>{return new qO({options:J,typeName:R8.ZodUnion,...n8(Q)})};dd=class dd extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==J6.object)return F6(Q,{code:h0.invalid_type,expected:J6.object,received:Q.parsedType}),N8;let Z=this.discriminator,X=Q.data[Z],Y=this.optionsMap.get(X);if(!Y)return F6(Q,{code:h0.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Z]}),N8;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=GW(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 dd({typeName:R8.ZodDiscriminatedUnion,discriminator:J,options:Q,optionsMap:X,...n8(Z)})}};zO=class zO extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J),X=(Y,K)=>{if(ud(Y)||ud(K))return N8;let G=pZ1(Y.value,K.value);if(!G.valid)return F6(Z,{code:h0.invalid_intersection_types}),N8;if(pd(Y)||pd(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}))}};zO.create=(J,Q,Z)=>{return new zO({left:J,right:Q,typeName:R8.ZodIntersection,...n8(Z)})};tq=class tq extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==J6.array)return F6(Z,{code:h0.invalid_type,expected:J6.array,received:Z.parsedType}),N8;if(Z.data.length<this._def.items.length)return F6(Z,{code:h0.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N8;if(!this._def.rest&&Z.data.length>this._def.items.length)F6(Z,{code:h0.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 ZG(Z,K,Z.path,G))}).filter((K)=>!!K);if(Z.common.async)return Promise.all(Y).then((K)=>{return e5.mergeArray(Q,K)});else return e5.mergeArray(Q,Y)}get items(){return this._def.items}rest(J){return new tq({...this._def,rest:J})}};tq.create=(J,Q)=>{if(!Array.isArray(J))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new tq({items:J,typeName:R8.ZodTuple,rest:null,...n8(Q)})};MS=class MS extends z9{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!==J6.object)return F6(Z,{code:h0.invalid_type,expected:J6.object,received:Z.parsedType}),N8;let X=[],Y=this._def.keyType,K=this._def.valueType;for(let G in Z.data)X.push({key:Y._parse(new ZG(Z,G,Z.path,G)),value:K._parse(new ZG(Z,Z.data[G],Z.path,G)),alwaysSet:G in Z.data});if(Z.common.async)return e5.mergeObjectAsync(Q,X);else return e5.mergeObjectSync(Q,X)}get element(){return this._def.valueType}static create(J,Q,Z){if(Q instanceof z9)return new MS({keyType:J,valueType:Q,typeName:R8.ZodRecord,...n8(Z)});return new MS({keyType:eK.create(),valueType:J,typeName:R8.ZodRecord,...n8(Q)})}};VS=class VS extends z9{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!==J6.map)return F6(Z,{code:h0.invalid_type,expected:J6.map,received:Z.parsedType}),N8;let X=this._def.keyType,Y=this._def.valueType,K=[...Z.data.entries()].map(([G,q],z)=>{return{key:X._parse(new ZG(Z,G,Z.path,[z,"key"])),value:Y._parse(new ZG(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 N8;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 N8;if(z.status==="dirty"||U.status==="dirty")Q.dirty();G.set(z.value,U.value)}return{status:Q.value,value:G}}}};VS.create=(J,Q,Z)=>{return new VS({valueType:Q,keyType:J,typeName:R8.ZodMap,...n8(Z)})};vN=class vN extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==J6.set)return F6(Z,{code:h0.invalid_type,expected:J6.set,received:Z.parsedType}),N8;let X=this._def;if(X.minSize!==null){if(Z.data.size<X.minSize.value)F6(Z,{code:h0.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)F6(Z,{code:h0.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 N8;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 ZG(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 vN({...this._def,minSize:{value:J,message:y6.toString(Q)}})}max(J,Q){return new vN({...this._def,maxSize:{value:J,message:y6.toString(Q)}})}size(J,Q){return this.min(J,Q).max(J,Q)}nonempty(J){return this.min(1,J)}};vN.create=(J,Q)=>{return new vN({valueType:J,minSize:null,maxSize:null,typeName:R8.ZodSet,...n8(Q)})};XO=class XO extends z9{constructor(){super(...arguments);this.validate=this.implement}_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==J6.function)return F6(Q,{code:h0.invalid_type,expected:J6.function,received:Q.parsedType}),N8;function Z(G,q){return HS({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,JO(),KW].filter((z)=>!!z),issueData:{code:h0.invalid_arguments,argumentsError:q}})}function X(G,q){return HS({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,JO(),KW].filter((z)=>!!z),issueData:{code:h0.invalid_return_type,returnTypeError:q}})}let Y={errorMap:Q.common.contextualErrorMap},K=Q.data;if(this._def.returns instanceof kN){let G=this;return SJ(async function(...q){let z=new WZ([]),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 SJ(function(...q){let z=G._def.args.safeParse(q,Y);if(!z.success)throw new WZ([Z(q,z.error)]);let U=Reflect.apply(K,this,z.data),W=G._def.returns.safeParse(U,Y);if(!W.success)throw new WZ([X(U,W.error)]);return W.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...J){return new XO({...this._def,args:tq.create(J).rest(MB.create())})}returns(J){return new XO({...this._def,returns:J})}implement(J){return this.parse(J)}strictImplement(J){return this.parse(J)}static create(J,Q,Z){return new XO({args:J?J:tq.create([]).rest(MB.create()),returns:Q||MB.create(),typeName:R8.ZodFunction,...n8(Z)})}};UO=class UO extends z9{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})}};UO.create=(J,Q)=>{return new UO({getter:J,typeName:R8.ZodLazy,...n8(Q)})};WO=class WO extends z9{_parse(J){if(J.data!==this._def.value){let Q=this._getOrReturnCtx(J);return F6(Q,{received:Q.data,code:h0.invalid_literal,expected:this._def.value}),N8}return{status:"valid",value:J.data}}get value(){return this._def.value}};WO.create=(J,Q)=>{return new WO({value:J,typeName:R8.ZodLiteral,...n8(Q)})};LB=class LB extends z9{_parse(J){if(typeof J.data!=="string"){let Q=this._getOrReturnCtx(J),Z=this._def.values;return F6(Q,{expected:O9.joinValues(Z),received:Q.parsedType,code:h0.invalid_type}),N8}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 F6(Q,{received:Q.data,code:h0.invalid_enum_value,options:Z}),N8}return SJ(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 LB.create(J,{...this._def,...Q})}exclude(J,Q=this._def){return LB.create(this.options.filter((Z)=>!J.includes(Z)),{...this._def,...Q})}};LB.create=kl1;FO=class FO extends z9{_parse(J){let Q=O9.getValidEnumValues(this._def.values),Z=this._getOrReturnCtx(J);if(Z.parsedType!==J6.string&&Z.parsedType!==J6.number){let X=O9.objectValues(Q);return F6(Z,{expected:O9.joinValues(X),received:Z.parsedType,code:h0.invalid_type}),N8}if(!this._cache)this._cache=new Set(O9.getValidEnumValues(this._def.values));if(!this._cache.has(J.data)){let X=O9.objectValues(Q);return F6(Z,{received:Z.data,code:h0.invalid_enum_value,options:X}),N8}return SJ(J.data)}get enum(){return this._def.values}};FO.create=(J,Q)=>{return new FO({values:J,typeName:R8.ZodNativeEnum,...n8(Q)})};kN=class kN extends z9{unwrap(){return this._def.type}_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==J6.promise&&Q.common.async===!1)return F6(Q,{code:h0.invalid_type,expected:J6.promise,received:Q.parsedType}),N8;let Z=Q.parsedType===J6.promise?Q.data:Promise.resolve(Q.data);return SJ(Z.then((X)=>{return this._def.type.parseAsync(X,{path:Q.path,errorMap:Q.common.contextualErrorMap})}))}};kN.create=(J,Q)=>{return new kN({type:J,typeName:R8.ZodPromise,...n8(Q)})};XG=class XG extends z9{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R8.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(F6(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 N8;let q=await this._def.schema._parseAsync({data:G,path:Z.path,parent:Z});if(q.status==="aborted")return N8;if(q.status==="dirty")return TN(q.value);if(Q.value==="dirty")return TN(q.value);return q});else{if(Q.value==="aborted")return N8;let G=this._def.schema._parseSync({data:K,path:Z.path,parent:Z});if(G.status==="aborted")return N8;if(G.status==="dirty")return TN(G.value);if(Q.value==="dirty")return TN(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 N8;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 N8;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(!DB(K))return N8;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(!DB(K))return N8;return Promise.resolve(X.transform(K.value,Y)).then((G)=>({status:Q.value,value:G}))});O9.assertNever(X)}};XG.create=(J,Q,Z)=>{return new XG({schema:J,typeName:R8.ZodEffects,effect:Q,...n8(Z)})};XG.createWithPreprocess=(J,Q,Z)=>{return new XG({schema:Q,effect:{type:"preprocess",transform:J},typeName:R8.ZodEffects,...n8(Z)})};QG=class QG extends z9{_parse(J){if(this._getType(J)===J6.undefined)return SJ(void 0);return this._def.innerType._parse(J)}unwrap(){return this._def.innerType}};QG.create=(J,Q)=>{return new QG({innerType:J,typeName:R8.ZodOptional,...n8(Q)})};qW=class qW extends z9{_parse(J){if(this._getType(J)===J6.null)return SJ(null);return this._def.innerType._parse(J)}unwrap(){return this._def.innerType}};qW.create=(J,Q)=>{return new qW({innerType:J,typeName:R8.ZodNullable,...n8(Q)})};HO=class HO extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=Q.data;if(Q.parsedType===J6.undefined)Z=this._def.defaultValue();return this._def.innerType._parse({data:Z,path:Q.path,parent:Q})}removeDefault(){return this._def.innerType}};HO.create=(J,Q)=>{return new HO({innerType:J,typeName:R8.ZodDefault,defaultValue:typeof Q.default==="function"?Q.default:()=>Q.default,...n8(Q)})};BO=class BO extends z9{_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(QO(X))return X.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new WZ(Z.common.issues)},input:Z.data})}});else return{status:"valid",value:X.status==="valid"?X.value:this._def.catchValue({get error(){return new WZ(Z.common.issues)},input:Z.data})}}removeCatch(){return this._def.innerType}};BO.create=(J,Q)=>{return new BO({innerType:J,typeName:R8.ZodCatch,catchValue:typeof Q.catch==="function"?Q.catch:()=>Q.catch,...n8(Q)})};NS=class NS extends z9{_parse(J){if(this._getType(J)!==J6.nan){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.nan,received:Z.parsedType}),N8}return{status:"valid",value:J.data}}};NS.create=(J)=>{return new NS({typeName:R8.ZodNaN,...n8(J)})};vH6=Symbol("zod_brand");cd=class cd extends z9{_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}};LS=class LS extends z9{_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 N8;if(Y.status==="dirty")return Q.dirty(),TN(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 N8;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 LS({in:J,out:Q,typeName:R8.ZodPipeline})}};DO=class DO extends z9{_parse(J){let Q=this._def.innerType._parse(J),Z=(X)=>{if(DB(X))X.value=Object.freeze(X.value);return X};return QO(Q)?Q.then((X)=>Z(X)):Z(Q)}unwrap(){return this._def.innerType}};DO.create=(J,Q)=>{return new DO({innerType:J,typeName:R8.ZodReadonly,...n8(Q)})};kH6={object:k4.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"})(R8||(R8={}));xl1=eK.create,bl1=VB.create,xH6=NS.create,bH6=NB.create,yl1=YO.create,yH6=CN.create,fH6=BS.create,hH6=KO.create,gH6=GO.create,mH6=SN.create,uH6=MB.create,pH6=oq.create,dH6=DS.create,cH6=JG.create,lH6=k4.create,iH6=k4.strictCreate,aH6=qO.create,nH6=dd.create,rH6=zO.create,sH6=tq.create,oH6=MS.create,tH6=VS.create,eH6=vN.create,JB6=XO.create,QB6=UO.create,ZB6=WO.create,XB6=LB.create,YB6=FO.create,KB6=kN.create,GB6=XG.create,qB6=QG.create,zB6=qW.create,UB6=XG.createWithPreprocess,WB6=LS.create,DB6={string:(J)=>eK.create({...J,coerce:!0}),number:(J)=>VB.create({...J,coerce:!0}),boolean:(J)=>YO.create({...J,coerce:!0}),bigint:(J)=>NB.create({...J,coerce:!0}),date:(J)=>CN.create({...J,coerce:!0})},MB6=N8});var Q1={};C6(Q1,{void:()=>dH6,util:()=>O9,unknown:()=>uH6,union:()=>aH6,undefined:()=>hH6,tuple:()=>sH6,transformer:()=>GB6,symbol:()=>fH6,string:()=>xl1,strictObject:()=>iH6,setErrorMap:()=>zH6,set:()=>eH6,record:()=>oH6,quotelessJson:()=>GH6,promise:()=>KB6,preprocess:()=>UB6,pipeline:()=>WB6,ostring:()=>FB6,optional:()=>qB6,onumber:()=>HB6,oboolean:()=>BB6,objectUtil:()=>hZ1,object:()=>lH6,number:()=>bl1,nullable:()=>zB6,null:()=>gH6,never:()=>pH6,nativeEnum:()=>YB6,nan:()=>xH6,map:()=>tH6,makeIssue:()=>HS,literal:()=>ZB6,lazy:()=>QB6,late:()=>kH6,isValid:()=>DB,isDirty:()=>pd,isAsync:()=>QO,isAborted:()=>ud,intersection:()=>rH6,instanceof:()=>_H6,getParsedType:()=>sq,getErrorMap:()=>JO,function:()=>JB6,enum:()=>XB6,effect:()=>GB6,discriminatedUnion:()=>nH6,defaultErrorMap:()=>KW,datetimeRegex:()=>vl1,date:()=>yH6,custom:()=>_l1,coerce:()=>DB6,boolean:()=>yl1,bigint:()=>bH6,array:()=>cH6,any:()=>mH6,addIssueToContext:()=>F6,ZodVoid:()=>DS,ZodUnknown:()=>MB,ZodUnion:()=>qO,ZodUndefined:()=>KO,ZodType:()=>z9,ZodTuple:()=>tq,ZodTransformer:()=>XG,ZodSymbol:()=>BS,ZodString:()=>eK,ZodSet:()=>vN,ZodSchema:()=>z9,ZodRecord:()=>MS,ZodReadonly:()=>DO,ZodPromise:()=>kN,ZodPipeline:()=>LS,ZodParsedType:()=>J6,ZodOptional:()=>QG,ZodObject:()=>k4,ZodNumber:()=>VB,ZodNullable:()=>qW,ZodNull:()=>GO,ZodNever:()=>oq,ZodNativeEnum:()=>FO,ZodNaN:()=>NS,ZodMap:()=>VS,ZodLiteral:()=>WO,ZodLazy:()=>UO,ZodIssueCode:()=>h0,ZodIntersection:()=>zO,ZodFunction:()=>XO,ZodFirstPartyTypeKind:()=>R8,ZodError:()=>WZ,ZodEnum:()=>LB,ZodEffects:()=>XG,ZodDiscriminatedUnion:()=>dd,ZodDefault:()=>HO,ZodDate:()=>CN,ZodCatch:()=>BO,ZodBranded:()=>cd,ZodBoolean:()=>YO,ZodBigInt:()=>NB,ZodArray:()=>JG,ZodAny:()=>SN,Schema:()=>z9,ParseStatus:()=>e5,OK:()=>SJ,NEVER:()=>MB6,INVALID:()=>N8,EMPTY_PATH:()=>UH6,DIRTY:()=>TN,BRAND:()=>vH6});var dZ1=B1(()=>{md();mZ1();El1();FS();fl1();gd()});var zW=B1(()=>{dZ1();dZ1()});function NB6(J){return hl1.safeParse(J)}function AB(J){return VB6.safeParse(J)}function MO(J){if(!J||!Array.isArray(J))return[];let Q=[];for(let[Z,X]of J.entries()){let Y=NB6(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 cZ1,hl1,VB6;var _N=B1(()=>{zW();G0();cZ1=Q1.lazy(()=>Q1.union([Q1.string().describe('Pattern match where "*" matches any number of any characters'),Q1.array(cZ1).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(),cZ1).describe("Matching individual keys of an object")])),hl1=Q1.object({tool:Q1.string().min(1).describe("The name of the tool to which this entry applies"),matches:Q1.record(Q1.string(),cZ1).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"]})}),VB6=Q1.array(hl1).describe("Entries checked in sequence to configure tool permissions")});function LQ(J,Q){let Z=LB6(J,Q);return typeof Z==="string"?Z:Z.toString()}function LB6(J,Q,Z=!0){if(!Q)Q=AB6();let{workspaceFolders:X,isWindows:Y,homeDir:K}=Q,G=typeof J==="string"?$0.parse(J):$0.from(J);if(X)for(let q of X){let z=V8(q);if(b0.hasPrefix(G,z)){let U=z.path.endsWith("/")?z.path.slice(0,-1):z.path,F=Z&&X&&X.length>=2?FN(z.path)+(Y?"\\":"/"):"";return lZ1(F+G.path.slice(U.length+1),Y,G.scheme)}}if(G?.scheme==="file"){if(K){let q=V8(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 lZ1("~"+(Y?"\\":"/")+U,Y,G.scheme)}}return lZ1(G.fsPath,Y,G.scheme)}return G}function lZ1(J,Q,Z){return Q&&Z==="file"?J.replaceAll("/","\\"):J}function id(J){let Q=ld;return ld=J,Q}function AB6(){if(ld)return ld;throw Error("must call setDisplayPathEnvInfo before calling displayPath() and related functions")}var ld=null;var wB=B1(()=>{b6();bR();op()});function vJ(J,...Q){throw Error(`[Immer] minified error nr: ${J}. Full error at: https://bit.ly/3cXEKWf`)}function yN(J){return!!J&&!!J[jX]}function RB(J){if(!J)return!1;return dl1(J)||Array.isArray(J)||!!J[AS]||!!J.constructor?.[AS]||$S(J)||ES(J)}function dl1(J){if(!J||typeof J!=="object")return!1;let Q=bN(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)===wB6}function wS(J,Q){if(fN(J)===0)Reflect.ownKeys(J).forEach((Z)=>{Q(Z,J[Z],J)});else J.forEach((Z,X)=>Q(X,Z,J))}function fN(J){let Q=J[jX];return Q?Q.type_:Array.isArray(J)?1:$S(J)?2:ES(J)?3:0}function RS(J,Q){return fN(J)===2?J.has(Q):Object.prototype.hasOwnProperty.call(J,Q)}function iZ1(J,Q){return fN(J)===2?J.get(Q):J[Q]}function cl1(J,Q,Z){let X=fN(J);if(X===2)J.set(Q,Z);else if(X===3)J.add(Z);else J[Q]=Z}function RB6(J,Q){if(J===Q)return J!==0||1/J===1/Q;else return J!==J&&Q!==Q}function $S(J){return J instanceof Map}function ES(J){return J instanceof Set}function xN(J){return J.copy_||J.base_}function rZ1(J,Q){if($S(J))return new Map(J);if(ES(J))return new Set(J);if(Array.isArray(J))return Array.prototype.slice.call(J);let Z=dl1(J);if(Q===!0||Q==="class_only"&&!Z){let X=Object.getOwnPropertyDescriptors(J);delete X[jX];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(bN(J),X)}else{let X=bN(J);if(X!==null&&Z)return{...J};let Y=Object.create(X);return Object.assign(Y,J)}}function AQ(J,Q=!1){if(rd(J)||yN(J)||!RB(J))return J;if(fN(J)>1)J.set=J.add=J.clear=J.delete=OB6;if(Object.freeze(J),Q)Object.entries(J).forEach(([Z,X])=>AQ(X,!0));return J}function OB6(){vJ(2)}function rd(J){return Object.isFrozen(J)}function hN(J){let Q=sZ1[J];if(!Q)vJ(0,J);return Q}function jB6(J,Q){if(!sZ1[J])sZ1[J]=Q}function ll1(){return OS}function $B6(J,Q){return{drafts_:[],parent_:J,immer_:Q,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function gl1(J,Q){if(Q)hN("Patches"),J.patches_=[],J.inversePatches_=[],J.patchListener_=Q}function oZ1(J){tZ1(J),J.drafts_.forEach(EB6),J.drafts_=null}function tZ1(J){if(J===OS)OS=J.parent_}function ml1(J){return OS=$B6(OS,J)}function EB6(J){let Q=J[jX];if(Q.type_===0||Q.type_===1)Q.revoke_();else Q.revoked_=!0}function ul1(J,Q){Q.unfinalizedDrafts_=Q.drafts_.length;let Z=Q.drafts_[0];if(J!==void 0&&J!==Z){if(Z[jX].modified_)oZ1(Q),vJ(4);if(RB(J)){if(J=ad(Q,J),!Q.parent_)nd(Q,J)}if(Q.patches_)hN("Patches").generateReplacementPatches_(Z[jX].base_,J,Q.patches_,Q.inversePatches_)}else J=ad(Q,Z,[]);if(oZ1(Q),Q.patches_)Q.patchListener_(Q.patches_,Q.inversePatches_);return J!==QX1?J:void 0}function ad(J,Q,Z){if(rd(Q))return Q;let X=Q[jX];if(!X)return wS(Q,(Y,K)=>pl1(J,X,Q,Y,K,Z)),Q;if(X.scope_!==J)return Q;if(!X.modified_)return nd(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(wS(K,(q,z)=>pl1(J,X,Y,q,z,Z,G)),nd(J,Y,!1),Z&&J.patches_)hN("Patches").generatePatches_(X,Z,J.patches_,J.inversePatches_)}return X.copy_}function pl1(J,Q,Z,X,Y,K,G){if(yN(Y)){let q=K&&Q&&Q.type_!==3&&!RS(Q.assigned_,X)?K.concat(X):void 0,z=ad(J,Y,q);if(cl1(Z,X,z),yN(z))J.canAutoFreeze_=!1;else return}else if(G)Z.add(Y);if(RB(Y)&&!rd(Y)){if(!J.immer_.autoFreeze_&&J.unfinalizedDrafts_<1)return;if(ad(J,Y),(!Q||!Q.scope_.parent_)&&typeof X!=="symbol"&&Object.prototype.propertyIsEnumerable.call(Z,X))nd(J,Y)}}function nd(J,Q,Z=!1){if(!J.parent_&&J.immer_.autoFreeze_&&J.canAutoFreeze_)AQ(Q,Z)}function IB6(J,Q){let Z=Array.isArray(J),X={type_:Z?1:0,scope_:Q?Q.scope_:ll1(),modified_:!1,finalized_:!1,assigned_:{},parent_:Q,base_:J,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=X,K=ZX1;if(Z)Y=[X],K=jS;let{revoke:G,proxy:q}=Proxy.revocable(Y,K);return X.draft_=q,X.revoke_=G,q}function aZ1(J,Q){let Z=J[jX];return(Z?xN(Z):J)[Q]}function PB6(J,Q,Z){let X=il1(Q,Z);return X?"value"in X?X.value:X.get?.call(J.draft_):void 0}function il1(J,Q){if(!(Q in J))return;let Z=bN(J);while(Z){let X=Object.getOwnPropertyDescriptor(Z,Q);if(X)return X;Z=bN(Z)}return}function eZ1(J){if(!J.modified_){if(J.modified_=!0,J.parent_)eZ1(J.parent_)}}function nZ1(J){if(!J.copy_)J.copy_=rZ1(J.base_,J.scope_.immer_.useStrictShallowCopy_)}function JX1(J,Q){let Z=$S(J)?hN("MapSet").proxyMap_(J,Q):ES(J)?hN("MapSet").proxySet_(J,Q):IB6(J,Q);return(Q?Q.scope_:ll1()).drafts_.push(Z),Z}function CB6(J){if(!yN(J))vJ(10,J);return al1(J)}function al1(J){if(!RB(J)||rd(J))return J;let Q=J[jX],Z;if(Q){if(!Q.modified_)return Q.base_;Q.finalized_=!0,Z=rZ1(J,Q.scope_.immer_.useStrictShallowCopy_)}else Z=rZ1(J,!0);if(wS(Z,(X,Y)=>{cl1(Z,X,al1(Y))}),Q)Q.finalized_=!1;return Z}function sd(){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;wS(H.assigned_,(A,w)=>{let R=iZ1(N,A),O=iZ1(L,A),$=!w?X:RS(N,A)?Q:Z;if(R===O&&$===Q)return;let j=B.concat(A);M.push($===X?{op:$,path:j}:{op:$,path:j,value:O}),V.push($===Z?{op:X,path:j}:$===X?{op:Z,path:j,value:F(R)}:{op:Q,path:j,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===QX1?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 $=fN(L),j=V[O];if(typeof j!=="string"&&typeof j!=="number")j=""+j;if(($===0||$===1)&&(j==="__proto__"||j==="constructor"))vJ(19);if(typeof L==="function"&&j==="prototype")vJ(19);if(L=iZ1(L,j),typeof L!=="object")vJ(18,V.join("/"))}let A=fN(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:vJ(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:vJ(17,N)}}),H}function W(H){if(!RB(H))return H;if(Array.isArray(H))return H.map(W);if($S(H))return new Map(Array.from(H.entries()).map(([M,V])=>[M,W(V)]));if(ES(H))return new Set(Array.from(H).map(W));let B=Object.create(bN(H));for(let M in H)B[M]=W(H[M]);if(RS(H,AS))B[AS]=H[AS];return B}function F(H){if(yN(H))return W(H);else return H}jB6("Patches",{applyPatches_:U,generatePatches_:Y,generateReplacementPatches_:z})}function m8(J){return J}var QX1,AS,jX,bN,wB6,sZ1,OS,ZX1,jS,TB6=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")vJ(6);if(X!==void 0&&typeof X!=="function")vJ(7);let Y;if(RB(Q)){let K=ml1(this),G=JX1(Q,void 0),q=!0;try{Y=Z(G),q=!1}finally{if(q)oZ1(K);else tZ1(K)}return gl1(K,X),ul1(Y,K)}else if(!Q||typeof Q!=="object"){if(Y=Z(Q),Y===void 0)Y=Q;if(Y===QX1)Y=void 0;if(this.autoFreeze_)AQ(Y,!0);if(X){let K=[],G=[];hN("Patches").generateReplacementPatches_(Q,Y,K,G),X(K,G)}return Y}else vJ(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(!RB(J))vJ(8);if(yN(J))J=CB6(J);let Q=ml1(this),Z=JX1(J,void 0);return Z[jX].isManual_=!0,tZ1(Q),Z}finishDraft(J,Q){let Z=J&&J[jX];if(!Z||!Z.isManual_)vJ(9);let{scope_:X}=Z;return gl1(X,Q),ul1(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=hN("Patches").applyPatches_;if(yN(J))return X(J,Q);return this.produce(J,(Y)=>X(Y,Q))}},$X,OB,VO,qU9,zU9,nl1,UU9,WU9;var wQ=B1(()=>{QX1=Symbol.for("immer-nothing"),AS=Symbol.for("immer-draftable"),jX=Symbol.for("immer-state");bN=Object.getPrototypeOf;wB6=Object.prototype.constructor.toString();sZ1={};ZX1={get(J,Q){if(Q===jX)return J;let Z=xN(J);if(!RS(Z,Q))return PB6(J,Z,Q);let X=Z[Q];if(J.finalized_||!RB(X))return X;if(X===aZ1(J.base_,Q))return nZ1(J),J.copy_[Q]=JX1(X,J);return X},has(J,Q){return Q in xN(J)},ownKeys(J){return Reflect.ownKeys(xN(J))},set(J,Q,Z){let X=il1(xN(J),Q);if(X?.set)return X.set.call(J.draft_,Z),!0;if(!J.modified_){let Y=aZ1(xN(J),Q),K=Y?.[jX];if(K&&K.base_===Z)return J.copy_[Q]=Z,J.assigned_[Q]=!1,!0;if(RB6(Z,Y)&&(Z!==void 0||RS(J.base_,Q)))return!0;nZ1(J),eZ1(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(aZ1(J.base_,Q)!==void 0||Q in J.base_)J.assigned_[Q]=!1,nZ1(J),eZ1(J);else delete J.assigned_[Q];if(J.copy_)delete J.copy_[Q];return!0},getOwnPropertyDescriptor(J,Q){let Z=xN(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(){vJ(11)},getPrototypeOf(J){return bN(J.base_)},setPrototypeOf(){vJ(12)}},jS={};wS(ZX1,(J,Q)=>{jS[J]=function(){return arguments[0]=arguments[0][0],Q.apply(this,arguments)}});jS.deleteProperty=function(J,Q){return jS.set.call(this,J,Q,void 0)};jS.set=function(J,Q,Z){return ZX1.set.call(this,J[0],Q,Z,J[0])};$X=new TB6,OB=$X.produce,VO=$X.produceWithPatches.bind($X),qU9=$X.setAutoFreeze.bind($X),zU9=$X.setUseStrictShallowCopy.bind($X),nl1=$X.applyPatches.bind($X),UU9=$X.createDraft.bind($X),WU9=$X.finishDraft.bind($X)});function XX1({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 IS(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(SB6,"")}var SB6;var YX1=B1(()=>{SB6=XX1()});var sl1=t((VU9,rl1)=>{rl1.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}});function vB6(J){return typeof J==="number"&&Number.isInteger(J)&&J>=1&&J<=3600}function tl1(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=rR.contributes.configuration.properties["amp.tools.inactivityTimeout"].default;if(!vB6(X))return null;return X*1000}function el1(J){let Q=J.settings["tools.stopTimeout"],Z=rR.contributes.configuration.properties["amp.tools.stopTimeout"].default;return(Q??Z)*1000}var ol1;var od=B1(()=>{TZ1();ol1=rR.contributes.configuration.properties});function td(J,Q){return new t1((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 KX1=B1(()=>{v0()});function o2(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 kJ(J){return["done","error","rejected-by-user","cancelled"].includes(J.status)}function Zi1(J){return["done","error","cancelled"].includes(J.status)}function NO(J){let Q=[],Z=new I8;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(PS(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 kB6;return Y(K,G,q)},tools:b9(J.configService.config,Z.pipe(u2(void 0))).pipe(y0(([K])=>{return Q.map((G)=>({spec:G.spec,...PS(G.spec,K)})).sort((G,q)=>G.spec.name.localeCompare(q.spec.name))})),invokeTool(K,G,q){let z=performance.now(),U=()=>_B6.record(performance.now()-z,{toolName:K});if(K===qX1&&G.args&&"invalid_tool_name"in G.args&&typeof G.args.invalid_tool_name==="string"){Jc.add(1,{toolName:K,error:"invalid"});let F=GX1(G.args.invalid_tool_name);return new t1((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 Jc.add(1,{toolName:K,error:"not_found"}),new t1((V)=>{V.error(Error(`tool ${JSON.stringify(K)} not found`))});let H=F[0],B=PS(H.spec,q.config);Jc.add(1,{toolName:K,error:"disabled"});let M=B.enabled?"unknown":B.disabledReason;return new t1((V)=>{V.error(Error(`tool ${JSON.stringify(K)} is disabled: ${M}`))})}return Jc.add(1,{toolName:K}),c6(()=>W.fn).pipe(q8((F)=>{let H=F(G,q);if(W.spec.meta?.disableTimeout)return H;return td(H,el1(q.config))}),QW(()=>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 ed(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(Qi1.default(Z,{dot:!0})(J))return!0}catch(X){continue}}return!1}function PS(J,Q){let Z=Q.settings?.["tools.disable"]??[];if(ed(J.name,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"mcp"in J.source){let X=Yi1(J.name);if(X&&J.source.mcp===X.server&&ed(X.tool,Z))return{enabled:!1,disabledReason:"settings"}}if(J.source==="builtin"&&ed(`builtin:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"toolbox"in J.source&&ed(`toolbox:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(J.name===t5||J.name===UB){if(Q.settings?.["todos.enabled"])return{enabled:!0};return{enabled:!1,disabledReason:"feature-flag"}}return{enabled:!0}}function GX1(J){return`Invalid tool name ${JSON.stringify(J)}. Tool names must match the pattern ${TS.toString()}. Try again with a valid tool name.`}function Yi1(J){let[,Q,Z]=J.split(/mcp__([^ ]+)__([^ ]+)/);if(Q&&Z)return{server:Q,tool:Z};return}function zX1(J){if(J.status==="in-progress"||J.status==="done"||J.status==="cancelled"||J.status==="error")return J.progress;return}function FZ(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&&Yi1(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 t1((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(y0((K)=>K.filter((G)=>Y(G.spec.name)))),dispose(){}}}var Ji1,Qi1,kB6,qX1="invalid_tool",TS,Xi1,Jc,_B6;var t2=B1(()=>{v0();G0();od();KX1();F8();Ji1=x6(Kd(),1),Qi1=x6(IN(),1);kB6={dispose(){}};TS=/^[a-zA-Z0-9_]{1,64}$/,Xi1=Ji1.metrics.getMeter("tool_service"),Jc=Xi1.createCounter("tool_service.invocation_count",{description:"Number of tool invocations"}),_B6=Xi1.createHistogram("tool_service.invocation_latency",{description:"Latency of tool invocations",unit:"ms"})});var Wi1=t((zi1)=>{Object.defineProperty(zi1,"__esModule",{value:!0});zi1.calcSlices=zi1.applyPatch=zi1.calcPatch=zi1.lcs=zi1.diff=zi1.diff_core=void 0;function xB6(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 $=Z[O-1-U*Math.floor((O-1)/U)],j=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 $=Z[U+O-1-U*Math.floor((O-1)/U)],j=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 Ki1{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=xB6(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 Gi1(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 Ki1({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:[]})}zi1.diff_core=Gi1;function Qc(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 Gi1(X,Y+1-X,X,K+1-X,Z)}zi1.diff=Qc;class qi1{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 bB6(J,Q,Z){return new qi1(Qc(J,Q,Z),J.length)}zi1.lcs=bB6;function*yB6(J,Q,Z){let X=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let Y of Qc(J,Q,Z))Y[2]=X.call(Q,Y[2],Y[3]),yield Y}zi1.calcPatch=yB6;function*fB6(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)}zi1.applyPatch=fB6;function*hB6(J,Q,Z){let X=0,Y=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[K,G,q,z]of Qc(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)]}zi1.calcSlices=hB6});function Zc(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 Fi1.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 Lc1(J,Q){let Z=(J&73)!==0;if(process.platform==="win32"){let X=ON.extname(Q).toLowerCase();return Z||[".exe",".bat",".cmd",".ps1"].includes(X)}return Z}function Ac1(J){return ON.extname(J).toLowerCase()===".md"}function wc1(J){let Q=J.replace(/\\/g,"/"),Z=ON.basename(Q);return ON.basename(Z,ON.extname(Z))}function Rc1(J){return/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(J)&&J.length>0}var Oc1=()=>{};var Ic1={};C6(Ic1,{CommandDiscovery:()=>Ec1});import*as $c1 from"node:fs";import{promises as Fd}from"node:fs";import{homedir as jc1}from"node:os";import*as LX from"node:path";function AZ1(J,Q,Z){return Promise.race([J,new Promise((X,Y)=>setTimeout(()=>Y(Error(`${Z} timed out after ${Q}ms`)),Q))])}class Ec1{config;workspaceRoots;watchFactory;debounceMs;changes=new I8;watchers=new Map;debounceTimer;disposed=!1;constructor(J,Q,Z={}){this.config=J,this.workspaceRoots=Q,this.watchFactory=Z.watchFactory??tW6,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=$0.file(Z),Y=await this.discoverCommandsInDirectory(X,"global");J.push(...Y)}return J}async discoverCommandsInDirectory(J,Q){try{let Z=J.fsPath;try{await AZ1(Fd.access(Z),LZ1,"directory access")}catch{return[]}let Y=(await AZ1(Fd.readdir(Z,{withFileTypes:!0}),LZ1,"directory read")).filter((G)=>G.isFile()),K=[];for(let G of Y){let q=LX.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 Fd.stat(J),Z=LX.basename(J);if(this.ignoreCommandName(Z))return null;let X=wc1(Z);if(!Rc1(X))return u.warn(`Invalid command name: ${X}`,{filePath:J}),null;if(Ac1(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:LX.dirname(J),lastModified:Q.mtimeMs,available:!0,unavailableReason:void 0}}async createExecutableCommand(J,Q,Z){let X=LX.basename(J),Y=Lc1(Q.mode,X),K=await Nc1(J),G=LX.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:LX.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 LX.join(jc1(),J.slice(2));if(J.startsWith("~/.config/amp/")){let Q=YB||LX.join(jc1(),".config");return LX.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 AZ1(Fd.access(J),LZ1,"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 LZ1=5000,tW6=(J,Q)=>$c1.watch(J,Q);var Pc1=B1(()=>{b6();v0();cR();G0();Oc1()});import{homedir as Hd}from"node:os";import jN from"node:path";var Cc1,YF6,Sc1,KF6,Bd,GF6,lR,KB,RZ1;var XW=B1(()=>{cR();Cc1=jN.join(Hd(),".local/share"),YF6=process.platform==="win32"||process.platform==="darwin"?Cc1:XB??Cc1,Sc1=jN.join(Hd(),".config"),KF6=process.platform==="win32"||process.platform==="darwin"?Sc1:YB??Sc1,Bd=jN.join(YF6,"amp"),GF6=jN.join(KF6,"amp"),lR=jN.join(GF6,"tools"),KB=jN.join(Hd(),".cache","amp"),RZ1=jN.join(Hd(),".cache","amp","http-debug-logs")});function wX(J,Q,Z=Q+"s"){return J===1?Q:Z}var rR;var TZ1=B1(()=>{rR={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","dev:watch":"NODE_ENV=development bun run scripts/watch.ts","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":"NODE_ENV=development bun run scripts/build.ts",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":"NODE_ENV=development bun run scripts/build.ts","_build:extension:production":"NODE_ENV=production bun run scripts/build.ts","_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":"pnpm run -s build && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code --install-extension dist/amp-dev.vsix --force","dev:insiders:vsix":"pnpm run -s build && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code-insiders --install-extension dist/amp-dev.vsix --force","prod:vsix":"pnpm run -s build:production && vsce package --no-dependencies --pre-release --out dist/amp-prod.vsix && code --install-extension dist/amp-prod.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.cjs",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"},{type:"webview",id:"amp.reviewPanel",name:"Review",icon:"$(compare-changes)",visibility:"visible",when:"config.amp.review.separatePanel"}]},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"},{command:"amp.agent.switchAgentMode",key:"ctrl+shift+m",mac:"cmd+shift+m",when:"amp.activated && amp.hasMultipleVisibleModes"}],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"}},oauth:{type:"object",description:"OAuth 2.0 configuration for MCP server authentication",properties:{clientId:{type:"string",description:"OAuth client ID"},clientSecret:{type:"string",description:"OAuth client secret (optional for public clients)"},authUrl:{type:"string",description:"OAuth authorization endpoint URL"},tokenUrl:{type:"string",description:"OAuth token endpoint URL"},scopes:{type:"array",description:"OAuth scopes to request",items:{type:"string"}},redirectUrl:{type:"string",description:"OAuth redirect URL (defaults to http://localhost:8976/oauth/callback)"}}}},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.promptAutocomplete.verboseLogging":{type:"boolean",default:!1,markdownDescription:"Enable verbose logging for prompt autocomplete.",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.review.separatePanel":{type:"boolean",default:!1,description:"Show the review panel as a separate container that's independently draggable to a different sidebar location.",scope:"window"},"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.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","jsonc-parser":"^3.3.1",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:{"@secretlint/secretlint-rule-no-dotenv":"^11.2.5","@secretlint/secretlint-rule-preset-recommend":"^11.2.5","@sourcegraph/amp-web":"workspace:*","@types/bun":"^1.2.17","@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"}}});var dc1="run_terminal_command",Nd="read_file",cc1="write_file",s5="Task",lc1="chat_llm",P5="finder",GB="fast_finder",lq="xai_finder",iq="kimiK2_finder",qB="gossip_finder",zB="sonoma_finder",EN="get_diagnostics",c4="Bash",o5="oracle",YS="mermaid",UB="todo_read",t5="todo_write",aq="read_web_page",Ld="read_thread",ic1="run_javascript",CJ="create_file",WB="glob",ac1="Glob",Ad="undo_edit",wd="read_mcp_resource",J9="Read",NQ="edit_file",Rd="format_file",FB="web_search",v4="Grep",KS="Check",nq="librarian",Od="read_github",jd="search_github",$d="commit_search",Ed="list_directory_github",Id="list_repositories",Pd="glob_github",Td="diff",nc1;var F8=B1(()=>{nc1=["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","delete_file","format_file","web_search","Grep","search_documents","get_document","Check","code_review","librarian","read_thread"]});var GS=t((qz9,sc1)=>{var rc1={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:"/"},$F6={...rc1,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:"\\"},EF6={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"};sc1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:EF6,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?$F6:rc1}}});var qS=t((SF6)=>{var{REGEX_BACKSLASH:IF6,REGEX_REMOVE_BACKSLASH:PF6,REGEX_SPECIAL_CHARS:TF6,REGEX_SPECIAL_CHARS_GLOBAL:CF6}=GS();SF6.isObject=(J)=>J!==null&&typeof J==="object"&&!Array.isArray(J);SF6.hasRegexChars=(J)=>TF6.test(J);SF6.isRegexChar=(J)=>J.length===1&&SF6.hasRegexChars(J);SF6.escapeRegex=(J)=>J.replace(CF6,"\\$1");SF6.toPosixSlashes=(J)=>J.replace(IF6,"/");SF6.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};SF6.removeBackslashes=(J)=>{return J.replace(PF6,(Q)=>{return Q==="\\"?"":Q})};SF6.escapeLast=(J,Q,Z)=>{let X=J.lastIndexOf(Q,Z);if(X===-1)return J;if(J[X-1]==="\\")return SF6.escapeLast(J,Q,X-1);return`${J.slice(0,X)}\\${J.slice(X)}`};SF6.removePrefix=(J,Q={})=>{let Z=J;if(Z.startsWith("./"))Z=Z.slice(2),Q.prefix="./";return Z};SF6.wrapOutput=(J,Q={},Z={})=>{let X=Z.contains?"":"^",Y=Z.contains?"":"$",K=`${X}(?:${J})${Y}`;if(Q.negated===!0)K=`(?:^(?!${K}).*$)`;return K};SF6.basename=(J,{windows:Q}={})=>{let Z=J.split(Q?/[\\/]/:"/"),X=Z[Z.length-1];if(X==="")return Z[Z.length-2];return X}});var Gl1=t((Uz9,Kl1)=>{var ec1=qS(),{CHAR_ASTERISK:CZ1,CHAR_AT:mF6,CHAR_BACKWARD_SLASH:zS,CHAR_COMMA:uF6,CHAR_DOT:SZ1,CHAR_EXCLAMATION_MARK:vZ1,CHAR_FORWARD_SLASH:Yl1,CHAR_LEFT_CURLY_BRACE:kZ1,CHAR_LEFT_PARENTHESES:_Z1,CHAR_LEFT_SQUARE_BRACKET:pF6,CHAR_PLUS:dF6,CHAR_QUESTION_MARK:Jl1,CHAR_RIGHT_CURLY_BRACE:cF6,CHAR_RIGHT_PARENTHESES:Ql1,CHAR_RIGHT_SQUARE_BRACKET:lF6}=GS(),Zl1=(J)=>{return J===Yl1||J===zS},Xl1=(J)=>{if(J.isPrefix!==!0)J.depth=J.isGlobstar?1/0:1},iF6=(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,$=0,j,E,I={value:"",depth:0,isGlob:!1},T=()=>U>=X,S=()=>z.charCodeAt(U+1),x=()=>{return j=E,z.charCodeAt(++U)};while(U<X){E=x();let g;if(E===zS){if(A=I.backslashes=!0,E=x(),E===kZ1)L=!0;continue}if(L===!0||E===kZ1){$++;while(T()!==!0&&(E=x())){if(E===zS){A=I.backslashes=!0,x();continue}if(E===kZ1){$++;continue}if(L!==!0&&E===SZ1&&(E=x())===SZ1){if(H=I.isBrace=!0,M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(L!==!0&&E===uF6){if(H=I.isBrace=!0,M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===cF6){if($--,$===0){L=!1,H=I.isBrace=!0,O=!0;break}}}if(Y===!0)continue;break}if(E===Yl1){if(K.push(U),G.push(I),I={value:"",depth:0,isGlob:!1},O===!0)continue;if(j===SZ1&&U===W+1){W+=2;continue}F=U+1;continue}if(Z.noext!==!0){if((E===dF6||E===mF6||E===CZ1||E===Jl1||E===vZ1)===!0&&S()===_Z1){if(M=I.isGlob=!0,V=I.isExtglob=!0,O=!0,E===vZ1&&U===W)R=!0;if(Y===!0){while(T()!==!0&&(E=x())){if(E===zS){A=I.backslashes=!0,E=x();continue}if(E===Ql1){M=I.isGlob=!0,O=!0;break}}continue}break}}if(E===CZ1){if(j===CZ1)N=I.isGlobstar=!0;if(M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===Jl1){if(M=I.isGlob=!0,O=!0,Y===!0)continue;break}if(E===pF6){while(T()!==!0&&(g=x())){if(g===zS){A=I.backslashes=!0,x();continue}if(g===lF6){B=I.isBracket=!0,M=I.isGlob=!0,O=!0;break}}if(Y===!0)continue;break}if(Z.nonegate!==!0&&E===vZ1&&U===W){w=I.negated=!0,W++;continue}if(Z.noparen!==!0&&E===_Z1){if(M=I.isGlob=!0,Y===!0){while(T()!==!0&&(E=x())){if(E===_Z1){A=I.backslashes=!0,E=x();continue}if(E===Ql1){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(Zl1(h.charCodeAt(h.length-1)))h=h.slice(0,-1)}if(Z.unescape===!0){if(_)_=ec1.removeBackslashes(_);if(h&&A===!0)h=ec1.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,!Zl1(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 f=g?g+1:W,y=K[k],m=J.slice(f,y);if(Z.tokens){if(k===0&&W!==0)G[k].isPrefix=!0,G[k].value=v;else G[k].value=m;Xl1(G[k]),b.maxDepth+=G[k].depth}if(k!==0||m!=="")q.push(m);g=y}if(g&&g+1<J.length){let k=J.slice(g+1);if(q.push(k),Z.tokens)G[G.length-1].value=k,Xl1(G[G.length-1]),b.maxDepth+=G[G.length-1].depth}b.slashes=K,b.parts=q}return b};Kl1.exports=iF6});var Ul1=t((Wz9,zl1)=>{var Cd=GS(),rq=qS(),{MAX_LENGTH:Sd,POSIX_REGEX_SOURCE:aF6,REGEX_NON_SPECIAL_CHARS:nF6,REGEX_SPECIAL_CHARS_BACKREF:rF6,REPLACEMENTS:ql1}=Cd,sF6=(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)=>rq.escapeRegex(Y)).join("..")}return Z},sR=(J,Q)=>{return`Missing ${J}: "${Q}" - use "\\\\${Q}" to match literal characters`},xZ1=(J,Q)=>{if(typeof J!=="string")throw TypeError("Expected a string");J=ql1[J]||J;let Z={...Q},X=typeof Z.maxLength==="number"?Math.min(Sd,Z.maxLength):Sd,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=Cd.globChars(Z.windows),U=Cd.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,$=(F1)=>{return`(${q}(?:(?!${O}${F1.dot?M:W}).)*?)`},j=Z.dot?"":V,E=Z.dot?A:w,I=Z.bash===!0?$(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=rq.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]||"",f=()=>J.slice(T.index+1),y=(F1="",l=0)=>{T.consumed+=F1,T.index+=l},m=(F1)=>{T.output+=F1.output!=null?F1.output:F1.value,y(F1.value)},a=()=>{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},W1=(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=$(Z);if(i!==I||b()||/^\)+$/.test(f()))l=F1.close=`)$))${i}`;if(F1.inner.includes("*")&&(d=f())&&/^\.[^\\/.]+$/.test(d)){let n=xZ1(d,{...Q,fastpaths:!1}).output;l=F1.close=`)${n})${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(rF6,(d,i,n,s,Y1,J1)=>{if(s==="\\")return F1=!0,d;if(s==="?"){if(i)return i+s+(Y1?A.repeat(Y1.length):"");if(J1===0)return E+(Y1?A.repeat(Y1.length):"");return A.repeat(n.length)}if(s===".")return W.repeat(n.length);if(s==="*"){if(i)return i+s+(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=rq.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(f()),n=0;if(i&&i[0].length>2){if(n=i[0].length,T.index+=n,n%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("["),n=v.value.slice(0,i),s=v.value.slice(i+2),Y1=aF6[s];if(Y1){if(v.value=n+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&&_!=='"'){_=rq.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(sR("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||!f().includes("]")){if(Z.nobracket!==!0&&Z.strictBrackets===!0)throw SyntaxError(sR("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(sR("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||rq.hasRegexChars(d))continue;let i=rq.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 n=G.slice(),s=[];for(let Y1=n.length-1;Y1>=0;Y1--){if(G.pop(),n[Y1].type==="brace")break;if(n[Y1].type!=="dots")s.unshift(n[Y1].value)}i=sF6(s,Z),T.backtrack=!0}if(d.comma!==!0&&d.dots!==!0){let n=T.output.slice(0,d.outputIndex),s=T.tokens.slice(d.tokensIndex);d.value=d.output="\\{",_=i="\\}",T.output=n;for(let Y1 of s)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)!=="?"){W1("qmark",_);continue}if(v&&v.type==="paren"){let i=g(),n=_;if(v.value==="("&&!/[!=<:]/.test(i)||i==="<"&&!/<([!=]|\w+>)/.test(f()))n=`\\${_}`;G1({type:"text",value:_,output:n});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))){W1("negate",_);continue}}if(Z.nonegate!==!0&&T.index===0){a();continue}}if(_==="+"){if(Z.noextglob!==!0&&g()==="("&&g(2)!=="?"){W1("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=nF6.exec(f());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,y(_);continue}let F1=f();if(Z.noextglob!==!0&&/^\([^?]/.test(F1)){W1("star",_);continue}if(v.type==="star"){if(Z.noglobstar===!0){y(_);continue}let d=v.prev,i=d.prev,n=d.type==="slash"||d.type==="bos",s=i&&(i.type==="star"||i.type==="globstar");if(Z.bash===!0&&(!n||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(!n&&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),y("/**",3)}if(d.type==="bos"&&b()){v.type="globstar",v.value+=_,v.output=$(Z),T.output=v.output,T.globstar=!0,y(_);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&!s&&b()){T.output=T.output.slice(0,-(d.output+v.output).length),d.output=`(?:${d.output}`,v.type="globstar",v.output=$(Z)+(Z.strictSlashes?")":"|$)"),v.value+=_,T.globstar=!0,T.output+=d.output+v.output,y(_);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=`${$(Z)}${H}|${H}${H1})`,v.value+=_,T.output+=d.output+v.output,T.globstar=!0,y(_+k()),G1({type:"slash",value:"/",output:""});continue}if(d.type==="bos"&&F1[0]==="/"){v.type="globstar",v.value+=_,v.output=`(?:^|${H}|${$(Z)}${H})`,T.output=v.output,T.globstar=!0,y(_+k()),G1({type:"slash",value:"/",output:""});continue}T.output=T.output.slice(0,-v.output.length),v.type="globstar",v.output=$(Z),v.value+=_,T.output+=v.output,T.globstar=!0,y(_);continue}let l={type:"star",value:_,output:I};if(Z.bash===!0){if(l.output=".*?",v.type==="bos"||v.type==="slash")l.output=j+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+=j,v.output+=j;if(g()!=="*")T.output+=B,v.output+=B}G1(l)}while(T.brackets>0){if(Z.strictBrackets===!0)throw SyntaxError(sR("closing","]"));T.output=rq.escapeLast(T.output,"["),e("brackets")}while(T.parens>0){if(Z.strictBrackets===!0)throw SyntaxError(sR("closing",")"));T.output=rq.escapeLast(T.output,"("),e("parens")}while(T.braces>0){if(Z.strictBrackets===!0)throw SyntaxError(sR("closing","}"));T.output=rq.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};xZ1.fastpaths=(J,Q)=>{let Z={...Q},X=typeof Z.maxLength==="number"?Math.min(Sd,Z.maxLength):Sd,Y=J.length;if(Y>X)throw SyntaxError(`Input length: ${Y}, exceeds maximum allowed length: ${X}`);J=ql1[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}=Cd.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=(j)=>{if(j.noglobstar===!0)return A;return`(${N}(?:(?!${B}${j.dot?z:K}).)*?)`},R=(j)=>{switch(j){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(j);if(!E)return;let I=R(E[1]);if(!I)return;return I+K+E[2]}}},O=rq.removePrefix(J,L),$=R(O);if($&&Z.strictSlashes!==!0)$+=`${G}?`;return $};zl1.exports=xZ1});var US=t((Fz9,Fl1)=>{var oF6=Gl1(),bZ1=Ul1(),Wl1=qS(),tF6=GS(),eF6=(J)=>J&&typeof J==="object"&&!Array.isArray(J),U7=(J,Q,Z=!1)=>{if(Array.isArray(J)){let W=J.map((H)=>U7(H,Q,Z));return(H)=>{for(let B of W){let M=B(H);if(M)return M}return!1}}let X=eF6(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?U7.compileRe(J,Q):U7.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=U7(Y.ignore,W,Z)}let U=(W,F=!1)=>{let{isMatch:H,match:B,output:M}=U7.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};U7.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?Wl1.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=U7.matchBase(J,Q,Z,Y);else q=Q.exec(z);return{isMatch:Boolean(q),match:q,output:z}};U7.matchBase=(J,Q,Z)=>{return(Q instanceof RegExp?Q:U7.makeRe(Q,Z)).test(Wl1.basename(J))};U7.isMatch=(J,Q,Z)=>U7(Q,Z)(J);U7.parse=(J,Q)=>{if(Array.isArray(J))return J.map((Z)=>U7.parse(Z,Q));return bZ1(J,{...Q,fastpaths:!1})};U7.scan=(J,Q)=>oF6(J,Q);U7.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=U7.toRegex(q,Q);if(X===!0)z.state=J;return z};U7.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=bZ1.fastpaths(J,Q);if(!Y.output)Y=bZ1(J,Q);return U7.compileRe(Y,Q,Z,X)};U7.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/$^/}};U7.constants=tF6;Fl1.exports=U7});var IN=t((Hz9,Dl1)=>{var Hl1=US(),JH6=qS();function Bl1(J,Q,Z=!1){if(Q&&(Q.windows===null||Q.windows===void 0))Q={...Q,windows:JH6.isWindows()};return Hl1(J,Q,Z)}Object.assign(Bl1,Hl1);Dl1.exports=Bl1});function vd(J){if(!J)return null;let Z=_d(J)?.toolAllowlist;if(!Z)return null;let X=Object.entries(WS).find(([K,G])=>G.includes(J))?.[0],Y=Nl1.filter((K)=>K!==X).map((K)=>`!${K}`);if(X&&X!=="finder")Y.push("!finder");return[...Z,...Y]}function kd(J,Q){let Z=!1;for(let X of Q){if(X==="")continue;if(X.startsWith("!")){let Y=X.slice(1);if(Ml1(J,Y))return!1;continue}if(Ml1(J,X))Z=!0}return Z}function Ml1(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 Vl1.default(Q,{dot:!0})(J)}catch(Z){return!1}return!1}var Vl1;var yZ1=B1(()=>{O2();Vl1=x6(IN(),1)});function f8(J){let Q=b2[J];return`${Q.provider}/${Q.name}`}function OX(J){let[Q,Z]=J.split("/");for(let X of Object.values(b2))if(X.provider===Q&&X.name===Z)return X;switch(Q){case"anthropic":return b2.CLAUDE_SONNET_4_5;case"openai":return b2.GPT_5;case"xai":return b2.GROK_CODE_FAST_1;case"cerebras":return b2.QWEN_3_CODER_480B;case"moonshotai":return b2.KIMI_K2_INSTRUCT;case"openrouter":return b2.SONOMA_SKY_ALPHA;case"supernova":return b2.CODE_SUPERNOVA;case"groq":return b2.GPT_OSS_120B;case"vertexai":return b2.GEMINI_2_5_FLASH_PREVIEW_09_2025;default:throw Error(`Unknown provider: ${Q}`)}}function oR(J){let[,Q]=J.split("/");return Q||J}function zZ(J){let Q=OX(J);return Q.contextWindow-Q.maxOutputTokens}function YW(J){let Q=J?.["internal.visibleModes"]??[];return Object.values(PN).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 _d(J){return Object.values(PN).find((Q)=>Q.key===J)}function Al1(J){return _d(J)?.primaryModel??f8("CLAUDE_SONNET_4_5")}function xd(J){let Q=_d(J);if(!Q)return!1;return OX(Q.primaryModel).capabilities?.vision??!1}function wl1(J,Q){return Q.find((Z)=>Z.mode===J)?.description}function bd(J,Q){let X=(Q.findIndex((K)=>K.mode===J)+1)%Q.length;return Q[X]?.mode??"smart"}var C2,b2,PN,Ll1,WS,Nl1;var O2=B1(()=>{C2={ANTHROPIC:"anthropic",OPENAI:"openai",XAI:"xai",CEREBRAS:"cerebras",GROQ:"groq",MOONSHOT:"moonshotai",OPENROUTER:"openrouter",VERTEXAI:"vertexai",SUPERNOVA:"supernova"},b2={CLAUDE_SONNET_4:{provider:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.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:C2.OPENAI,name:"openai/gpt-oss-120b",displayName:"GPT OSS 120B",contextWindow:128000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0}},GROK_CODE_FAST_1:{provider:C2.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:C2.XAI,name:"grok-code",displayName:"Grok Code",contextWindow:256000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0},freeTierEligible:!0},GEMINI_2_5_PRO:{provider:C2.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:C2.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:C2.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:C2.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:C2.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:C2.CEREBRAS,name:"qwen-3-coder-480b",displayName:"Qwen 3 Coder 480B",contextWindow:128000,maxOutputTokens:32000,capabilities:{tools:!0}},KIMI_K2_INSTRUCT:{provider:C2.MOONSHOT,name:"kimi-k2-instruct-0905",displayName:"Kimi K2 Instruct",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0}},SONOMA_SKY_ALPHA:{provider:C2.OPENROUTER,name:"sonoma-sky-alpha",displayName:"Sonoma Sky Alpha",contextWindow:256000,maxOutputTokens:32000,capabilities:{tools:!0}},CODE_SUPERNOVA:{provider:C2.SUPERNOVA,name:"code-supernova",displayName:"Code Supernova",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0},freeTierEligible:!0}};PN={SMART:{key:"smart",displayName:"Smart",description:"Smarter, but slower",primaryModel:f8("CLAUDE_SONNET_4_5"),visible:!0},FREE:{key:"free",displayName:"Free",description:"Amp Free",primaryModel:f8("GROK_CODE_FAST_1"),visible:!0,toolAllowlist:["*","!oracle","!librarian","!Task","!read_thread"]},FREE_NEXT:{key:"free-next",displayName:"Free (Next)",description:"Preview of Amp Free configuration in testing",primaryModel:f8("GEMINI_2_5_FLASH_PREVIEW_09_2025"),toolAllowlist:["*","!oracle","!librarian","!Task"]},GRONK_FAST_MAIN:{key:"gronk-fast:main",displayName:"Gronk Fast Main",primaryModel:f8("GROK_CODE_FAST_1")},GRONK_FAST_SEARCH:{key:"gronk-fast:search",displayName:"Gronk Fast Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("GROK_CODE_FAST_1")},GRONK_FAST_MAIN_SEARCH:{key:"gronk-fast:main+search",displayName:"Gronk Fast Main+Search",primaryModel:f8("GROK_CODE_FAST_1"),searchModel:f8("GROK_CODE_FAST_1")},BOLT_SEARCH:{key:"bolt:search",displayName:"Bolt Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("QWEN_3_CODER_480B")},BOLT_MAIN:{key:"bolt:main",displayName:"Bolt Main",primaryModel:f8("QWEN_3_CODER_480B")},BOLT_MAIN_SEARCH:{key:"bolt:main+search",displayName:"Bolt Main+Search",primaryModel:f8("QWEN_3_CODER_480B"),searchModel:f8("QWEN_3_CODER_480B")},GEPPETTO_MAIN:{key:"geppetto:main",displayName:"Geppetto Main",primaryModel:f8("GPT_5")},GEPPETTO_PRO_MAIN:{key:"geppetto-pro:main",displayName:"Geppetto Pro Main",primaryModel:f8("GPT_5")},PINOCCHIO_MAIN:{key:"pinocchio:main",displayName:"Pinocchio Main",primaryModel:f8("GPT_5_CODEX")},CLAUDIUS_MAIN:{key:"claudius:main",displayName:"Claudius Main",primaryModel:f8("CLAUDE_OPUS_4")},OPUS_4_1:{key:"opus4.1",displayName:"Opus 4.1",primaryModel:f8("CLAUDE_OPUS_4_1")},HYDROGEN_MAIN:{key:"hydrogen:main",displayName:"Hydrogen Main",primaryModel:f8("CODE_SUPERNOVA")},KASHMIR_MAIN:{key:"kashmir:main",displayName:"Kashmir Main",primaryModel:f8("KIMI_K2_INSTRUCT")},KASHMIR_SEARCH:{key:"kashmir:search",displayName:"Kashmir Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("KIMI_K2_INSTRUCT")},KASHMIR_MAIN_SEARCH:{key:"kashmir:main+search",displayName:"Kashmir Main+Search",primaryModel:f8("KIMI_K2_INSTRUCT"),searchModel:f8("KIMI_K2_INSTRUCT")},GOSSIP_MAIN:{key:"gossip:main",displayName:"Gossip Main",primaryModel:f8("GPT_OSS_120B")},GOSSIP_SEARCH:{key:"gossip:search",displayName:"Gossip Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("GPT_OSS_120B")},GOSSIP_MAIN_SEARCH:{key:"gossip:main+search",displayName:"Gossip Main+Search",primaryModel:f8("GPT_OSS_120B"),searchModel:f8("GPT_OSS_120B")},SONOMOON_MAIN:{key:"sonomoon:main",displayName:"Sonomoon Main",primaryModel:f8("SONOMA_SKY_ALPHA")},SONOMOON_SEARCH:{key:"sonomoon:search",displayName:"Sonomoon Search",primaryModel:f8("CLAUDE_SONNET_4_5"),searchModel:f8("SONOMA_SKY_ALPHA")},SONOMOON_MAIN_SEARCH:{key:"sonomoon:main+search",displayName:"Sonomoon Main+Search",primaryModel:f8("SONOMA_SKY_ALPHA"),searchModel:f8("SONOMA_SKY_ALPHA")}},Ll1=Object.values(PN).map((J)=>J.key),WS={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"]},Nl1=Object.keys(WS)});function fZ1(J){return QH6.includes(J)}function Ol1(J){let Q=J["internal.oracleModel"]?.trim();if(Q&&Q.length>0)return Q;return b2.GPT_5.name}function jl1(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 QH6,yd,Rl1;var tR=B1(()=>{TZ1();O2();QH6=["guardedFiles.allowlist","mcpPermissions","tools.disable","permissions"];yd=rR.capabilities.untrustedWorkspaces.restrictedConfigurations.map((J)=>J.replace(/^amp\./,"")),Rl1=["apiKey","buildkite-access-token","github-access-token","gitlab-access-token","gitlab-instance-url","mcp-oauth-client-secret","mcp-oauth-token"]});function HB(J){let Q=typeof J==="string"?J:J.toString();return Q===UZ||Q===UZ.slice(0,-1)}function eR(J){return HB(J)?UZ:J}var YH6,UZ,KH6,$z9;var BB=B1(()=>{YH6=new URL("https://ampcode.com/"),UZ=YH6.toString(),KH6=new URL("https://api.anthropic.com/"),$z9=KH6.toString()});var O9,hZ1,J6,sq=(J)=>{switch(typeof J){case"undefined":return J6.undefined;case"string":return J6.string;case"number":return Number.isNaN(J)?J6.nan:J6.number;case"boolean":return J6.boolean;case"function":return J6.function;case"bigint":return J6.bigint;case"symbol":return J6.symbol;case"object":if(Array.isArray(J))return J6.array;if(J===null)return J6.null;if(J.then&&typeof J.then==="function"&&J.catch&&typeof J.catch==="function")return J6.promise;if(typeof Map<"u"&&J instanceof Map)return J6.map;if(typeof Set<"u"&&J instanceof Set)return J6.set;if(typeof Date<"u"&&J instanceof Date)return J6.date;return J6.object;default:return J6.unknown}};var FS=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}}})(hZ1||(hZ1={}));J6=O9.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var h0,GH6=(J)=>{return JSON.stringify(J,null,2).replace(/"([^"]+)":/g,"$1:")},WZ;var gd=B1(()=>{FS();h0=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"]);WZ=class WZ 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 WZ))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()}};WZ.create=(J)=>{return new WZ(J)}});var qH6=(J,Q)=>{let Z;switch(J.code){case h0.invalid_type:if(J.received===J6.undefined)Z="Required";else Z=`Expected ${J.expected}, received ${J.received}`;break;case h0.invalid_literal:Z=`Invalid literal value, expected ${JSON.stringify(J.expected,O9.jsonStringifyReplacer)}`;break;case h0.unrecognized_keys:Z=`Unrecognized key(s) in object: ${O9.joinValues(J.keys,", ")}`;break;case h0.invalid_union:Z="Invalid input";break;case h0.invalid_union_discriminator:Z=`Invalid discriminator value. Expected ${O9.joinValues(J.options)}`;break;case h0.invalid_enum_value:Z=`Invalid enum value. Expected ${O9.joinValues(J.options)}, received '${J.received}'`;break;case h0.invalid_arguments:Z="Invalid function arguments";break;case h0.invalid_return_type:Z="Invalid function return type";break;case h0.invalid_date:Z="Invalid date";break;case h0.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 h0.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 h0.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 h0.custom:Z="Invalid input";break;case h0.invalid_intersection_types:Z="Intersection results could not be merged";break;case h0.not_multiple_of:Z=`Number must be a multiple of ${J.multipleOf}`;break;case h0.not_finite:Z="Number must be finite";break;default:Z=Q.defaultError,O9.assertNever(J)}return{message:Z}},KW;var gZ1=B1(()=>{gd();FS();KW=qH6});function zH6(J){$l1=J}function JO(){return $l1}var $l1;var md=B1(()=>{gZ1();$l1=KW});function F6(J,Q){let Z=JO(),X=HS({issueData:Q,data:J.data,path:J.path,errorMaps:[J.common.contextualErrorMap,J.schemaErrorMap,Z,Z===KW?void 0:KW].filter((Y)=>!!Y)});J.common.issues.push(X)}class e5{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 N8;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 e5.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 N8;if(K.status==="aborted")return N8;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 HS=(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}},UH6,N8,TN=(J)=>({status:"dirty",value:J}),SJ=(J)=>({status:"valid",value:J}),ud=(J)=>J.status==="aborted",pd=(J)=>J.status==="dirty",DB=(J)=>J.status==="valid",QO=(J)=>typeof Promise<"u"&&J instanceof Promise;var mZ1=B1(()=>{md();gZ1();UH6=[];N8=Object.freeze({status:"aborted"})});var El1=()=>{};var y6;var Il1=B1(()=>{(function(J){J.errToObj=(Q)=>typeof Q==="string"?{message:Q}:Q||{},J.toString=(Q)=>typeof Q==="string"?Q:Q?.message})(y6||(y6={}))});class ZG{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 n8(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 z9{get description(){return this._def.description}_getType(J){return sq(J.data)}_getOrReturnCtx(J,Q){return Q||{common:J.parent.common,data:J.data,parsedType:sq(J.data),schemaErrorMap:this._def.errorMap,path:J.path,parent:J.parent}}_processInputParams(J){return{status:new e5,ctx:{common:J.parent.common,data:J.data,parsedType:sq(J.data),schemaErrorMap:this._def.errorMap,path:J.path,parent:J.parent}}}_parseSync(J){let Q=this._parse(J);if(QO(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:sq(J)},X=this._parseSync({data:J,path:Z.path,parent:Z});return Pl1(Z,X)}"~validate"(J){let Q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:J,parsedType:sq(J)};if(!this["~standard"].async)try{let Z=this._parseSync({data:J,path:[],parent:Q});return DB(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)=>DB(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:sq(J)},X=this._parse({data:J,path:Z.path,parent:Z}),Y=await(QO(X)?X:Promise.resolve(X));return Pl1(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:h0.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 XG({schema:this,typeName:R8.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 QG.create(this,this._def)}nullable(){return qW.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return JG.create(this)}promise(){return kN.create(this,this._def)}or(J){return qO.create([this,J],this._def)}and(J){return zO.create(this,J,this._def)}transform(J){return new XG({...n8(this._def),schema:this,typeName:R8.ZodEffects,effect:{type:"transform",transform:J}})}default(J){let Q=typeof J==="function"?J:()=>J;return new HO({...n8(this._def),innerType:this,defaultValue:Q,typeName:R8.ZodDefault})}brand(){return new cd({typeName:R8.ZodBranded,type:this,...n8(this._def)})}catch(J){let Q=typeof J==="function"?J:()=>J;return new BO({...n8(this._def),innerType:this,catchValue:Q,typeName:R8.ZodCatch})}describe(J){return new this.constructor({...this._def,description:J})}pipe(J){return LS.create(this,J)}readonly(){return DO.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Sl1(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 IH6(J){return new RegExp(`^${Sl1(J)}$`)}function vl1(J){let Q=`${Cl1}T${Sl1(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 PH6(J,Q){if((Q==="v4"||!Q)&&AH6.test(J))return!0;if((Q==="v6"||!Q)&&RH6.test(J))return!0;return!1}function TH6(J,Q){if(!MH6.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 CH6(J,Q){if((Q==="v4"||!Q)&&wH6.test(J))return!0;if((Q==="v6"||!Q)&&OH6.test(J))return!0;return!1}function SH6(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 ZO(J){if(J instanceof k4){let Q={};for(let Z in J.shape){let X=J.shape[Z];Q[Z]=QG.create(ZO(X))}return new k4({...J._def,shape:()=>Q})}else if(J instanceof JG)return new JG({...J._def,type:ZO(J.element)});else if(J instanceof QG)return QG.create(ZO(J.unwrap()));else if(J instanceof qW)return qW.create(ZO(J.unwrap()));else if(J instanceof tq)return tq.create(J.items.map((Q)=>ZO(Q)));else return J}function pZ1(J,Q){let Z=sq(J),X=sq(Q);if(J===Q)return{valid:!0,data:J};else if(Z===J6.object&&X===J6.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=pZ1(J[q],Q[q]);if(!z.valid)return{valid:!1};G[q]=z.data}return{valid:!0,data:G}}else if(Z===J6.array&&X===J6.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=pZ1(G,q);if(!z.valid)return{valid:!1};Y.push(z.data)}return{valid:!0,data:Y}}else if(Z===J6.date&&X===J6.date&&+J===+Q)return{valid:!0,data:J};else return{valid:!1}}function kl1(J,Q){return new LB({values:J,typeName:R8.ZodEnum,...n8(Q)})}function Tl1(J,Q){let Z=typeof J==="function"?J(Q):typeof J==="string"?{message:J}:J;return typeof Z==="string"?{message:Z}:Z}function _l1(J,Q={},Z){if(J)return SN.create().superRefine((X,Y)=>{let K=J(X);if(K instanceof Promise)return K.then((G)=>{if(!G){let q=Tl1(Q,X),z=q.fatal??Z??!0;Y.addIssue({code:"custom",...q,fatal:z})}});if(!K){let G=Tl1(Q,X),q=G.fatal??Z??!0;Y.addIssue({code:"custom",...G,fatal:q})}return});return SN.create()}var Pl1=(J,Q)=>{if(DB(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 WZ(J.common.issues);return this._error=Z,this._error}}}},WH6,FH6,HH6,BH6,DH6,MH6,VH6,NH6,LH6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uZ1,AH6,wH6,RH6,OH6,jH6,$H6,Cl1="((\\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])))",EH6,eK,VB,NB,YO,CN,BS,KO,GO,SN,MB,oq,DS,JG,k4,qO,GW=(J)=>{if(J instanceof UO)return GW(J.schema);else if(J instanceof XG)return GW(J.innerType());else if(J instanceof WO)return[J.value];else if(J instanceof LB)return J.options;else if(J instanceof FO)return O9.objectValues(J.enum);else if(J instanceof HO)return GW(J._def.innerType);else if(J instanceof KO)return[void 0];else if(J instanceof GO)return[null];else if(J instanceof QG)return[void 0,...GW(J.unwrap())];else if(J instanceof qW)return[null,...GW(J.unwrap())];else if(J instanceof cd)return GW(J.unwrap());else if(J instanceof DO)return GW(J.unwrap());else if(J instanceof BO)return GW(J._def.innerType);else return[]},dd,zO,tq,MS,VS,vN,XO,UO,WO,LB,FO,kN,XG,QG,qW,HO,BO,NS,vH6,cd,LS,DO,kH6,R8,_H6=(J,Q={message:`Input not instance of ${J.name}`})=>_l1((Z)=>Z instanceof J,Q),xl1,bl1,xH6,bH6,yl1,yH6,fH6,hH6,gH6,mH6,uH6,pH6,dH6,cH6,lH6,iH6,aH6,nH6,rH6,sH6,oH6,tH6,eH6,JB6,QB6,ZB6,XB6,YB6,KB6,GB6,qB6,zB6,UB6,WB6,FB6=()=>xl1().optional(),HB6=()=>bl1().optional(),BB6=()=>yl1().optional(),DB6,MB6;var fl1=B1(()=>{gd();md();Il1();mZ1();FS();WH6=/^c[^\s-]{8,}$/i,FH6=/^[0-9a-z]+$/,HH6=/^[0-9A-HJKMNP-TV-Z]{26}$/i,BH6=/^[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,DH6=/^[a-z0-9_-]{21}$/i,MH6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,VH6=/^[-+]?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)?)??$/,NH6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,AH6=/^(?:(?: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])$/,wH6=/^(?:(?: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])$/,RH6=/^(([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]))$/,OH6=/^(([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])$/,jH6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$H6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,EH6=new RegExp(`^${Cl1}$`);eK=class eK extends z9{_parse(J){if(this._def.coerce)J.data=String(J.data);if(this._getType(J)!==J6.string){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_type,expected:J6.string,received:Y.parsedType}),N8}let Z=new e5,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),F6(X,{code:h0.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),F6(X,{code:h0.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)F6(X,{code:h0.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});else if(G)F6(X,{code:h0.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});Z.dirty()}}else if(Y.kind==="email"){if(!NH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"email",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="emoji"){if(!uZ1)uZ1=new RegExp(LH6,"u");if(!uZ1.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"emoji",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="uuid"){if(!BH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"uuid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="nanoid"){if(!DH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"nanoid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cuid"){if(!WH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"cuid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cuid2"){if(!FH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"cuid2",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="ulid"){if(!HH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"ulid",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="url")try{new URL(J.data)}catch{X=this._getOrReturnCtx(J,X),F6(X,{validation:"url",code:h0.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),F6(X,{validation:"regex",code:h0.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),F6(X,{code:h0.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),F6(X,{code:h0.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),F6(X,{code:h0.invalid_string,validation:{endsWith:Y.value},message:Y.message}),Z.dirty()}else if(Y.kind==="datetime"){if(!vl1(Y).test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:"datetime",message:Y.message}),Z.dirty()}else if(Y.kind==="date"){if(!EH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:"date",message:Y.message}),Z.dirty()}else if(Y.kind==="time"){if(!IH6(Y).test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{code:h0.invalid_string,validation:"time",message:Y.message}),Z.dirty()}else if(Y.kind==="duration"){if(!VH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"duration",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="ip"){if(!PH6(J.data,Y.version))X=this._getOrReturnCtx(J,X),F6(X,{validation:"ip",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="jwt"){if(!TH6(J.data,Y.alg))X=this._getOrReturnCtx(J,X),F6(X,{validation:"jwt",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="cidr"){if(!CH6(J.data,Y.version))X=this._getOrReturnCtx(J,X),F6(X,{validation:"cidr",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="base64"){if(!jH6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"base64",code:h0.invalid_string,message:Y.message}),Z.dirty()}else if(Y.kind==="base64url"){if(!$H6.test(J.data))X=this._getOrReturnCtx(J,X),F6(X,{validation:"base64url",code:h0.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:h0.invalid_string,...y6.errToObj(Z)})}_addCheck(J){return new eK({...this._def,checks:[...this._def.checks,J]})}email(J){return this._addCheck({kind:"email",...y6.errToObj(J)})}url(J){return this._addCheck({kind:"url",...y6.errToObj(J)})}emoji(J){return this._addCheck({kind:"emoji",...y6.errToObj(J)})}uuid(J){return this._addCheck({kind:"uuid",...y6.errToObj(J)})}nanoid(J){return this._addCheck({kind:"nanoid",...y6.errToObj(J)})}cuid(J){return this._addCheck({kind:"cuid",...y6.errToObj(J)})}cuid2(J){return this._addCheck({kind:"cuid2",...y6.errToObj(J)})}ulid(J){return this._addCheck({kind:"ulid",...y6.errToObj(J)})}base64(J){return this._addCheck({kind:"base64",...y6.errToObj(J)})}base64url(J){return this._addCheck({kind:"base64url",...y6.errToObj(J)})}jwt(J){return this._addCheck({kind:"jwt",...y6.errToObj(J)})}ip(J){return this._addCheck({kind:"ip",...y6.errToObj(J)})}cidr(J){return this._addCheck({kind:"cidr",...y6.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,...y6.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,...y6.errToObj(J?.message)})}duration(J){return this._addCheck({kind:"duration",...y6.errToObj(J)})}regex(J,Q){return this._addCheck({kind:"regex",regex:J,...y6.errToObj(Q)})}includes(J,Q){return this._addCheck({kind:"includes",value:J,position:Q?.position,...y6.errToObj(Q?.message)})}startsWith(J,Q){return this._addCheck({kind:"startsWith",value:J,...y6.errToObj(Q)})}endsWith(J,Q){return this._addCheck({kind:"endsWith",value:J,...y6.errToObj(Q)})}min(J,Q){return this._addCheck({kind:"min",value:J,...y6.errToObj(Q)})}max(J,Q){return this._addCheck({kind:"max",value:J,...y6.errToObj(Q)})}length(J,Q){return this._addCheck({kind:"length",value:J,...y6.errToObj(Q)})}nonempty(J){return this.min(1,y6.errToObj(J))}trim(){return new eK({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new eK({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new eK({...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}};eK.create=(J)=>{return new eK({checks:[],typeName:R8.ZodString,coerce:J?.coerce??!1,...n8(J)})};VB=class VB extends z9{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)!==J6.number){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_type,expected:J6.number,received:Y.parsedType}),N8}let Z=void 0,X=new e5;for(let Y of this._def.checks)if(Y.kind==="int"){if(!O9.isInteger(J.data))Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.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),F6(Z,{code:h0.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),F6(Z,{code:h0.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),X.dirty()}else if(Y.kind==="multipleOf"){if(SH6(J.data,Y.value)!==0)Z=this._getOrReturnCtx(J,Z),F6(Z,{code:h0.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),F6(Z,{code:h0.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,y6.toString(Q))}gt(J,Q){return this.setLimit("min",J,!1,y6.toString(Q))}lte(J,Q){return this.setLimit("max",J,!0,y6.toString(Q))}lt(J,Q){return this.setLimit("max",J,!1,y6.toString(Q))}setLimit(J,Q,Z,X){return new VB({...this._def,checks:[...this._def.checks,{kind:J,value:Q,inclusive:Z,message:y6.toString(X)}]})}_addCheck(J){return new VB({...this._def,checks:[...this._def.checks,J]})}int(J){return this._addCheck({kind:"int",message:y6.toString(J)})}positive(J){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y6.toString(J)})}negative(J){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y6.toString(J)})}nonpositive(J){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y6.toString(J)})}nonnegative(J){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y6.toString(J)})}multipleOf(J,Q){return this._addCheck({kind:"multipleOf",value:J,message:y6.toString(Q)})}finite(J){return this._addCheck({kind:"finite",message:y6.toString(J)})}safe(J){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y6.toString(J)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y6.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:R8.ZodNumber,coerce:J?.coerce||!1,...n8(J)})};NB=class NB extends z9{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)!==J6.bigint)return this._getInvalidInput(J);let Z=void 0,X=new e5;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),F6(Z,{code:h0.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),F6(Z,{code:h0.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),F6(Z,{code:h0.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 F6(Q,{code:h0.invalid_type,expected:J6.bigint,received:Q.parsedType}),N8}gte(J,Q){return this.setLimit("min",J,!0,y6.toString(Q))}gt(J,Q){return this.setLimit("min",J,!1,y6.toString(Q))}lte(J,Q){return this.setLimit("max",J,!0,y6.toString(Q))}lt(J,Q){return this.setLimit("max",J,!1,y6.toString(Q))}setLimit(J,Q,Z,X){return new NB({...this._def,checks:[...this._def.checks,{kind:J,value:Q,inclusive:Z,message:y6.toString(X)}]})}_addCheck(J){return new NB({...this._def,checks:[...this._def.checks,J]})}positive(J){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y6.toString(J)})}negative(J){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y6.toString(J)})}nonpositive(J){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y6.toString(J)})}nonnegative(J){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y6.toString(J)})}multipleOf(J,Q){return this._addCheck({kind:"multipleOf",value:J,message:y6.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}};NB.create=(J)=>{return new NB({checks:[],typeName:R8.ZodBigInt,coerce:J?.coerce??!1,...n8(J)})};YO=class YO extends z9{_parse(J){if(this._def.coerce)J.data=Boolean(J.data);if(this._getType(J)!==J6.boolean){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.boolean,received:Z.parsedType}),N8}return SJ(J.data)}};YO.create=(J)=>{return new YO({typeName:R8.ZodBoolean,coerce:J?.coerce||!1,...n8(J)})};CN=class CN extends z9{_parse(J){if(this._def.coerce)J.data=new Date(J.data);if(this._getType(J)!==J6.date){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_type,expected:J6.date,received:Y.parsedType}),N8}if(Number.isNaN(J.data.getTime())){let Y=this._getOrReturnCtx(J);return F6(Y,{code:h0.invalid_date}),N8}let Z=new e5,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),F6(X,{code:h0.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),F6(X,{code:h0.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 CN({...this._def,checks:[...this._def.checks,J]})}min(J,Q){return this._addCheck({kind:"min",value:J.getTime(),message:y6.toString(Q)})}max(J,Q){return this._addCheck({kind:"max",value:J.getTime(),message:y6.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}};CN.create=(J)=>{return new CN({checks:[],coerce:J?.coerce||!1,typeName:R8.ZodDate,...n8(J)})};BS=class BS extends z9{_parse(J){if(this._getType(J)!==J6.symbol){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.symbol,received:Z.parsedType}),N8}return SJ(J.data)}};BS.create=(J)=>{return new BS({typeName:R8.ZodSymbol,...n8(J)})};KO=class KO extends z9{_parse(J){if(this._getType(J)!==J6.undefined){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.undefined,received:Z.parsedType}),N8}return SJ(J.data)}};KO.create=(J)=>{return new KO({typeName:R8.ZodUndefined,...n8(J)})};GO=class GO extends z9{_parse(J){if(this._getType(J)!==J6.null){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.null,received:Z.parsedType}),N8}return SJ(J.data)}};GO.create=(J)=>{return new GO({typeName:R8.ZodNull,...n8(J)})};SN=class SN extends z9{constructor(){super(...arguments);this._any=!0}_parse(J){return SJ(J.data)}};SN.create=(J)=>{return new SN({typeName:R8.ZodAny,...n8(J)})};MB=class MB extends z9{constructor(){super(...arguments);this._unknown=!0}_parse(J){return SJ(J.data)}};MB.create=(J)=>{return new MB({typeName:R8.ZodUnknown,...n8(J)})};oq=class oq extends z9{_parse(J){let Q=this._getOrReturnCtx(J);return F6(Q,{code:h0.invalid_type,expected:J6.never,received:Q.parsedType}),N8}};oq.create=(J)=>{return new oq({typeName:R8.ZodNever,...n8(J)})};DS=class DS extends z9{_parse(J){if(this._getType(J)!==J6.undefined){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.void,received:Z.parsedType}),N8}return SJ(J.data)}};DS.create=(J)=>{return new DS({typeName:R8.ZodVoid,...n8(J)})};JG=class JG extends z9{_parse(J){let{ctx:Q,status:Z}=this._processInputParams(J),X=this._def;if(Q.parsedType!==J6.array)return F6(Q,{code:h0.invalid_type,expected:J6.array,received:Q.parsedType}),N8;if(X.exactLength!==null){let K=Q.data.length>X.exactLength.value,G=Q.data.length<X.exactLength.value;if(K||G)F6(Q,{code:K?h0.too_big:h0.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)F6(Q,{code:h0.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)F6(Q,{code:h0.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 ZG(Q,K,Q.path,G))})).then((K)=>{return e5.mergeArray(Z,K)});let Y=[...Q.data].map((K,G)=>{return X.type._parseSync(new ZG(Q,K,Q.path,G))});return e5.mergeArray(Z,Y)}get element(){return this._def.type}min(J,Q){return new JG({...this._def,minLength:{value:J,message:y6.toString(Q)}})}max(J,Q){return new JG({...this._def,maxLength:{value:J,message:y6.toString(Q)}})}length(J,Q){return new JG({...this._def,exactLength:{value:J,message:y6.toString(Q)}})}nonempty(J){return this.min(1,J)}};JG.create=(J,Q)=>{return new JG({type:J,minLength:null,maxLength:null,exactLength:null,typeName:R8.ZodArray,...n8(Q)})};k4=class k4 extends z9{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)!==J6.object){let z=this._getOrReturnCtx(J);return F6(z,{code:h0.invalid_type,expected:J6.object,received:z.parsedType}),N8}let{status:Z,ctx:X}=this._processInputParams(J),{shape:Y,keys:K}=this._getCached(),G=[];if(!(this._def.catchall instanceof oq&&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 ZG(X,W,X.path,z)),alwaysSet:z in X.data})}if(this._def.catchall instanceof oq){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)F6(X,{code:h0.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 ZG(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 e5.mergeObjectSync(Z,z)});else return e5.mergeObjectSync(Z,q)}get shape(){return this._def.shape()}strict(J){return y6.errToObj,new k4({...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:y6.errToObj(J).message??X};return{message:X}}}:{}})}strip(){return new k4({...this._def,unknownKeys:"strip"})}passthrough(){return new k4({...this._def,unknownKeys:"passthrough"})}extend(J){return new k4({...this._def,shape:()=>({...this._def.shape(),...J})})}merge(J){return new k4({unknownKeys:J._def.unknownKeys,catchall:J._def.catchall,shape:()=>({...this._def.shape(),...J._def.shape()}),typeName:R8.ZodObject})}setKey(J,Q){return this.augment({[J]:Q})}catchall(J){return new k4({...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 k4({...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 k4({...this._def,shape:()=>Q})}deepPartial(){return ZO(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 k4({...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 QG)Y=Y._def.innerType;Q[Z]=Y}return new k4({...this._def,shape:()=>Q})}keyof(){return kl1(O9.objectKeys(this.shape))}};k4.create=(J,Q)=>{return new k4({shape:()=>J,unknownKeys:"strip",catchall:oq.create(),typeName:R8.ZodObject,...n8(Q)})};k4.strictCreate=(J,Q)=>{return new k4({shape:()=>J,unknownKeys:"strict",catchall:oq.create(),typeName:R8.ZodObject,...n8(Q)})};k4.lazycreate=(J,Q)=>{return new k4({shape:J,unknownKeys:"strip",catchall:oq.create(),typeName:R8.ZodObject,...n8(Q)})};qO=class qO extends z9{_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 WZ(G.ctx.common.issues));return F6(Q,{code:h0.invalid_union,unionErrors:K}),N8}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 WZ(q));return F6(Q,{code:h0.invalid_union,unionErrors:G}),N8}}get options(){return this._def.options}};qO.create=(J,Q)=>{return new qO({options:J,typeName:R8.ZodUnion,...n8(Q)})};dd=class dd extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==J6.object)return F6(Q,{code:h0.invalid_type,expected:J6.object,received:Q.parsedType}),N8;let Z=this.discriminator,X=Q.data[Z],Y=this.optionsMap.get(X);if(!Y)return F6(Q,{code:h0.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Z]}),N8;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=GW(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 dd({typeName:R8.ZodDiscriminatedUnion,discriminator:J,options:Q,optionsMap:X,...n8(Z)})}};zO=class zO extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J),X=(Y,K)=>{if(ud(Y)||ud(K))return N8;let G=pZ1(Y.value,K.value);if(!G.valid)return F6(Z,{code:h0.invalid_intersection_types}),N8;if(pd(Y)||pd(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}))}};zO.create=(J,Q,Z)=>{return new zO({left:J,right:Q,typeName:R8.ZodIntersection,...n8(Z)})};tq=class tq extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==J6.array)return F6(Z,{code:h0.invalid_type,expected:J6.array,received:Z.parsedType}),N8;if(Z.data.length<this._def.items.length)return F6(Z,{code:h0.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N8;if(!this._def.rest&&Z.data.length>this._def.items.length)F6(Z,{code:h0.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 ZG(Z,K,Z.path,G))}).filter((K)=>!!K);if(Z.common.async)return Promise.all(Y).then((K)=>{return e5.mergeArray(Q,K)});else return e5.mergeArray(Q,Y)}get items(){return this._def.items}rest(J){return new tq({...this._def,rest:J})}};tq.create=(J,Q)=>{if(!Array.isArray(J))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new tq({items:J,typeName:R8.ZodTuple,rest:null,...n8(Q)})};MS=class MS extends z9{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!==J6.object)return F6(Z,{code:h0.invalid_type,expected:J6.object,received:Z.parsedType}),N8;let X=[],Y=this._def.keyType,K=this._def.valueType;for(let G in Z.data)X.push({key:Y._parse(new ZG(Z,G,Z.path,G)),value:K._parse(new ZG(Z,Z.data[G],Z.path,G)),alwaysSet:G in Z.data});if(Z.common.async)return e5.mergeObjectAsync(Q,X);else return e5.mergeObjectSync(Q,X)}get element(){return this._def.valueType}static create(J,Q,Z){if(Q instanceof z9)return new MS({keyType:J,valueType:Q,typeName:R8.ZodRecord,...n8(Z)});return new MS({keyType:eK.create(),valueType:J,typeName:R8.ZodRecord,...n8(Q)})}};VS=class VS extends z9{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!==J6.map)return F6(Z,{code:h0.invalid_type,expected:J6.map,received:Z.parsedType}),N8;let X=this._def.keyType,Y=this._def.valueType,K=[...Z.data.entries()].map(([G,q],z)=>{return{key:X._parse(new ZG(Z,G,Z.path,[z,"key"])),value:Y._parse(new ZG(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 N8;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 N8;if(z.status==="dirty"||U.status==="dirty")Q.dirty();G.set(z.value,U.value)}return{status:Q.value,value:G}}}};VS.create=(J,Q,Z)=>{return new VS({valueType:Q,keyType:J,typeName:R8.ZodMap,...n8(Z)})};vN=class vN extends z9{_parse(J){let{status:Q,ctx:Z}=this._processInputParams(J);if(Z.parsedType!==J6.set)return F6(Z,{code:h0.invalid_type,expected:J6.set,received:Z.parsedType}),N8;let X=this._def;if(X.minSize!==null){if(Z.data.size<X.minSize.value)F6(Z,{code:h0.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)F6(Z,{code:h0.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 N8;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 ZG(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 vN({...this._def,minSize:{value:J,message:y6.toString(Q)}})}max(J,Q){return new vN({...this._def,maxSize:{value:J,message:y6.toString(Q)}})}size(J,Q){return this.min(J,Q).max(J,Q)}nonempty(J){return this.min(1,J)}};vN.create=(J,Q)=>{return new vN({valueType:J,minSize:null,maxSize:null,typeName:R8.ZodSet,...n8(Q)})};XO=class XO extends z9{constructor(){super(...arguments);this.validate=this.implement}_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==J6.function)return F6(Q,{code:h0.invalid_type,expected:J6.function,received:Q.parsedType}),N8;function Z(G,q){return HS({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,JO(),KW].filter((z)=>!!z),issueData:{code:h0.invalid_arguments,argumentsError:q}})}function X(G,q){return HS({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,JO(),KW].filter((z)=>!!z),issueData:{code:h0.invalid_return_type,returnTypeError:q}})}let Y={errorMap:Q.common.contextualErrorMap},K=Q.data;if(this._def.returns instanceof kN){let G=this;return SJ(async function(...q){let z=new WZ([]),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 SJ(function(...q){let z=G._def.args.safeParse(q,Y);if(!z.success)throw new WZ([Z(q,z.error)]);let U=Reflect.apply(K,this,z.data),W=G._def.returns.safeParse(U,Y);if(!W.success)throw new WZ([X(U,W.error)]);return W.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...J){return new XO({...this._def,args:tq.create(J).rest(MB.create())})}returns(J){return new XO({...this._def,returns:J})}implement(J){return this.parse(J)}strictImplement(J){return this.parse(J)}static create(J,Q,Z){return new XO({args:J?J:tq.create([]).rest(MB.create()),returns:Q||MB.create(),typeName:R8.ZodFunction,...n8(Z)})}};UO=class UO extends z9{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})}};UO.create=(J,Q)=>{return new UO({getter:J,typeName:R8.ZodLazy,...n8(Q)})};WO=class WO extends z9{_parse(J){if(J.data!==this._def.value){let Q=this._getOrReturnCtx(J);return F6(Q,{received:Q.data,code:h0.invalid_literal,expected:this._def.value}),N8}return{status:"valid",value:J.data}}get value(){return this._def.value}};WO.create=(J,Q)=>{return new WO({value:J,typeName:R8.ZodLiteral,...n8(Q)})};LB=class LB extends z9{_parse(J){if(typeof J.data!=="string"){let Q=this._getOrReturnCtx(J),Z=this._def.values;return F6(Q,{expected:O9.joinValues(Z),received:Q.parsedType,code:h0.invalid_type}),N8}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 F6(Q,{received:Q.data,code:h0.invalid_enum_value,options:Z}),N8}return SJ(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 LB.create(J,{...this._def,...Q})}exclude(J,Q=this._def){return LB.create(this.options.filter((Z)=>!J.includes(Z)),{...this._def,...Q})}};LB.create=kl1;FO=class FO extends z9{_parse(J){let Q=O9.getValidEnumValues(this._def.values),Z=this._getOrReturnCtx(J);if(Z.parsedType!==J6.string&&Z.parsedType!==J6.number){let X=O9.objectValues(Q);return F6(Z,{expected:O9.joinValues(X),received:Z.parsedType,code:h0.invalid_type}),N8}if(!this._cache)this._cache=new Set(O9.getValidEnumValues(this._def.values));if(!this._cache.has(J.data)){let X=O9.objectValues(Q);return F6(Z,{received:Z.data,code:h0.invalid_enum_value,options:X}),N8}return SJ(J.data)}get enum(){return this._def.values}};FO.create=(J,Q)=>{return new FO({values:J,typeName:R8.ZodNativeEnum,...n8(Q)})};kN=class kN extends z9{unwrap(){return this._def.type}_parse(J){let{ctx:Q}=this._processInputParams(J);if(Q.parsedType!==J6.promise&&Q.common.async===!1)return F6(Q,{code:h0.invalid_type,expected:J6.promise,received:Q.parsedType}),N8;let Z=Q.parsedType===J6.promise?Q.data:Promise.resolve(Q.data);return SJ(Z.then((X)=>{return this._def.type.parseAsync(X,{path:Q.path,errorMap:Q.common.contextualErrorMap})}))}};kN.create=(J,Q)=>{return new kN({type:J,typeName:R8.ZodPromise,...n8(Q)})};XG=class XG extends z9{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R8.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(F6(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 N8;let q=await this._def.schema._parseAsync({data:G,path:Z.path,parent:Z});if(q.status==="aborted")return N8;if(q.status==="dirty")return TN(q.value);if(Q.value==="dirty")return TN(q.value);return q});else{if(Q.value==="aborted")return N8;let G=this._def.schema._parseSync({data:K,path:Z.path,parent:Z});if(G.status==="aborted")return N8;if(G.status==="dirty")return TN(G.value);if(Q.value==="dirty")return TN(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 N8;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 N8;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(!DB(K))return N8;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(!DB(K))return N8;return Promise.resolve(X.transform(K.value,Y)).then((G)=>({status:Q.value,value:G}))});O9.assertNever(X)}};XG.create=(J,Q,Z)=>{return new XG({schema:J,typeName:R8.ZodEffects,effect:Q,...n8(Z)})};XG.createWithPreprocess=(J,Q,Z)=>{return new XG({schema:Q,effect:{type:"preprocess",transform:J},typeName:R8.ZodEffects,...n8(Z)})};QG=class QG extends z9{_parse(J){if(this._getType(J)===J6.undefined)return SJ(void 0);return this._def.innerType._parse(J)}unwrap(){return this._def.innerType}};QG.create=(J,Q)=>{return new QG({innerType:J,typeName:R8.ZodOptional,...n8(Q)})};qW=class qW extends z9{_parse(J){if(this._getType(J)===J6.null)return SJ(null);return this._def.innerType._parse(J)}unwrap(){return this._def.innerType}};qW.create=(J,Q)=>{return new qW({innerType:J,typeName:R8.ZodNullable,...n8(Q)})};HO=class HO extends z9{_parse(J){let{ctx:Q}=this._processInputParams(J),Z=Q.data;if(Q.parsedType===J6.undefined)Z=this._def.defaultValue();return this._def.innerType._parse({data:Z,path:Q.path,parent:Q})}removeDefault(){return this._def.innerType}};HO.create=(J,Q)=>{return new HO({innerType:J,typeName:R8.ZodDefault,defaultValue:typeof Q.default==="function"?Q.default:()=>Q.default,...n8(Q)})};BO=class BO extends z9{_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(QO(X))return X.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new WZ(Z.common.issues)},input:Z.data})}});else return{status:"valid",value:X.status==="valid"?X.value:this._def.catchValue({get error(){return new WZ(Z.common.issues)},input:Z.data})}}removeCatch(){return this._def.innerType}};BO.create=(J,Q)=>{return new BO({innerType:J,typeName:R8.ZodCatch,catchValue:typeof Q.catch==="function"?Q.catch:()=>Q.catch,...n8(Q)})};NS=class NS extends z9{_parse(J){if(this._getType(J)!==J6.nan){let Z=this._getOrReturnCtx(J);return F6(Z,{code:h0.invalid_type,expected:J6.nan,received:Z.parsedType}),N8}return{status:"valid",value:J.data}}};NS.create=(J)=>{return new NS({typeName:R8.ZodNaN,...n8(J)})};vH6=Symbol("zod_brand");cd=class cd extends z9{_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}};LS=class LS extends z9{_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 N8;if(Y.status==="dirty")return Q.dirty(),TN(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 N8;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 LS({in:J,out:Q,typeName:R8.ZodPipeline})}};DO=class DO extends z9{_parse(J){let Q=this._def.innerType._parse(J),Z=(X)=>{if(DB(X))X.value=Object.freeze(X.value);return X};return QO(Q)?Q.then((X)=>Z(X)):Z(Q)}unwrap(){return this._def.innerType}};DO.create=(J,Q)=>{return new DO({innerType:J,typeName:R8.ZodReadonly,...n8(Q)})};kH6={object:k4.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"})(R8||(R8={}));xl1=eK.create,bl1=VB.create,xH6=NS.create,bH6=NB.create,yl1=YO.create,yH6=CN.create,fH6=BS.create,hH6=KO.create,gH6=GO.create,mH6=SN.create,uH6=MB.create,pH6=oq.create,dH6=DS.create,cH6=JG.create,lH6=k4.create,iH6=k4.strictCreate,aH6=qO.create,nH6=dd.create,rH6=zO.create,sH6=tq.create,oH6=MS.create,tH6=VS.create,eH6=vN.create,JB6=XO.create,QB6=UO.create,ZB6=WO.create,XB6=LB.create,YB6=FO.create,KB6=kN.create,GB6=XG.create,qB6=QG.create,zB6=qW.create,UB6=XG.createWithPreprocess,WB6=LS.create,DB6={string:(J)=>eK.create({...J,coerce:!0}),number:(J)=>VB.create({...J,coerce:!0}),boolean:(J)=>YO.create({...J,coerce:!0}),bigint:(J)=>NB.create({...J,coerce:!0}),date:(J)=>CN.create({...J,coerce:!0})},MB6=N8});var Q1={};C6(Q1,{void:()=>dH6,util:()=>O9,unknown:()=>uH6,union:()=>aH6,undefined:()=>hH6,tuple:()=>sH6,transformer:()=>GB6,symbol:()=>fH6,string:()=>xl1,strictObject:()=>iH6,setErrorMap:()=>zH6,set:()=>eH6,record:()=>oH6,quotelessJson:()=>GH6,promise:()=>KB6,preprocess:()=>UB6,pipeline:()=>WB6,ostring:()=>FB6,optional:()=>qB6,onumber:()=>HB6,oboolean:()=>BB6,objectUtil:()=>hZ1,object:()=>lH6,number:()=>bl1,nullable:()=>zB6,null:()=>gH6,never:()=>pH6,nativeEnum:()=>YB6,nan:()=>xH6,map:()=>tH6,makeIssue:()=>HS,literal:()=>ZB6,lazy:()=>QB6,late:()=>kH6,isValid:()=>DB,isDirty:()=>pd,isAsync:()=>QO,isAborted:()=>ud,intersection:()=>rH6,instanceof:()=>_H6,getParsedType:()=>sq,getErrorMap:()=>JO,function:()=>JB6,enum:()=>XB6,effect:()=>GB6,discriminatedUnion:()=>nH6,defaultErrorMap:()=>KW,datetimeRegex:()=>vl1,date:()=>yH6,custom:()=>_l1,coerce:()=>DB6,boolean:()=>yl1,bigint:()=>bH6,array:()=>cH6,any:()=>mH6,addIssueToContext:()=>F6,ZodVoid:()=>DS,ZodUnknown:()=>MB,ZodUnion:()=>qO,ZodUndefined:()=>KO,ZodType:()=>z9,ZodTuple:()=>tq,ZodTransformer:()=>XG,ZodSymbol:()=>BS,ZodString:()=>eK,ZodSet:()=>vN,ZodSchema:()=>z9,ZodRecord:()=>MS,ZodReadonly:()=>DO,ZodPromise:()=>kN,ZodPipeline:()=>LS,ZodParsedType:()=>J6,ZodOptional:()=>QG,ZodObject:()=>k4,ZodNumber:()=>VB,ZodNullable:()=>qW,ZodNull:()=>GO,ZodNever:()=>oq,ZodNativeEnum:()=>FO,ZodNaN:()=>NS,ZodMap:()=>VS,ZodLiteral:()=>WO,ZodLazy:()=>UO,ZodIssueCode:()=>h0,ZodIntersection:()=>zO,ZodFunction:()=>XO,ZodFirstPartyTypeKind:()=>R8,ZodError:()=>WZ,ZodEnum:()=>LB,ZodEffects:()=>XG,ZodDiscriminatedUnion:()=>dd,ZodDefault:()=>HO,ZodDate:()=>CN,ZodCatch:()=>BO,ZodBranded:()=>cd,ZodBoolean:()=>YO,ZodBigInt:()=>NB,ZodArray:()=>JG,ZodAny:()=>SN,Schema:()=>z9,ParseStatus:()=>e5,OK:()=>SJ,NEVER:()=>MB6,INVALID:()=>N8,EMPTY_PATH:()=>UH6,DIRTY:()=>TN,BRAND:()=>vH6});var dZ1=B1(()=>{md();mZ1();El1();FS();fl1();gd()});var zW=B1(()=>{dZ1();dZ1()});function NB6(J){return hl1.safeParse(J)}function AB(J){return VB6.safeParse(J)}function MO(J){if(!J||!Array.isArray(J))return[];let Q=[];for(let[Z,X]of J.entries()){let Y=NB6(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 cZ1,hl1,VB6;var _N=B1(()=>{zW();G0();cZ1=Q1.lazy(()=>Q1.union([Q1.string().describe('Pattern match where "*" matches any number of any characters'),Q1.array(cZ1).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(),cZ1).describe("Matching individual keys of an object")])),hl1=Q1.object({tool:Q1.string().min(1).describe("The name of the tool to which this entry applies"),matches:Q1.record(Q1.string(),cZ1).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"]})}),VB6=Q1.array(hl1).describe("Entries checked in sequence to configure tool permissions")});function LQ(J,Q){let Z=LB6(J,Q);return typeof Z==="string"?Z:Z.toString()}function LB6(J,Q,Z=!0){if(!Q)Q=AB6();let{workspaceFolders:X,isWindows:Y,homeDir:K}=Q,G=typeof J==="string"?$0.parse(J):$0.from(J);if(X)for(let q of X){let z=V8(q);if(b0.hasPrefix(G,z)){let U=z.path.endsWith("/")?z.path.slice(0,-1):z.path,F=Z&&X&&X.length>=2?FN(z.path)+(Y?"\\":"/"):"";return lZ1(F+G.path.slice(U.length+1),Y,G.scheme)}}if(G?.scheme==="file"){if(K){let q=V8(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 lZ1("~"+(Y?"\\":"/")+U,Y,G.scheme)}}return lZ1(G.fsPath,Y,G.scheme)}return G}function lZ1(J,Q,Z){return Q&&Z==="file"?J.replaceAll("/","\\"):J}function id(J){let Q=ld;return ld=J,Q}function AB6(){if(ld)return ld;throw Error("must call setDisplayPathEnvInfo before calling displayPath() and related functions")}var ld=null;var wB=B1(()=>{b6();bR();op()});function vJ(J,...Q){throw Error(`[Immer] minified error nr: ${J}. Full error at: https://bit.ly/3cXEKWf`)}function yN(J){return!!J&&!!J[jX]}function RB(J){if(!J)return!1;return dl1(J)||Array.isArray(J)||!!J[AS]||!!J.constructor?.[AS]||$S(J)||ES(J)}function dl1(J){if(!J||typeof J!=="object")return!1;let Q=bN(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)===wB6}function wS(J,Q){if(fN(J)===0)Reflect.ownKeys(J).forEach((Z)=>{Q(Z,J[Z],J)});else J.forEach((Z,X)=>Q(X,Z,J))}function fN(J){let Q=J[jX];return Q?Q.type_:Array.isArray(J)?1:$S(J)?2:ES(J)?3:0}function RS(J,Q){return fN(J)===2?J.has(Q):Object.prototype.hasOwnProperty.call(J,Q)}function iZ1(J,Q){return fN(J)===2?J.get(Q):J[Q]}function cl1(J,Q,Z){let X=fN(J);if(X===2)J.set(Q,Z);else if(X===3)J.add(Z);else J[Q]=Z}function RB6(J,Q){if(J===Q)return J!==0||1/J===1/Q;else return J!==J&&Q!==Q}function $S(J){return J instanceof Map}function ES(J){return J instanceof Set}function xN(J){return J.copy_||J.base_}function rZ1(J,Q){if($S(J))return new Map(J);if(ES(J))return new Set(J);if(Array.isArray(J))return Array.prototype.slice.call(J);let Z=dl1(J);if(Q===!0||Q==="class_only"&&!Z){let X=Object.getOwnPropertyDescriptors(J);delete X[jX];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(bN(J),X)}else{let X=bN(J);if(X!==null&&Z)return{...J};let Y=Object.create(X);return Object.assign(Y,J)}}function AQ(J,Q=!1){if(rd(J)||yN(J)||!RB(J))return J;if(fN(J)>1)J.set=J.add=J.clear=J.delete=OB6;if(Object.freeze(J),Q)Object.entries(J).forEach(([Z,X])=>AQ(X,!0));return J}function OB6(){vJ(2)}function rd(J){return Object.isFrozen(J)}function hN(J){let Q=sZ1[J];if(!Q)vJ(0,J);return Q}function jB6(J,Q){if(!sZ1[J])sZ1[J]=Q}function ll1(){return OS}function $B6(J,Q){return{drafts_:[],parent_:J,immer_:Q,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function gl1(J,Q){if(Q)hN("Patches"),J.patches_=[],J.inversePatches_=[],J.patchListener_=Q}function oZ1(J){tZ1(J),J.drafts_.forEach(EB6),J.drafts_=null}function tZ1(J){if(J===OS)OS=J.parent_}function ml1(J){return OS=$B6(OS,J)}function EB6(J){let Q=J[jX];if(Q.type_===0||Q.type_===1)Q.revoke_();else Q.revoked_=!0}function ul1(J,Q){Q.unfinalizedDrafts_=Q.drafts_.length;let Z=Q.drafts_[0];if(J!==void 0&&J!==Z){if(Z[jX].modified_)oZ1(Q),vJ(4);if(RB(J)){if(J=ad(Q,J),!Q.parent_)nd(Q,J)}if(Q.patches_)hN("Patches").generateReplacementPatches_(Z[jX].base_,J,Q.patches_,Q.inversePatches_)}else J=ad(Q,Z,[]);if(oZ1(Q),Q.patches_)Q.patchListener_(Q.patches_,Q.inversePatches_);return J!==QX1?J:void 0}function ad(J,Q,Z){if(rd(Q))return Q;let X=Q[jX];if(!X)return wS(Q,(Y,K)=>pl1(J,X,Q,Y,K,Z)),Q;if(X.scope_!==J)return Q;if(!X.modified_)return nd(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(wS(K,(q,z)=>pl1(J,X,Y,q,z,Z,G)),nd(J,Y,!1),Z&&J.patches_)hN("Patches").generatePatches_(X,Z,J.patches_,J.inversePatches_)}return X.copy_}function pl1(J,Q,Z,X,Y,K,G){if(yN(Y)){let q=K&&Q&&Q.type_!==3&&!RS(Q.assigned_,X)?K.concat(X):void 0,z=ad(J,Y,q);if(cl1(Z,X,z),yN(z))J.canAutoFreeze_=!1;else return}else if(G)Z.add(Y);if(RB(Y)&&!rd(Y)){if(!J.immer_.autoFreeze_&&J.unfinalizedDrafts_<1)return;if(ad(J,Y),(!Q||!Q.scope_.parent_)&&typeof X!=="symbol"&&Object.prototype.propertyIsEnumerable.call(Z,X))nd(J,Y)}}function nd(J,Q,Z=!1){if(!J.parent_&&J.immer_.autoFreeze_&&J.canAutoFreeze_)AQ(Q,Z)}function IB6(J,Q){let Z=Array.isArray(J),X={type_:Z?1:0,scope_:Q?Q.scope_:ll1(),modified_:!1,finalized_:!1,assigned_:{},parent_:Q,base_:J,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=X,K=ZX1;if(Z)Y=[X],K=jS;let{revoke:G,proxy:q}=Proxy.revocable(Y,K);return X.draft_=q,X.revoke_=G,q}function aZ1(J,Q){let Z=J[jX];return(Z?xN(Z):J)[Q]}function PB6(J,Q,Z){let X=il1(Q,Z);return X?"value"in X?X.value:X.get?.call(J.draft_):void 0}function il1(J,Q){if(!(Q in J))return;let Z=bN(J);while(Z){let X=Object.getOwnPropertyDescriptor(Z,Q);if(X)return X;Z=bN(Z)}return}function eZ1(J){if(!J.modified_){if(J.modified_=!0,J.parent_)eZ1(J.parent_)}}function nZ1(J){if(!J.copy_)J.copy_=rZ1(J.base_,J.scope_.immer_.useStrictShallowCopy_)}function JX1(J,Q){let Z=$S(J)?hN("MapSet").proxyMap_(J,Q):ES(J)?hN("MapSet").proxySet_(J,Q):IB6(J,Q);return(Q?Q.scope_:ll1()).drafts_.push(Z),Z}function CB6(J){if(!yN(J))vJ(10,J);return al1(J)}function al1(J){if(!RB(J)||rd(J))return J;let Q=J[jX],Z;if(Q){if(!Q.modified_)return Q.base_;Q.finalized_=!0,Z=rZ1(J,Q.scope_.immer_.useStrictShallowCopy_)}else Z=rZ1(J,!0);if(wS(Z,(X,Y)=>{cl1(Z,X,al1(Y))}),Q)Q.finalized_=!1;return Z}function sd(){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;wS(H.assigned_,(A,w)=>{let R=iZ1(N,A),O=iZ1(L,A),$=!w?X:RS(N,A)?Q:Z;if(R===O&&$===Q)return;let j=B.concat(A);M.push($===X?{op:$,path:j}:{op:$,path:j,value:O}),V.push($===Z?{op:X,path:j}:$===X?{op:Z,path:j,value:F(R)}:{op:Q,path:j,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===QX1?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 $=fN(L),j=V[O];if(typeof j!=="string"&&typeof j!=="number")j=""+j;if(($===0||$===1)&&(j==="__proto__"||j==="constructor"))vJ(19);if(typeof L==="function"&&j==="prototype")vJ(19);if(L=iZ1(L,j),typeof L!=="object")vJ(18,V.join("/"))}let A=fN(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:vJ(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:vJ(17,N)}}),H}function W(H){if(!RB(H))return H;if(Array.isArray(H))return H.map(W);if($S(H))return new Map(Array.from(H.entries()).map(([M,V])=>[M,W(V)]));if(ES(H))return new Set(Array.from(H).map(W));let B=Object.create(bN(H));for(let M in H)B[M]=W(H[M]);if(RS(H,AS))B[AS]=H[AS];return B}function F(H){if(yN(H))return W(H);else return H}jB6("Patches",{applyPatches_:U,generatePatches_:Y,generateReplacementPatches_:z})}function m8(J){return J}var QX1,AS,jX,bN,wB6,sZ1,OS,ZX1,jS,TB6=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")vJ(6);if(X!==void 0&&typeof X!=="function")vJ(7);let Y;if(RB(Q)){let K=ml1(this),G=JX1(Q,void 0),q=!0;try{Y=Z(G),q=!1}finally{if(q)oZ1(K);else tZ1(K)}return gl1(K,X),ul1(Y,K)}else if(!Q||typeof Q!=="object"){if(Y=Z(Q),Y===void 0)Y=Q;if(Y===QX1)Y=void 0;if(this.autoFreeze_)AQ(Y,!0);if(X){let K=[],G=[];hN("Patches").generateReplacementPatches_(Q,Y,K,G),X(K,G)}return Y}else vJ(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(!RB(J))vJ(8);if(yN(J))J=CB6(J);let Q=ml1(this),Z=JX1(J,void 0);return Z[jX].isManual_=!0,tZ1(Q),Z}finishDraft(J,Q){let Z=J&&J[jX];if(!Z||!Z.isManual_)vJ(9);let{scope_:X}=Z;return gl1(X,Q),ul1(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=hN("Patches").applyPatches_;if(yN(J))return X(J,Q);return this.produce(J,(Y)=>X(Y,Q))}},$X,OB,VO,qU9,zU9,nl1,UU9,WU9;var wQ=B1(()=>{QX1=Symbol.for("immer-nothing"),AS=Symbol.for("immer-draftable"),jX=Symbol.for("immer-state");bN=Object.getPrototypeOf;wB6=Object.prototype.constructor.toString();sZ1={};ZX1={get(J,Q){if(Q===jX)return J;let Z=xN(J);if(!RS(Z,Q))return PB6(J,Z,Q);let X=Z[Q];if(J.finalized_||!RB(X))return X;if(X===aZ1(J.base_,Q))return nZ1(J),J.copy_[Q]=JX1(X,J);return X},has(J,Q){return Q in xN(J)},ownKeys(J){return Reflect.ownKeys(xN(J))},set(J,Q,Z){let X=il1(xN(J),Q);if(X?.set)return X.set.call(J.draft_,Z),!0;if(!J.modified_){let Y=aZ1(xN(J),Q),K=Y?.[jX];if(K&&K.base_===Z)return J.copy_[Q]=Z,J.assigned_[Q]=!1,!0;if(RB6(Z,Y)&&(Z!==void 0||RS(J.base_,Q)))return!0;nZ1(J),eZ1(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(aZ1(J.base_,Q)!==void 0||Q in J.base_)J.assigned_[Q]=!1,nZ1(J),eZ1(J);else delete J.assigned_[Q];if(J.copy_)delete J.copy_[Q];return!0},getOwnPropertyDescriptor(J,Q){let Z=xN(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(){vJ(11)},getPrototypeOf(J){return bN(J.base_)},setPrototypeOf(){vJ(12)}},jS={};wS(ZX1,(J,Q)=>{jS[J]=function(){return arguments[0]=arguments[0][0],Q.apply(this,arguments)}});jS.deleteProperty=function(J,Q){return jS.set.call(this,J,Q,void 0)};jS.set=function(J,Q,Z){return ZX1.set.call(this,J[0],Q,Z,J[0])};$X=new TB6,OB=$X.produce,VO=$X.produceWithPatches.bind($X),qU9=$X.setAutoFreeze.bind($X),zU9=$X.setUseStrictShallowCopy.bind($X),nl1=$X.applyPatches.bind($X),UU9=$X.createDraft.bind($X),WU9=$X.finishDraft.bind($X)});function XX1({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 IS(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(SB6,"")}var SB6;var YX1=B1(()=>{SB6=XX1()});var sl1=t((VU9,rl1)=>{rl1.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}});function vB6(J){return typeof J==="number"&&Number.isInteger(J)&&J>=1&&J<=3600}function tl1(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=rR.contributes.configuration.properties["amp.tools.inactivityTimeout"].default;if(!vB6(X))return null;return X*1000}function el1(J){let Q=J.settings["tools.stopTimeout"],Z=rR.contributes.configuration.properties["amp.tools.stopTimeout"].default;return(Q??Z)*1000}var ol1;var od=B1(()=>{TZ1();ol1=rR.contributes.configuration.properties});function td(J,Q){return new t1((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 KX1=B1(()=>{v0()});function o2(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 kJ(J){return["done","error","rejected-by-user","cancelled"].includes(J.status)}function Zi1(J){return["done","error","cancelled"].includes(J.status)}function NO(J){let Q=[],Z=new I8;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(PS(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 kB6;return Y(K,G,q)},tools:b9(J.configService.config,Z.pipe(u2(void 0))).pipe(y0(([K])=>{return Q.map((G)=>({spec:G.spec,...PS(G.spec,K)})).sort((G,q)=>G.spec.name.localeCompare(q.spec.name))})),invokeTool(K,G,q){let z=performance.now(),U=()=>_B6.record(performance.now()-z,{toolName:K});if(K===qX1&&G.args&&"invalid_tool_name"in G.args&&typeof G.args.invalid_tool_name==="string"){Jc.add(1,{toolName:K,error:"invalid"});let F=GX1(G.args.invalid_tool_name);return new t1((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 Jc.add(1,{toolName:K,error:"not_found"}),new t1((V)=>{V.error(Error(`tool ${JSON.stringify(K)} not found`))});let H=F[0],B=PS(H.spec,q.config);Jc.add(1,{toolName:K,error:"disabled"});let M=B.enabled?"unknown":B.disabledReason;return new t1((V)=>{V.error(Error(`tool ${JSON.stringify(K)} is disabled: ${M}`))})}return Jc.add(1,{toolName:K}),c6(()=>W.fn).pipe(q8((F)=>{let H=F(G,q);if(W.spec.meta?.disableTimeout)return H;return td(H,el1(q.config))}),QW(()=>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 ed(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(Qi1.default(Z,{dot:!0})(J))return!0}catch(X){continue}}return!1}function PS(J,Q){let Z=Q.settings?.["tools.disable"]??[];if(ed(J.name,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"mcp"in J.source){let X=Yi1(J.name);if(X&&J.source.mcp===X.server&&ed(X.tool,Z))return{enabled:!1,disabledReason:"settings"}}if(J.source==="builtin"&&ed(`builtin:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"toolbox"in J.source&&ed(`toolbox:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(J.name===t5||J.name===UB){if(Q.settings?.["todos.enabled"])return{enabled:!0};return{enabled:!1,disabledReason:"feature-flag"}}return{enabled:!0}}function GX1(J){return`Invalid tool name ${JSON.stringify(J)}. Tool names must match the pattern ${TS.toString()}. Try again with a valid tool name.`}function Yi1(J){let[,Q,Z]=J.split(/mcp__([^ ]+)__([^ ]+)/);if(Q&&Z)return{server:Q,tool:Z};return}function zX1(J){if(J.status==="in-progress"||J.status==="done"||J.status==="cancelled"||J.status==="error")return J.progress;return}function FZ(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&&Yi1(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 t1((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(y0((K)=>K.filter((G)=>Y(G.spec.name)))),dispose(){}}}var Ji1,Qi1,kB6,qX1="invalid_tool",TS,Xi1,Jc,_B6;var t2=B1(()=>{v0();G0();od();KX1();F8();Ji1=x6(Kd(),1),Qi1=x6(IN(),1);kB6={dispose(){}};TS=/^[a-zA-Z0-9_]{1,64}$/,Xi1=Ji1.metrics.getMeter("tool_service"),Jc=Xi1.createCounter("tool_service.invocation_count",{description:"Number of tool invocations"}),_B6=Xi1.createHistogram("tool_service.invocation_latency",{description:"Latency of tool invocations",unit:"ms"})});var Wi1=t((zi1)=>{Object.defineProperty(zi1,"__esModule",{value:!0});zi1.calcSlices=zi1.applyPatch=zi1.calcPatch=zi1.lcs=zi1.diff=zi1.diff_core=void 0;function xB6(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 $=Z[O-1-U*Math.floor((O-1)/U)],j=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 $=Z[U+O-1-U*Math.floor((O-1)/U)],j=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 Ki1{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=xB6(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 Gi1(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 Ki1({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:[]})}zi1.diff_core=Gi1;function Qc(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 Gi1(X,Y+1-X,X,K+1-X,Z)}zi1.diff=Qc;class qi1{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 bB6(J,Q,Z){return new qi1(Qc(J,Q,Z),J.length)}zi1.lcs=bB6;function*yB6(J,Q,Z){let X=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let Y of Qc(J,Q,Z))Y[2]=X.call(Q,Y[2],Y[3]),yield Y}zi1.calcPatch=yB6;function*fB6(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)}zi1.applyPatch=fB6;function*hB6(J,Q,Z){let X=0,Y=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[K,G,q,z]of Qc(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)]}zi1.calcSlices=hB6});function Zc(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 Fi1.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 Hi1(J){return{added:J?.split(`
6
6
  `).length??0,deleted:0,changed:0}}function UX1(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 Fi1;var Xc=B1(()=>{Fi1=x6(Wi1(),1)});function eq(){return`T-${crypto.randomUUID()}`}function YG(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 gN(){return`toolu_${crypto.randomUUID()}`}function Bi1(J){return J.startsWith("toolu_")||J.startsWith("call_")}function Di1(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 EX(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 LO(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 jB(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 JJ(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 WX1(J){if(J&&typeof J==="object"&&"threadID"in J){let Q=J.threadID;if(typeof Q==="string"&&YG(Q))return Q}return}function FX1(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===s5)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?WX1(G.progress):void 0;if(q)Q.push({toolUseID:Y.toolUseID,threadID:q,toolUse:K,toolResult:Y})}}}return Q}function Mi1(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 Vi1(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 HX1(J){if(!J)return!1;return J.role==="info"}function cB6(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 Yc(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===t5&&X.input){let Y=X.input.todos;if(Array.isArray(Y))return Y;let K=X.input.content;if(typeof K==="string")return cB6(K)}}return}function n7(J){return J.map((Q)=>Q.type==="text"?Q.text:null).filter((Q)=>Q!==null).join(`
@@ -6034,11 +6034,11 @@ Actual: ${Y}`)}async function b99(J,Q,Z){let{execSync:X}=await import("node:ch
6034
6034
  ${B}`;if(Y==="pnpm"&&B.includes("Unable to find the global bin directory"))M+=`
6035
6035
 
6036
6036
  Hint: Try running "pnpm setup" to configure pnpm global directory, or use npm instead:
6037
- 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 D51(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=m99(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 m99(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}v0();function ay1(J,Q){let Z=new I8,X=Z.pipe(M9({shouldCountRefs:!1}));return setImmediate(async()=>{let Y=new cq().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 U_(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 D51(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 du(z.latestVersion,U);let W=await lV(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 U_(5000),Z.next("hidden"),K.unsubscribe(),Z.complete()}}),{state:X}}import{stderr as aU}from"node:process";function cQ6(J){let Q=new lw().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 cy1(X.force||!1,X.verbose||!1,"0.0.1761868901-gb9e977"),process.exit()});J.addCommand(Q,{hidden:!0});let Z=new lw("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 u99(X.version)});J.addCommand(Z)}async function u99(J){if(process.env.AMP_SKIP_UPDATE_CHECK==="1")aU.write(U8.yellow(`Note: AMP_SKIP_UPDATE_CHECK=1 is set, which disables automatic update checking. Manual updates will still work.
6037
+ 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 D51(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=m99(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 m99(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}v0();function ay1(J,Q){let Z=new I8,X=Z.pipe(M9({shouldCountRefs:!1}));return setImmediate(async()=>{let Y=new cq().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 U_(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 D51(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 du(z.latestVersion,U);let W=await lV(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 U_(5000),Z.next("hidden"),K.unsubscribe(),Z.complete()}}),{state:X}}import{stderr as aU}from"node:process";function cQ6(J){let Q=new lw().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 cy1(X.force||!1,X.verbose||!1,"0.0.1761883329-ga93f38"),process.exit()});J.addCommand(Q,{hidden:!0});let Z=new lw("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 u99(X.version)});J.addCommand(Z)}async function u99(J){if(process.env.AMP_SKIP_UPDATE_CHECK==="1")aU.write(U8.yellow(`Note: AMP_SKIP_UPDATE_CHECK=1 is set, which disables automatic update checking. Manual updates will still work.
6038
6038
 
6039
6039
  `));try{if(!J){aU.write(U8.blue(`Checking for updates...
6040
- `));let{hasUpdate:Z,latestVersion:X}=await D51("0.0.1761868901-gb9e977");if(!Z){aU.write(U8.green(`✓ Amp CLI is already up to date.
6041
- `));let Y=await lV("0.0.1761868901-gb9e977");if(Y.warning)aU.write(`
6040
+ `));let{hasUpdate:Z,latestVersion:X}=await D51("0.0.1761883329-ga93f38");if(!Z){aU.write(U8.green(`✓ Amp CLI is already up to date.
6041
+ `));let Y=await lV("0.0.1761883329-ga93f38");if(Y.warning)aU.write(`
6042
6042
  `+U8.yellow(Y.warning)+`
6043
6043
  `);process.exit(0)}if(!X)aU.write(U8.yellow("[WARN] could not find latest version")),process.exit(0);J=X}aU.write(U8.blue(`Updating to version ${J}...
6044
6044
  `)),await du(J,void 0,(Z)=>{aU.write(U8.dim(`Running: ${Z}
@@ -6598,7 +6598,7 @@ exit code: ${q}`,new j1({color:X.foreground,dim:!0,italic:!0})));if(z)U.push(new
6598
6598
  `,B),...M],N=new a0({crossAxisAlignment:"stretch",mainAxisSize:"min",children:[new a1({text:new V1("",void 0,V)})]}),L="high";if(this.agentMode==="fast")L="fast";else if(this.agentMode==="free")L="free";return t9.child(new g0({constraints:new O6(40,120,0,1/0),child:new Q8({mainAxisAlignment:"center",crossAxisAlignment:"center",children:[new w8({flex:1,child:new tf1({width:40,height:40,colorMode:L,fps:G==="fast"?60:G==="slow"?15:0,...G==="disabled"&&{seed:42,t:3}})}),new F0({width:1}),new w8({flex:2,child:N})]})}))}}i8();class og1 extends c0{props;constructor(J){super({key:J.key});this.props=J;this.props.enabled??=!0}createState(){return new SG6}}class SG6 extends d0{build(J){let Z=A6.of(J).colors,{todos:X,title:Y="TODOs",enabled:K=!0}=this.widget.props;if(!Array.isArray(X)||X.length===0)return new F0({width:0,height:0});let G=K?Z.foreground:Z.mutedForeground,q=X.map((z)=>this.buildTodoItem(z,Z,K));return new g0({child:new T6({padding:N0.symmetric(1,0),child:new a0({crossAxisAlignment:"stretch",mainAxisSize:"min",children:[new a1({text:new V1(Y,new j1({bold:!0,color:G}))}),...q]})})})}buildTodoItem(J,Q,Z){let X=this.getStatusIcon(J.status),Y=Z?Q.foreground:Q.mutedForeground,K=new j1({bold:J.status==="in-progress",color:Y}),G=new j1({bold:J.status==="in-progress",strikethrough:J.status==="completed",color:Y});return new Q8({crossAxisAlignment:"start",children:[new a1({text:new V1(X,K)}),new F0({width:1}),new w8({child:new a1({text:new V1(J.content,G)})})]})}getStatusIcon(J){return J==="completed"?"✓":"•"}}class tg1 extends j6{ad;onDismiss;onButtonClick;constructor({key:J,ad:Q,onDismiss:Z,onButtonClick:X}){super({key:J});this.ad=Q,this.onDismiss=Z,this.onButtonClick=X}build(J){let Q=A6.of(J),Z=Q.colors.primary,X=Q.colors.foreground;return new g0({decoration:new G9(void 0,new g8(new k8(Z,1,"rounded"),new k8(Z,1,"rounded"),void 0,new k8(Z,1,"rounded"))),child:new T6({padding:N0.horizontal(1),child:new a0({children:[new Q8({crossAxisAlignment:"start",children:[new w8({child:new a1({text:new V1(this.ad.content,new j1({color:X}))})}),new F0({width:4}),new BQ({uri:"https://ampcode.com/free",text:"Ad",style:new j1({color:X,dim:!0}),onError:(Y)=>{}})]}),new Q8({crossAxisAlignment:"start",children:[new xf1({text:this.ad.buttonLabel,onPressed:()=>this.onButtonClick?.(),padding:N0.horizontal(1),color:Z,reverse:!0}),new F0({width:2}),new a1({text:new V1(this.ad.destinationUrlHostname,new j1({color:X,dim:!0}))})]})]})})})}}B9();i8();class eg1 extends c0{props;constructor(J){super();this.props=J}createState(){return new vG6(this.props.autofocus??!0)}}class vG6 extends d0{autofocus;constructor(J){super();this.autofocus=J}build(J){let Q=(q)=>{if(q.key==="Enter"&&this.widget.props.showCopyOption)return this.widget.props.onSelect("copy"),"handled";if(q.ctrlKey&&q.key==="c"||q.key==="Escape")return this.widget.props.onSelect(null),"handled";return"ignored"},Z=y8.sizeOf(J),X=Math.min(60,Z.width-4),Y=Z.height-4,K=[];if(this.widget.props.title)K.push(new a1({text:new V1(this.widget.props.title,new j1({bold:!0,color:I1.blue}))}),new F0({height:1}));if(this.widget.props.message)K.push(new a1({text:new V1(this.widget.props.message,void 0,void 0,{uri:this.widget.props.message,id:"ad-link"})}));if(this.widget.props.message)K.push(new F0({height:1}));let G=[];if(this.widget.props.showCopyOption)G.push(new a1({text:new V1("Enter to copy",new j1({dim:!0}))}));return G.push(new a1({text:new V1("Escape to close",new j1({dim:!0}))})),K.push(new Q8({children:G.flatMap((q,z)=>z<G.length-1?[q,new F0({width:1}),new a1({text:new V1("•",new j1({dim:!0}))}),new F0({width:1})]:[q]),mainAxisSize:"min"})),new t9({child:new g0({constraints:new O6(X,X,0,Y),decoration:new G9(I1.default(),new g8(new k8(I1.blue,1,"rounded"),new k8(I1.blue,1,"rounded"),new k8(I1.blue,1,"rounded"),new k8(I1.blue,1,"rounded"))),padding:new N0(2,2,2,2),child:new t8({autofocus:this.autofocus,onKey:Q,child:new a0({children:K,mainAxisSize:"min"})})})})}}function Jm1(J){let Q=J.match(/"([^"]*)"|'([^']*)'|([^\s"']+)/g);if(!Q)return[];return Q.map((Z)=>{if(Z.startsWith('"')&&Z.endsWith('"')||Z.startsWith("'")&&Z.endsWith("'"))return Z.slice(1,-1);return Z})}Xj();G0();import{spawn as iZ9}from"node:child_process";import{promises as aZ9}from"node:fs";function kG6(J){return J.kind==="executable"}function _G6(J){return J.kind==="markdown"}var nH=50000,xG6=300000;async function Qm1(J,Q,Z,X={}){let{timeoutMs:Y=xG6,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}),_G6(G))return await nZ9(G,Q);else if(kG6(G))return await rZ9(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 nZ9(J,Q){try{if(Q.length>0)return{success:!1,output:"",error:"Markdown commands do not accept arguments"};let Z=await aZ9.readFile(J.filePath,"utf8");return{success:!0,output:(Z.length>nH?Z.slice(0,nH)+`
6599
6599
  ... (output truncated at ${nH} characters)`:Z).trim(),exitCode:0}}catch(Z){return{success:!1,output:"",error:Z instanceof Error?Z.message:"Failed to read markdown file"}}}async function rZ9(J,Q,Z=xG6,X){return new Promise((Y)=>{let[K,G]=sZ9(J,Q);u.debug("Spawning command",{spawnCommand:K,spawnArgs:G.slice(0,10),filePath:J.filePath,timeoutMs:Z});let q=qe1(X),z=!1,U=setTimeout(()=>{z=!0,q.abort(),u.warn("Command execution timed out",{commandName:J.name,timeoutMs:Z})},Z),W=iZ9(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<=nH)F.push(V);else{let N=nH-(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<=nH)H.push(V);else{let N=nH-(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?`
6600
6600
  ${L}`:L;if(B>nH)A+=`
6601
- ... (output truncated at ${nH} 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 sZ9(J,Q){let{filePath:Z,interpreter:X,extension:Y}=J;if(process.platform==="win32")return tZ9(Z,X?[...X]:null,Y,Q);else return oZ9(Z,X?[...X]:null,Y,Q)}function oZ9(J,Q,Z,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];else return[J,X]}function tZ9(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();O2();wB();kY();bW();mC();import{execSync as bG6}from"child_process";import{writeFile as eZ9}from"fs/promises";import JX9 from"path";G0();kY();class Zm1{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.1761868901-gb9e977"},parameters:{metadata:{count:Z}},timestamp:Date.now()*1000}));this.commandCounts.clear();try{let Q=JSON.stringify(J);await Qn(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}}function QX9(J){return J.startsWith("custom-command-")}function yG6(J){return J.startsWith("agent-mode-")}function ZX9(J){return J.replace(/^custom-command-/,"")}class Xm1{configService;registry;onExecute;onExecutionComplete;commands=new Map;latestCustom=[];telemetrySubmitter;constructor(J,Q,Z,X){this.configService=J;this.registry=Q;this.onExecute=Z;this.onExecutionComplete=X;this.configService.config.subscribe((Y)=>{this.commands.clear(),this.registerCommands(Y)}),this.registry.commands.subscribe((Y)=>this.latestCustom=Y),this.telemetrySubmitter=new Zm1(async()=>{try{return(await this.configService.getLatest()).settings["experimental.cli.commandTelemetry.enabled"]===!0}catch{return!1}},this.configService)}async execute(J,Q,Z=[]){this.telemetrySubmitter.submit(J).catch((W)=>{u.debug("Failed to submit command telemetry",W)});let X=new AbortController,Y=Date.now(),K=`command-${Y}-${Math.random().toString(36).substring(7)}`,G=this.commands.get(J);if(G){this.onExecute({id:K,name:G.id,startTime:Y,abortController:X});let W=await G.execute(Q,Z);return this.onExecutionComplete(),W}let q=ZX9(J),z=this.latestCustom.find((W)=>W.name===q);if(!z)return;this.onExecute({id:K,name:z.name,startTime:Y,abortController:X});let U=await Qm1(q,Z,this.registry,{signal:X.signal});if(this.onExecutionComplete(),U.success){let W=Q.editorState.text,H=W.trim()&&!W.endsWith(`
6601
+ ... (output truncated at ${nH} 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 sZ9(J,Q){let{filePath:Z,interpreter:X,extension:Y}=J;if(process.platform==="win32")return tZ9(Z,X?[...X]:null,Y,Q);else return oZ9(Z,X?[...X]:null,Y,Q)}function oZ9(J,Q,Z,X){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...X]];else return[J,X]}function tZ9(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();O2();wB();kY();bW();mC();import{execSync as bG6}from"child_process";import{writeFile as eZ9}from"fs/promises";import JX9 from"path";G0();kY();class Zm1{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.1761883329-ga93f38"},parameters:{metadata:{count:Z}},timestamp:Date.now()*1000}));this.commandCounts.clear();try{let Q=JSON.stringify(J);await Qn(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}}function QX9(J){return J.startsWith("custom-command-")}function yG6(J){return J.startsWith("agent-mode-")}function ZX9(J){return J.replace(/^custom-command-/,"")}class Xm1{configService;registry;onExecute;onExecutionComplete;commands=new Map;latestCustom=[];telemetrySubmitter;constructor(J,Q,Z,X){this.configService=J;this.registry=Q;this.onExecute=Z;this.onExecutionComplete=X;this.configService.config.subscribe((Y)=>{this.commands.clear(),this.registerCommands(Y)}),this.registry.commands.subscribe((Y)=>this.latestCustom=Y),this.telemetrySubmitter=new Zm1(async()=>{try{return(await this.configService.getLatest()).settings["experimental.cli.commandTelemetry.enabled"]===!0}catch{return!1}},this.configService)}async execute(J,Q,Z=[]){this.telemetrySubmitter.submit(J).catch((W)=>{u.debug("Failed to submit command telemetry",W)});let X=new AbortController,Y=Date.now(),K=`command-${Y}-${Math.random().toString(36).substring(7)}`,G=this.commands.get(J);if(G){this.onExecute({id:K,name:G.id,startTime:Y,abortController:X});let W=await G.execute(Q,Z);return this.onExecutionComplete(),W}let q=ZX9(J),z=this.latestCustom.find((W)=>W.name===q);if(!z)return;this.onExecute({id:K,name:z.name,startTime:Y,abortController:X});let U=await Qm1(q,Z,this.registry,{signal:X.signal});if(this.onExecutionComplete(),U.success){let W=Q.editorState.text,H=W.trim()&&!W.endsWith(`
6602
6602
 
6603
6603
  `)?`
6604
6604
  ${U.output}`:U.output;Q.editorDispatch({type:"insert-text",text:H});return}return Error(U.error??`Command '${J}' failed`)}getPriority(J,Q){if(QX9(J))return 4;if(Q.editorState.hasSelection)switch(J){case"copy-selection":return 60}if(this.isThreadEmpty(Q)){if(yG6(J))return 59;switch(J){case"set-agent-mode":return 58;case"toggle-agent-mode":return 57}}if(this.hasPromptText(Q)&&Q.isProcessing)switch(J){case"queue":return 39;case"dequeue":return 37}if(Q.isProcessing)switch(J){case"queue":return 29;case"dequeue":return 27}if(this.hasPromptText(Q))switch(J){case"handoff":return 19;case"editor":return 18;case"clear":return 17}if(yG6(J))return 0;switch(J){case"help":return 10;case"continue":return 9;case"new":return 8;case"handoff":return 7;case"editor":return 6;case"browser":case"url":case"visibility":case"toggle-thinking-blocks":case"queue":case"clear":case"copy-selection":case"dequeue":case"generate-agent-file":case"agent-files":case"connect":case"disconnect":case"settings":case"permissions":case"permissions-enable":case"permissions-disable":case"ide":case"toggle-agent-mode":case"set-agent-mode":case"show-costs":case"refresh":case"debug-thread-json":return 1;case"quit":return 0}}getCommandFollows(J){switch(J){case"handoff":return["new"];case"quit":return["queue","dequeue"];case"set-agent-mode":case"toggle-agent-mode":return YW().map(({mode:Q})=>`agent-mode-${Q}`);default:return[]}}registerCommands(J){this.register({id:"new",noun:"thread",verb:"new",description:"Start new thread",aliases:["start"],execute:async(X)=>{await X.startNewThread()},isEnabled:(X)=>!this.isThreadEmpty(X)}),this.register({id:"continue",noun:"thread",verb:"switch",description:"Switch to existing thread",aliases:["continue"],gatherArguments:async(X,Y)=>{return await Y.launchThreadPicker()},execute:async(X,Y)=>{await X.switchToThread(Y)},isEnabled:()=>!0}),this.register({id:"handoff",noun:"thread",verb:"handoff",description:"Draft a new thread based on current thread",gatherArguments:async(X,Y)=>{if(this.hasPromptText(X))return X.editorState.text;return await Y.launchMultilinePrompt("handoff","Describe a prompt to hand off...")},execute:async(X,Y)=>{return X.handleHandoff(Y)},isEnabled:(X)=>!this.isThreadEmpty(X),getPromptText:(X)=>{if(this.hasPromptText(X))return this.truncatedPromptText(X)},nonBlocking:!0}),this.register({id:"browser",noun:"thread",verb:"open in browser",description:"Open thread in browser",execute:async({thread:X,ampURL:Y})=>{let K=q_(new URL(Y),X.id).toString();try{await AX(K)}catch(G){u.error("Failed to open browser",{error:G})}},isEnabled:(X)=>!this.isThreadEmpty(X)}),this.register({id:"url",noun:"thread",verb:"copy URL",description:"Copy thread URL",execute:async(X)=>{let Y=q_(new URL(X.ampURL),X.thread.id).toString();try{return await x9.instance.tuiInstance.clipboard.writeText(Y),new lK(`Thread URL: ${Y}
@@ -6653,7 +6653,7 @@ https://www.jetbrains.com/help/idea/managing-plugins.html#install_plugin_from_di
6653
6653
  `),J.stdout.write(`Thread: ${H}
6654
6654
  `),J.stdout.write(`Continue this thread with: amp threads continue ${W}
6655
6655
  `)}}function dm1(J){return J==="smart"?I1.rgb(3,197,97):J==="free"?I1.rgb(0,184,255):wY9(J)}function wY9(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 I1.index(Z[X])}Rf1();if(process.env.AMP_PWD)try{process.chdir(process.env.AMP_PWD),delete process.env.AMP_PWD}catch(J){aK.write(`Failed to change directory to ${process.env.AMP_PWD}: ${J}
6656
- `)}var lm1=cm1.join(Vc1||cm1.join(process.env.HOME||process.cwd(),".local","state"),"amp","last-thread-id");function EY9(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 gq(J,Q){if(J.getOptionValueSourceWithGlobals("dangerouslyAllowAll")==="cli")tK("dangerouslyAllowAll",Q.dangerouslyAllowAll);if(J.getOptionValueSourceWithGlobals("tryGpt5")==="cli")throw new v9("The --try-gpt5 flag has been removed.",1,`GPT-5 is now available as the oracle. Read why: ${U8.blue("https://ampcode.com/news/gpt-5-oracle")}`);if(J.getOptionValueSourceWithGlobals("agentMode")==="cli")tK("experimental.agentMode",Q.agentMode)}async function am1(J){try{await OY9(cm1.dirname(lm1),{recursive:!0}),await jY9(lm1,J,"utf-8")}catch(Q){u.debug("Failed to save last thread ID",Q)}}async function IY9(){try{return(await eq6(lm1,"utf-8")).trim()}catch(J){return null}}function PY9(J,Q){return{...J,async get(Z){if(Z==="mcpServers"){let X=await J.get(Z);return fd("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 sq6=[{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??jJ,description:`Custom settings file path (overrides the default location ${jJ})`},{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 ${My1})`},{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:FQ(),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:Ll1}],oq6=(J)=>("deprecated"in J)&&J.deprecated===!0,TY9=(J)=>("hidden"in J)&&J.hidden===!0,CY9=(J)=>("default"in J),SY9=(J)=>("default"in J)?J.default:void 0;function vY9(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 v9(hK.unknownCommand(Z),1,G)}}var Jz6=null;function Gn2(){return Jz6}function qQ1(J){return{...J,getThreadEnvironment:p71,vfs:C20({os:J.fileSystem},J.configService.config),fileChangeTrackerStorage:new R_(J.fileSystem),generateThreadTitle:pG0,deleteThread:(Q)=>J.threadService.delete(Q)}}var nm1=$0.file($Y9.homedir()),Qz6=process.env.XDG_CONFIG_HOME?$0.file(process.env.XDG_CONFIG_HOME):b0.joinPath(nm1,".config");async function mq(J,Q){Ii1("0.0.1761868901-gb9e977");let Z=MX1({storage:J.settings,secretStorage:J.secrets,workspaceRoots:t1.of([$0.file(process.cwd())]),defaultAmpURL:J.ampURL,homeDir:nm1,userConfigDir:Qz6}),{initializeCLITelemetry:X}=await Promise.resolve().then(() => (KQ1(),YQ1));X(Z);let Y=await Z.getLatest();u.debug("Global configuration initialized",{settingsKeys:Object.keys(Y.settings)});let K=Nn(NO({configService:Z})),G=new Map,q=()=>G.clear(),z=K20({configService:Z,toolService:K,createOAuthProvider:async(E)=>{let I=G.get(E);if(I)return u.debug("Reusing existing OAuth provider for server",{serverName:E}),I;u.debug("Creating OAuth provider for server",{serverName:E});let T=(async()=>{let S=new Y3(J.secrets),x=await S.getClientInfo(E),h=new hU1({storage:S,serverName:E,clientId:x?.clientId,clientSecret:x?.clientSecret,scopes:x?.scopes});return u.debug("OAuth provider created",{serverName:E,hasManualClientId:!!x?.clientId,willUseDCR:!x?.clientId}),h})();return G.set(E,T),T}}),U=AR0(K,j2,oe).catch((E)=>{u.warn("Toolbox registration failed, continuing anyway:",E)}),W=z.initialized.catch((E)=>{u.warn("MCP service initialization failed, continuing anyway:",E)}),F=Promise.all([W,U]).then(()=>{});if(Q.jetbrains)AO("JetBrains");else if(Q.ide&&TQ6())AO("VS Code");else if(Q.ide&&CQ6())AO("Neovim");if(J.executeMode)Pi1(!0);E96(K,{configService:Z});let H,B=T7.status.pipe(y0((E)=>Boolean(E.connected&&E.authenticated)),G8()).subscribe((E)=>{if(E){if(!H)H=K.registerTool(As)}else H?.dispose(),H=void 0}),M;if(!J.executeMode)M=new X51(process.cwd(),{},!0);else M=new class extends X51{async start(){}async query(){return[]}getStats(){return{state:"unstarted",stats:[]}}dispose(){}};if(!await J.secrets.get("apiKey",J.ampURL)){if(s2.write(`No API key found. Starting login flow...
6656
+ `)}var lm1=cm1.join(Vc1||cm1.join(process.env.HOME||process.cwd(),".local","state"),"amp","last-thread-id");function EY9(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 gq(J,Q){if(J.getOptionValueSourceWithGlobals("dangerouslyAllowAll")==="cli")tK("dangerouslyAllowAll",Q.dangerouslyAllowAll);if(J.getOptionValueSourceWithGlobals("tryGpt5")==="cli")throw new v9("The --try-gpt5 flag has been removed.",1,`GPT-5 is now available as the oracle. Read why: ${U8.blue("https://ampcode.com/news/gpt-5-oracle")}`);if(J.getOptionValueSourceWithGlobals("agentMode")==="cli")tK("experimental.agentMode",Q.agentMode)}async function am1(J){try{await OY9(cm1.dirname(lm1),{recursive:!0}),await jY9(lm1,J,"utf-8")}catch(Q){u.debug("Failed to save last thread ID",Q)}}async function IY9(){try{return(await eq6(lm1,"utf-8")).trim()}catch(J){return null}}function PY9(J,Q){return{...J,async get(Z){if(Z==="mcpServers"){let X=await J.get(Z);return fd("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 sq6=[{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??jJ,description:`Custom settings file path (overrides the default location ${jJ})`},{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 ${My1})`},{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:FQ(),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:Ll1}],oq6=(J)=>("deprecated"in J)&&J.deprecated===!0,TY9=(J)=>("hidden"in J)&&J.hidden===!0,CY9=(J)=>("default"in J),SY9=(J)=>("default"in J)?J.default:void 0;function vY9(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 v9(hK.unknownCommand(Z),1,G)}}var Jz6=null;function Gn2(){return Jz6}function qQ1(J){return{...J,getThreadEnvironment:p71,vfs:C20({os:J.fileSystem},J.configService.config),fileChangeTrackerStorage:new R_(J.fileSystem),generateThreadTitle:pG0,deleteThread:(Q)=>J.threadService.delete(Q)}}var nm1=$0.file($Y9.homedir()),Qz6=process.env.XDG_CONFIG_HOME?$0.file(process.env.XDG_CONFIG_HOME):b0.joinPath(nm1,".config");async function mq(J,Q){Ii1("0.0.1761883329-ga93f38");let Z=MX1({storage:J.settings,secretStorage:J.secrets,workspaceRoots:t1.of([$0.file(process.cwd())]),defaultAmpURL:J.ampURL,homeDir:nm1,userConfigDir:Qz6}),{initializeCLITelemetry:X}=await Promise.resolve().then(() => (KQ1(),YQ1));X(Z);let Y=await Z.getLatest();u.debug("Global configuration initialized",{settingsKeys:Object.keys(Y.settings)});let K=Nn(NO({configService:Z})),G=new Map,q=()=>G.clear(),z=K20({configService:Z,toolService:K,createOAuthProvider:async(E)=>{let I=G.get(E);if(I)return u.debug("Reusing existing OAuth provider for server",{serverName:E}),I;u.debug("Creating OAuth provider for server",{serverName:E});let T=(async()=>{let S=new Y3(J.secrets),x=await S.getClientInfo(E),h=new hU1({storage:S,serverName:E,clientId:x?.clientId,clientSecret:x?.clientSecret,scopes:x?.scopes});return u.debug("OAuth provider created",{serverName:E,hasManualClientId:!!x?.clientId,willUseDCR:!x?.clientId}),h})();return G.set(E,T),T}}),U=AR0(K,j2,oe).catch((E)=>{u.warn("Toolbox registration failed, continuing anyway:",E)}),W=z.initialized.catch((E)=>{u.warn("MCP service initialization failed, continuing anyway:",E)}),F=Promise.all([W,U]).then(()=>{});if(Q.jetbrains)AO("JetBrains");else if(Q.ide&&TQ6())AO("VS Code");else if(Q.ide&&CQ6())AO("Neovim");if(J.executeMode)Pi1(!0);E96(K,{configService:Z});let H,B=T7.status.pipe(y0((E)=>Boolean(E.connected&&E.authenticated)),G8()).subscribe((E)=>{if(E){if(!H)H=K.registerTool(As)}else H?.dispose(),H=void 0}),M;if(!J.executeMode)M=new X51(process.cwd(),{},!0);else M=new class extends X51{async start(){}async query(){return[]}getStats(){return{state:"unstarted",stats:[]}}dispose(){}};if(!await J.secrets.get("apiKey",J.ampURL)){if(s2.write(`No API key found. Starting login flow...
6657
6657
  `),!await kY9(J))await ZR(),process.exit(1)}let V=await b20({isDevelopment:!1}),N=new AV1(V,Z),L=new YB1(V,{lazy:!0}),A=Q.notifications!==void 0?Q.notifications:!J.executeMode,w=P96({playNotificationSound:async(E)=>{if(A){I96(E);let I=Af1(),T=wf1();if((!I||T)&&Y.settings["notifications.system.enabled"]!==!1){if(E==="idle")process.stdout.write("\x1B]777;notify;Amp;Agent is ready\x1B\\");else if(E==="requires-user-input")process.stdout.write("\x1B]777;notify;Amp;Waiting for approval\x1B\\")}}},windowFocused:()=>Promise.resolve(!1),threadService:N,configService:Z});u.info("Starting Amp background services");let R=uG0({threadService:N,threadHistoryService:L,configService:Z,isExtensionDevelopment:!1}),O;T7.status.subscribe((E)=>{O=E});let j={codebaseContextService:new UZ1({workspaceRoots:[$0.file(process.cwd())],getCurrentFile:()=>{if(!O?.openFile)return;try{return $0.parse(O.openFile)}catch(E){u.warn("Failed to parse current file URI",{uri:O.openFile,error:E});return}},getOpenFiles:()=>{if(!O?.visibleFiles?.length)return[];let E=O.openFile;return O.visibleFiles.filter((I)=>I!==E).map((I)=>{try{return $0.parse(I)}catch(T){return u.warn("Failed to parse visible file URI",{uri:I,error:T}),null}}).filter((I)=>I!==null)}}),configService:Z,toolService:K,mcpService:z,threadService:N,threadHistoryService:L,threadSyncService:R,threadStorage:V,secretStorage:J.secrets,settingsStorage:J.settings,fuzzyServer:M,notificationService:w,backgroundInit:F,fileSystem:Q.jetbrains||Q.ide?I20:j2};return{...j,async asyncDispose(){await j.mcpService.dispose(),q(),await j.threadService.asyncDispose(),j.configService.unsubscribe(),j.toolService.dispose(),j.fuzzyServer.dispose(),j.threadSyncService.dispose(),j.settingsStorage[Symbol.dispose](),B.unsubscribe(),H?.dispose()}}}async function kY9(J){if(!J.executeMode){if(!await ry1("Would you like to log in to Amp? [(y)es, (n)o]: "))return s2.write(`Login cancelled. Run the command again to retry.
6658
6658
  `),!1}return await Zz6(J)}async function Zz6(J){let Q=RY9(32).toString("hex"),Z=await ny1(J.ampURL,Q),X=new AbortController;try{await AX(Z,X.signal)}catch(K){u.error("Error opening browser",{error:K})}let Y=await ny1(J.ampURL,Q,!1);s2.write(`If your browser does not open automatically, visit:
6659
6659
 
@@ -6663,13 +6663,13 @@ ${U8.blue.bold(Y)}
6663
6663
  Login successful! You can now use the Amp CLI.
6664
6664
  `),!0}catch(K){return u.error("Login failed",{error:K}),aK.write(`
6665
6665
  Login failed: ${K instanceof Error?K.message:String(K)}
6666
- `),!1}}function _Y9(){let J=new lw().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)KR(),process.exit(0);let W=U.originalError??U;TJ6(W)}),J.option("-V, --version","output the version number",()=>{s2.write(`0.0.1761868901-gb9e977 (released 2025-10-31T00:06:44.844Z)
6666
+ `),!1}}function _Y9(){let J=new lw().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)KR(),process.exit(0);let W=U.originalError??U;TJ6(W)}),J.option("-V, --version","output the version number",()=>{s2.write(`0.0.1761883329-ga93f38 (released 2025-10-31T04:07:05.357Z)
6667
6667
  `),process.exit(0)}),J.addHelpText("after",EQ6()),J.configureHelp({formatHelp:IQ6}),J.command("logout").description("Log out by removing stored API key").action(async(U,W)=>{let F=W.optsWithGlobals(),H=await BX(F);await fY9(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 BX(F);await yY9(H,await fy1(F,H.settings))});let Q=async(U,W,F)=>{MX1({storage:W.settings,secretStorage:W.secrets,workspaceRoots:t1.of([$0.file(process.cwd())]),defaultAmpURL:W.ampURL,homeDir:nm1,userConfigDir:Qz6});let H={...W,executeMode:!1};await im1(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 BX(F);await tq6(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 BX(F);await dY9(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 BX(H);if(W.pick)aK.write(`${U8.yellow("Warning:")} The --pick flag is deprecated. The picker is now shown by default.
6668
6668
  `);if(W.last||U||B.executeMode)await pY9(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 BX(H);await uY9(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 BX(F);await tq6(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 BX(H);await mY9(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 BX(B);await hY9(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 BX(H);await gY9(H,B,U,F)}),SZ6(J,async(U,W)=>{let F=await BX(W);gq(U,W);let H=await mq(F,W);return{context:F,mcpService:H.mcpService,toolService:H.toolService,configService:H.configService,cleanupTerminal:KR,asyncDispose:H.asyncDispose.bind(H)}}),KZ6(J),oQ6(J,async(U)=>{let W=await BX(U);return{settings:W.settings,secretStorage:W.secrets,getThreadDeps:async(F)=>{gq(F,U);let H=await mq(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 BX(F);gq(W,F);let B=await mq(H,F);try{await $y1(B,B.configService,{})}finally{await B.asyncDispose(),await KR()}});function X(U,W,F){let B=typeof U.description==="string"?U.description:F===void 0?U.description(!0):U.description(F),M=new bV(W,B),V=SY9(U);if(V)M.default(V);if(M.hidden=TY9(U)||oq6(U),"choices"in U)M.choices([...U.choices]);return M}for(let U of sq6)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 bV("-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 bV("-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 bV("--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 bV("--stream-json-input","Read JSON Lines user messages from stdin. Requires both --execute and --stream-json.").default(!1);J.addOption(q);let z=new bV("--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 bV("--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 BX(F);if(Object.keys(F).forEach((B)=>{let M=sq6.find((V)=>V.name===B);if(M&&oq6(M)&&!CY9(M))aK.write(U8.yellow(`Warning: '--${B}' flag is deprecated
6669
6669
  `))}),W.args.length>0)vY9(H,W);await im1(H,F,W)}),cQ6(J),J}async function GQ1(J,Q){let{thread:Z,visibility:X}=Q,Y=Z?.id??eq(),K=qQ1(J);if(Z)await J.threadStorage.set(Y,Z);let G=await qJ.getOrCreateForThread(K,Y);if(X)await J.threadSyncService.updateThreadMeta(Y,V51(X));let q=J.threadService.observe(Y).subscribe(async(z)=>{if(r7(z,"assistant"))await am1(Y),q.unsubscribe()});return await G.resume(),G}async function im1(J,Q,Z){let X=M51(Q);if(X instanceof Error)iK(X.message);let Y,K=null;if(Q.streamJsonInput)Y="";else if(typeof Q.execute==="string"){Y=Q.execute;let O=(await oy1()).trimEnd();if(O)K=O}else Y=(await oy1()).trimEnd();if(Q.remote&&!J.executeMode)throw new v9("The -r/--remote flag currently only works with --execute mode",1,'Use: amp --remote --execute "your message"');if(Q.streamJson&&!J.executeMode)throw new v9("The --stream-json flag requires --execute mode",1,'Use: amp --execute "your message" --stream-json');if(Q.streamJsonInput&&!J.executeMode)throw new v9("The --stream-json-input flag requires --execute mode",1,"Use: amp --execute --stream-json --stream-json-input");if(Q.streamJsonInput&&!Q.streamJson)throw new v9("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 v9(`Execute mode is not permitted with --agent-mode '${Q.agentMode}'`,1);if(Q.stats&&!J.executeMode)throw new v9("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 v9("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 v9("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"
6670
6670
  Or pipe via stdin: echo "your message" | amp --execute`);gq(Z,Q);let G=await mq(J,Q);if(J.executeMode||Q.threadId)await G.backgroundInit;Jz6=G;let q=qQ1(G),z=async(O)=>{let $=await eq6(O,"utf-8"),j=JSON.parse($);if(!YG(j.id))throw new v9(hK.invalidThreadId);return GQ1(G,{visibility:X,thread:j})},U=async(O)=>{if(!YG(O))throw new v9(hK.invalidThreadId);let $=await G.threadService.get(O)??void 0;if(u.info(`[fetchAndStartThread] Loaded thread ${O}, agentMode: ${$?.agentMode??"undefined"}`),$?.agentMode)u.info(`[fetchAndStartThread] Setting runtime override for agentMode to: ${$.agentMode}`),tK("experimental.agentMode",$.agentMode);else u.info("[fetchAndStartThread] No agentMode on thread, not setting override");return GQ1(G,{visibility:X,thread:$})},W=async()=>{try{if(Q.threadId)return U(Q.threadId);else return GQ1(G,{visibility:X})}catch(O){if(O instanceof v9)throw O;throw await n71(O,Q.threadId),Error("handleError should have called process.exit()")}},F=async()=>{return GQ1(G,{visibility:X})};if(Q.format==="jsonl")aK.write(`jsonl format is deprecated. Version "0.0.1752148945-gd8844f" or earlier is required to use jsonl format.
6671
- `),await ZR(),process.exit(1);if(J.executeMode&&Q.remote)await GZ6(Y,K,G.configService),await G.asyncDispose(),process.exit(0);let H=await W();if(J.executeMode)await uJ6(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 mn1();let O=await yO({jetbrainsOnly:Q.jetbrains});if(O.length===0){if(Q.jetbrains)M=!await G.configService.get("jetbrains.skipInstall")}else if(O.length===1){let $=O[0];if($)T7.selectConfig($)}else B=!0}let V=ay1("0.0.1761868901-gb9e977",G.settingsStorage),N=new XB1(G.threadStorage),L=t1.of([$0.file(process.cwd())]),A=Tc1(void 0,L);if(Y)H.handle({type:"user:message",message:{content:[{type:"text",text:Y}]}});let w;try{w=await ZJ.getUserFreeTierStatus({},{config:G.configService,signal:AbortSignal.timeout(5000)})}catch(O){w={ok:!1,error:O}}u.info("User free tier status:",w);let R=await WZ6();u.info("Loaded session state:",R),await rq6({codebaseContextService:G.codebaseContextService,stdout:process.stdout,history:new Cy1,fuzzyServer:G.fuzzyServer,settingsStorage:G.settingsStorage,threadService:G.threadService,threadSyncService:G.threadSyncService,threadID:H.threadID,threadFuzzyIndexer:N,worker:H,workerDeps:q,configService:G.configService,internalAPIClient:ZJ,ampURL:J.ampURL,startNewThread:F,pickAndContinueThread:async()=>{u.info("Thread picker requested - not yet implemented in TUI")},switchToThread:U,ideClient:T7,connectedClientsService:new LX1,commandRegistry:A,showJetBrainsInstaller:M,showIdePicker:B,startWithPicker:Q.startWithPicker,updateService:V,inspector:Q.inspector,inspectorPort:Q.inspectorPort,jetbrainsMode:Q.jetbrains,clientId:Q.clientId,sessionState:R,freeTierStatus:w.ok?w.result:void 0,threadDependencies:G}),await G.asyncDispose(),process.exit(0)}async function BX(J){if(J.interactive)aK.write(`Warning: --interactive flag is deprecated. Interactive mode is now the default unless --execute is used or output is redirected.
6672
- `);let Q=!!J.execute||!process.stdout.isTTY&&!J.streamJson,Z=process.stdout.isTTY&&process.stderr.isTTY,X=await UQ6({...J,workspaceTrust:{current:!0,changes:nC},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 tQ6(J.mcpConfig);X=PY9(X,G)}let Y=await X.get("url","global");if(!Y)Y=UZ;if(!HB(Y))u.info("Targeting custom Amp server",{ampURL:Y});if(X=pc1(X),await X.get("debug.httpLogging"))_c1();return{executeMode:Q,isTTY:Z,ampURL:Y,settings:X,secrets:qZ6(await fy1(J,X))}}function xY9(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 bY9(){let J=xY9(process.argv);if(FJ6({logLevel:J.logLevel||process.env.AMP_LOG_LEVEL,logFile:J.logFile||process.env.AMP_LOG_FILE}),EY9(u),u.info("Starting Amp CLI.",{version:"0.0.1761868901-gb9e977",buildTimestamp:"2025-10-31T00:06:44.844Z"}),parseInt(process.version.slice(1).split(".")[0]??"")<20)throw new v9(hK.nodeVersion(process.version),1,"Please upgrade your Node.js installation from https://nodejs.org");await _Y9().parseAsync(process.argv)}bY9().catch(n71);async function yY9(J,Q){if(process.env.AMP_URL)await J.settings.set("url",process.env.AMP_URL,"global"),s2.write(`Saving custom server URL to settings: ${process.env.AMP_URL}
6671
+ `),await ZR(),process.exit(1);if(J.executeMode&&Q.remote)await GZ6(Y,K,G.configService),await G.asyncDispose(),process.exit(0);let H=await W();if(J.executeMode)await uJ6(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 mn1();let O=await yO({jetbrainsOnly:Q.jetbrains});if(O.length===0){if(Q.jetbrains)M=!await G.configService.get("jetbrains.skipInstall")}else if(O.length===1){let $=O[0];if($)T7.selectConfig($)}else B=!0}let V=ay1("0.0.1761883329-ga93f38",G.settingsStorage),N=new XB1(G.threadStorage),L=t1.of([$0.file(process.cwd())]),A=Tc1(void 0,L);if(Y)H.handle({type:"user:message",message:{content:[{type:"text",text:Y}]}});let w;try{w=await ZJ.getUserFreeTierStatus({},{config:G.configService,signal:AbortSignal.timeout(5000)})}catch(O){w={ok:!1,error:O}}u.info("User free tier status:",w);let R=await WZ6();u.info("Loaded session state:",R),await rq6({codebaseContextService:G.codebaseContextService,stdout:process.stdout,history:new Cy1,fuzzyServer:G.fuzzyServer,settingsStorage:G.settingsStorage,threadService:G.threadService,threadSyncService:G.threadSyncService,threadID:H.threadID,threadFuzzyIndexer:N,worker:H,workerDeps:q,configService:G.configService,internalAPIClient:ZJ,ampURL:J.ampURL,startNewThread:F,pickAndContinueThread:async()=>{u.info("Thread picker requested - not yet implemented in TUI")},switchToThread:U,ideClient:T7,connectedClientsService:new LX1,commandRegistry:A,showJetBrainsInstaller:M,showIdePicker:B,startWithPicker:Q.startWithPicker,updateService:V,inspector:Q.inspector,inspectorPort:Q.inspectorPort,jetbrainsMode:Q.jetbrains,clientId:Q.clientId,sessionState:R,freeTierStatus:w.ok?w.result:void 0,threadDependencies:G}),await G.asyncDispose(),process.exit(0)}async function BX(J){if(J.interactive)aK.write(`Warning: --interactive flag is deprecated. Interactive mode is now the default unless --execute is used or output is redirected.
6672
+ `);let Q=!!J.execute||!process.stdout.isTTY&&!J.streamJson,Z=process.stdout.isTTY&&process.stderr.isTTY,X=await UQ6({...J,workspaceTrust:{current:!0,changes:nC},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 tQ6(J.mcpConfig);X=PY9(X,G)}let Y=await X.get("url","global");if(!Y)Y=UZ;if(!HB(Y))u.info("Targeting custom Amp server",{ampURL:Y});if(X=pc1(X),await X.get("debug.httpLogging"))_c1();return{executeMode:Q,isTTY:Z,ampURL:Y,settings:X,secrets:qZ6(await fy1(J,X))}}function xY9(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 bY9(){let J=xY9(process.argv);if(FJ6({logLevel:J.logLevel||process.env.AMP_LOG_LEVEL,logFile:J.logFile||process.env.AMP_LOG_FILE}),EY9(u),u.info("Starting Amp CLI.",{version:"0.0.1761883329-ga93f38",buildTimestamp:"2025-10-31T04:07:05.357Z"}),parseInt(process.version.slice(1).split(".")[0]??"")<20)throw new v9(hK.nodeVersion(process.version),1,"Please upgrade your Node.js installation from https://nodejs.org");await _Y9().parseAsync(process.argv)}bY9().catch(n71);async function yY9(J,Q){if(process.env.AMP_URL)await J.settings.set("url",process.env.AMP_URL,"global"),s2.write(`Saving custom server URL to settings: ${process.env.AMP_URL}
6673
6673
  `);else if(!HB(J.ampURL))s2.write(`Logging in to ${new URL(J.ampURL).hostname}
6674
6674
  `);let Z=process.env.AMP_API_KEY;if(Z)s2.write(`API key found in environment variable, storing...
6675
6675
  `),await Q.set("apiKey",Z,J.ampURL),s2.write(`API key successfully stored.